/* The app's stylesheet. Styles HTML elements rather than classes: the only classes are the card's parts (modules/card).
   Colours are variables, with a dark theme. The look is englishgo.co.uk's (the WordPress site it replaces): navy and
   slate blue with white, Jost for text; the dark theme is that site's slate page. Headings are League Spartan, the
   podcast artwork's lettering, and the site's pages take the artwork's navy, red and blue too (Q157). Green is kept
   for growth (progress, charts); warm yellow marks the words being learned.
   Graphics are SVG files in public/img/. Shed has its own stylesheet (public/admin/style.css). */

/* englishgo.co.uk's fonts (SIL Open Font Licence), served from public/fonts/ */
@font-face { font-family: Jost; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/Jost-VariableFont_wght.woff2") format("woff2"); }
@font-face { font-family: Jost; font-style: italic; font-weight: 100 900; font-display: swap; src: url("/fonts/Jost-Italic-VariableFont_wght.woff2") format("woff2"); }
/* The podcast artwork's lettering, for headings (Q157): Google Fonts' variable font, Latin only (LeagueSpartan-OFL.txt) */
@font-face { font-family: "League Spartan"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("/fonts/LeagueSpartan-VariableFont_wght.woff2") format("woff2"); }
/* Cardo: the old headings' font, no longer used (Q157); browsers don't fetch a font nothing uses */
@font-face { font-family: Cardo; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/cardo_normal_400.woff2") format("woff2"); }
@font-face { font-family: Cardo; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/cardo_italic_400.woff2") format("woff2"); }
@font-face { font-family: Cardo; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/cardo_normal_700.woff2") format("woff2"); }

:root {
    --bg: #eef2f8;        /* page: a pale blue-grey */
    --surface: #ffffff;   /* main area, inputs */
    --sunken: #f3f6fa;    /* forms, code, table headings: a light grey on the white main area */
    --border: #d5e0f0;
    --field-border: #7d8a99; /* inputs, selects and text areas: 3:1 against the white and grey they sit on */
    --text: #1c2836;
    --muted: #556275;
    --heading: #142a51;   /* englishgo.co.uk's navy */
    --accent: #2b4a74;    /* links, buttons, focus: between the site's navy and slate (4.5:1 on the page and form greys) */
    --accent-text: #ffffff;
    --warm: #f2a541;      /* a second colour: cards */
    --neutral: #3c5268;   /* the site's slate: outline buttons such as "I already know this" */
    --scroll-track: #d5e0f0;
    --highlight: #ffe58a; /* <mark>: the term in a card's sentence, the line being read in a transcript */
    --error: #b42318;
    --forgotten: #c8372d; /* the Forgotten button in reviews */
    --error-bg: #fdecea;
    --ok: #146c43;
    --ok-bg: #e6f4ec;
    --chart-learned: #8fd3a8;    /* graphs: lessons learned, */
    --chart-remembered: #23864b; /* remembered (and other single-colour graphs), */
    --chart-forgotten: #f2a541;  /* forgotten */
    --heat-0: #ebebe6;           /* the heatmap: no reviews, then four greens from a few to many */
    --heat-1: #c6ead3;
    --heat-2: #8fd3a8;
    --heat-3: #3fae6a;
    --heat-4: #1f7442;
    --radius: 6px;        /* englishgo.co.uk's buttons */
    --brand-navy: #0b1f44; /* the podcast artwork's navy, red and blue (Q157): the site's bands and main buttons, in both themes */
    --brand-red: #d6262e;  /* white text on it: 5:1 */
    --brand-blue: #1f4fa3;
    --tint: #eef2f8;       /* outline buttons on white: the page's pale blue (--bg, owner 2026-12-02; Q157); under the mouse, a shade deeper */
    --tint-hover: #dbe7fb;
    color-scheme: light dark;
}
/* Dark colours: from the device's setting, unless the learner chose light in the footer (theme cookie), or chosen dark */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #3c5268;        /* englishgo.co.uk's slate page */
        --surface: #34495e;
        --sunken: #2c3f53;
        --border: #566d85;
        --field-border: #8fa3b8;
        --text: #ffffff;
        --muted: #d5e0f0;
        --heading: #ffffff;
        --accent: #ffffff;    /* the site's white buttons, with navy text */
        --accent-text: #142a51;
        --warm: #f2a541;
        --neutral: #d5e0f0;
        --scroll-track: #142a51;
        --tint: #34495e;   /* dark: the outline buttons as the main area */
        --tint-hover: #2c3f53;
        --highlight: #7a6516;
        --error: #ffb4ab;
        --forgotten: #c8372d; /* white text on it: 4.5:1 */
        --error-bg: #5a2a2f;
        --ok: #a6e3c0;
        --ok-bg: #2a4d45;
        --chart-learned: #2f7a4e;
        --chart-remembered: #5fd38d;
        --chart-forgotten: #d9902f;
        --heat-0: #2a2e33;
        --heat-1: #1f4a31;
        --heat-2: #2f7a4e;
        --heat-3: #46b072;
        --heat-4: #7ee0a4;
    }
}
:root[data-theme="dark"] {
    --bg: #3c5268;        /* englishgo.co.uk's slate page */
    --surface: #34495e;
    --sunken: #2c3f53;
    --border: #566d85;
    --field-border: #8fa3b8;
    --text: #ffffff;
    --muted: #d5e0f0;
    --heading: #ffffff;
    --accent: #ffffff;    /* the site's white buttons, with navy text */
    --accent-text: #142a51;
    --warm: #f2a541;
    --neutral: #d5e0f0;
    --scroll-track: #142a51;
    --tint: #34495e;
    --tint-hover: #2c3f53;
    --highlight: #7a6516;
    --error: #ffb4ab;
    --forgotten: #c8372d; /* white text on it: 4.5:1 */
    --error-bg: #5a2a2f;
    --ok: #a6e3c0;
    --ok-bg: #2a4d45;
    --chart-learned: #2f7a4e;
    --chart-remembered: #5fd38d;
    --chart-forgotten: #d9902f;
    --heat-0: #2a2e33;
    --heat-1: #1f4a31;
    --heat-2: #2f7a4e;
    --heat-3: #46b072;
    --heat-4: #7ee0a4;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/**** Page *****************************************************************/

* { box-sizing: border-box; }

html {
    font-family: Jost, system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    scrollbar-color: var(--accent) var(--scroll-track); /* thumb, then track */
}
body {
    max-width: 76rem; /* wide, so the dashboard and Settings use the screen; card pages narrow their own column (below) */
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

body > header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding: 1rem 0;
}
body > header > a:first-child { /* the logo: englishgo.co.uk's wordmark */
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--heading);
    text-decoration: none;
}
nav a {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
@media (hover: hover) { nav a:hover { color: var(--accent); } }
nav strong a { /* a call to action, such as Register */
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    color: #ffffff;
    background: var(--brand-red); /* the artwork's red, as the site's main buttons (Q157) */
    white-space: nowrap; /* one pill, not two lines on a phone */
}
@media (hover: hover) { nav strong a:hover { color: #ffffff; filter: brightness(1.08); } }

main {
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
body > footer {
    padding: 1.25rem 0;
    font-size: 0.9rem;
    color: var(--muted);
    text-align: center;
}
body > footer > * + * { margin-top: 0.75rem; }
body > footer + footer { text-align: left; } /* the dev stats panel (test users only, Q62) comes after the page's footer: not centred */
body > footer .controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem 1.5rem; }
body > footer .controls + nav { margin-top: 1.25rem; }
body > footer form.language { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.5rem; }
body > footer form.language label { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; }
body > footer form.language select { width: auto; padding: 0.3rem 0.5rem; }
body > footer form.language button { padding: 0.3rem 0.8rem; font-size: 0.85rem; } /* small, in the usual green */
body > footer nav div { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; }
body > footer nav a { font-weight: 500; color: var(--muted); } /* quieter than the header's menu */
@media (hover: hover) { body > footer nav a:hover { color: var(--accent); } }

/* Separators between nav links, for text browsers (Lynx, Dillo); hidden elsewhere */
.sep { visibility: hidden; color: var(--bg); }

/**** Text *****************************************************************/

h1, h2, h3, h4 { line-height: 1.2; margin: 1.5em 0 0.5em; color: var(--heading); font-family: "League Spartan", Jost, system-ui, "Hiragino Sans", "Noto Sans JP", sans-serif; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-weight: 800; }
h1 { font-size: 1.8rem; margin-top: 0; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

a { color: var(--accent); text-underline-offset: 0.15em; }
@media (hover: hover) { a:hover { text-decoration-thickness: 2px; } }

small { color: var(--muted); }
mark { color: inherit; background: var(--highlight); padding: 0 0.15em; border-radius: 0.2em; }
code, kbd { padding: 0 0.3em; background: var(--sunken); border-radius: 0.25em; }
img { max-width: 100%; height: auto; }
figure { margin: 0 0 1rem; text-align: center; } /* illustrations, such as public/img/growth.svg */
img[src^="/img/stage-"] { vertical-align: -0.35em; margin-right: 0.25rem; } /* the stage icons on the dashboard */
/* Pages written in Shed (/help, /pages/…): a readable line length, room between sections, and keys that look like keys */
.page { max-width: 42rem; }
.page h2 { margin-top: 2rem; }
.page figure img { max-height: 12rem; width: auto; }
.page kbd { border: 1px solid var(--border); border-bottom-width: 2px; font-family: inherit; }
.page details { border-bottom: 1px solid var(--border); padding: 0 0 0.75rem; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Messages: form errors (role="alert") and confirmations (role="status") */
[role="alert"], [role="status"] {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
}
[role="alert"] { color: var(--error); background: var(--error-bg); }
[role="status"] { color: var(--ok); background: var(--ok-bg); }
[role="alert"] ul { margin: 0.25rem 0 0; }

/* A page's heading with a profile picture beside it (the dashboard's welcome) */
main > header { display: flex; align-items: center; gap: 1rem; margin: 0 0 1rem; }
main > header h1 { margin: 0; }
h2 > img[src^="/img/icon-"] { vertical-align: -0.4em; margin-right: 0.35rem; } /* section icons on the dashboard */
img[src^="/profile/avatar"] { border-radius: 50%; object-fit: cover; }
/* A section's header: a picture beside a few lines of text (the Profile card in Settings) */
main section > header { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.25rem; padding: 0 0 1rem; border-bottom: 1px solid var(--border); }
main section > header strong { font-size: 1.2rem; }
main section > header > div { min-width: 0; overflow-wrap: anywhere; } /* a long email address wraps rather than running off the screen */
@media (max-width: 40rem) { main section > header { flex-direction: column; align-items: flex-start; } } /* phones: the address below the picture */
main section form > div > input + button { margin-left: 0.5rem; } /* a field with its button beside it */
/* A field with its buttons beside it (Settings → Profile): on a phone they wrap under it, level with it on the left and
   with a gap above, rather than indented and touching it */
.field-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.25rem 0; }
.field-row > * { margin: 0; }
main input[type="file"] { max-width: 20rem; padding: 0.35rem; } /* narrower than text fields */
main section > form + form { margin-top: 1rem; }

/**** Dashboard sections ***************************************************/

/* A <div> of <section>s inside <main> lays them out side by side when there's room */
main > div { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 0 0 1rem; }
main > div[role] { display: block; } /* not the message boxes: a form error's list goes below its text */
main section { padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 1rem; }
main > div > section { margin: 0; }
main section h2 { margin-top: 0; font-size: 1.1rem; }
main section p > strong:first-child { font-size: 2rem; line-height: 1; } /* a big number */
main section form { margin: 0.5rem 0 0; }
main section table { margin: 0; }
/* Progress bars (level progress) */
progress {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 14px;
    margin: 0.5rem 0;
    overflow: hidden;
    color: var(--accent); /* old Edge */
    background: var(--sunken);
    border: 0;
    border-radius: 7px;
}
progress::-webkit-progress-bar { background: var(--sunken); border-radius: 7px; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 7px; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 7px; }

/* Graphs (modules/dashboard/dashboard_chart.php): inline SVG */
figure:has(> svg) { overflow-x: auto; } /* a graph wider than a phone scrolls sideways */
figure svg { display: block; height: auto; }
figure svg text { font-size: 12px; fill: var(--muted); }
figure > figcaption { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; font-size: 0.9rem; color: var(--muted); }

/**** Tables ***************************************************************/

table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
th, td { padding: 0.45rem 0.6rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
th { font-weight: 700; background: var(--sunken); }
tr:last-child td { border-bottom: 0; }
footer table { font-size: 0.85rem; }
footer td:first-child { font-family: ui-monospace, monospace; word-break: break-word; } /* SQL in the dev stats */
footer td:last-child, footer th:last-child { width: 1%; white-space: nowrap; } /* the Time column: as narrow as its content */

/**** Forms ****************************************************************/

/* A page's own forms (direct children of <main>) sit in a box; small action forms inside content don't */
main > form {
    display: block; /* Dillo */
    padding: 1.25rem;
    background: var(--sunken);
    border-radius: var(--radius);
}
main > form + form { margin-top: 1rem; }
form > p:first-child, form > input[type="hidden"]:first-child + p { margin-top: 0; }
form > div { margin: 0 0 1rem; }
form > div:last-child { margin-bottom: 0; }

label { font-weight: 600; }
fieldset {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
legend { padding: 0 0.25rem; font-weight: 700; }
fieldset label { font-weight: normal; }
fieldset > div { margin: 0.5rem 0; }
fieldset ul { margin: 0.25rem 0 0.75rem 1.75rem; padding: 0; list-style: none; font-size: 0.9rem; color: var(--muted); }
fieldset ul p { margin: 0; }

input, select, textarea, button {
    font: inherit;
    color: inherit;
}
input:not([type="checkbox"], [type="radio"]), select, textarea {
    width: 100%;
    max-width: 28rem;
    padding: 0.5rem 0.65rem;
    background: var(--surface);
    border: 1px solid var(--field-border);
    border-radius: var(--radius);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; vertical-align: -0.15em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

button {
    padding: 0.6rem 1.3rem;
    font-weight: 700;
    color: var(--accent-text);
    background: var(--accent);
    border: 0;
    border-radius: var(--radius);
    cursor: pointer;
}
@media (hover: hover) { button:hover { filter: brightness(1.08); } }
button:disabled { opacity: 0.5; cursor: default; filter: none; }
/* Secondary actions under a card: small text buttons in a row */
aside { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 1rem 0 0; }
aside form { margin: 0; }
aside button { padding: 0.2rem 0; font-size: 0.9rem; font-weight: 600; color: var(--muted); background: none; text-decoration: underline; text-underline-offset: 0.15em; }
aside p { margin: 0.2rem 0; }
/* Report a problem with this card (Q96): a text link like the buttons beside it; opened, the form takes the whole row */
aside details.report { margin: 0; }
aside details.report > summary { padding: 0.2rem 0; font-size: 0.9rem; color: var(--muted); text-decoration: underline; text-underline-offset: 0.15em; }
aside details.report[open] { flex-basis: 100%; }
aside details.report fieldset { margin: 0.5rem 0 0.75rem; }
aside details.report textarea { display: block; margin: 0.25rem 0 0.75rem; }
aside details.report button { padding: 0.6rem 1.3rem; font-size: 1rem; font-weight: 700; color: var(--accent-text); background: var(--accent); text-decoration: none; }
td button { padding: 0.2rem 0.75rem; font-size: 0.9rem; color: var(--accent); background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); } /* small row actions */
td form { margin: 0; }
td form.inline { display: inline; } /* a link-style action after a status (level pages: Q70) */
td form.inline button.link { padding: 0; font-size: inherit; color: var(--accent); box-shadow: none; text-underline-offset: 0.15em; }
.level-nav { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0; }
.level-nav a[rel=next] { margin-left: auto; }
button + button { margin-left: 0.5rem; color: var(--accent); background: transparent; box-shadow: inset 0 0 0 2px var(--accent); } /* a second, lesser choice */
button[value="forgotten"] { color: #ffffff; background: var(--forgotten); box-shadow: none; } /* reviews: red Forgotten, then */
button[value="remembered"], button[value="got"] { color: var(--accent-text); background: var(--accent); box-shadow: none; } /* solid green Remembered and Got it */
button[value="known"] { /* "I already know this", in lessons and reviews: a dark grey outline, apart from the green answers */
    padding: 0.6rem 1.3rem; font-size: 1rem; font-weight: 700; text-decoration: none;
    color: var(--neutral); background: transparent; box-shadow: inset 0 0 0 2px var(--neutral);
}

details { margin: 0.75rem 0 0; }
summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details > form { margin: 0.5rem 0 0; }
/* Settings → General's Danger zone (Reset progress, Delete my account): red, and closed until opened */
details.danger { margin: 2rem 0 0; padding: 0.75rem 1rem; border: 1px solid var(--error); border-radius: var(--radius); }
details.danger > summary { color: var(--error); }
details.danger h3 { margin: 1.25rem 0 0; }
details.danger button { color: #ffffff; background: var(--error); box-shadow: none; }

/* Badges and celebrations (14.1–14.3, modules/achievement): a medal per badge, coloured by group, greyed out when it's
   a goal still to reach; a "well done" for a passed level or finished deck, which pops in (not with reduced motion) */
.badge-art { flex: 0 0 auto; display: inline-block; width: 56px; height: 56px; vertical-align: middle; }
.badge-art img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 3px var(--accent); }
.badge-decks { color: #2e9d5b; }
.badge-levels { color: #5fb6e8; }
.badge-words { color: #3fbf72; }
.badge-habit { color: #f2a541; }
.badge-firsts { color: #e8607a; }
.badge-next { filter: grayscale(1); opacity: 0.45; }
ul.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.75rem 1rem; margin: 0.5rem 0 1rem; padding: 0; list-style: none; }
ul.badges li { display: flex; align-items: center; gap: 0.75rem; }
ul.badges li.next { color: var(--muted); }
ul.badges progress { display: block; width: 8rem; }
.celebrate { margin: 0 0 1.5rem; text-align: center; }
.celebrate-big { margin: 0 0 1rem; padding: 1rem; border-radius: var(--radius); background: var(--ok-bg); animation: celebrate-pop 0.5s ease-out; }
.celebrate-big h2 { margin: 0.5rem 0; color: var(--ok); }
.celebrate-big figure { margin: 0; }
.celebrate-big img { max-width: 100%; height: auto; }
.celebrate-deck { border-radius: var(--radius); max-height: 10rem; object-fit: cover; }
.celebrate details.share { text-align: left; background: var(--bg); }
.celebrate-badges { display: inline-block; margin: 0 auto; padding: 0.75rem 1rem; border: 2px solid var(--accent); border-radius: var(--radius); text-align: left; }
.celebrate-badges p { margin: 0 0 0.5rem; }
.celebrate-badges ul.badges { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); margin: 0; }
.celebrate-badges .badge-art { animation: celebrate-spin 0.8s ease-out; }
@keyframes celebrate-pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes celebrate-spin { from { transform: rotate(-200deg) scale(0.4); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .celebrate-big, .celebrate-badges .badge-art { animation: none; } }

/* Invite friends (Q102): the picture beside "Give a free month, get a free month", and the callout linking to it */
.invite-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 0 0 1rem; padding: 1rem 1.25rem;
    border-radius: var(--radius); background: var(--ok-bg); }
.invite-hero img { flex: 0 0 auto; width: 10rem; height: auto; }
.invite-hero > div { flex: 1 1 16rem; }
.invite-hero ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.invite-lead { margin: 0; font-size: 1.35rem; font-weight: 700; color: var(--ok); }
a.invite-callout { display: flex; align-items: center; gap: 1rem; margin: 1rem 0; padding: 0.75rem 1rem; border-radius: var(--radius);
    background: var(--ok-bg); color: var(--ok); text-decoration: none; }
a.invite-callout img { flex: 0 0 auto; }
a.invite-callout strong { color: var(--accent); text-decoration: underline; text-underline-offset: 0.15em; }

/* Share buttons (Q102, modules/invite): a row of the sites' links, then the invite link to copy */
details.share { margin: 1rem 0; padding: 0.75rem 1rem; border: 1px solid var(--border); border-radius: var(--radius); }
details.share .share-text { color: var(--muted); }
.share-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-links a, .share-links button { padding: 0.45rem 0.9rem; border-radius: 999px; font-weight: 600; text-decoration: none;
    color: var(--accent); background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.share-links button { color: var(--accent-text); background: var(--accent); box-shadow: none; }
.share-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.share-copy label { flex-basis: 100%; }
.share-copy input { flex: 1 1 14rem; min-width: 0; }
.share-copy button { margin: 0; }

/**** Cards (modules/card) *************************************************/

/* Pages built around a card (lessons, reviews, a term's page) hold little, so they keep a narrow column in the middle */
main:has(> article) > * { max-width: 46rem; margin-left: auto; margin-right: auto; }

main article { /* a card being studied */
    margin: 0 auto 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 6px solid var(--warm);
    border-radius: var(--radius);
}
main article h1 { margin-top: 0; }
main article hr { margin: 1rem 0; } /* between the front and the back, as on the landing site */

.card-front { font-size: 1.4rem; line-height: 1.5; }
.card-meaning { font-size: 1.1rem; font-weight: 600; }
.card-translation { color: var(--muted); }
.card-us { color: var(--muted); }
/* Play a recording (Q51): a round speaker button after the term or sentence; .playing while app.js plays it */
a.play { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; margin-left: 0.4rem;
    vertical-align: middle; border-radius: 50%; color: var(--accent); background: var(--surface); border: 1px solid var(--border); }
a.play.playing { color: var(--accent-text); background: var(--accent); border-color: var(--accent); }
@media (hover: hover) { a.play:hover { color: var(--accent-text); background: var(--accent); border-color: var(--accent); } }
a.play svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
/* Without JS (Q116): the browser's own player, wide enough to lay out normally but clipped to a round button showing its play button */
.play-nojs { display: inline-block; position: relative; width: 2.25rem; height: 2.25rem; margin-left: 0.4rem; vertical-align: middle;
    border-radius: 50%; overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.play-nojs audio { position: absolute; left: -0.6rem; top: 50%; width: 12rem; height: 3rem; margin-top: -1.5rem; }
.card-term { font-size: 1.1rem; font-weight: 700; } /* bold, as on the landing site */
/* Tap to turn on sound (templates/footer.php, app.js): a pill at the top, over the page, when auto play was blocked */
button.sound-on {
    position: fixed; z-index: 100; top: calc(0.75rem + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
    display: inline-flex; align-items: center; gap: 0.4rem; margin: 0; padding: 0.5rem 1rem; border-radius: 2rem;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.25); white-space: nowrap;
}
button.sound-on[hidden] { display: none; }
button.sound-on svg { fill: currentColor; }

/* A "nothing to do" page after or between sessions (lesson and review status): a centred column, the message larger,
   and the closing link (where to go next) as a button, so a wide screen isn't a small picture and two lines in a big box */
main > div.status { display: block; max-width: 36rem; margin: 0 auto; padding: 2rem 0 1rem; text-align: center; }
.status figure { margin-bottom: 1.5rem; }
.status figure + p { font-size: 1.2rem; font-weight: 600; color: var(--heading); }
.status > p:last-child { margin: 2rem 0 0; }
.status > p:last-child a {
    display: inline-block; padding: 0.6rem 1.5rem; font-weight: 700; text-decoration: none;
    color: var(--accent-text); background: var(--accent); border-radius: var(--radius);
}
@media (hover: hover) { .status > p:last-child a:hover { filter: brightness(1.08); } }
.status ul.study-today { list-style: none; padding: 0; margin: 1rem 0; } /* /study done for today: today's counts (Q115) */
.status > form { margin: 2rem 0 0; } /* Keep going, Keep studying, More reviews: a real button (a GET form), to catch the eye */
.status > form button { padding: 0.75rem 2rem; font-size: 1.1rem; }
/* All of today's lessons or reviews done (templates/all_done.php): a bigger picture and heading than after a batch, with a little bounce */
.status figure.all-done img { width: 100%; max-width: 320px; height: auto; }
.status h2.all-done { font-size: 2rem; margin: 0 0 0.75rem; color: var(--accent); }
.status h2.all-done + p { font-size: 1.2rem; font-weight: 600; color: var(--heading); }
@media (prefers-reduced-motion: no-preference) {
    .status figure.all-done img { animation: all-done-pop 0.6s ease-out; }
}
@keyframes all-done-pop { 0% { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }

/* Loading (public/js/app.js): a bar sliding along the top while the next page is on its way, shown only after a moment so
   quick pages don't flash it; the pressed button dims and spins. In the installed app the bar and spinner show at once (.now),
   as an iPhone paints nothing more once the page is asked for. With reduced motion the bar stays still and fades in and
   out, and the spinner (small, and in place) turns more slowly: something still shows it's working. */
html.loading, html.loading button { cursor: progress; }
button[aria-busy="true"] { opacity: 0.7; filter: none; }
html.loading button[aria-busy="true"]::after {
    content: "";
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin-left: 0.5em;
    vertical-align: -0.05em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: loading-in 0.2s step-end both, loading-spin 0.8s linear infinite;
}
html.loading body::before {
    content: "";
    position: fixed;
    z-index: 100;
    top: env(safe-area-inset-top, 0);
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat;
    background-size: 50% 100%;
    animation: loading-in 0.2s step-end both, loading-slide 1.2s linear infinite;
}
html.loading.now body::before { animation: loading-slide 1.2s linear infinite; }
html.loading.now button[aria-busy="true"]::after { animation: loading-spin 0.8s linear infinite; }
@media (prefers-reduced-motion: reduce) {
    html.loading button[aria-busy="true"]::after { animation-duration: 0.2s, 1.6s; }
    html.loading.now button[aria-busy="true"]::after { animation-duration: 1.6s; }
    html.loading body::before { background: var(--accent); animation: loading-in 0.2s step-end both, loading-pulse 1.6s ease-in-out 0.2s infinite; }
    html.loading.now body::before { animation: loading-pulse 1.6s ease-in-out infinite; }
}
@keyframes loading-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes loading-spin { to { transform: rotate(360deg); } }
@keyframes loading-slide { from { background-position: -100% 0; } to { background-position: 200% 0; } }
@keyframes loading-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* The review keys' hint (review.js) only where the main pointer is a mouse or trackpad: a phone or tablet, in the browser
   or installed, has no keyboard to use them with (owner report, 2026-11-25) */
@media (pointer: coarse) { main .keys { display: none; } }

/**** Small screens ********************************************************/

@media (max-width: 40rem) {
    main { padding: 1rem; border-left: 0; border-right: 0; border-radius: 0; margin: 0 -1rem; }
}

/* The review heatmap (dashboard) */
svg.heatmap text { font-size: 11px; }
.heat-scroll { display: flex; flex-direction: row-reverse; overflow-x: auto; } /* on a narrow screen, starts scrolled to the latest weeks */
.heat-scroll svg { flex: none; width: 100%; }
svg.heatmap rect.today { stroke: var(--text); stroke-width: 1.5; }
/* Less ▪▪▪▪▪ More: the caption is a flex row, where vertical-align does nothing, so the squares sit on the text's
   baseline through align-items, close together */
figcaption.heat-legend { align-items: baseline; gap: 0.25rem; }
.heat-key { display: inline-block; width: 0.85em; height: 0.85em; border-radius: 2px; }
.heat-stats { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; padding: 0; list-style: none; }

/* The dashboard (Q66): today's next step stands out; cards by stage in one row */
img.daily-done { vertical-align: middle; } /* the calm Today box's done-for-today picture (Q127) */
section.today { border-color: var(--accent); border-width: 2px; }
section.today p { margin: 0.5rem 0; }
section.today { display: flow-root; } /* holds the floated illustration */
img.today-art { float: right; margin: 0 0 0.5rem 1rem; } /* the welcome illustration in the box's empty right side */
@media (max-width: 40rem) { img.today-art { display: none; } }
/* Q111: wider screens put the next step (counts and button, or done for today) to the right of the ring and streak */
@media (min-width: 40rem) {
    .today-body { display: flex; flex-wrap: wrap; align-items: center; column-gap: 2.5rem; }
    .today-body .today-goal { margin: 0; }
}
@media (min-width: 40rem) { .today-counts { display: flex; gap: 2.5rem; } } /* the two counts side by side on wider screens */
/* Today's goal ring and the study streak (14.4, 14.5) */
.today-goal { display: flex; align-items: center; gap: 1rem; margin: 0.5rem 0 0.75rem; }
svg.ring { flex: none; }
svg.ring circle { fill: none; stroke-width: 10; }
svg.ring .ring-track { stroke: var(--border); }
svg.ring .ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray 0.6s ease-out; }
svg.ring .ring-tick { fill: none; stroke: var(--accent); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
p.streak img { vertical-align: middle; }
/* The "i" beside the streak and the words learned (owner request, 2026-11-30): a <details> (no JS) whose note opens
   over the section below it, across the section's width */
section.today, section.learned { position: relative; }
.info-row { display: flex; align-items: center; gap: 0.5rem; }
details.info { display: inline-block; flex: none; margin: 0; }
details.info > summary { display: flex; align-items: center; justify-content: center; width: 1.6rem; height: 1.6rem;
    border: 2px solid var(--accent); border-radius: 50%; list-style: none; font: italic 700 1rem/1 Georgia, serif; }
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary::before { content: "i"; }
details.info[open] > summary { color: var(--accent-text); background: var(--accent); }
details.info > div { position: absolute; left: 1rem; right: 1rem; z-index: 2; margin-top: 0.4rem; padding: 0.25rem 1rem;
    font-size: 0.95rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.15); }
details.info > div p { margin: 0.6rem 0; }
@media (prefers-reduced-motion: reduce) { svg.ring .ring-fill { transition: none; } }
ul.stages { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; padding: 0; margin: 0 0 0.75rem; list-style: none; }
ul.stages li { display: flex; align-items: center; gap: 0.4rem; }
ul.stages small { display: block; color: var(--muted); }
h2.learned small { font-size: 0.8rem; font-weight: normal; color: var(--muted); }
@media (max-width: 40rem) { h2.learned small { display: block; margin-left: calc(28px + 0.35rem + 0.3em); } h2.learned small span { display: none; } } /* phones: this week's count below the total */

/* Settings tabs: links, one page each (no JS) */
nav.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0 0 1.5rem; border-bottom: 2px solid var(--border); }
nav.tabs a { padding: 0.5rem 1rem; margin-bottom: -2px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 600; text-decoration: none; }
@media (hover: hover) { nav.tabs a:hover { color: var(--text); } }
/* Phones (web and app): narrower tabs, so Settings' four fit on one line (owner, 2026-11-25); they still wrap if not */
@media (max-width: 40rem) {
    nav.tabs { gap: 0; }
    nav.tabs a { padding: 0.5rem 0.45rem; font-size: 0.9rem; }
}
nav.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Reset progress can't be undone: a red button, as a warning */
form[action="/settings/reset"] button, form[action="/settings/delete"] button { color: #ffffff; background: var(--forgotten); box-shadow: none; }

/* Help requests: the new-reply banner on every page, the count on the Help tab, and the conversation */
.notice { margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--ok-bg); color: var(--ok); }
.notice a { font-weight: 700; }
.notice > p { margin: 0.5rem 0; } /* the Decks welcome (Q63) */
.notice > p:first-child { margin-top: 0; }
.notice > p:last-child { margin-bottom: 0; }

/* Installing on a phone (PWA, PLAN.md Phase 15). The install note's "don't show again" looks like a link; the notes are
   hidden inside the installed app itself, which needs no telling (no JS: the display-mode media query). */
button.link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
form.logout { margin: 1rem 0; } /* Log out: a POST, so other sites can't log learners out, that looks like a link */
form.logout button.link { color: var(--accent); text-underline-offset: 0.15em; }
form.install-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; }
@media (display-mode: standalone) { form.install-note { display: none; } } /* form. to outweigh the rule above */
/* /install: each phone's steps, a picture over its words; side by side when there's room */
.install-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.install-steps figcaption { display: block; margin-top: 0.5rem; font-size: 1rem; color: inherit; }
/* Full screen on an iPhone (viewport-fit=cover in templates/header.php): keep everything clear of the notch, the rounded
   corners and the home bar. env() is 0 everywhere else, so nothing changes there. */
body {
    padding-left: max(1.5rem, env(safe-area-inset-left));
    padding-right: max(1.5rem, env(safe-area-inset-right));
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
}
body > header { padding-top: calc(1rem + env(safe-area-inset-top, 0px)); } /* 1rem below the time and icons on an iPhone, as elsewhere */
/* The installed app looks like an app, not a web site (Q94). All of it only in the app (display-mode: standalone): the
   web site is unchanged. Logged in, the header's menu (nav.app) is a tab bar along the bottom with an icon over each
   label, and the footer (footer.app) is hidden: its links and theme button are at the bottom of Settings → Profile
   (.app-only, hidden elsewhere). The page is edge to edge, without the box around <main>; taps don't flash grey, zoom on
   a double tap or select a button's words; a pressed button dims; and pages cross-fade instead of flashing white.
   Logged in, the header shows no logo or name, only room for the status bar (Q95). Studying, the answer buttons
   (form.answer) sit just above the tab bar, in thumb reach, each half the width (Q95). */
.app-only { display: none; }
@media (display-mode: standalone) {
    .app-only { display: block; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; color: var(--muted); }
    .app-only nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; margin-top: 1.25rem; }
    .app-only nav a { color: var(--muted); }
    html {
        --tab-bar: 3.6rem; /* the tab bar's height, without the iPhone's home bar */
        /* At least the screen's height: on an iPhone, a page shorter than that leaves out the status bar (when the page runs under it),
           so the tab bar, fixed to the bottom, sat that much too high on a card (owner, 2026-11-25) */
        min-height: calc(100% + env(safe-area-inset-top, 0px));
        background: var(--surface);
        -webkit-tap-highlight-color: transparent;
    }
    body { padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
    main { margin: 0; padding: 0.5rem 0 1rem; border: 0; border-radius: 0; background: none; } /* margin: not pulled out to the edges, as on phones (above) */
    body > header > a:first-child { font-size: 1.15rem; }
    body > header > a:first-child img { width: auto; height: 36px; } /* the wordmark, by its height */
    body > header:has(nav.app) { padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 0 0; } /* only the tab bar in it */
    body > header:has(nav.app) > a:first-child { display: none; }
    a, button, input, select, textarea, label, summary { touch-action: manipulation; }
    button, nav a, a.play, summary { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
    button:active:not(:disabled) { filter: brightness(0.9); transform: scale(0.98); }
    body > footer.app { display: none; }
    body:has(> header nav.app) { padding-bottom: calc(var(--tab-bar) + 1rem + env(safe-area-inset-bottom)); } /* room for the tab bar */
    body:has(main > form.answer) { padding-bottom: calc(var(--tab-bar) + 5.5rem + env(safe-area-inset-bottom)); } /* and the answer buttons */
    main > form.answer {
        position: fixed;
        z-index: 98;
        left: 0;
        right: 0;
        bottom: calc(var(--tab-bar) + env(safe-area-inset-bottom));
        display: flex;
        gap: 0.75rem;
        max-width: none;
        margin: 0;
        padding: 0.75rem max(1rem, env(safe-area-inset-right), calc((100% - 46rem) / 2)) 0.75rem max(1rem, env(safe-area-inset-left), calc((100% - 46rem) / 2));
        border: 0;
        border-radius: 0;
        background: var(--surface);
    }
    main > form.answer button { flex: 1 1 0; margin: 0; padding: 0.85rem 0.5rem; line-height: 1.25; } /* narrow sides and lines: "I already know this" on one line, or two not too tall */
    nav.app {
        position: fixed;
        z-index: 99; /* under the loading bar */
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        height: calc(var(--tab-bar) + env(safe-area-inset-bottom));
        padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
        background: var(--surface);
        border-top: 1px solid var(--border);
        view-transition-name: tab-bar; /* stays still while the page cross-fades */
    }
    nav.app .sep { display: none; }
    nav.app a {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.15rem;
        padding: 0 0.25rem;
        font-size: 0.75rem;
        line-height: 1.2;
        color: var(--muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    nav.app a::before { /* the icon: a one-colour SVG as a mask, so it takes the link's colour */
        content: "";
        width: 1.6rem;
        height: 1.6rem;
        background: currentColor;
        -webkit-mask: var(--tab-icon) center / contain no-repeat;
        mask: var(--tab-icon) center / contain no-repeat;
    }
    nav.app a[href="/home"] { --tab-icon: url(/img/tab-home.svg); }
    nav.app a[href="/study"] { --tab-icon: url(/img/tab-study.svg); }
    nav.app a[href="/episodes"] { --tab-icon: url(/img/tab-episodes.svg); }
    nav.app a[href="/phrases"] { --tab-icon: url(/img/tab-phrases.svg); }
    nav.app a[href="/english-lessons/"] { --tab-icon: url(/img/tab-lessons.svg); }
    nav.app a[href="/contact"] { --tab-icon: url(/img/tab-contact.svg); }
    nav.app a[href="/decks"] { --tab-icon: url(/img/tab-decks.svg); }
    nav.app a[href="/settings"] { --tab-icon: url(/img/tab-settings.svg); }
    nav.app a[aria-current="page"] { color: var(--accent); }
    nav.app a:active { opacity: 0.6; }
    /* Log in, Register, Forgot your password and its reset page, the app's first screens logged out (body.auth, owner
       2026-11-29): like the launch page, the logo and name centred over the page, without the site's menu; the form a card
       like the dashboard's, its button full width; the footer only the language and theme switchers (the links between
       these pages are under each form). */
    body.auth > header { flex-direction: column; justify-content: center; padding: calc(2.5rem + env(safe-area-inset-top, 0px)) 0 1.5rem; }
    body.auth > header > a:first-child { flex-direction: column; gap: 0.75rem; font-size: 1.6rem; }
    body.auth > header > a:first-child img { width: auto; height: 72px; }
    body.auth > header nav { display: none; }
    body.auth main { max-width: 28rem; margin: 0 auto; }
    body.auth main { padding: 0; background: none; box-shadow: none; clip-path: none; }
    body.auth .page-head { margin: 0 0 1rem; padding: 0; background: none; box-shadow: none; clip-path: none; }
    body.auth .page-head::after { display: none; }
    body.auth .page-head h1 { font-size: 1.4rem; color: var(--heading); text-align: center; }
    body.auth main > p, body.auth main > figure { text-align: center; }
    body.auth main > figure img { width: 160px; height: auto; }
    body.auth .form-with-art, body.auth main > form { display: block; padding: 1.25rem; background: var(--surface); border: 1px solid var(--border); }
    body.auth .form-with-art > form, body.auth .form-with-art > .login-forms { max-width: none; }
    body.auth main form input:not([type="checkbox"]), body.auth main form select { width: 100%; max-width: none; }
    body.auth main form button { width: 100%; padding: 0.85rem 0.5rem; }
    body.auth > footer > :not(.controls) { display: none; }
}
@media (display-mode: standalone) and (prefers-reduced-motion: no-preference) {
    @view-transition { navigation: auto; }
}
nav.tabs .count, .new { display: inline-block; min-width: 1.4em; padding: 0 0.4em; border-radius: 1em; background: var(--forgotten); color: #ffffff; font-size: 0.8em; text-align: center; }
.new { min-width: 0; }
ol.thread { list-style: none; padding: 0; }
ol.thread li { margin: 0 0 1rem; padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--sunken); border: 1px solid var(--border); }
ol.thread li.owner { border-left: 4px solid var(--accent); }
ol.thread li p { margin: 0.25rem 0; }

/* Decks: the search form as one row (label above the field and its button), with room before the results */
form.search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0 0 1.5rem; }
form.search label { flex: 0 0 100%; }
form.search input { flex: 1 1 16rem; max-width: 28rem; }
table.results { width: 100%; border-collapse: collapse; }
table.results td { padding: 0.6rem 0.5rem; vertical-align: middle; border-top: 1px solid var(--border); }
table.results tr:first-child td { border-top: 0; }
table.results td:last-child { text-align: right; white-space: nowrap; }
table.results form { margin: 0; }

/* Help requests: message boxes as wide as the page allows */
form[action^="/contact"] textarea { max-width: none; }
.contact-top { display: flex; align-items: center; gap: 1rem 2rem; } /* the type and subject, the picture to their right */
.contact-top > div { flex: 1 1 auto; max-width: 28rem; }
.contact-top > div > div { margin: 0 0 1rem; }
.contact-top > div > div:last-child { margin-bottom: 0; }
.contact-top img { flex: 0 0 auto; width: 160px; margin-left: auto; }
@media (max-width: 40rem) { .contact-top img { display: none; } }

/* The theme button, in the footer and Settings → Profile (the installed app's, Q94): only the one that switches away from the theme being shown is visible */
form.theme { display: flex; justify-content: center; }
form.theme button { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.8rem; font-size: 0.85rem;
    color: var(--text); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
form.theme .to-light { display: none; }
:root[data-theme="dark"] form.theme .to-light { display: inline-flex; }
:root[data-theme="dark"] form.theme .to-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) form.theme .to-light { display: inline-flex; }
    :root:not([data-theme]) form.theme .to-dark { display: none; }
}

/* The Decks page: two columns of decks, each with its picture (set in Shed) on top; one column on phones */
.deck-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.deck-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--surface); }
/* The picture across the top (8:3, as Shed saves it) */
.deck-card > img { display: block; width: calc(100% + 2rem); max-width: none; margin: -1rem -1rem 1rem; aspect-ratio: 8 / 3;
    object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.deck-card > h2 { margin-top: 0; }
/* The deck's own page: its name and description, with the same picture on the right (above them on phones) */
.deck-head { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1rem; }
.deck-head > div { flex: 1; }
.deck-head > img { flex: none; width: 16rem; height: auto; aspect-ratio: 8 / 3; object-fit: cover; border-radius: var(--radius); }
@media (max-width: 40rem) { .deck-head { flex-direction: column-reverse; align-items: stretch; gap: 0; }
    .deck-head > img { width: 100%; } }
.deck-card select { width: auto; }
.deck-card label + select { margin: 0 0.5rem; } /* "Start at [Level 1] [Start this deck]" on one line */
@media (max-width: 40rem) { .deck-grid { grid-template-columns: minmax(0, 1fr); } }
/* The Decks page search: in the grey box like a page's own forms, with its picture on the right (hidden on phones) */
.deck-search { display: flex; align-items: center; gap: 1.5rem; margin: 0 0 1.5rem; padding: 1.25rem;
    background: var(--sunken); border-radius: var(--radius); }
.deck-search > form { flex: 1; margin: 0; }
.deck-search > img { flex: none; }
@media (max-width: 40rem) { .deck-search > img { display: none; } }
/* A form with a picture and a few words on its right (Create account): both in one grey box; the picture side goes on
   narrow screens */
.form-with-art { display: flex; align-items: flex-start; gap: 2.5rem; padding: 1.25rem; background: var(--sunken); border-radius: var(--radius); }
.form-with-art > form, .form-with-art > .login-forms { flex: 1 1 24rem; max-width: 30rem; padding: 0; background: none; }
.join-steps li { margin-bottom: 1.25rem; } /* /register: join on Patreon, then log in (Q155) */
.join-steps .button { margin-top: .5rem; }
.login-forms form { padding: 0; background: none; }
.login-forms .or { margin: 1.25rem 0 0.5rem; }
.form-art { display: block; flex: 0 1 560px; align-self: stretch; min-width: 0; margin: 0 0 0 auto; padding-left: 2.5rem; border-left: 1px solid var(--border); text-align: center; } /* a line between form and picture */
.form-art img { display: block; width: 100%; margin: 0 auto; }
.form-art img.cover { width: min(100%, 20rem); border-radius: 1.5rem; } /* the podcast's cover: smaller than the old illustrations, corners as on the landing page */
.form-art h2 { margin: 1.5rem auto 0.5rem; font-size: 1.85rem; line-height: 1.2; text-align: center; text-wrap: balance; color: var(--heading); }
.form-art p { margin: 0 auto; max-width: 28rem; font-size: 1.1rem; text-align: center; color: var(--muted); }
@media (max-width: 52rem) { .form-art { display: none; } }

/* Accessibility (PLAN.md 12.8): text only screen readers hear, and the "Skip to content" link, hidden until it has focus */
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 0.75rem; top: -3rem; z-index: 10; padding: 0.5rem 0.9rem; border-radius: var(--radius);
    color: var(--accent-text); background: var(--accent); font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 0.75rem; }
main:focus { outline: none; } /* focused only by the skip link, which moves on to it */
main article[tabindex="-1"]:focus { outline: none; } /* focused by app.js after a swap, only so screen readers hear the new card (owner report: a green outline) */

/**** Episodes (modules/episode, PLAN.md 16.2) *****************************/

/* A link that looks like the main button (log in or subscribe to read a transcript) */
a.button { display: inline-block; padding: 0.6rem 1.3rem; font-weight: 700; color: var(--accent-text); background: var(--accent); border-radius: var(--radius); text-decoration: none; }
@media (hover: hover) { a.button:hover { filter: brightness(1.08); } }
main article.episodes, main article.episode { margin: 0 auto; padding: 0; border: 0; background: none; } /* pages, not cards */
.episodes ol { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.episodes h2 { margin: 2rem 0 0; scroll-margin-top: 1rem; } /* a year */
.episodes h2 a.top { margin-left: 0.5rem; font-family: system-ui, sans-serif; font-size: 0.85rem; font-weight: 500; color: var(--muted); }
@media (hover: hover) { .episodes h2 a.top:hover { color: var(--accent); } }
.episodes nav.years { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin: 1rem 0 0; }
.episodes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); }
.episodes li a { font-weight: 600; font-size: 1.1rem; }
strong.new-episode { padding: 0 0.5em; font-size: 0.8rem; color: var(--accent-text); background: var(--accent); border-radius: 1em; }
strong.free { padding: 0 0.5em; font-size: 0.8rem; color: var(--ok); background: var(--ok-bg); border-radius: 1em; }
.episode { max-width: 46rem; }
/* The player stays at the top while the learner reads down the transcript */
.episode .player { position: sticky; top: 0; z-index: 2; padding: 0.75rem 0; background: var(--surface); }
.episode audio { display: block; width: 100%; }
/* The player's own controls (public/js/episode.js, which hides the browser's): a round play button, the time and a seek
   bar on one line, and back, forward and the speed under them */
.player-controls[hidden], .player audio[hidden] { display: none; }
.player-controls { padding: 0.75rem 1rem; background: var(--sunken); border: 1px solid var(--border); border-radius: calc(var(--radius) * 2); }
.player-main { display: flex; align-items: center; gap: 0.75rem; }
.player-controls .toggle { flex: none; display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; border-radius: 50%; }
.player-controls .toggle .icon-pause, .player-controls.playing .toggle .icon-play { display: none; }
.player-controls.playing .toggle .icon-pause { display: block; }
.player-controls .clock { flex: none; min-width: 6.5em; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-controls .seek { flex: 1 1 auto; min-width: 0; width: 100%; margin: 0; accent-color: var(--accent); cursor: pointer; }
/* One row under them: back and forward, then the speed and shadowing (18.2) as small menus with their labels */
.player-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.4rem; margin-top: 0.6rem; }
.player-extra button, .player-extra button + button { margin: 0; padding: 0.25rem 0.65rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.player-extra label { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.player-extra select { width: auto; padding: 0.2rem 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); border: 2px solid var(--accent); cursor: pointer; }
@media (max-width: 30rem) { .player-controls .clock { min-width: 0; font-size: 0.8rem; } .player-extra label { margin-left: 0.2rem; } } /* phones: the seek bar keeps its room */
/* Shadowing (18.2): "Your turn" at the end of the row while it waits, and the line to say outlined */
.player-extra .shadow-turn { margin-left: 0.4rem; font-size: 0.9rem; color: var(--accent); }
.player-extra .shadow-turn:empty { display: none; }
.transcript p.your-turn { box-shadow: inset 0 0 0 2px var(--accent); }
/* Record yourself (18.12): Record, then Compare (the line, then the learner); red while recording */
.player-extra .recorder { display: inline-flex; gap: 0.4rem; margin-left: 0.6rem; }
.player-extra .recorder[hidden] { display: none; }
.player-extra .record-status { flex: 1 0 100%; font-size: 0.85rem; color: var(--muted); }
.player-extra .record-status:empty { display: none; }
.transcript p.recorded { box-shadow: inset 3px 0 0 var(--brand-red); }
@media (hover: none), (pointer: coarse) { .episode-keys { display: none; } } /* 18.11: the keyboard shortcuts, for a keyboard and mouse */
.transcript p { display: grid; grid-template-columns: 3.2em 1fr auto; gap: 0.5rem; margin: 0; padding: 0.3rem 0.5rem; border-radius: var(--radius); font-size: 1.1rem; } /* the time, then the line, wrapping beside it */
.transcript .time { padding-top: 0.3em; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
a.time { text-decoration: none; } /* a line's time plays from there (episode.js; ?t= without JS); the words stay free to select */
@media (hover: hover) { .transcript a.time:hover { color: var(--accent); text-decoration: underline; } }
.transcript p[aria-current] { background: var(--highlight); } /* the line being read (public/js/episode.js) */
/* Blur the lines (18.13): each line's words blurred until tapped (episode.js), or focused without JS; the time and + stay clear */
.transcript.blurred p:not(.revealed):not(:focus-within) > span { filter: blur(0.35em); cursor: pointer; user-select: none; }
.blur-tip { color: var(--muted); }
@media (display-mode: standalone) { .episode .player { top: env(safe-area-inset-top, 0px); } }
/* Under the Transcript heading: Print or save as PDF, and the text download, as outline buttons */
.episode-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 0.75rem; }
.episode-tools button, .episode-tools a.button { margin: 0; padding: 0.3rem 0.8rem; font-size: 0.9rem; font-weight: 600; color: var(--accent); background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.episode-tools button[hidden] { display: none; }
.episode-tools :is(button, a.button):not([hidden]) { display: inline-flex; align-items: center; gap: 0.4rem; } /* an icon beside the words (Q159) */
.episode-tools .icon { flex: none; }
.episode-tools .icon[hidden] { display: none; } /* Hide / Show the transcript: one icon at a time */
/* Printing a transcript, or saving it as PDF: the logo and the episode's address, the transcript, and a footer; not the
   menus, the player or the comments. Black on white, whatever the theme. */
.print-only { display: none; }
@media print {
    body, main, main article.episode { color: #000; background: #fff; }
    main:has(.page-head) { padding: 0; box-shadow: none; clip-path: none; }
    body > header, footer, .skip-link, .episode .player, .episode-tools, .episode-tip, .transcript-hidden, .comments, .episode .all-episodes, .head-actions { display: none !important; }
    .transcript[hidden] { display: block !important; } /* printed in full even when hidden on screen (18.8) */
    .transcript.blurred p > span { filter: none !important; } /* and not blurred (18.13) */
    .blur-tip { display: none !important; }
    .page-head { margin: 0 0 1rem; padding: 0; color: #000; background: none; box-shadow: none; clip-path: none; }
    .page-head::after { display: none; }
    .page-head h1 { font-size: 1.8rem; color: #000; }
    .page-head :is(p, small) { color: #555; }
    .print-only { display: block; }
    .print-brand { display: flex; align-items: center; justify-content: space-between; margin: 0 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid #999; font-size: 0.9rem; }
    .print-footer { margin-top: 1.5rem; padding-top: 0.5rem; border-top: 1px solid #999; font-size: 0.85rem; }
    .transcript p { padding: 0.15rem 0; font-size: 11pt; break-inside: avoid; }
    .transcript p[aria-current] { background: none; }
    .transcript .time { color: #555; }
}
/* Search (Q147): the box on one line, then each episode with its matching lines */
.episode-search { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0; }
.episode-search label { flex: 1 0 100%; font-weight: 600; }
.episode-search input { flex: 1 1 12rem; min-width: 0; margin: 0; }
.episode-search button { margin: 0; }
.search-results { list-style: none; padding: 0; }
.search-results > li { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--border); } /* block: not the episode list's flex row (.episodes li) */
.search-results > li > p { margin: 0.25rem 0; }
.search-results > li > p > a { font-weight: 600; font-size: 1.1rem; }
.search-results ul { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.search-results ul li { display: grid; grid-template-columns: 3.2em 1fr; gap: 0.5rem; padding: 0.2rem 0; border: 0; } /* not the episode list's lines between items */
.search-results .time { font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.search-results mark { background: var(--highlight); color: inherit; }
/* Play a line in place (Q159, 18.10: public/js/play-line.js): a round button before its time, the line highlighted while it plays */
.search-results.playable ul li { grid-template-columns: 2rem 3.2em 1fr; align-items: start; border-radius: var(--radius); }
button.play-line { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; margin: 0; padding: 0;
    color: var(--accent); background: var(--tint); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--accent); }
[data-line-player] li.playing { background: var(--highlight); }
[data-line-player] li.playing button.play-line { color: var(--accent-text); background: var(--accent); }
/* My phrases (Q148): a small + at the end of each transcript line (✓ once saved), and the list */
.transcript a.save-line { align-self: start; min-width: 1.8em; padding: 0.1em 0; text-align: center; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: var(--radius); }
.transcript a.save-line.saved { color: var(--ok); }
@media (hover: hover) { .transcript a.save-line:hover { color: var(--accent-text); background: var(--accent); } }
.episode blockquote { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 3px solid var(--accent); background: var(--sunken); }
.episode blockquote .time { margin-right: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.episode textarea#phrase { width: 100%; }
.phrase-list { list-style: none; padding: 0; }
.phrase-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.phrase-list li > p { grid-column: 1; margin: 0.1rem 0; }
.phrase-list .phrase { font-size: 1.1rem; font-weight: 600; }
.phrase-list button.play-line { display: inline-grid; vertical-align: -0.35em; margin-right: 0.5rem; } /* 18.10: hear its line */
.phrase-list li.playing { border-radius: var(--radius); }
@media print { .phrase-list button.play-line { display: none; } }
.phrase-list .phrase-line { color: var(--muted); }
.phrase-list .phrase-delete { grid-column: 2; grid-row: 1; margin: 0; }
.phrase-week { margin: 1.5rem 0 0; font-size: 1.1rem; } /* 18.9: My phrases by the week they were saved */
.phrase-list .phrase-note { grid-column: 1; display: flex; gap: 0.4rem; margin: 0.3rem 0; }
.phrase-list .phrase-note input { flex: 1; min-width: 0; margin: 0; }
.phrase-list .phrase-note button { margin: 0; padding: 0.25rem 0.7rem; font-size: 0.85rem; }
.phrase-list button.link { margin: 0; padding: 0; font-size: 0.85rem; color: var(--muted); background: none; box-shadow: none; text-decoration: underline; }
@media print { .transcript a.save-line, .phrase-delete, .phrase-note { display: none !important; } .phrase-list .phrase-line { color: #333; } .transcript p { grid-template-columns: 3.2em 1fr; } }
/* Listened (Q147): a tick-off on the episode page, and a mark on the list */
.listened-count { color: var(--muted); }
/* Comments (17.5): the owner's replies indented under the comment they answer */
.comments { margin-top: 2.5rem; }
.comments ol { list-style: none; padding: 0; margin: 1rem 0 1.5rem; }
.comments li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.comments li, .comment-reply { scroll-margin-top: 8rem; } /* clear of the sticky player */
.comments li p { margin: 0.25rem 0; }
.comments p.comment-meta { font-size: 0.85rem; color: var(--muted); }
.comments p.comment-meta strong { color: var(--text); }
.comments strong.waiting { padding: 0 0.5em; font-size: 0.8rem; font-weight: 600; color: var(--text); background: var(--highlight); border-radius: 1em; }
.comment-reply { margin: 0.5rem 0 0 1.25rem; padding: 0.25rem 0 0.25rem 0.75rem; border-left: 3px solid var(--accent); }
.comments form textarea { max-width: none; }

/**** The public site (modules/site, PLAN.md 16.6): the home page, FAQ, privacy, terms and articles ****************/

/* Logged in or not (<html class="signed-in">, templates/header.php): the copy's .signed-in and .signed-out parts */
html:not(.signed-in) .signed-in, html.signed-in .signed-out { display: none !important; }
/* The site's pages sit on the page, not in the app's box, at a reading width */
main:has(> .site) { padding: 0; background: none; border: 0; }
main > div.site { display: block; max-width: 60rem; margin: 0 auto; }
.site h1 { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 1rem; }
.site h2 { font-size: 1.6rem; margin: 0 0 1rem; }
.site h3 { font-size: 1.1rem; margin: 0 0 0.25rem; }
.site .small { font-size: 0.9rem; color: var(--muted); }
.site a.button { padding: 0.7rem 1.3rem; }
.site a.button.secondary, .site .listen a { color: var(--accent); background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.site section { margin: 0; padding: 2.5rem 0; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.site section:first-child { border-top: 0; }
.site section h2 { margin-top: 0; font-size: 1.6rem; }
.site .hero { text-align: center; padding-top: 2rem; }
.site .lead { font-size: 1.2rem; max-width: 40rem; margin: 0 auto 1.5rem; }
.site .actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.site .hero-art { display: block; width: min(100%, 16rem); height: auto; margin: 1.5rem auto 0; border-radius: 1.5rem; } /* the podcast's cover */
@media (min-width: 52rem) { /* text beside the cover */
    .site .hero { display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; align-items: center; text-align: left; }
    .site .hero .lead { margin-left: 0; }
    .site .hero .actions { justify-content: flex-start; }
    .site .hero-art { width: 100%; margin: 0; }
}
.site .listen-on { text-align: center; }
.site .listen { display: contents; }
.site .listen a { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.1rem; font-weight: 600; border-radius: var(--radius); text-decoration: none; }
.site .example { text-align: center; }
.site .transcript-demo { max-width: 36rem; margin: 0 auto 1rem; padding: 1rem; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.site .transcript-demo p { display: grid; grid-template-columns: 3.2em 1fr; gap: 0.5rem; margin: 0; padding: 0.3rem 0.5rem; border-radius: var(--radius); font-size: 1.1rem; }
.site .transcript-demo .time { padding-top: 0.3em; font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.site .transcript-demo .reading { background: var(--highlight); }
.site .transcript-demo button.time { margin: 0; padding: 0.3em 0 0; align-self: start; text-align: left; color: var(--muted); background: none; box-shadow: none; font-weight: inherit; } /* demo.js: a line's time plays from there */
@media (hover: hover) { .site .transcript-demo button.time:hover { color: var(--accent); text-decoration: underline; filter: none; } }
.site .demo-play { text-align: center; } /* the example's play button (public/js/demo.js) */
.site .benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; padding: 0; list-style: none; }
.site .benefits li { padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.site .benefits p { margin: 0; }
.site .benefits h3 img { display: inline-block; margin: 0 0.4rem 0 0; vertical-align: -0.3em; } /* an icon beside the heading */
/* The home page's two ways in (Q153): a free account and membership, side by side, each with a button */
.site .plans { text-align: center; }
.site .plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 1rem; text-align: left; }
.site .plan { display: flex; flex-direction: column; padding: 1.25rem 1.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.site .plan-member { border: 2px solid var(--accent); }
.site .plan h3 { font-size: 1.3rem; }
.site .plan .price-amount { margin: 0 0 0.75rem; }
.site .plan ul { flex: 1; margin: 0 0 1rem; padding: 0; list-style: none; }
.site .plan li { position: relative; padding: 0.3rem 0 0.3rem 1.6rem; }
.site .plan li::before { content: "✓"; position: absolute; left: 0; font-weight: 700; color: var(--accent); }
.site .plan .actions { justify-content: flex-start; margin: 0; }
.site .plan .small { margin: 0.5rem 0 0; }
.site .price { text-align: center; }
.site .price p { max-width: 40rem; margin-left: auto; margin-right: auto; }
.site .price-amount { font-size: 1.15rem; }
.site .price-amount strong { font-size: 1.6rem; line-height: 1.4; color: var(--heading); }

/* The home page in the podcast artwork's colours (Q157), and the English lessons page with it: each section a band across the whole window (a shadow as wide
   as the screen, clipped to the band's height, so the markup stays as Shed writes it), alternating white and the pale
   page, with the hero and the last call to action in navy. The main buttons are the artwork's red. */
:is(.site-home, .site-english-lessons .legal) > section { position: relative; padding: 3.5rem 0; border: 0; background: var(--band); box-shadow: 0 0 0 100vmax var(--band); clip-path: inset(0 -100vmax); --band: var(--bg); }
:where(.site-home, .site-english-lessons .legal) > section:nth-of-type(even) { --band: var(--surface); } /* :where, so the navy bands below win on even sections too */
.site-home > section.hero, .site-home > section.price { --band: var(--brand-navy); color: #ffffff; }
.site-home > section.hero { padding: 3rem 0 4rem; margin-bottom: 6px; clip-path: inset(0 -100vmax -6px); }
.site-home > section.hero::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 6px; background: var(--brand-red); box-shadow: 0 0 0 100vmax var(--brand-red); clip-path: inset(0 -100vmax); } /* a red stripe under the hero, across the window */
:is(.site-home, .site-english-lessons) section h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); font-weight: 800; }
.site-home .hero h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 900; line-height: 1.05; letter-spacing: -0.02em; text-transform: uppercase; }
.site-home :is(.hero, .price) :is(h1, h2) { color: #ffffff; }
.site-home :is(.hero, .price) :is(.small, p) { color: #d5e0f0; }
.site-home :is(.hero, .price) a:not(.button) { color: #ffffff; }
.site-home .hero .lead { color: #ffffff; }
:is(.site-home, .site-english-lessons) a.button:not(.secondary), .site-home .demo-play button { color: #ffffff; background: var(--brand-red); box-shadow: 0 3px 0 #9e1a20; } /* a solid red button, a little raised */
:is(.site-home, .site-english-lessons) a.button:not(.secondary):active, .site-home .demo-play button:active { transform: translateY(2px); box-shadow: 0 1px 0 #9e1a20; }
.site-home :is(.hero, .price) a.button.secondary { color: #ffffff; box-shadow: inset 0 0 0 2px #ffffff; }
.site-home .hero-art { border-radius: 1.25rem; transform: rotate(2.5deg); box-shadow: 0 1.25rem 2.5rem rgb(0 0 0 / 0.35); }
@media (prefers-reduced-motion: no-preference) and (hover: hover) {
    .site-home .hero-art { transition: transform 0.3s; }
    .site-home .hero-art:hover { transform: rotate(0deg) scale(1.02); }
}
/* The example transcript: bigger, lifted off the page, the line being read in the warm yellow with a red edge */
.site-home .transcript-demo { max-width: 40rem; padding: 1.25rem; border: 0; box-shadow: 0 0.75rem 2rem rgb(11 31 68 / 0.15); }
.site-home .transcript-demo p { font-size: 1.2rem; }
.site-home .transcript-demo .reading { box-shadow: inset 4px 0 0 var(--brand-red); }
/* Plans: the full membership a navy card, its ticks red */
:is(.site-home, .site-english-lessons) .plan { border-radius: 0.75rem; box-shadow: 0 0.5rem 1.5rem rgb(11 31 68 / 0.08); }
:is(.site-home, .site-english-lessons) .plan li::before { color: var(--brand-red); }
:is(.site-home, .site-english-lessons) .plan-member { color: #ffffff; background: var(--brand-navy); border: 0; }
:is(.site-home, .site-english-lessons) .plan-member :is(h3, .price-amount strong) { color: #ffffff; }
:is(.site-home, .site-english-lessons) .plan-member .small { color: #d5e0f0; }
:is(.site-home, .site-english-lessons) .plan-member li::before { color: #ffffff; }
/* Why read along: cards with a coloured top edge, red and blue in turn */
:is(.site-home, .site-english-lessons) .benefits li { border: 0; border-top: 4px solid var(--brand-red); border-radius: 0.75rem; box-shadow: 0 0.5rem 1.5rem rgb(11 31 68 / 0.08); }
:is(.site-home, .site-english-lessons) .benefits li:nth-child(even) { border-top-color: var(--brand-blue); }
:is(.site-home, .site-english-lessons) .benefits h3 { font-size: 1.2rem; }
/* The last call to action: centred, bigger */
.site-home .price { padding: 4rem 0; }
.site-home .price p { font-size: 1.1rem; }

/* Every other page in the home page's look (Q157): its title (with any back link and details) in a navy band across
   the window with the red stripe under it, as the home page's hero (<header class="page-head">), then the page on
   white across the window. Calls to action (a.button) and the player's play button are the artwork's red; form
   buttons stay navy, so Delete and Reset (red) still stand out. */
main:has(.page-head) { padding: 0 1.5rem 3.5rem; background: var(--surface); border: 0; border-radius: 0; box-shadow: 0 0 0 100vmax var(--surface); clip-path: inset(0 -100vmax); }
.page-head { display: block; position: relative; margin: 0 0 calc(2rem + 6px); padding: 2.5rem 0 2.25rem; color: #ffffff; background: var(--brand-navy); border: 0;
    box-shadow: 0 0 0 100vmax var(--brand-navy); clip-path: inset(0 -100vmax -6px); }
.page-head::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 6px; background: var(--brand-red); box-shadow: 0 0 0 100vmax var(--brand-red); clip-path: inset(0 -100vmax); }
.page-head h1 { margin: 0; font-size: clamp(2rem, 5vw, 3rem); font-weight: 900; line-height: 1.1; letter-spacing: -0.02em; color: #ffffff; text-wrap: balance; }
.page-head p { margin: 0 0 0.75rem; color: #d5e0f0; }
.page-head h1 + p { margin: 0.75rem 0 0; max-width: 40rem; font-size: 1.1rem; }
.page-head :is(small, .small) { font-size: 0.9rem; color: #d5e0f0; }
.page-head a { color: #ffffff; }
.page-head .free, .page-head .draft { color: var(--brand-navy); }
/* An episode's Comments button (Q160), in its title's band: white outline and edge, as on the home page's bands */
/* ...and Mark as listened beside it (Q147), green with a tick once listened (pressed again to undo) */
.page-head .head-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1rem 0 0; }
.page-head .head-actions form { margin: 0; }
.page-head :is(a.button.to-comments, form.listened button) { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0; padding: 0.45rem 1rem; font-size: 1rem; font-weight: 700; color: #ffffff; background: transparent;
    box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #ffffff; }
.page-head form.listened button[aria-pressed="true"] { color: #ffffff; background: var(--chart-remembered); box-shadow: inset 0 0 0 2px var(--chart-remembered), 0 3px 0 #ffffff; } /* green: done */
.page-head form.listened button[aria-pressed="true"]::before { content: "✓"; }
@media (hover: hover) { .page-head :is(a.button.to-comments, form.listened button[aria-pressed="false"]):hover { background: rgb(255 255 255 / 0.12); } }
.comments { scroll-margin-top: 6rem; } /* clear of the sticky player when the button jumps here */
a.button:where(:not(.secondary)), .player-controls .toggle { color: #ffffff; background: var(--brand-red); } /* :where(), so outline buttons (.episode-tools) keep their look */
.site a.button:not(.secondary) { box-shadow: 0 3px 0 #9e1a20; } /* the site's, a little raised, as on the home page */
main .site :has(> .page-head) { padding-top: 0; border-top: 0; } /* the band right under the menu, as on the home page */
/* Outline buttons, chunky like the artwork's lettering (Q157): a navy outline with a solid navy edge under it (white in
   the dark theme). A light fill under the mouse, and they press down when clicked, as the red ones do. */
:is(.site a.button.secondary, .site .listen a, .episode-tools :is(button, a.button), .player-extra button, button + button, form.theme button) {
    color: var(--accent); background: var(--tint); box-shadow: inset 0 0 0 2px var(--accent), 0 3px 0 var(--accent); }
/* already on a light blue: the player's box and the footer (the pale page). White there, light blue under the mouse */
.player-controls .player-extra button, :root body > footer form.theme button:not([hidden]) { background: var(--surface); }
@media (hover: hover) {
    :is(.site a.button.secondary, .site .listen a, .episode-tools :is(button, a.button), .player-extra button, button + button, form.theme button):hover {
        filter: none; background: var(--tint-hover); } /* a deeper shade, not a lift (owner: no moving on hover) */
    .player-controls .player-extra button:hover, :root body > footer form.theme button:not([hidden]):hover { background: var(--tint-hover); }
}
:is(.site a.button.secondary, .site .listen a, .episode-tools :is(button, a.button), .player-extra button, button + button, form.theme button):active {
    transform: translateY(2px); box-shadow: inset 0 0 0 2px var(--accent), 0 1px 0 var(--accent); }
@media (prefers-reduced-motion: no-preference) {
    :is(.site a.button, .site .listen a, .episode-tools :is(button, a.button), .player-extra button, button + button, form.theme button) { transition: transform 0.1s, box-shadow 0.1s; }
}
/* On: Blur the lines (18.13) filled navy; Record yourself (18.12) red while recording. After the outline buttons, to win */
.episode-tools a.button[aria-pressed="true"], .episode-tools a.button[aria-pressed="true"]:hover { color: var(--accent-text); background: var(--accent); }
.player-controls .player-extra button.recording, .player-controls .player-extra button.recording:hover { color: #ffffff; background: var(--brand-red); }
/* On the home page's navy bands: white outline and edge, and see-through */
.site-home :is(.hero, .price) a.button.secondary { color: #ffffff; background: transparent; box-shadow: inset 0 0 0 2px #ffffff, 0 3px 0 #ffffff; }
@media (hover: hover) { .site-home :is(.hero, .price) a.button.secondary:hover { background: rgb(255 255 255 / 0.12); } }
.site-home :is(.hero, .price) a.button.secondary:active { box-shadow: inset 0 0 0 2px #ffffff, 0 1px 0 #ffffff; }
/* The FAQ, privacy, terms and articles: a reading column */
.site .legal, .site .article { max-width: 44rem; margin: 0 auto; padding: 2rem 0; background: none; border: 0; border-radius: 0; }
.site .legal h2 { font-size: 1.3rem; margin-top: 2rem; }
/* An article's recording (public/site-audio/<slug>.mp3), under its title */
.site .article-audio audio { width: 100%; }
/* The English lessons page (Q144), in the home page's look (Q157, the bands and cards above): as wide as the home page;
   first Chris's video beside the welcome and a Book button, then the reasons as cards, the skills four in a row with
   their icons on top, the prices as the home page's plans (the full lesson navy), and Cal.com's calendar */
.site-english-lessons .legal { max-width: 60rem; padding-bottom: 0; }
.site-english-lessons .legal > section { padding: 3rem 0; }
.site-english-lessons .legal > section:nth-of-type(odd) { --band: var(--surface); } /* white first, so the last (the calendar) is white over the pale footer */
.site-english-lessons .legal > section:nth-of-type(even) { --band: var(--bg); }
.site-english-lessons .page-head { margin-bottom: 6px; } /* the first band right under the red stripe */
main:has(.site-english-lessons) { padding-bottom: 0; }
.site-english-lessons section:nth-of-type(2) .benefits { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); } /* why learn with me: two by two */
.site-english-lessons .legal > section:last-child { padding-bottom: 3.5rem; }
.site-english-lessons .legal section h2 { margin-top: 0; }
.site-english-lessons .intro { display: grid; gap: 1.5rem 2.5rem; align-items: center; }
@media (min-width: 48rem) { .site-english-lessons .intro { grid-template-columns: 7fr 5fr; } }
.site-english-lessons .intro .video { margin: 0; }
.site-english-lessons .intro .video iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 0.75rem; box-shadow: 0 1rem 2rem rgb(11 31 68 / 0.2); }
.site-english-lessons .intro .lead { margin: 0 0 1rem; font-size: 1.25rem; font-weight: 500; color: var(--heading); }
.site-english-lessons .intro .actions { justify-content: flex-start; }
.site-english-lessons #book, .site-english-lessons #calendar { text-align: center; }
.site-english-lessons .plan-cards { text-align: left; }
.site-english-lessons .plan .actions { justify-content: flex-start; }
/* What we can practise: four in a row on a wide screen, each icon big and on top */
.site-english-lessons section:nth-of-type(3) .benefits { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.site-english-lessons section:nth-of-type(3) .benefits h3 img { display: block; width: 44px; height: 44px; margin: 0 0 0.6rem; }
.site-english-lessons .legal .cal-inline { width: 100%; overflow: auto; }
.site .legal dt { font-weight: bold; margin-top: 1rem; }
.site .legal dd { margin: 0.25rem 0 0; }
.site .faq details { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.site .faq summary { cursor: pointer; font-weight: 600; color: var(--heading); }
.site .faq details p { margin: 0.5rem 0 0; }
.site .faq .actions { justify-content: flex-start; margin-top: 2rem; }
.site .articles { list-style: none; padding: 0; }
.site .articles li { padding: 1rem 0; border-top: 1px solid var(--border); }
.site .articles + h2 { margin-top: 2rem; }
.site .articles h3 { font-size: 1.25rem; }
.site .articles p { margin: 0; color: var(--muted); }
.site .article table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.site .article th, .site .article td { padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; border: 1px solid var(--border); }
.site .article th { background: var(--surface); }
.site aside.cta { display: block; margin-top: 2.5rem; padding: 1.25rem 1.5rem; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.site .draft { display: inline-block; padding: 0.2rem 0.6rem; font-size: 0.9rem; background: var(--highlight); border-radius: var(--radius); }
/* The footer's listen icons (templates/footer.php), with room above (the switchers) and below (the links) */
.listen-links { display: flex; justify-content: center; gap: 1rem; margin: 1.25rem 0 0; }
.listen-links + nav { margin-top: 1.25rem; }
.listen img { border-radius: 22%; } /* the RSS icon is square; the others are already round */
.listen-links .listen { display: contents; }
.listen-links a { display: block; line-height: 0; }
/* /episodes (Q157): the search box in the title's band, big, its button red; under the band the learner's progress
   and the private feeds (Q156) as two cards side by side, as the home page's; then the years as chips, and each year's
   heading over a red line */
.page-head .episode-search { max-width: 36rem; margin: 1.5rem 0 0; }
.page-head .episode-search label { font-size: 0.95rem; color: #d5e0f0; }
.page-head .episode-search input { padding: 0.75rem 1rem; font-size: 1.1rem; color: var(--text); border: 0; } /* inputs inherit the band's white text otherwise */
.page-head .episode-search button { padding: 0.75rem 1.5rem; color: #ffffff; background: var(--brand-red); box-shadow: 0 3px 0 #9e1a20; }
.page-head .episode-search button:active { transform: translateY(2px); box-shadow: 0 1px 0 #9e1a20; }
.episodes-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 0 0 2rem; }
.episodes-cards > * { margin: 0; padding: 1rem 1.25rem; color: var(--text); background: var(--surface); border-top: 4px solid var(--brand-red);
    border-radius: 0.75rem; box-shadow: 0 0.5rem 1.5rem rgb(11 31 68 / 0.1); }
.episodes-cards > * + * { border-top-color: var(--brand-blue); }
.listened-count progress { display: block; width: 100%; height: 0.6rem; margin: 0.6rem 0; border: 0; border-radius: 1rem; background: var(--sunken); appearance: none; overflow: hidden; }
.listened-count progress::-webkit-progress-bar { background: var(--sunken); }
.listened-count progress::-webkit-progress-value { background: var(--chart-remembered); border-radius: 1rem; } /* green: growth */
.listened-count progress::-moz-progress-bar { background: var(--chart-remembered); border-radius: 1rem; }
.listened-count a, .feed-link a { font-weight: 700; }
.feed-link { display: flex; align-items: flex-start; gap: 0.75rem; }
.feed-link img { flex: none; border-radius: 6px; }
.episodes nav.years { gap: 0.5rem; margin: 0; }
.episodes nav.years a { padding: 0.2rem 0.9rem; font-weight: 700; text-decoration: none; background: var(--tint); border-radius: 999px; box-shadow: inset 0 0 0 2px var(--accent), 0 2px 0 var(--accent); }
@media (hover: hover) { .episodes nav.years a:hover { color: var(--accent-text); background: var(--accent); } }
.episodes h2[id^="year-"] { padding-bottom: 0.35rem; font-size: 1.8rem; font-weight: 800; border-bottom: 3px solid var(--brand-red); }
/* Each year's progress (Q158): how many listened with a green bar, and Year complete! when they all are */
.year-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.6rem 0 0.25rem; }
.year-progress p { flex: 1 1 14rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; margin: 0; color: var(--muted); }
.year-progress progress { flex: 1 1 8rem; max-width: 14rem; height: 0.5rem; border: 0; border-radius: 1rem; background: var(--sunken); appearance: none; overflow: hidden; }
.year-progress progress::-webkit-progress-bar { background: var(--sunken); }
.year-progress progress::-webkit-progress-value { background: var(--chart-remembered); border-radius: 1rem; }
.year-progress progress::-moz-progress-bar { background: var(--chart-remembered); border-radius: 1rem; }
strong.year-done { padding: 0.1rem 0.7rem; font-size: 0.85rem; color: var(--ok); background: var(--ok-bg); border-radius: 1em; }
strong.year-done::before { content: "★ "; }
/* Each row's ⋯ menu (Q158): this episode and every older (or newer) one, marked or unmarked, a dropdown under the ⋯,
   which stays where it is */
.episodes details.range { position: relative; margin-left: auto; }
.episodes details.range summary { padding: 0 0.6rem; font-size: 1.2rem; font-weight: 900; line-height: 1.4; color: var(--muted); list-style: none; cursor: pointer; border-radius: var(--radius); }
.episodes details.range summary::-webkit-details-marker { display: none; }
@media (hover: hover) { .episodes details.range summary:hover { color: var(--accent); background: var(--tint); } }
.episodes details.range[open] summary { color: var(--accent); background: var(--tint); }
.episodes details.range ul { position: absolute; top: 100%; right: 0; z-index: 10; margin: 0.25rem 0 0; padding: 0.5rem 1rem; list-style: none;
    width: max-content; max-width: min(24rem, 85vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.15); }
.episodes details.range li { display: block; padding: 0.25rem 0; border: 0; }
.episodes details.range li :is(a, button) { font-size: 0.95rem; font-weight: 600; }
.episodes details.range form { margin: 0; }
.episodes details.range button.link { margin: 0; padding: 0; color: var(--accent); text-align: left; background: none; box-shadow: none; text-underline-offset: 0.15em; }
/* Are you sure? (Q158): what it changes (a warning when it loses progress), then Yes and Cancel in a row; Yes, unmark
   them red, like Reset progress */
.bulk-note { max-width: 40rem; padding: 0.75rem 1rem; background: var(--sunken); border-radius: var(--radius); }
.bulk-note.warning { color: var(--error); background: var(--error-bg); }
.listened-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 1.5rem 0 0; }
.listened-confirm button.danger { color: #ffffff; background: var(--forgotten); }
/* Listened (Q147): a pill on the list's row (marked, or unmarked, from its ⋯ menu) */
strong.listened-mark { padding: 0 0.5em; font-size: 0.8rem; color: var(--muted); background: var(--sunken); border-radius: 1em; }
strong.listened-mark::before { content: "✓ "; }
