/* Safe On Mobile — the web app.
   One brand with www.safeonmobile.be: its colours, its fonts (hosted here, not at Google, so
   no visitor's address goes to a third party), its calm. Built for seniors first: large type,
   high contrast, big targets. Phone first, and a real layout from 760px up. */

@font-face {
    font-family: "Source Sans 3";
    src: url("../fonts/sourcesans3-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "Bitter";
    src: url("../fonts/bitter-latin.woff2") format("woff2");
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* www.safeonmobile.be */
    --ink: #10201A;
    --ink-soft: #3F4F45;
    --paper: #FBFCFA;
    --thread: #F0F3EE;
    --green: #1B5E20;
    --green-deep: #0E3B14;
    --green-line: #256E2A;
    --green-lift: #9FD3A4;
    --flag: #B3261E;
    --flag-soft: #FBEAE8;
    --rule: #DCE3DB;
    --display: "Bitter", Georgia, "Times New Roman", serif;
    --body: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* the app's own */
    --green-surface: #E8F3E9;
    --muted: #4A5A50;
    --line: #DCE3DB;
    --bubble-in: #F0F3EE;
    --link: #0B57D0;
    --card: #FFFFFF;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 32, 26, 0.06), 0 6px 20px rgba(16, 32, 26, 0.06);
    --wide: 1120px;
    --reading: 760px;
    --tabbar: 64px;
    --stage-bar: 52px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 400 18px/1.6 var(--body);
    -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); margin: 0 0 0.75rem; }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--green); }

/* Blue, not the accent: on a form, a red ring reads as "you did something wrong". */
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
/* FocusOnNavigate focuses the heading for screen readers; it is not a control, so no ring. */
h1:focus { outline: none; }

/* Read by screen readers, not shown: a table column's name that the column makes obvious. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    padding: 10px 16px;
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--green-deep);
    font-weight: 700;
}
.skip-link:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 24px; }
@media (max-width: 759px) { .wrap { padding: 0 16px; } }

/* ---- buttons: one obvious action per screen ---- */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.75rem 1.4rem;
    border: none;
    border-radius: 12px;
    font: 600 1.05rem/1.2 var(--body);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: var(--green); color: #FFFFFF; }
.btn-primary:hover { background: var(--green-line); }
.btn-warning { background: var(--flag); color: #FFFFFF; }
.btn-quiet { background: #FFFFFF; color: var(--green); border: 2px solid var(--green); }
.btn-quiet:hover { background: var(--green-surface); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn + .btn { margin-top: 0.75rem; }
/* A row of buttons: side by side from 760px, stacked full width below. */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }
.btn-row .btn { margin: 0; }
@media (min-width: 760px) { .btn-row .btn { width: auto; } }

/* ---- the app shell: a header with the menu; on a phone, tabs at the bottom ---- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.content { flex: 1; }

.masthead { background: var(--green-deep); color: #FFFFFF; }
.masthead-row { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: #FFFFFF; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; display: block; }
.brand-name { font: 700 1.1rem/1 var(--display); letter-spacing: -0.01em; }
.masthead :focus-visible { outline-color: #FFFFFF; }

.mainnav { display: none; }
.mainnav a, .masthead .settings-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 10px;
    color: #C9DACB;
    font-weight: 600;
    text-decoration: none;
}
.mainnav a:hover, .masthead .settings-link:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.08); }
.mainnav a.active, .masthead .settings-link.active { color: #FFFFFF; background: rgba(255, 255, 255, 0.14); }
.masthead .settings-link .label { display: none; }
.masthead .sign-in { color: #FFFFFF; font-weight: 600; background: rgba(255, 255, 255, 0.14); border: 0; border-radius: 10px; min-height: 44px; padding: 0 16px; font-family: inherit; font-size: 1rem; cursor: pointer; }
.masthead .sign-in:hover { background: rgba(255, 255, 255, 0.22); }
.icon { width: 22px; height: 22px; flex: none; }

.tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: #FFFFFF;
    border-top: 1px solid var(--rule);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--tabbar);
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
}
.tabbar a.active { color: var(--green); box-shadow: inset 0 3px 0 var(--green); }
.tabbar .icon { width: 24px; height: 24px; }
.with-tabbar .content { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }

@media (min-width: 760px) {
    .mainnav { display: flex; gap: 4px; }
    .masthead .settings-link .label { display: inline; }
    .tabbar { display: none; }
    .with-tabbar .content { padding-bottom: 0; }
}

/* ---- pages ---- */
/* A page of reading and forms: one column, a comfortable line length. */
.hero { width: 100%; max-width: var(--reading); margin: 0 auto; padding: 2rem 24px 3rem; }
@media (max-width: 759px) { .hero { padding: 1.5rem 16px 2.5rem; } }
/* A page that uses the width: dashboard, choosing a drill, history. */
.page { padding: 2rem 0 3rem; }
@media (max-width: 759px) { .page { padding: 1.5rem 0 2.5rem; } }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: 0.4rem; }
.lead { color: var(--ink-soft); font-size: 1.1rem; margin: 0; }
.eyebrow { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--green-line); margin: 0 0 0.6rem; }

.card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 16px;
    padding: 1.4rem 1.5rem;
    box-shadow: var(--shadow);
}
.card h2 { font-size: 1.2rem; margin: 0 0 0.5rem; display: flex; align-items: center; gap: 10px; }
.card h2 .icon { color: var(--green); }
.card p:last-child { margin-bottom: 0; }
.card-primary { background: var(--green-deep); border-color: var(--green-deep); color: #EAF1EA; }
.card-primary h2 { color: #FFFFFF; font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
.card-primary .btn-primary { background: #FFFFFF; color: var(--green-deep); }
.card-primary .btn-primary:hover { background: #DCEBDD; }
.card-primary a:not(.btn) { color: #FFFFFF; }
.card-primary :focus-visible { outline-color: #FFFFFF; }
.card-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 0.75rem; font-weight: 600; }

.dash { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .dash { grid-template-columns: repeat(2, 1fr); } .dash .span-2 { grid-column: span 2; } }
@media (min-width: 1080px) { .dash { grid-template-columns: repeat(3, 1fr); } .dash .dash-wide { grid-column: span 2; } }

.stat { font: 700 2.6rem/1 var(--display); color: var(--green); margin: 0.25rem 0 0.2rem; }
.credits-line { margin: 1rem 0 0; color: #C9DACB; font-size: 0.98rem; }
/* The balance sits at the foot of the card, however tall its neighbour makes it. */
.dash-practice { display: flex; flex-direction: column; }
/* Margins do not collapse in a flex column: the row's own would double the gaps. */
.dash-practice .btn-row { margin: 0.25rem 0 0; }
.dash-practice .credits-line { margin-top: auto; padding-top: 1.25rem; }
.nowrap { white-space: nowrap; }
.recent { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; gap: 8px; }
.recent li { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.98rem; }
.recent .when { color: var(--muted); font-size: 0.88rem; }

/* ---- home, signed out ---- */
/* Green to the bottom of the screen: no strip of white page under the welcome. */
.welcome { background: var(--green-deep); color: #EAF1EA; min-height: calc(100dvh - 64px); display: flex; align-items: center; }
/* padding-block, not padding: the sides are .wrap's, and a shorthand here set them to 0. */
.welcome-grid { display: grid; gap: 40px; align-items: center; padding-block: 3rem 3.5rem; }
@media (min-width: 900px) { .welcome-grid { grid-template-columns: 1.05fr 0.95fr; gap: 64px; padding-block: 4rem 4.5rem; } }
.welcome h1 { color: #FFFFFF; font-size: clamp(2rem, 4.6vw, 3rem); line-height: 1.1; }
.welcome .lead { color: #C6D8C8; font-size: clamp(1.1rem, 2vw, 1.3rem); margin-bottom: 1.25rem; }
.welcome .eyebrow { color: var(--green-lift); }
.welcome .btn-primary { background: #FFFFFF; color: var(--green-deep); }
.welcome .btn-primary:hover { background: #DCEBDD; }
.welcome .btn-quiet { background: transparent; color: #FFFFFF; border-color: rgba(255, 255, 255, 0.6); }
.welcome .btn-quiet:hover { background: rgba(255, 255, 255, 0.08); }
.welcome :focus-visible { outline-color: #FFFFFF; }
.welcome .reassure { background: rgba(255, 255, 255, 0.07); color: #DCEBDD; }
.preview-phone { background: var(--thread); border-radius: 22px; padding: 18px 16px 22px; box-shadow: 0 22px 48px rgba(0, 0, 0, 0.30); max-width: 400px; margin: 0 auto; width: 100%; color: var(--ink); }
.preview-phone .bar { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--muted); padding: 2px 6px 14px; }
.preview-phone .who { font: 700 1rem var(--display); padding: 0 6px 12px; }
.preview-phone .bubble { max-width: 100%; background: #FFFFFF; border: 1px solid #E2E7E0; border-radius: 16px 16px 16px 5px; }

.reassure {
    background: var(--green-surface);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    margin: 1.5rem 0;
}

/* ---- onboarding ---- */
.lang-switch { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; max-width: 520px; }
.lang-switch button {
    flex: 1;
    min-height: 2.9rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    background: #FFFFFF;
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
}
.lang-switch button.on { border-color: var(--green); background: var(--green-surface); font-weight: 700; }
.consent { display: flex; gap: 0.75rem; align-items: flex-start; margin: 1.25rem 0; cursor: pointer; }
/* A checkbox a senior can actually hit. */
.consent input { flex: none; width: 1.6rem; height: 1.6rem; margin-top: 0.15rem; accent-color: var(--green); }
.consent a { color: var(--link); font-weight: 600; }
.field-error { color: #B71C1C; font-weight: 600; }

/* ---- choosing a drill ---- */
.channels { display: grid; gap: 16px; margin: 1.25rem 0; }
@media (min-width: 760px) { .channels { grid-template-columns: repeat(3, 1fr); } }
.channel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 1.25rem 1.3rem;
    border: 1px solid var(--rule);
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: var(--shadow);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.channel:hover:not(:disabled) { border-color: var(--green); }
.channel:disabled { opacity: 0.6; cursor: default; }
.channel-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; color: #FFFFFF; }
.channel-sms .channel-icon { background: #1565C0; }
.channel-whatsapp .channel-icon { background: #0E7A6C; }
.channel-email .channel-icon { background: #5E35B1; }
.channel-name { font: 700 1.25rem/1.2 var(--display); }
.channel-desc { color: var(--ink-soft); font-size: 0.98rem; }
.badge { flex: none; padding: 0.15rem 0.7rem; border-radius: 999px; background: var(--green-surface); color: var(--green); font-size: 0.85rem; font-weight: 700; }
/* On a phone the three choices fit one screen: the icon beside the words, not above them. */
@media (max-width: 759px) {
    .channel { display: grid; grid-template-columns: 48px 1fr; column-gap: 1rem; row-gap: 0.3rem; padding: 1rem 1.1rem; }
    .channel-icon { grid-row: span 3; }
    .channel .badge { justify-self: start; }
}

/* ---- a messages app, as the drill pretends to be (phone layout unchanged since 5d1af6d) ---- */
.chat-header {
    position: sticky;
    top: var(--stage-bar);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #FFFFFF;
    border-bottom: 1px solid var(--line);
}
.avatar {
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
}
.sender { font: 700 1.05rem/1.2 var(--body); margin: 0; }
.chat-header > div { min-width: 0; }
/* "This is a scam": small and in the toolbar, as in a mail program, but a full-size target. */
.report-btn {
    flex: none;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 2.75rem;
    padding: 0 12px;
    border: 1px solid var(--flag);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--flag);
    font: 600 0.95rem var(--body);
    cursor: pointer;
}
.report-btn:hover { background: var(--flag-soft); }
.report-btn .icon { width: 18px; height: 18px; }
/* The narrowest phones need the room for the sender's name. */
@media (max-width: 359px) { .chat-header .avatar { display: none; } }
.icon-btn {
    flex: none;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: none;
    background: none;
    color: var(--ink);
    font-size: 1.6rem;
    cursor: pointer;
}
.sender-detail { color: var(--muted); font-size: 0.85rem; }

.messages { flex: 1; padding: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.bubble {
    max-width: 85%;
    padding: 0.7rem 0.95rem;
    border-radius: 18px;
    overflow-wrap: anywhere;
}
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 6px; }
.bubble.out { align-self: flex-end; background: var(--green-surface); border-bottom-right-radius: 6px; }
.bubble .time { display: block; margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted); text-align: right; }
.bubble.typing { color: var(--muted); letter-spacing: 0.2em; }

/* A link in a drill is an action, so it is a button that looks like a link. */
.msg-link {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    color: var(--link);
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.composer {
    position: sticky;
    bottom: 0;
    background: #FFFFFF;
    border-top: 1px solid var(--line);
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
}
.composer form { display: flex; gap: 0.5rem; }
.composer input {
    flex: 1;
    min-width: 0;
    min-height: 3.25rem;
    padding: 0 1rem;
    border: 2px solid var(--line);
    border-radius: 999px;
    font: inherit;
}
.composer input:focus { border-color: var(--green); outline: none; }
.composer .send { width: auto; min-width: 6.5rem; border-radius: 999px; }
/* Below 375px "Verstuur" left the field 140-170px wide, too cramped to type in:
   give the field its own row there. 360px is the commonest Android width, so the
   breakpoint must include it. */
@media (max-width: 374px) {
    .composer form { flex-wrap: wrap; }
    .composer input { flex-basis: 100%; }
    .composer .send { width: 100%; }
}

/* ---- WhatsApp looks like WhatsApp ---- */
.chat { display: flex; flex-direction: column; min-height: calc(100dvh - var(--stage-bar)); background: #FFFFFF; }
.chat.wa { background: #ECE5DD; }
.chat.wa .chat-header { background: #075E54; border-bottom: none; }
.chat.wa .chat-header .sender, .chat.wa .chat-header .icon-btn { color: #FFFFFF; }
.chat.wa .chat-header .sender-detail { color: #D7EFE9; }
.chat.wa .report-btn { background: transparent; border-color: rgba(255, 255, 255, 0.7); color: #FFFFFF; }
.chat.wa .report-btn:hover { background: rgba(255, 255, 255, 0.12); }
.chat.wa :focus-visible { outline-color: #FFFFFF; }
.chat.wa .bubble.in { background: #FFFFFF; }
.chat.wa .bubble.out { background: #DCF8C6; }
.chat.wa .composer { background: #F0F0F0; }

/* ---- the fake bank page behind the link ---- */
.urlbar {
    position: sticky;
    top: var(--stage-bar);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem 0.4rem 0.25rem;
    background: #EDEDED;
    font-size: 0.85rem;
    color: #333;
    overflow-wrap: anywhere;
}
.urlbar .address { flex: 1; min-width: 0; line-height: 1.3; }
.urlbar .close {
    flex: none;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: none;
    background: none;
    font-size: 1.4rem;
    cursor: pointer;
}
.bank-top { padding: 1.25rem; font-size: 1.4rem; font-weight: 700; }
.bank-body { padding: 1.25rem; background: #FFFFFF; }
.warning-box { background: #FFF3CD; border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 1.25rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.field input {
    width: 100%;
    min-height: 3.25rem;
    padding: 0 0.9rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #FFFFFF;
    font: inherit;
}
.field input:focus { border-color: var(--green); }
/* Dots instead of digits without type="password", which would invite "save password?". */
.masked { -webkit-text-security: disc; }
.small-note { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 0.75rem; }

/* ---- the fake payment request ---- */
.pay-top { background: #1D1F2A; color: #FFFFFF; letter-spacing: 0.05em; }
.pay-request { font-size: 1.1rem; }
.pay-amount { font-size: 2rem; font-weight: 800; margin: 0.5rem 0 1.25rem; }
.pay-choose { font-size: 1.1rem; margin: 0 0 0.75rem; }
.bank-choice { margin-bottom: 0.6rem; }
.btn.bank-choice + .btn.bank-choice { margin-top: 0; }

/* ---- an e-mail: a mail app on a phone, webmail on a computer ---- */
.mail-app { min-height: calc(100dvh - var(--stage-bar)); display: flex; flex-direction: column; background: #FFFFFF; }
.mail-folders, .mail-status { display: none; }
.mail-view { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.email { flex: 1; padding: 1.25rem; }
.email-subject { font: 700 1.35rem/1.3 var(--body); margin: 0 0 0.75rem; }
.email-from { display: flex; gap: 0.75rem; align-items: flex-start; margin: 1rem 0 1.25rem; }
.email-address, .email-to, .email-time { color: var(--muted); font-size: 0.85rem; }
.email-time { margin-left: auto; }
.email-body { white-space: pre-line; margin-bottom: 1.25rem; }
.attachment {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
    max-width: 420px;
    min-height: 3.25rem;
    margin-bottom: 1.25rem;
    padding: 0.6rem 0.9rem;
    border: 2px solid var(--line);
    border-radius: 10px;
    background: #FAFAFA;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

/* ---- the drill stage: the device itself on a phone; a framed device on a computer ---- */
.stage-bar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--stage-bar);
    padding: 0 12px 0 16px;
    background: var(--green-deep);
    color: #FFFFFF;
}
.stage-bar :focus-visible { outline-color: #FFFFFF; }
.stage-home { display: flex; align-items: center; gap: 8px; min-height: 44px; color: #FFFFFF; text-decoration: none; }
.stage-note { display: none; }
.stage-stop {
    flex: none;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    background: transparent;
    color: #FFFFFF;
    font: 600 0.95rem/1.1 var(--body);
    cursor: pointer;
}
.stage-stop:hover { background: rgba(255, 255, 255, 0.12); }
/* No room for the name on the narrowest phones: the logo stays, and the name stays readable by
   screen readers, since it is what names the link. */
@media (max-width: 379px) {
    .stage-home .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}

@media (min-width: 760px) {
    .drill-stage {
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        padding: 0 24px 24px;
        background: var(--green-deep);
    }
    .stage-bar { width: min(1180px, 100%); padding: 0; }
    .drill-stage { gap: 0; }
    .chat-header, .urlbar { top: 0; }
    .stage-stop { padding: 0 16px; }
    .device { position: relative; background: #FFFFFF; overflow: hidden; }
    .device-screen { height: 100%; overflow-y: auto; overscroll-behavior: contain; }

    /* SMS and WhatsApp happen on a phone, so on a computer they are shown on one. */
    .device.phone {
        width: 400px;
        height: min(860px, calc(100dvh - var(--stage-bar) - 24px));
        border: 12px solid #121A16;
        border-radius: 46px;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    }
    .device.phone .chat, .device.phone .mail-app { min-height: 100%; }
    /* A phone shows no scrollbar; it still scrolls by wheel, by touch and by keyboard. */
    .device.phone .device-screen { scrollbar-width: none; }
    .device.phone .device-screen::-webkit-scrollbar { display: none; }

    /* An e-mail on a computer is read in a browser: a window with a webmail inside. */
    .device.browser {
        width: min(1180px, 100%);
        height: calc(100dvh - var(--stage-bar) - 24px);
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    }
    .device.browser .browser-chrome { flex: none; display: flex; gap: 8px; padding: 12px 16px; background: #E8EAED; }
    .device.browser .browser-chrome span { width: 12px; height: 12px; border-radius: 50%; background: #C4C7CC; }
    .device.browser .device-screen { flex: 1; height: auto; }
    .device.browser .urlbar { margin: 0; background: #F1F3F4; border-bottom: 1px solid #DADCE0; }

    .mail-app { min-height: 100%; flex-direction: row; }
    .mail-folders {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 220px;
        flex: none;
        padding: 16px 12px;
        background: #F6F8FC;
        border-right: 1px solid #E3E6EA;
        color: #3C4043;
        font-size: 0.95rem;
    }
    .mail-folders .compose { margin-bottom: 12px; padding: 14px 18px; border-radius: 16px; background: #C2E7FF; color: #001D35; font-weight: 600; }
    .mail-folders .folder { display: flex; justify-content: space-between; padding: 6px 14px; border-radius: 999px; }
    .mail-folders .folder.on { background: #D3E3FD; font-weight: 700; }
    .mail-view .chat-header { position: sticky; }
    .mail-view .chat-header .sender { display: none; }
    .email { padding: 1.5rem 2rem; max-width: 900px; }
    /* What a browser shows when the pointer rests on a link: the real address. */
    .mail-status {
        position: absolute;
        left: 0;
        bottom: 0;
        z-index: 5;
        max-width: 70%;
        padding: 4px 10px;
        background: #F1F3F4;
        border: 1px solid #DADCE0;
        border-left: 0;
        border-bottom: 0;
        border-top-right-radius: 6px;
        color: #202124;
        font-size: 0.85rem;
        overflow-wrap: anywhere;
    }
    .mail-status.on { display: block; }
}

@media (min-width: 900px) {
    .stage-note { display: block; flex: 1; min-width: 0; margin: 0; color: #C9DACB; font-size: 0.95rem; text-align: center; }
}

/* ---- result ---- */
.result { width: 100%; max-width: var(--reading); margin: 0 auto; padding: 2rem 24px 3rem; text-align: center; }
@media (max-width: 759px) { .result { padding: 1.5rem 16px 2.5rem; } }
.practice-tag { color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.score {
    width: 9rem;
    height: 9rem;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #FFFFFF;
    font: 700 1.9rem/1 var(--display);
}
.result h1 { font-size: 1.45rem; }
@media (max-width: 759px) { .result h1 { font-size: 1.3rem; } }
.result h2 { font-size: 1.15rem; text-align: left; margin: 1.5rem 0 0; }
.result .btn-row { justify-content: center; }
.conversation { display: flex; flex-direction: column; gap: 0.6rem; margin: 1rem 0; text-align: left; }
.conversation .bubble { white-space: pre-line; }
.conversation-box { margin: 1.5rem 0; text-align: left; }
.conversation-box summary { display: flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; color: var(--green); font-weight: 600; cursor: pointer; }
.conversation-box summary::before { content: "▸"; }
.conversation-box[open] summary::before { content: "▾"; }
.original-note { text-align: left; }
.upsell { margin: 1.5rem 0; text-align: left; }
.result .upsell h2 { margin: 0 0 0.4rem; }
.upsell p { margin-bottom: 0; }
.upsell .btn-row { justify-content: flex-start; margin-bottom: 0; }
.upsell .btn-quiet { background: transparent; color: #FFFFFF; border-color: rgba(255, 255, 255, 0.6); }
.upsell .btn-quiet:hover { background: rgba(255, 255, 255, 0.08); }
.flags { list-style: none; padding: 0; margin: 1.5rem 0; text-align: left; }
.flags li {
    display: flex;
    gap: 0.75rem;
    padding: 0.8rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    background: var(--flag-soft);
}
.flags li.spotted { background: var(--green-surface); }
.flags .mark { flex: none; font-weight: 800; }

/* ---- navigation within a page ---- */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 1rem; color: var(--green); font-weight: 600; text-decoration: none; }

/* ---- history: a table on a computer, a list on a phone ---- */
.history { list-style: none; padding: 0; margin: 1rem 0; }
.history a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 4rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: #FFFFFF;
    color: var(--ink);
    text-decoration: none;
}
.h-main { display: flex; flex-direction: column; }
.h-date { color: var(--muted); font-size: 0.9rem; }
.h-score { flex: none; padding: 0.3rem 0.8rem; border-radius: 999px; color: #FFFFFF; font-weight: 700; white-space: nowrap; }
.table-wrap { display: none; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { text-align: left; padding: 12px 18px; background: var(--thread); color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; border-bottom: 1px solid var(--rule); }
.data-table td, .data-table tbody th { padding: 14px 18px; border-bottom: 1px solid var(--rule); vertical-align: middle; text-align: left; font-weight: 400; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:hover { background: #F7FAF6; }
.channel-cell { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
@media (min-width: 760px) {
    .table-wrap { display: block; background: #FFFFFF; border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
    .history.phone-list { display: none; }
}

/* ---- home, signed in (older markup, still used by other pages) ---- */
.saved { color: var(--green); font-weight: 600; }
.actions { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.action {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 4.25rem;
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: #FFFFFF;
    color: var(--ink);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.action:disabled { opacity: 0.6; cursor: default; }
.action-title { font-size: 1.15rem; font-weight: 700; color: var(--green); }
.action-desc { color: var(--muted); font-size: 0.95rem; }

/* ---- lessons ---- */
.lessons { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
@media (min-width: 760px) { .lessons { grid-template-columns: repeat(2, 1fr); gap: 16px; } .lessons .lesson-card { height: 100%; } }
@media (min-width: 1080px) { .lessons { grid-template-columns: repeat(3, 1fr); } }

/* A slide: its words, and beside them on a computer the scam to look at. */
.lesson .slide-content { font-size: 1.1rem; }
.slide.with-example { display: grid; }
.lesson .small-note { text-align: left; }
@media (min-width: 900px) {
    .hero.lesson { max-width: var(--wide); }
    .lesson-nav, .quiz-options, .quiz-feedback, .lesson .small-note { max-width: var(--reading); }
    .slide.with-example { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr; column-gap: 2.5rem; row-gap: 0; align-items: start; }
    .slide.with-example h1 { grid-column: 1; grid-row: 1; }
    .slide.with-example .slide-content { grid-column: 1; grid-row: 2; }
    .slide.with-example .example { grid-column: 2; grid-row: 1 / span 2; }
}

/* A scam to look at, not to use: it says what it is, and nothing in it responds to a tap. */
.example { margin: 0 0 1.5rem; max-width: 460px; width: 100%; }
.ex-banner { padding: 0.45rem 0.9rem; border-radius: 14px 14px 0 0; background: var(--flag); color: #FFFFFF; font-size: 0.9rem; font-weight: 700; }
.ex-screen { border: 1px solid var(--rule); border-top: 0; border-radius: 0 0 14px 14px; background: #FFFFFF; overflow: hidden; box-shadow: var(--shadow); }
.ex-head { display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--rule); }
.ex-avatar { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--thread); font-weight: 700; }
.ex-who { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ex-detail { color: var(--muted); font-size: 0.85rem; }
.ex-message { margin: 0.9rem; padding: 0.75rem 0.95rem; border-radius: 16px; border-bottom-left-radius: 5px; background: var(--bubble-in); line-height: 1.7; overflow-wrap: anywhere; }
.ex-time { display: block; margin-top: 0.25rem; color: var(--muted); font-size: 0.8rem; text-align: right; }
.ex-message mark { padding: 0.1rem 0.3rem; border-radius: 5px; background: #FFE08A; color: var(--ink); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ex-number { display: inline-grid; place-items: center; width: 1.35rem; height: 1.35rem; margin-right: 0.3rem; border-radius: 50%; background: var(--flag); color: #FFFFFF; font-size: 0.8rem; font-weight: 700; line-height: 1; }
.example-whatsapp .ex-head { background: #075E54; color: #FFFFFF; border-bottom: 0; }
.example-whatsapp .ex-detail { color: #D7EFE9; }
.example-whatsapp .ex-avatar { color: var(--ink); }
.example-whatsapp .ex-screen { background: #ECE5DD; }
.example-whatsapp .ex-message { background: #FFFFFF; }
.example-call .ex-screen { background: #10201A; color: #FFFFFF; border-color: #10201A; }
.example-call .ex-head { border-bottom-color: rgba(255, 255, 255, 0.2); }
.example-call .ex-detail { color: #C9DACB; }
.example-call .ex-message { background: #FFFFFF; color: var(--ink); }
.example-popup .ex-screen { background: #FFF3CD; }
.example-popup .ex-message { background: transparent; margin: 0; padding: 0.9rem; font-size: 1.1rem; font-weight: 600; }
.example-popup .ex-avatar { background: #FFFFFF; }
.example-approval .ex-message { font-size: 1.15rem; font-weight: 700; text-align: center; background: var(--thread); }
.ex-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; padding: 0 0.9rem 0.9rem; font-weight: 700; text-align: center; }
.ex-buttons span { padding: 0.65rem; border-radius: 10px; }
.ex-refuse { border: 2px solid var(--ink-soft); }
.ex-approve { background: var(--ink-soft); color: #FFFFFF; }
.ex-addresses { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.ex-addresses li { display: grid; gap: 0.15rem; padding: 0.75rem 0.9rem; border: 1px solid var(--rule); border-left-width: 6px; border-radius: 10px; background: #FFFFFF; }
.ex-addresses li.real { border-left-color: var(--green); }
.ex-addresses li.fake { border-left-color: var(--flag); }
.ex-verdict { font-size: 0.85rem; font-weight: 700; }
.real .ex-verdict { color: var(--green); }
.fake .ex-verdict { color: var(--flag); }
.ex-address { font-size: 1.1rem; font-weight: 700; overflow-wrap: anywhere; }
.ex-note { color: var(--muted); font-size: 0.95rem; }
.lesson-card {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding: 0.9rem 1rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: #FFFFFF;
    color: var(--ink);
    text-decoration: none;
}
.lesson-card.done { background: #F7FAF6; }
.lesson-icon { flex: none; font-size: 1.8rem; line-height: 1.2; }
.lesson-text { display: flex; flex-direction: column; gap: 0.15rem; }
.lesson-title { font-weight: 700; }
.lesson-desc { color: var(--muted); font-size: 0.95rem; }
.lesson-meta { color: var(--muted); font-size: 0.85rem; }
.lesson-done { margin-left: 0.5rem; padding: 0.1rem 0.6rem; border-radius: 999px; background: var(--green-surface); color: var(--green); font-weight: 700; }
.lesson-head { color: var(--green); font-weight: 700; margin-bottom: 0.75rem; }
.progress { height: 0.6rem; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > div { height: 100%; background: var(--green); }
.progress-text { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 1.25rem; text-align: right; }
.lesson h1:focus { outline: none; }
.slide-content { white-space: pre-line; margin-bottom: 1.5rem; }
.lesson-nav { display: flex; gap: 0.75rem; }
.lesson-nav .btn + .btn { margin-top: 0; }
.quiz-options { display: grid; gap: 0.6rem; margin: 1.25rem 0; }
.quiz-option {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    min-height: 3.5rem;
    padding: 0.8rem 1rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: #FFFFFF;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.quiz-option:disabled { cursor: default; }
.quiz-option.right { background: var(--green-surface); border-color: var(--green); }
.quiz-option.wrong { background: #FFEBEE; border-color: #B71C1C; }
.quiz-option .mark { flex: none; font-weight: 800; }
.quiz-feedback { padding: 0.9rem 1rem; border-radius: var(--radius); }
.quiz-feedback.right { background: var(--green-surface); color: var(--green); }
.quiz-feedback.wrong { background: #FFEBEE; color: #B71C1C; }

/* ---- settings ---- */
.settings h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.setting { margin-bottom: 1.75rem; }
.setting h3 { font-size: 1.05rem; margin: 0 0 0.25rem; }
.setting p { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.6rem; }
.setting p.confirm { color: var(--ink); font-weight: 600; }
.setting.danger h3 { color: var(--flag); }

/* ---- upgrade ---- */
.packs { display: grid; gap: 0.75rem; margin: 1.25rem 0; }
.pack {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.1rem 0.75rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: #FFFFFF;
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.pack-name { font-weight: 700; }
.pack-credits { grid-row: 2; color: var(--muted); font-size: 0.9rem; }
.pack-price { grid-row: 1 / span 2; grid-column: 2; font-size: 1.25rem; font-weight: 800; color: var(--green); }

/* ---- family ---- */
.muted { color: var(--muted); font-size: 0.95rem; }
.family h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.invite { margin: 1rem 0; padding: 1rem 1.1rem; border: 2px solid var(--green); border-radius: var(--radius); background: var(--green-surface); }
.invite-code {
    margin: 0.25rem 0 0.5rem;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--green);
}
.helpers { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.75rem; }
.helpers li { padding: 0.8rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: #FFFFFF; }
.helpers li > div { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; margin-bottom: 0.6rem; }
.member-drills { list-style: none; padding: 0; margin: 1rem 0 2rem; display: grid; gap: 0.75rem; }
.member-drills > li { padding: 0.8rem 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: #FFFFFF; }
.md-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.member-drills .flags { margin: 0.75rem 0 0; }
.shares { margin: 1.25rem 0; padding: 1rem 1.1rem; border-radius: var(--radius); background: #FFFFFF; border: 1px solid var(--line); }
.shares h2 { border: none; padding: 0; margin: 0 0 0.25rem; font-size: 1.05rem; }
.shares p:last-child { margin-bottom: 0; }

/* ---- choices (e-mail frequency): big targets, one per line ---- */
.choices { border: none; padding: 0; margin: 0 0 1rem; }
.choices legend { font-weight: 600; margin-bottom: 0.4rem; padding: 0; }
.choice { display: flex; gap: 0.75rem; align-items: center; min-height: 2.75rem; cursor: pointer; }
.choice input { flex: none; width: 1.4rem; height: 1.4rem; accent-color: var(--green); }

/* ---- loading and errors (before and outside Blazor) ---- */
.boot { min-height: 100dvh; text-align: center; }
.boot-brand { padding-top: 8vh; color: var(--green); font: 700 1.4rem var(--display); }
.boot-note { position: absolute; inset: calc(20vh + 9rem) 1rem auto; color: var(--muted); }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}
.loading-progress circle {
    fill: none;
    stroke: #E0E0E0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--green);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}
.loading-progress-text:after { content: var(--blazor-load-percentage-text, ""); }

#blazor-error-ui {
    color-scheme: light only;
    background: #FFF3CD;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.8rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
