body { font-size: 16px; }

.p-shell { min-height: 100dvh; }
.p-nav {
    display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
    padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.p-brand { font-size: 1.2rem; }
.p-nav-bare { justify-content: flex-start; }
.p-nav nav { display: flex; gap: 6px; flex: 1; flex-wrap: wrap; }
.p-nav nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; }
.p-nav nav a.active { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); }
.p-main h1 { font-family: var(--display); letter-spacing: -.02em; }
.p-main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 64px; display: flex; flex-direction: column; gap: 20px; }
.p-narrow { max-width: 420px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: 16px; }

.p-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-section { display: flex; flex-direction: column; gap: 14px; }

.p-form { display: flex; flex-direction: column; gap: 14px; }
.p-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.p-form input:not([type=checkbox]):not([type=radio]), .p-form select, .p-form textarea {
    font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
    background: var(--surface); color: var(--text); font-weight: 400;
}
.p-form input:focus, .p-form select:focus, .p-form textarea:focus { outline: none; border-color: var(--accent); }
.p-checks { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.p-checks legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: 6px; }
.p-form-row { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
.p-form-row label { flex: 1 1 160px; }
.p-form .btn { min-height: 48px; }
.p-code-area { font-family: ui-monospace, Consolas, monospace !important; font-size: .85rem; }
.p-check { flex-direction: row !important; align-items: center; font-weight: 500 !important; gap: 10px !important; }
.p-checks { display: flex; flex-wrap: wrap; gap: 6px 20px; padding-left: 28px; }
.validation-message, .validation-errors { color: color-mix(in srgb, var(--miss) 55%, var(--text)); font-weight: 600; font-size: .9rem; }
.p-ok { color: color-mix(in srgb, var(--good) 55%, var(--text)); font-weight: 600; }

.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.p-child { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; }
.p-child:hover { border-color: var(--accent); }
.p-child-head { display: flex; align-items: center; justify-content: space-between; }
.p-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.p-facts-wide { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.p-facts > div { display: flex; flex-direction: column; }
.p-facts .num { font-size: 1.5rem; font-weight: 700; }
.p-facts .label { color: var(--muted); font-size: .8rem; }

.p-code { font-size: 3rem; font-weight: 700; letter-spacing: .3em; color: var(--accent); }

.p-list { display: flex; flex-direction: column; }
.p-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.p-row:last-child { border-bottom: 0; }
.p-row-top { align-items: flex-start; }
.p-row .btn { min-height: 44px; flex: none; }

.p-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.p-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 8px 10px; border-bottom: 2px solid var(--line); }
.p-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.p-table tr:last-child td { border-bottom: 0; }
table.card { padding: 8px 12px; }
.p-table a { color: var(--text); font-weight: 600; }
/* "Add a test" beside a topic with none: quieter than the topic's own name. */
.p-table a.p-add { color: var(--muted); font-weight: 500; }
.p-nowrap { white-space: nowrap; }
/* A child's topics: the name takes what room is left, and the numbers beside it each stay on one line.
   Only where the page is wide: on a tablet or a phone the name would be squeezed to a word a line. */
@media (min-width: 900px) { .p-topics th, .p-topics td:not(:first-child) { white-space: nowrap; } }
/* Said under a topic's name on a phone, where the column that says it is hidden. */
.p-phone-only { display: none; }
@media (max-width: 640px) {
    .p-phone-only { display: block; }
    /* A link there is the only way to its page on a phone: give a thumb room to hit it and not the link above. */
    .p-phone-only a { display: inline-block; padding: 12px 0; }
}
/* Beside the child's name, the way down to the phones at the foot of the page. */
.p-title-link { margin-left: auto; color: var(--muted); }
/* On a phone it has a line to itself under the name, with room to tap. */
@media (max-width: 640px) { .p-title-link { margin-left: 0; flex-basis: 100%; padding: 8px 0; } }
/* A row whose button or links drop below its words when there isn't room beside them. */
.p-row-wrap { flex-wrap: wrap; }
.p-row-wrap > :first-child { flex: 1 1 240px; min-width: 0; }

/* A child's page. A form there sends the parent back to its own section: leave it clear of the top of the window. */
.p-section[id], .p-test-form { scroll-margin-top: 16px; }
/* Adding a test is its own part of the Tests section, under the tests already there. */
.p-test-form { border-top: 1px solid var(--line); padding-top: 16px; }
/* A topic an upload couldn't make, with the line saying how many it did. */
.p-missing { display: flex; flex-direction: column; gap: 10px; }
.p-missing p, .p-missing form { margin: 0; }
/* The upload form folded away under its heading while there are drafts to check. */
details.p-section:not([open]) { gap: 0; }
details.p-section > summary { padding: 4px 0; }
.p-test-form .p-checks { padding-left: 0; }
.p-test-form .p-date { flex: 0 1 210px; }
.p-test-form .p-form-row { gap: 12px; }
/* What a test covers: the child's topics, then the library's by subject, each subject opened when wanted. */
.p-test-topics { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.p-test-topics legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: 4px; }
.p-test-topics h4 { margin: 6px 0 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
.p-test-form [hidden] { display: none !important; }
.p-test-find { max-width: 420px; }
.p-test-group { border-bottom: 1px solid var(--line); }
.p-test-group summary { cursor: pointer; font-weight: 600; padding: 10px 0; min-height: 24px; }
.p-test-group .p-checks { padding: 0 0 12px; }
.p-test-form .p-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; }
.p-test-form .p-check { padding: 6px 0; align-items: flex-start; }
.p-test-form .p-check input { margin-top: 4px; flex: none; }
.p-test-adds { margin: 0; font-weight: 600; }

/* The topic library: one list a subject, with the same columns in each so they line up down the page. */
.p-library { display: flex; flex-direction: column; gap: 20px; }
.p-library .p-table th:nth-child(2), .p-library .p-table td:nth-child(2) { width: 11rem; text-align: right; }
.p-library .p-table td { vertical-align: middle; }
.p-library .p-table .btn { display: inline-flex; min-height: 44px; padding: 6px 18px; }
/* The page comes back to a topic's row after it is added: leave it clear of the top of the window. */
.p-library tr { scroll-margin-top: 90px; }
.p-library .p-ok, .p-library td .small { display: block; }
.p-library .link { min-height: 44px; }
/* The next step after adding a topic, under its row. ".p-table a" would otherwise give it dark text on purple. */
.p-library .p-table tr:has(+ .p-next-row) td { border-bottom: 0; }
.p-library .p-table .p-next-row td { width: auto; text-align: left; padding-top: 0; }
.p-library .p-table .p-next-row .btn { width: 100%; justify-content: center; color: var(--accent-ink); }
/* What to show: the child, then the choices side by side, then the search with its button. */
.p-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px 14px; align-items: end; }
.p-filters-wide { grid-column: 1 / -1; }
/* A choice with long names shrinks to its column: it never pushes the form wider than the phone. */
.p-filters label, .p-filters select, .p-filters input { min-width: 0; max-width: 100%; }
.p-search { display: flex; gap: 12px; align-items: flex-end; }
.p-search label { flex: 1; min-width: 0; }
.p-search .btn { flex: none; min-height: 50px; }
/* Columns of a set share of the width. A long word breaks only when it is wider than its whole column, so
   words stay whole and the table never runs off the side of a phone. */
.p-table-fixed { table-layout: fixed; }
.p-table-fixed th:last-child, .p-table-fixed td:last-child { width: 42%; }
.p-table-fixed td { overflow-wrap: break-word; }
.p-more summary { cursor: pointer; font-weight: 700; padding: 11px 0; }
.p-more[open] summary { margin-bottom: 12px; }
.p-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.p-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.p-copy { margin-top: 8px; padding: 12px 14px; background: var(--surface-2); border-radius: 12px; word-break: break-all; }
.p-copy-text { word-break: normal; overflow-wrap: anywhere; }
.p-examples { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

@media (max-width: 640px) {
    .p-table th:nth-child(n+4), .p-table td:nth-child(n+4) { display: none; }
    /* On a phone the name and Sign out share the first row and the pages go in a row beneath, or five links stack beside the name. */
    .p-nav { gap: 6px 16px; padding: 10px 16px; }
    .p-nav nav { order: 3; flex: 1 0 100%; gap: 2px; }
    .p-nav nav a { padding: 8px 7px; }
    .p-nav form { margin-left: auto; }
    .p-library .p-table th:nth-child(2), .p-library .p-table td:nth-child(2) { width: 7.5rem; }
    .p-filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    /* The stage names are long ("GCSE (Years 10 and 11)"), so that choice has a row to itself. */
    .p-filters label:has([data-library-stage]) { grid-column: 1 / -1; }
}

.p-prose { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; line-height: 1.6; }
.p-prose h2 { margin-top: 16px; }
.p-prose ul, .p-prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }

/* About page */
.m-shell { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.m-top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.m-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; }
/* The pigeon's head, cropped from the companion drawing. */
.m-logo { position: relative; width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 13px; border: 2.5px solid var(--ink); background: #5b3ff0; }
.m-logo > .pet, .m-logo svg { position: absolute; width: 96px; height: 95px; left: -27px; top: -1px; }
.m-signin { color: var(--text); font-weight: 600; }
.m-main { display: flex; flex-direction: column; gap: 72px; padding: 24px 0 72px; }

.m-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.m-hero h1 { font-family: var(--display); font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1.06; letter-spacing: -.035em; max-width: 13ch; text-wrap: balance; }
.m-hero-text { display: flex; flex-direction: column; gap: 20px; }
.m-lead { font-size: 1.15rem; max-width: 34em; }
.m-cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.m-cta .get-app { width: auto; }
.m-cta .btn { min-height: 52px; padding: 10px 22px; }

.m-small { font-size: .92rem; color: var(--muted); }
.m-demo { position: relative; padding-top: 150px; }
.m-demo-pet { position: absolute; top: 0; left: 50%; width: 176px; height: 174px; margin-left: -88px; z-index: 1; }
.m-demo-pet [hidden] { display: none; }
.m-q-count { font-weight: 600; color: var(--muted); }
button.m-opt { font: inherit; font-weight: 600; text-align: left; color: var(--text); cursor: pointer; transition: transform .07s, box-shadow .07s; }
button.m-opt:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
button.m-opt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button.m-opt:disabled { cursor: default; }
button.m-opt.m-opt-miss { background: var(--miss-soft); border-color: var(--miss); }
.m-say { font-weight: 600; min-height: 1.5em; }
.m-q { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.m-q-head { display: flex; align-items: center; justify-content: space-between; }
.m-subject { color: color-mix(in srgb, #f08a24 55%, var(--text)); font-weight: 700; }
.m-q-text { font-size: 1.3rem; font-weight: 700; line-height: 1.25; max-width: 16em; }
.m-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-opt { border: 2.5px solid var(--ink); border-radius: 14px; padding: 12px; font-weight: 600; background: var(--surface); box-shadow: var(--shadow-hard); }
.m-opt-right { background: var(--good-soft); border-color: var(--good); }
.m-hook { border-left: 6px solid #f08a24; padding: 4px 10px; font-size: .92rem; background: var(--surface-2); border-radius: 0 10px 10px 0; }

.m-section { display: flex; flex-direction: column; gap: 18px; }
.m-section h2 { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.03em; }
.m-sub { font-size: 1.08rem; max-width: 40em; color: var(--muted); }
.m-note { max-width: 44em; }

.m-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.m-mode { display: flex; flex-direction: column; gap: 8px; }
.m-mode-main { background: #ff8a24; color: #1d1f3f; }
.m-icon { font-size: 1.8rem; }

.m-wire { color: var(--text); }
.m-wire-run { position: relative; padding-top: 96px; container-type: inline-size; }
.m-wire-line { display: block; width: 100%; height: auto; }
/* Feet on the wire: the line sags to about 7.2% of the width below the top of the drawing. */
.m-wire-pet { position: absolute; left: 62%; top: calc(96px + 7.2cqi - 123px); width: 132px; height: 130px; }
.m-nest { display: flex; flex-direction: column; gap: 16px; }
.m-nest-finds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.m-find { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--surface-2); font-size: .8rem; font-weight: 600; text-align: center; }
.m-find .find-icon { width: 1.7rem; height: 1.7rem; flex: none; overflow: visible; }

.m-days { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.m-day { display: flex; flex-direction: column; gap: 8px; }
.m-day-pet { width: 140px; height: 138px; }
.m-day-charged { background: color-mix(in srgb, var(--gold) 30%, var(--surface)); }

.m-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.m-split > div:first-child { display: flex; flex-direction: column; gap: 18px; }
.m-list { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.m-progress { display: flex; flex-direction: column; gap: 10px; }
.m-progress-head { display: flex; justify-content: space-between; align-items: baseline; }
.m-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 8px; border-top: 1.5px solid var(--soft-line); }
.m-why { margin-top: -4px; }

.m-steps { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 12px; font-size: 1.05rem; max-width: 42em; }
.m-steps li::marker { font-family: var(--display); font-weight: 700; color: var(--accent); }
.m-privacy p { max-width: 44em; }
.m-privacy a, .m-foot a, .m-hero-text p a { color: var(--accent); }

.m-foot { border-top: 2.5px solid var(--ink); padding: 24px 0 40px; display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 760px) {
    .m-brand { font-size: 1.1rem; }
    .m-days { grid-template-columns: 1fr; }
    .m-hero, .m-split { grid-template-columns: 1fr; gap: 32px; }
    .m-modes { grid-template-columns: 1fr; }
    .m-main { gap: 56px; }
}


.m-lost { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 48px 0 96px; }
.m-lost-pet { width: 190px; height: 188px; }

/* Getting started */
.p-start { margin: 0; padding: 0; list-style: none; counter-reset: start; display: flex; flex-direction: column; }
.p-start li { counter-increment: start; display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.p-start li:last-child { border-bottom: 0; }
.p-start li::before { content: counter(start); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; border: 2px solid var(--line); color: var(--muted); }
.p-start li.p-start-next::before { border-color: var(--accent); color: var(--accent); }
.p-start li.p-start-done::before { background: var(--good); border-color: var(--good); color: var(--on-good); }
/* The text keeps a real width, so on a phone the button drops below it instead of squeezing it to a sliver. */
.p-start-text { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.p-start-done .p-start-text { flex-basis: 0; }
.p-start .btn { flex: none; min-height: 44px; }
@media (max-width: 480px) { .p-start li { flex-wrap: wrap; } .p-start li > .btn, .p-start li > form { margin-left: 44px; } }

/* Pictures in a draft, for a parent to look over. */
.p-pictures { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.p-picture { display: flex; flex-direction: column; gap: 6px; }
.p-picture img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.p-thumb { width: 96px; height: 96px; object-fit: contain; background: #fff; border: 2px solid var(--line); border-radius: 10px; display: block; margin-top: 6px; }

/* Getting started (/parent/start): one question a screen, narrow enough to read on a phone. */
.p-start-flow { max-width: 520px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.p-start-flow h1 { margin: 0; }
.p-start-flow > p { margin: 0; }
.p-choices { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.p-choices a { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 2px solid var(--line); border-radius: 14px;
    background: var(--surface); color: var(--text); text-decoration: none; }
.p-choices a:hover, .p-choices a:focus-visible { border-color: var(--accent); }
.p-choices strong { font-size: 1.05rem; }
.p-choices span { color: var(--muted); font-size: .92rem; }
.p-subject { border-bottom: 1px solid var(--line); padding: 10px 0; }
.p-subject summary { cursor: pointer; padding: 6px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.p-pick { flex-direction: row !important; align-items: flex-start; gap: 12px !important; font-weight: 400 !important; padding: 10px 0; }
.p-pick input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.p-pick > span { display: flex; flex-direction: column; gap: 2px; }
.p-start-flow .p-steps li { line-height: 1.5; }
.p-start-flow .p-code { font-size: 2.6rem; letter-spacing: .2em; margin-top: 6px; }
/* A drawn arrow, so a closed subject looks like something to open. */
.p-subject summary { list-style: none; }
.p-subject summary::-webkit-details-marker { display: none; }
.p-subject summary > span::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 10px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); transition: transform .15s; }
.p-subject[open] summary > span::after { transform: translateY(1px) rotate(-135deg); }

/* Admin pages (/parent/admin): only admins see these. */
.a-nav { display: flex; gap: 6px; flex-wrap: wrap; }
.a-nav a { padding: 6px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.a-nav a.active { background: var(--surface-2); color: var(--text); }
.a-title { overflow-wrap: anywhere; }
.a-search { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; max-width: 420px; }
.a-search input { font: inherit; font-weight: 400; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.a-table { width: 100%; border-collapse: collapse; font-size: .92rem; padding: 8px 12px; }
.a-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; padding: 8px 10px; border-bottom: 2px solid var(--line); }
.a-table td { padding: 10px; border-bottom: 1px solid var(--soft-line); vertical-align: top; overflow-wrap: anywhere; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table a { color: var(--text); font-weight: 600; }
.a-label { display: none; }
.a-table td:nth-child(2) { white-space: nowrap; }
.a-meter { display: inline-flex; gap: 3px; margin-bottom: 4px; }
.a-mark { width: 12px; height: 8px; border-radius: 3px; background: var(--grey); }
.a-mark-done { background: var(--good); }
.a-library td:first-child { font-weight: 600; }
.a-library .a-not-started td { color: var(--muted); }
.a-library .a-total td { font-weight: 700; border-top: 2px solid var(--line); }
@media (max-width: 640px) {
    .a-library .a-total { border-top: 2px solid var(--line); }
    .a-library .a-total td { border-top: 0; }
}
/* On a phone each family is a block of lines instead of a row of columns. */
@media (max-width: 640px) {
    .a-table thead { display: none; }
    .a-table, .a-table tbody, .a-table tr, .a-table td { display: block; }
    .a-table tr { padding: 10px 0; border-bottom: 1px solid var(--soft-line); }
    .a-table tr:last-child { border-bottom: 0; }
    .a-table td { padding: 2px 0; border: 0; }
    .a-table tr[hidden] { display: none; }
    .a-label { display: inline; }
}
.a-group h2 { margin-bottom: 6px; }
.a-costs td:first-child { white-space: nowrap; }
.a-costs td:nth-child(2) { white-space: normal; }
.a-stuck, .a-plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.a-stuck a { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.a-plain li { overflow-wrap: anywhere; }
.a-journey { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px; }
.a-journey li { display: flex; flex-direction: column; padding: 6px 0 6px 26px; position: relative; }
.a-journey li::before { content: ""; position: absolute; left: 0; top: 9px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); box-sizing: border-box; }
.a-journey li.a-done::before { background: var(--good); border-color: var(--good); }
.a-note-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.a-note-form label { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.a-note-form textarea { font: inherit; width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); box-sizing: border-box; }
.a-note { border-top: 1px solid var(--soft-line); padding-top: 10px; }
.a-note p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.a-timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.a-timeline li { display: grid; grid-template-columns: 11rem 1fr; gap: 12px; }
.a-timeline li.a-problem span:last-child { color: var(--miss); font-weight: 600; }
@media (max-width: 640px) { .a-timeline li { grid-template-columns: 1fr; gap: 0; } }

/* Message us (/parent/messages) and the admin inbox. */
.p-message-us { min-height: 40px; padding: 6px 14px; font-size: .92rem; }
.p-messages { max-width: 640px; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.p-messages h1, .p-messages > p { margin: 0; }
.p-messages textarea { resize: vertical; }
.p-thread { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.p-msg { align-self: flex-start; max-width: 85%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.p-msg-mine { align-self: flex-end; background: var(--surface); border: 2px solid var(--line); }
.p-msg p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.a-conversation { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.a-conversation .a-journey { grid-template-columns: 1fr; }
.a-beside h2 { margin: 0; }
.a-unread td:first-child a { font-weight: 800; }
@media (max-width: 800px) { .a-conversation { grid-template-columns: 1fr; } .p-msg { max-width: 100%; } }
/* On a phone Message us shares the first row with the name and Sign out, so everything there is a little smaller. */
@media (max-width: 640px) {
    .p-nav { column-gap: 12px; }
    .p-brand { font-size: 1.05rem; }
    .p-message-us { margin-left: auto; min-height: 36px; padding: 4px 10px; font-size: .85rem; }
    .p-message-us + form { margin-left: 0; }
    .p-nav form .link { font-size: .85rem; }
}

/* The plan, at the top of the children page near the end of the trial and after it. */
.p-plan-nudge { background: color-mix(in srgb, var(--gold) 22%, var(--surface)); border: 2.5px solid var(--ink); }
.p-plan-nudge h2 { margin-top: 0; }
.p-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; margin: 6px 0 14px; }
.p-compare h3 { margin: 0 0 8px; font-size: 1rem; }
.p-compare-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.p-compare-list li { display: flex; gap: 8px; align-items: flex-start; }
.p-mark { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--ink); }
.p-mark-plus { color: var(--accent); }
.p-compare-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.p-compare-buy .btn { width: auto; }
@media (max-width: 640px) { .p-compare { grid-template-columns: 1fr; } }
/* Add topics. The library is a row with its button beside it; on a phone the button goes underneath. */
.p-way { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.p-way > div { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.p-way h2, .p-way p { margin: 0; }
.p-way .btn { flex: none; min-height: 48px; }
/* The files and the pasted list are one thing to give: set together on a tint. */
.p-give { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 14px; background: var(--surface-2); }
.p-give p { margin: 0; }
/* Four lines to start with, longer as the list is pasted in, where the browser can. */
.p-setup textarea { field-sizing: content; min-height: 6.5em; max-height: 22em; resize: vertical; }
.p-setup .p-form-row { display: flex; gap: 12px; }
.p-setup .p-date { flex: 0 1 210px; }
.p-setup .p-optional { font-weight: 500; }
/* The test and what they find hard, behind one quiet line under the files. */
.p-extra summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 10px 0; min-height: 24px; width: fit-content; }
.p-extra[open] { display: flex; flex-direction: column; gap: 14px; }
fieldset.p-extra { display: flex; flex-direction: column; gap: 10px; border: 0; margin: 0; padding: 0; }
fieldset.p-extra legend { font-weight: 700; padding: 0; margin-bottom: 2px; }
fieldset.p-extra p { margin: 0; }
.p-setup .p-form .btn-primary { align-self: flex-start; padding-inline: 28px; }
@media (max-width: 640px) {
    .p-setup .p-form-row { flex-direction: column; align-items: stretch; }
    .p-setup .p-form-row label, .p-setup .p-date { flex: none; }
    .p-setup .p-form .btn-primary { align-self: stretch; }
    .p-way .btn { width: 100%; justify-content: center; }
}

/* Checking new topics: one section per topic, closed to its name until opened. */
.p-drafts { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.p-draft { padding: 0; }
.p-draft > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 44px; }
.p-draft > summary::-webkit-details-marker { display: none; }
.p-draft > summary input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); cursor: pointer; }
.p-draft-head { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.p-draft-name { font-weight: 700; }
.p-draft-flag { font-size: .85rem; font-weight: 600; color: color-mix(in srgb, var(--miss) 60%, var(--text)); }
/* A drawn arrow, so a closed topic looks like something to open. */
.p-draft > summary::after { content: ""; flex: none; width: 9px; height: 9px; margin: 0 4px 4px auto;
    border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.p-draft[open] > summary::after { transform: translateY(4px) rotate(-135deg); }
.p-draft-body { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; }
.p-draft-off > summary .p-draft-head { opacity: .5; text-decoration: line-through; }
.p-draft-note { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; }
.p-draft-note p { margin: 0 0 6px; font-weight: 600; }
.p-draft-note ul { margin: 0; padding-left: 20px; }
.p-draft-note li + li { margin-top: 6px; }
.p-draft-rename { display: flex; flex-direction: row !important; align-items: center; gap: 10px !important; color: var(--muted); font-weight: 500 !important; font-size: .9rem; }
.p-draft-rename input { flex: 1; max-width: 420px; padding: 6px 10px; border-width: 1px; border-color: transparent; background: var(--surface-2); font-size: 1rem; }
.p-draft-rename input:hover { border-color: var(--line); }
.p-draft-sub { margin: 8px 0 0; font-size: 1rem; }
.p-draft-finish { margin-top: 4px; }
.p-draft-finish .p-form { gap: 6px; }
.p-draft-finish .p-date { max-width: 320px; }
.p-draft-finish .p-form p { margin: 0; }
.p-draft-delete { margin-top: 8px; color: var(--muted); }
.p-draft-delete summary { font-weight: 500; }
@media (max-width: 640px) {
    .p-draft > summary { padding: 14px; gap: 12px; }
    .p-draft-body { padding: 12px 14px 14px; }
    .p-draft-rename { flex-direction: column !important; align-items: stretch; }
    .p-draft-rename input { max-width: none; }
    .p-draft-finish .p-date { max-width: none; }
    .p-draft-finish .btn-primary { width: 100%; justify-content: center; }
}
.p-draft-body .p-check > input, .p-row-top.p-check > input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--accent); }
.p-draft-finish .btn-primary { align-self: flex-start; }
@media (max-width: 640px) { .p-draft-finish .btn-primary { align-self: stretch; } }

/* A test's own page. */
.p-test-when { margin: -6px 0 18px; color: var(--muted); font-weight: 600; }
.p-test-library { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 4px; }
.p-test-library .p-test-form { border-top: 0; padding-top: 0; }
.p-way h3 { margin: 0; font-size: 1.05rem; }
.p-test-move { align-items: flex-end; margin-bottom: 12px; }
.p-test-move .p-date { flex: 0 1 210px; }
.p-test-list a { font-weight: 700; }
.p-test-short .p-form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.p-test-short .p-date { flex: 0 1 210px; }
.p-test-short label:not(.p-date) { flex: 1 1 220px; }
.p-drafts-group + .p-drafts-group { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.p-drafts-group p { margin-top: 0; }
[data-new-test][hidden] { display: none !important; }
.p-draft-finish [data-new-test] { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }

/* The child's page (Child.razor). One tinted band for what needs the parent, the coming tests in their subject's
   colour, and the rest as plain sections: ten boxes of the same weight was what hid Ethan's tests (22 Nov 2026). */
.p-needs { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-radius: var(--radius); padding: 18px 20px; }
.p-needs .p-row { border-bottom-color: color-mix(in srgb, var(--accent) 22%, transparent); }
/* Small buttons for the parent pages: a row's action shouldn't outweigh the row. */
.btn.btn-small { min-height: 40px; padding: 6px 14px; font-size: .95rem; border-radius: 12px; border-width: 2px; }
.btn.btn-quiet { box-shadow: none; border-color: var(--soft-line); }
.p-todo { display: flex; flex-direction: column; }
.p-todo-row { display: grid; grid-template-columns: 1fr 280px; align-items: center; gap: 16px; padding: 12px 0;
    border-bottom: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.p-todo-row:last-child { border-bottom: 0; padding-bottom: 0; }
.p-todo-do { display: flex; gap: 8px; justify-content: flex-end; }
.p-todo-do .btn { flex: 1 1 0; max-width: 280px; white-space: nowrap; }
@media (max-width: 560px) {
    .p-todo-row { grid-template-columns: 1fr; gap: 8px; }
    .p-todo-do { justify-content: flex-start; }
}
.p-plain { padding: 8px 4px 0; border-top: 1px solid var(--soft-line); }
.p-plain .p-row { border-bottom-color: var(--soft-line); }
.p-plain h2 { margin: 0; }

.p-test { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border-radius: var(--radius);
    background: color-mix(in srgb, var(--subject) 12%, var(--surface)); border: 2px solid color-mix(in srgb, var(--subject) 55%, var(--surface)); }
.p-test-head { display: flex; align-items: center; gap: 16px; }
.p-test-count { flex: none; min-width: 76px; padding: 8px 10px; border-radius: 14px; text-align: center; display: flex; flex-direction: column;
    background: color-mix(in srgb, var(--subject) 38%, var(--surface)); color: var(--text); line-height: 1.05; }
.p-test-num { font-family: var(--display); font-size: 1.9rem; font-weight: 700; }
.p-test-word { font-size: 1rem; }
.p-test h3 { margin: 0; font-size: 1.2rem; }
.p-test h3 a { color: var(--text); }
.p-test .p-row { border-bottom-color: color-mix(in srgb, var(--subject) 25%, transparent); }

.p-topic-line > :first-child { display: flex; flex-direction: column; gap: 6px; }
.p-topic-line a { color: var(--text); font-weight: 600; }
.p-bar { height: 8px; max-width: 320px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.p-bar span { display: block; height: 100%; min-width: 4px; background: var(--accent); border-radius: 99px; }

.p-split { display: flex; height: 18px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.p-split span { min-width: 6px; }
.p-key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .92rem; }

.p-more summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
details.p-more.card { padding: 16px 20px; }

@media (max-width: 560px) {
    .p-test { padding: 14px; }
    .p-test-head { gap: 12px; }
    .p-test-count { min-width: 62px; }
    .p-test-num { font-size: 1.5rem; }
    .p-needs { padding: 14px; }
}

/* Topics being made from an upload: the pigeon at work, and how far it has got */
.p-making {
    display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; padding: 20px;
    background: color-mix(in srgb, var(--gold) 24%, var(--surface)); border: 2.5px solid var(--ink); border-radius: var(--radius);
}
.p-making h2 { margin: 0 0 4px; }
.p-making-body { flex: 1; min-width: 0; }
.p-making-step { font-weight: 700; margin: 0 0 10px; }
.p-making-bird {
    position: relative; width: 64px; height: 64px; flex: none; overflow: hidden; border-radius: 18px;
    border: 2.5px solid var(--ink); background: #5b3ff0; animation: p-making-bob 1.6s ease-in-out infinite;
}
.p-making-bird > .pet, .p-making-bird svg { position: absolute; width: 140px; height: 138px; left: -39px; top: -2px; }
.p-making-bar { height: 12px; border-radius: 99px; border: 2px solid var(--ink); background: var(--surface); overflow: hidden; margin-bottom: 10px; }
.p-making-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s ease; }
.p-making-bar-wait span { width: 35%; animation: p-making-slide 1.4s ease-in-out infinite; }
.p-making .p-actions { margin-top: 12px; }
@keyframes p-making-bob { 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes p-making-slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
@media (prefers-reduced-motion: reduce) {
    .p-making-bird, .p-making-bar-wait span { animation: none; }
}
@media (max-width: 520px) {
    .p-making { flex-direction: column; gap: 12px; }
}
.p-row-end { display: inline-flex; align-items: center; gap: 14px; }
.p-part { display: block; margin: 2px 0 0 24px; }
