/* =============================================================================
 * The student pages, and the account page every role shares.
 *
 * Until v1.27.0 this file carried its own palette and set everything in
 * Georgia, because the student pages were the one light corner of a site
 * whose staff pages were dark. The whole site is light now, so the palette
 * and the type come from css/site.css — loaded first by every page that loads
 * this one — and what is left here is layout: the navy banner, the lesson
 * card, the rows, the forms.
 *
 * Phone first. The inventory that started v1.27.0 measured these pages at
 * 390px: "Take the test" sat under six stat tiles and a ten-line assignment,
 * the lesson steps were 31px tall, the verse reference 25px, the stat labels
 * 10.6px, and a test's score fell onto a line of its own. Every rule below
 * that sets a min-height of var(--tap) is one of those.
 *
 * account/settings.html links this file too, so the settings layout here is
 * the one a teacher and an administrator see as well: one account page, one
 * look, whoever you are.
 * ========================================================================== */

.wrap { max-width: var(--w-main); margin: 0 auto; padding: 0 20px 72px; }

[hidden] { display: none !important; }

/* The page heading ---------------------------------------------------------
   Until v1.28.0 this was a navy banner carrying the student's own links and
   Sign out. The strip js/app-nav.js draws across every page carries those now,
   so what is left is the heading itself, set like every other page's. */
header.hero { padding: 0 20px; margin-bottom: 20px; }
header.hero .inner { max-width: calc(var(--w-main) - 40px); margin: 0 auto; }
header.hero .org {
    font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 6px;
}
header.hero h1 { margin: 0 0 6px; font-size: 2rem; line-height: 1.15; color: var(--ink); }
header.hero .sub { color: var(--muted); font-size: .98rem; }

/* Cards ---------------------------------------------------------------- */
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 1.3rem; line-height: 1.2; }
.card .note { color: var(--muted); font-size: .9rem; margin: 0 0 14px; }
.card h2 + .note { margin-top: 2px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sec-h a { font-weight: 600; font-size: .92rem; text-decoration: none; white-space: nowrap; }

.lbl, .eyebrow {
    display: block; font-size: .75rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--muted);
}
.eyebrow { color: var(--gold); }

/* Stats ---------------------------------------------------------------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; min-width: 0;
}
/* The label is first in the markup and stays there, so innerText reads
   "Course grade / 75%", which is also how a screen reader should say it. */
.stat .k { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.stat .v {
    font: 600 1.6rem/1.15 var(--serif); color: var(--ink); margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.stat .v small { font: 400 .85rem var(--sans); color: var(--muted); }
.stats.minor { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px; }
@media (min-width: 721px) and (max-width: 979px) {
    .stats.minor { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stats.minor .stat { padding: 9px 12px; background: var(--paper-2); border-color: transparent; }
.stats.minor .v { font-size: 1.15rem; }

/* Progress bar --------------------------------------------------------- */
.track { height: 6px; border-radius: 3px; background: var(--paper-2); overflow: hidden; margin: 0 0 12px; }
.track i { display: block; height: 100%; background: var(--good); border-radius: inherit; }

/* The home page's two columns on a wide screen -------------------------
   One column on a phone, in the order a student needs them: the lesson,
   then how they are doing, then the record. On a wide screen the record
   moves beside the lesson instead of under it. */
.home { display: grid; gap: 0 22px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) {
    .home { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
            grid-template-areas: "main side" "rest side"; align-items: start; }
    .home > .home-main { grid-area: main; }
    .home > .home-side { grid-area: side; }
    .home > .home-rest { grid-area: rest; }
}

/* The current lesson --------------------------------------------------- */
.now { padding: 0; overflow: hidden; }
.now-head {
    background: var(--navy); color: #fff; padding: 20px 22px 22px;
    display: grid; gap: 6px;
}
.now h2.standing {
    margin: 0; font: 600 .78rem var(--sans); letter-spacing: .08em; text-transform: uppercase;
    color: #E9C98A;
}
.now-head .note { color: #C9D3E4; margin: 0; }
.now h3 { margin: 0; font: 600 1.6rem/1.15 var(--serif); color: #fff; text-wrap: balance; }
.now .ref { font-family: var(--mono); font-size: .88rem; color: #C9D3E4; }
.now-head .actions { margin-top: 12px; }
.now-body { padding: 18px 22px 20px; display: grid; gap: 14px; }
.now-body > * { margin: 0; }
.now-body .note { margin: 0; }

/* The assignment is often ten lines of instruction for the week. Clamped,
   so the card's own buttons and the verse stay near the top, with the rest
   one tap away. */
.assignment { margin: 4px 0 0; }
.assignment.clamp {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden;
}
.more {
    background: none; border: 0; padding: 0; min-height: var(--tap);
    font: 600 .92rem var(--sans); color: var(--navy); cursor: pointer; text-align: left;
}
.more:hover { text-decoration: underline; background: none; }

/* Buttons --------------------------------------------------------------
   Scoped to the page's own content with :where(), which adds nothing to the
   specificity. The header, the tab bar, the menu, the sheets, the reading
   panel and the bug reporter all draw buttons of their own, and a bare
   `button { ... }` here would reach into every one of them. */
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
:where(.wrap) button, :where(.wrap) .btn {
    font: 600 .95rem var(--sans);
    min-height: var(--tap); padding: 0 18px; border-radius: 12px; cursor: pointer;
    border: 1.5px solid var(--navy); background: var(--card); color: var(--navy);
    text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; text-align: center; line-height: 1.2;
}
:where(.wrap) button:hover, :where(.wrap) .btn:hover { background: var(--navy-soft); }
:where(.wrap) button.primary, :where(.wrap) .btn.primary { background: var(--navy); color: #fff; }
:where(.wrap) button.primary:hover, :where(.wrap) .btn.primary:hover { background: var(--navy-2); }
:where(.wrap) button.quiet, :where(.wrap) .btn.quiet { border-color: var(--line); color: var(--ink); background: var(--card); }
:where(.wrap) button.quiet:hover, :where(.wrap) .btn.quiet:hover { border-color: var(--navy); background: var(--card); }
:where(.wrap) button.danger, :where(.wrap) .btn.danger { border-color: #E2B2AB; color: var(--bad); background: var(--card); }
:where(.wrap) button.danger:hover, :where(.wrap) .btn.danger:hover { background: var(--bad-soft); }
:where(.wrap) button:disabled, :where(.wrap) .btn:disabled { opacity: .45; cursor: not-allowed; }

/* On the navy head of the lesson card the main button is white, the rest
   outlined — the same pair the course page and the results screen use. */
.now-head .btn { min-height: 48px; border-color: #5C79A6; background: transparent; color: #fff; }
.now-head .btn:hover { background: rgba(255, 255, 255, .08); }
.now-head .btn.primary { background: #fff; color: var(--navy); border-color: #fff; }
.now-head .btn.primary:hover { background: var(--navy-soft); }

/* Stepping between lessons. Sits at the foot of the lesson card, below a rule,
   so it reads as navigation rather than as one more thing the lesson asks for.
   The ends of the course keep their button in place but disabled — a row that
   loses a button shifts the other one under the cursor. */
.lesson-steps {
    display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
    justify-content: space-between;
    padding-top: 14px; border-top: 1px solid var(--line);
}
.lesson-steps .step { font-size: .9rem; padding: 0 14px; }

/* Lists ---------------------------------------------------------------- */
/*
 * One row per test, telling or device: what it was and when on the left, the
 * mark on the right. A grid rather than a wrapping flex row, because the flex
 * row put the score on a line of its own at phone width, right-aligned under
 * nothing, which read as a stray number.
 */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px;
    align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line);
}
.rows > li:last-child { border-bottom: 0; }
.rows > li.with-open { grid-template-columns: minmax(0, 1fr) auto auto; }
.rows .what { grid-column: 1; min-width: 0; }
.rows .what b { font-weight: 600; color: var(--ink); }
.rows .when { grid-column: 1; color: var(--muted); font-size: .85rem; }
.rows .score {
    grid-column: 2; grid-row: 1 / span 2; justify-self: end;
    font: 600 1.05rem var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rows .score.low { color: var(--bad); }
.rows > li > .open { grid-column: 3; grid-row: 1 / span 2; }
.rows > li.detail { display: block; padding: 0 0 8px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 16px 0; margin: 0; }

.tag {
    display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px;
    border-radius: 999px; font: 600 .8rem var(--sans); white-space: nowrap;
    background: var(--paper-2); color: var(--muted); vertical-align: 1px;
}
.tag.ok { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.note { background: var(--gold-soft); color: var(--gold); }

/* The teacher's verdict on a lesson with no test ------------------------ */
.review {
    padding: 10px 14px; font-size: .93rem; border-radius: 10px;
    border-left: 3px solid var(--line); background: var(--paper);
}
.review.waiting { border-left-color: var(--gold); }
.review.passed { border-left-color: var(--good); }
.review.failed { border-left-color: var(--bad); }

/* The verse to learn by heart ------------------------------------------ */
/* Scoped to the lesson card: the reading panel sets every verse it shows as
   a p.verse too, and a bare `.verse` here would give each one a gold box. */
.now .verse { padding: 12px 14px; background: var(--gold-soft); border-radius: 12px; }
.verse-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
.verse-label {
    font-size: .78rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--gold);
}
/* A button, because it opens the reading panel rather than going anywhere —
   but it reads as the reference it is. Tall enough to hit with a thumb; the
   underline says it does something. */
.verse-ref {
    background: none; border: 0; padding: 0 4px; margin-left: -4px; min-height: var(--tap);
    font: 600 1rem var(--sans); color: var(--navy); cursor: pointer; text-decoration: underline;
    text-underline-offset: 3px; border-radius: 8px;
}
.verse-ref:hover { background: rgba(255, 255, 255, .5); color: var(--navy-2); }
.verse-text { margin: 2px 0 0; font: 500 1.08rem/1.45 var(--serif); }
.verse-text .vn {
    font: 600 .7rem var(--sans); color: var(--muted); vertical-align: super; margin-right: 2px;
}
.verse-mark {
    margin: 10px 0 0; padding: 8px 12px; font-size: .9rem; border-radius: 8px;
    border-left: 3px solid var(--line); background: rgba(255, 255, 255, .6);
}
.verse-mark.waiting { border-left-color: var(--gold); }
.verse-mark.passed { border-left-color: var(--good); }
.verse-mark.failed { border-left-color: var(--bad); }

/* A teacher's note ----------------------------------------------------- */
.teachernote {
    background: var(--gold-soft); border-left: 3px solid var(--gold); border-radius: 8px;
    padding: 10px 14px; margin-top: 8px; font-size: .92rem;
}
.teachernote b {
    font-size: .75rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--gold); display: block; margin-bottom: 2px;
}

/* History: a switch between its three lists on a phone ---------------- */
.seg {
    display: none; position: sticky; top: 0; z-index: 5;
    margin: -8px -16px 14px; padding: 10px 16px; background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.seg-inner {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
    background: var(--paper-2); border-radius: 12px; padding: 4px;
}
.seg button {
    min-height: var(--tap); border: 0; border-radius: 9px; background: transparent;
    color: var(--muted); font-size: .9rem; padding: 0 6px;
}
.seg button[aria-pressed="true"] {
    background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 35, 58, .12);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.chip {
    min-height: var(--tap); padding: 0 16px; border-radius: 999px; font-size: .92rem; font-weight: 500;
    border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.chip b { font-weight: 600; margin-left: 4px; }
.chip:hover { background: var(--card); border-color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.summary { margin: 0 0 12px; color: var(--muted); }
.summary b { color: var(--ink); }

/* An opened test, laid out like the results screen a student saw when they
   finished it: the question in the reading face, the passage it came from as
   a button, what they wrote against a coloured rule, then the mark. */
.q { padding: 16px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.q:first-child { border-top: 0; }
.q .qn { font-size: .75rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--gold); }
.q .qt { font: 500 1.08rem/1.35 var(--serif); }
.q .pericope {
    justify-self: start; min-height: 40px; padding: 0 12px; border-radius: 10px; font-size: .88rem;
    background: var(--navy-soft); border-color: var(--navy-soft); color: var(--navy);
}
.q .pericope:hover { border-color: var(--navy); background: var(--navy-soft); }
.q .ans { margin: 0; padding: 4px 0 4px 12px; border-left: 3px solid var(--line); }
.q .ans.good { border-left-color: var(--good); }
.q .ans.bad { border-left-color: var(--bad); }
.q .mark { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: .92rem; color: var(--muted); }
.q .mark .pct { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Forms ---------------------------------------------------------------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field span, .field > label { font-size: .85rem; font-weight: 600; color: var(--muted); }
input[type=text], input[type=email], input[type=password] {
    width: 100%; min-height: 48px; font: inherit; font-size: 1rem; padding: 0 14px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
}
select {
    width: 100%; min-height: 48px; font: inherit; font-size: 1rem; padding: 0 12px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink);
}
input:disabled { background: var(--paper-2); color: var(--muted); }
input:focus { outline: 2px solid var(--navy-2); outline-offset: 1px; }
.hint { font-size: .85rem; color: var(--muted); margin: -6px 0 14px; }

/* Messages ------------------------------------------------------------- */
.message { display: none; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-size: .93rem; }
.message.visible { display: block; }
.message.error { background: var(--bad-soft); border: 1px solid #E9BDB7; color: var(--bad); }
.message.success { background: var(--good-soft); border: 1px solid #B9DBC5; color: var(--good); }
.message.info { background: var(--navy-soft); border: 1px solid #C3D0E4; color: var(--navy); }

/* Settings: who you are, then a list of what is on the page ------------ */
.settings { display: grid; gap: 0 24px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
    .settings { grid-template-columns: 290px minmax(0, 1fr); align-items: start; }
    .settings > .settings-nav { position: sticky; top: 16px; }
}
.me-card { display: flex; align-items: center; gap: 14px; }
.avatar {
    width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
    background: var(--navy); color: #fff; font: 600 22px var(--serif);
}
.me-card .name { font: 600 1.2rem/1.2 var(--serif); }
.me-card .role { font-size: .88rem; color: var(--muted); }

.jump { list-style: none; margin: 0; padding: 0; }
.jump li + li { border-top: 1px solid var(--line); }
.jump a, .jump button {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 16px;
    color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: 0;
    font: inherit; text-align: left; justify-content: flex-start;
}
.jump a:hover, .jump button:hover { background: var(--paper); }
.jump .ico {
    width: 40px; height: 40px; border-radius: 10px; flex: none; display: grid; place-items: center;
    background: var(--paper-2); color: var(--navy);
}
.jump .grow { flex: 1; min-width: 0; }
.jump .ttl { display: block; font-weight: 600; line-height: 1.3; }
.jump .sub { display: block; font-size: .83rem; color: var(--muted); line-height: 1.35; }
.jump .chev { color: var(--faint); flex: none; }
.jump .danger-row, .jump .danger-row .ico { color: var(--bad); }
.jump .danger-row .ico { background: var(--bad-soft); }
.card.flush { padding: 0; overflow: hidden; }
.settings-nav .btn { width: 100%; margin-bottom: 18px; }
.settings .card { scroll-margin-top: 92px; }   /* clear of the sticky strip across the top */
.settings .actions .btn, .settings .actions button { min-width: 140px; }

/* The account-closing block, kept visually apart from the rest ---------- */
.danger-zone { border-color: #E9BDB7; background: #FDF8F7; }
.danger-zone h2 { color: var(--bad); }

/* Devices, on the account page ----------------------------------------- */
.handover {
    background: var(--warn-soft); border: 1px solid #E5CFA4; color: var(--ink);
    border-radius: var(--radius); padding: 16px 18px; margin-bottom: 18px; line-height: 1.55;
}
/* While a handover password is outstanding the list beside the cards is
   gone, and the one card left is the password. */
.settings.solo { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
.crumbs a {
    display: inline-flex; align-items: center; min-height: var(--tap);
    font-weight: 600; font-size: .92rem; text-decoration: none;
}
.page-head { margin: 4px 0 18px; }
.page-head h1 { margin: 0 0 2px; font-size: 1.9rem; line-height: 1.15; }
.page-head .subtitle { margin: 0; color: var(--muted); }

/* The phone ------------------------------------------------------------ */
@media (max-width: 720px) {
    .wrap { padding: 0 16px 32px; }

    header.hero { padding: 0 16px; margin-bottom: 16px; }
    header.hero h1 { font-size: 1.5rem; }
    header.hero .org { font-size: .72rem; }
    header.hero .sub { font-size: .9rem; }

    .card { padding: 16px; margin-bottom: 14px; }
    .card h2 { font-size: 1.2rem; }
    .now { padding: 0; }
    .now-head { padding: 16px 16px 18px; }
    .now h3 { font-size: 1.45rem; }
    .now-body { padding: 14px 16px 16px; }
    .assignment.clamp { -webkit-line-clamp: 3; }

    /* Full-width buttons on the lesson card: "Take the test" is the one thing
       this page is for, and a thumb should not have to aim at it. */
    .now-head .actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .now-head .actions .btn { width: 100%; }

    .lesson-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .lesson-steps .step { width: 100%; padding: 0 8px; }
    .lesson-steps [data-goto="here"] { grid-column: 1 / -1; grid-row: 1; }

    .seg { display: block; }
    .hist-section:not(.on) { display: none; }

    .rows > li.with-open { grid-template-columns: minmax(0, 1fr) auto; }
    .rows > li.with-open > .open { grid-column: 1 / -1; grid-row: auto; margin-top: 8px; width: 100%; }

    .page-head h1 { font-size: 1.5rem; }
    body.has-tabs .crumbs { display: none; }
    .settings .actions .btn, .settings .actions button { flex: 1 1 100%; }
}

/* Courses on the settings page (v1.28.0): one row per enrolment. */
.course-row { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; display: grid; gap: 10px; }
.course-row > b { font-size: 1rem; }
.course-row .actions { margin-top: 0; }
#enrolBox { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
