/* ==========================================================================
   Report Alchemy - one stylesheet for the whole site.

   The idea: a school report, done beautifully. Paper, ink, a ruled margin, a gold
   stamp. Newsreader (an editorial serif with optical sizes) for anything that is read
   as a heading; Atkinson Hyperlegible Next - designed for low-vision readers - for
   everything a tired teacher has to read at eleven at night.

   Before this file, 25 templates each carried their own copy of the chrome (~17,000
   lines of CSS), so a fix to the navbar had to be made five times and was usually
   made in four. The legacy custom properties at the bottom of :root keep the
   page-specific CSS that remains working on the new palette.
   ========================================================================== */

:root {
    /* Paper and ink */
    --paper: #faf7f1;
    --paper-2: #f3eee4;
    --paper-3: #ebe4d6;
    --card: #ffffff;
    --rule: #e8e0d2;
    --rule-strong: #d6cab5;
    --ink: #1b1a2e;
    --ink-2: #34334a;
    --muted: #625f73;
    --faint: #8b8797;

    /* Brand */
    --plum: #422568;
    --plum-2: #5a3a88;
    --plum-soft: #f0eaf6;
    --gold: #c8955a;
    --gold-hi: #d8a86e;
    --gold-deep: #8b6232;       /* AA on paper, paper-2, card and gold-soft (was #9c6f3a, 3.8-4.4:1) */
    --gold-soft: #f8efe1;
    --teal: #16766b;
    --teal-hi: #1d8a7d;
    --teal-soft: #e4f2ef;
    --margin: #cf4a3f;          /* the red margin line of an exercise book */
    --margin-soft: #fbebe8;
    --success: #16766b;
    --danger: #b83b31;
    --danger-soft: #fbebe8;
    --warning: #a86a1c;
    --warning-soft: #fdf2e0;

    /* Type */
    --font-display: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', -apple-system, 'Segoe UI', sans-serif;

    /* Shape and depth */
    --r-sm: 6px;
    --r-md: 10px;
    --r-lg: 16px;
    --r-xl: 24px;
    --shadow-1: 0 1px 0 rgba(27, 26, 46, 0.04), 0 1px 3px rgba(27, 26, 46, 0.06);
    --shadow-2: 0 1px 0 rgba(27, 26, 46, 0.04), 0 10px 30px -14px rgba(27, 26, 46, 0.22);
    --shadow-3: 0 2px 0 rgba(27, 26, 46, 0.04), 0 24px 60px -24px rgba(27, 26, 46, 0.35);
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --container: 1160px;
    --gutter: clamp(16px, 4vw, 32px);

    /* --- Legacy names, mapped onto the new palette ------------------------------
       Page-specific CSS still refers to these; they are aliases, not a second palette. */
    --bg-primary: var(--paper);
    --bg-secondary: var(--paper-2);
    --bg-card: var(--card);
    --bg-card-alt: #fdfbf7;
    --bg-elevated: var(--card);
    --bg-ink: var(--ink);
    --bg: var(--paper);
    --surface-muted: var(--paper-2);
    --ink-deep: var(--ink);
    --ink-medium: var(--ink-2);
    --ink-soft: var(--muted);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --text-muted: var(--faint);
    --gold-rich: var(--gold);
    --gold-bright: var(--gold-hi);
    --gold-muted: #ead9bf;
    --primary-gold: var(--gold);
    --accent-primary: var(--gold);
    --teal-rich: var(--teal);
    --teal-bright: var(--teal-hi);
    --teal-deep: #115e55;
    --teal-muted: #bfe0da;
    --border-light: var(--rule);
    --border-medium: var(--rule-strong);
    --border-gold: #e3cba6;
    --border-teal: #bfe0da;
    --border: var(--rule);
    --danger-color: var(--danger);
    --error-color: var(--danger);
    --error-soft: var(--danger-soft);
    --success-color: var(--success);
    --amber-glow: rgba(200, 149, 90, 0.18);
    --amber-soft: var(--gold-soft);
    --teal-glow: rgba(22, 118, 107, 0.16);
    --gradient-gold: linear-gradient(180deg, var(--gold-hi) 0%, var(--gold) 100%);
    --gradient-teal: linear-gradient(180deg, var(--teal-hi) 0%, var(--teal) 100%);
    --gradient-ink: linear-gradient(180deg, #2a2940 0%, var(--ink) 100%);
    --shadow-sm: var(--shadow-1);
    --shadow-md: var(--shadow-2);
    --shadow-lg: var(--shadow-2);
    --shadow-xl: var(--shadow-3);
    --shadow-gold: 0 8px 20px -10px rgba(156, 111, 58, 0.55);
    --shadow-teal: 0 8px 20px -10px rgba(22, 118, 107, 0.5);
    --ease-out-expo: var(--ease);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    font-variant-numeric: tabular-nums;
}
/* A whisper of paper grain, so large fields of colour do not read as flat plastic. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.09 0 0 0 0 0.15 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body > * { position: relative; z-index: 1; }
img, svg, video { max-width: 100%; }
a { color: var(--plum); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--plum-2); }
::selection { background: var(--gold-soft); color: var(--ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--plum) 55%, transparent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4, .display {
    font-family: var(--font-display);
    font-optical-sizing: auto;
    color: var(--ink);
    letter-spacing: -0.015em;
    line-height: 1.12;
    margin: 0 0 0.5em;
    font-weight: 500;
}
h1 { font-size: clamp(2.2rem, 4.2vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 2.8vw, 2.4rem); }
h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.005em; }
h4 { font-size: 1.08rem; font-weight: 600; }
p { margin: 0 0 1em; }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--gold-deep);
    margin-bottom: 0.9rem;
}
.eyebrow::before { content: ""; width: 18px; height: 1.5px; background: currentColor; }
.serif-italic { font-family: var(--font-display); font-style: italic; font-weight: 400; }
mark, .highlight { background: linear-gradient(transparent 58%, var(--gold-soft) 58%); color: inherit; padding: 0 0.1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.container-narrow { max-width: 820px; margin: 0 auto; padding: 0 var(--gutter); }
.section-pad { padding: clamp(56px, 8vw, 104px) 0; }
.stack > * + * { margin-top: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 36px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(18px, 2.5vw, 28px); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
    padding: 0.72rem 1.2rem;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font: 600 0.98rem/1.2 var(--font-body);
    color: var(--ink);
    background: var(--card);
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s var(--ease), background-color 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn i { font-size: 0.95em; }
/* The primary button is a gold stamp with ink lettering (WCAG AA; white on gold was 2.5:1). */
.btn-primary {
    background: var(--gold);
    color: var(--ink);
    box-shadow: inset 0 -2px 0 rgba(27, 26, 46, 0.14), 0 6px 16px -10px rgba(156, 111, 58, 0.8);
}
.btn-primary:hover { background: var(--gold-hi); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); color: var(--paper); }
.btn-secondary { background: var(--card); color: var(--ink); border-color: var(--rule-strong); }
.btn-secondary:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-success { background: var(--teal); color: #fff; }
.btn-success:hover { background: var(--teal-hi); color: #fff; }
.btn-danger { background: var(--card); color: var(--danger); border-color: #e7b9b4; }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-warning { background: var(--warning-soft); color: #74460e; border-color: #efd3a6; }   /* AA: was 4.0:1 */
.btn-large, .btn-lg { padding: 0.95rem 1.6rem; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.88rem; }
.btn-block { width: 100%; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: 8px; border: 1px solid var(--rule); background: var(--card);
    color: var(--ink-2); cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.icon-btn:hover { border-color: var(--rule-strong); background: var(--paper-2); color: var(--ink); }
.icon-btn.danger:hover { color: var(--danger); border-color: #e7b9b4; background: var(--danger-soft); }
.icon-btn:disabled { opacity: 0.4; cursor: default; }

/* ---------------------------------------------------------------- surfaces */
.card, .section {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    padding: clamp(20px, 3vw, 32px);
}
.section + .section { margin-top: 22px; }
.section h2 { font-size: 1.45rem; font-weight: 600; display: flex; align-items: center; gap: 0.6rem; }
.section h2 i { color: var(--gold-deep); font-size: 0.9em; }
.card-quiet { background: var(--paper-2); border-color: transparent; box-shadow: none; }
.pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.18rem 0.6rem; border-radius: 999px;
    background: var(--paper-2); border: 1px solid var(--rule);
    font-size: 0.8rem; font-weight: 600; color: var(--ink-2);
}
.pill.muted { color: var(--faint); }
.pill-gold { background: var(--gold-soft); border-color: #eedcc0; color: var(--gold-deep); }
.pill-teal { background: var(--teal-soft); border-color: #cbe6e1; color: var(--teal); }

/* The report sheet: ruled paper with a red margin line. Used wherever a finished report
   is shown, because that is the object teachers are actually making. */
.paper-sheet {
    position: relative;
    background:
        linear-gradient(90deg, transparent 46px, var(--margin) 46px, var(--margin) 47.5px, transparent 47.5px),
        repeating-linear-gradient(180deg, transparent 0 29px, rgba(66, 37, 104, 0.09) 29px 30px),
        var(--card);
    /* The ruling is shifted so each rule sits under a line of text, not between two. */
    background-position: 0 0, 0 14px, 0 0;
    border: 1px solid var(--rule);
    border-radius: var(--r-md);
    padding: 22px 24px 22px 64px;
    line-height: 30px;
    box-shadow: var(--shadow-2);
    font-family: var(--font-display);
    font-size: 1.08rem;
    color: var(--ink);
    white-space: pre-wrap;
}

/* ---------------------------------------------------------------- forms */
label { font-weight: 600; font-size: 0.93rem; color: var(--ink-2); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="date"],
input:not([type]), select, textarea {
    width: 100%;
    font: 400 1rem/1.5 var(--font-body);
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-md);
    padding: 0.68rem 0.85rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--plum-2);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--plum) 14%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2334334a' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; padding-right: 2.2rem; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--plum); width: 1.05rem; height: 1.05rem; }
.form-group, .field { margin-bottom: 1.1rem; }
.form-group label, .field label { display: block; margin-bottom: 0.4rem; }
label.required::after { content: " *"; color: var(--margin); }
.switch-row { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 500; cursor: pointer; }
.hint, .note { font-size: 0.88rem; color: var(--muted); }

/* ---------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
td { padding: 0.8rem 0.9rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

/* ---------------------------------------------------------------- dialogs */
.modal-backdrop, .popup-overlay, .custom-modal, .credit-popup-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(27, 26, 46, 0.42);
    backdrop-filter: blur(3px);
    padding: 20px;
}
.modal-backdrop.open { display: flex; align-items: center; justify-content: center; }
.modal, .popup-content, .custom-modal-content, .credit-popup {
    background: var(--card);
    border-radius: var(--r-lg);
    border: 1px solid var(--rule);
    box-shadow: var(--shadow-3);
    padding: 28px;
    width: 100%; max-width: 520px;
    max-height: calc(100vh - 40px); overflow: auto;
    margin: 8vh auto 0;
    animation: ra-rise 0.22s var(--ease);
}
.modal-backdrop .modal { margin: 0; }
.modal h2, .popup-content h2, .credit-popup h2 { font-size: 1.45rem; }
.modal-sub { color: var(--muted); margin-top: -0.3rem; }
.modal-actions, .popup-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.modal-error { display: none; background: var(--danger-soft); color: var(--danger); border-radius: var(--r-sm); padding: 0.6rem 0.8rem; margin-bottom: 1rem; font-size: 0.92rem; }
@keyframes ra-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.toast, .notification {
    position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
    background: var(--ink); color: var(--paper);
    padding: 0.8rem 1.2rem; border-radius: var(--r-md); box-shadow: var(--shadow-3);
    font-weight: 600; font-size: 0.95rem;
    opacity: 0; pointer-events: none; z-index: 1100;
    transition: opacity 0.25s, transform 0.25s var(--ease);
    max-width: min(560px, calc(100vw - 32px));
}
.toast.show, .notification.show { opacity: 1; transform: translate(-50%, 0); }
#error-message { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 1100; max-width: min(560px, calc(100vw - 32px)); }

/* ---------------------------------------------------------------- site navigation */
.site-nav {
    position: sticky; top: 0; z-index: 900;
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    backdrop-filter: saturate(1.3) blur(10px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, background-color 0.2s;
}
.site-nav.scrolled { border-bottom-color: var(--rule); }
.site-nav .container { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 600; font-size: 1.22rem; letter-spacing: -0.01em; }
.brand svg { width: 32px; height: 32px; border-radius: 8px; box-shadow: var(--shadow-1); }
.brand:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a:not(.btn) {
    color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.93rem;
    padding: 0.5rem 0.75rem; border-radius: 8px;
}
.nav-links a:not(.btn):hover, .nav-links a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }
.nav-links .btn { margin-left: 8px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--rule); border-radius: 8px; width: 42px; height: 40px; cursor: pointer; color: var(--ink); font-size: 1.1rem; }
.avatar {
    width: 38px; height: 38px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--plum); color: #fff; font-weight: 700; font-size: 0.9rem;
    border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--rule-strong);
    overflow: hidden; cursor: pointer; padding: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-menu { position: relative; margin-left: 10px; }
.account-menu .menu {
    display: none; position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px;
    background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: var(--shadow-3);
    padding: 6px; z-index: 950;
}
.account-menu.open .menu { display: block; animation: ra-rise 0.16s var(--ease); }
.account-menu .menu .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--rule); margin-bottom: 6px; }
.account-menu .menu .who strong { display: block; font-size: 0.95rem; }
.account-menu .menu .who span { font-size: 0.82rem; color: var(--muted); word-break: break-all; }
.account-menu .menu a, .account-menu .menu button {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 9px 12px; border-radius: 8px; border: 0; background: none;
    font: 600 0.92rem var(--font-body); color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left;
}
.account-menu .menu a:hover, .account-menu .menu button:hover { background: var(--paper-2); color: var(--ink); }
.account-menu .menu i { width: 16px; color: var(--muted); }
.plan-chip { margin: 4px 12px 8px; }

@media (max-width: 960px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav-links {
        display: none; position: absolute; left: 0; right: 0; top: 68px;
        flex-direction: column; align-items: stretch; gap: 2px;
        background: var(--paper); border-bottom: 1px solid var(--rule); padding: 10px var(--gutter) 18px;
        box-shadow: var(--shadow-2);
    }
    .nav-links.open { display: flex; }
    .nav-links a:not(.btn) { padding: 0.8rem 0.75rem; font-size: 1rem; }
    .nav-links .btn { margin: 8px 0 0; }
    .account-menu { margin: 8px 0 0; }
    .account-menu .menu { position: static; display: block; box-shadow: none; border: 0; padding: 0; }
    .account-menu .avatar { display: none; }
}

/* The app bar is the same object with the teacher's tools in it. */
.app-nav .nav-links a:not(.btn) i { color: var(--faint); margin-right: 4px; font-size: 0.85em; }
.app-main { padding: clamp(24px, 4vw, 44px) 0 80px; }
.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); margin-bottom: 0.25rem; }
.page-head p { color: var(--muted); max-width: 64ch; margin: 0; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--ink); color: #cfcddc; padding: 64px 0 28px; margin-top: 0; }
.site-footer a { color: #e9e7f2; text-decoration: none; }
.site-footer a:hover { color: var(--gold-hi); }
.site-footer .brand { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 36px; }
.footer-grid h4 { color: #fff; font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 0.95rem; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, 0.1); margin-top: 44px; padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; font-size: 0.85rem; color: #a9a6b8; }
.app-footer { border-top: 1px solid var(--rule); padding: 22px 0 36px; font-size: 0.86rem; color: var(--muted); }
.app-footer .container { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; }
.app-footer a { color: var(--muted); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- cookie notice */
.cookie-banner {
    display: none;
    position: fixed; left: 20px; bottom: 20px; z-index: 1200;
    width: min(400px, calc(100vw - 40px));
    background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg);
    box-shadow: var(--shadow-3); padding: 18px 20px;
    font-size: 0.93rem;
}
.cookie-banner p { margin: 0 0 12px; color: var(--ink-2); }
.cookie-banner .row { display: flex; gap: 10px; }
@media (max-width: 520px) { .cookie-banner { left: 12px; right: 12px; bottom: 12px; width: auto; } }

/* ---------------------------------------------------------------- motion */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    .js .reveal { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- print */
@media print {
    body::before, .site-nav, .site-footer, .app-footer, .cookie-banner, .no-print { display: none !important; }
    body { background: #fff; }
}

/* ==========================================================================
   Long-form reading - the legal and data-protection documents, and the blog.

   These pages are read closely: by a school DPO deciding whether to sign, by a
   teacher at eleven at night. So: a ~70ch measure, clause numbers hung in the
   margin the way a statute sets them (the text keeps one clean left edge),
   contents that follow the reader, tables that become cards on a phone, and a
   print stylesheet that gives a plain A4 document - the DPA gets printed and filed.
   ========================================================================== */
:root {
    --measure: 36rem;           /* ~72 characters of Atkinson at 18px (its "ch" is a wide zero, so not ch) */
    --num-gutter: 3.6rem;
    --gold-text: #7f5727;       /* gold that passes AA as small text (--gold-deep is 4.1:1 on paper) */
}
.print-only { display: none; }

/* ---- title block */
.doc-head {
    padding: clamp(36px, 6vw, 76px) 0 clamp(28px, 4vw, 44px);
    border-bottom: 1px solid var(--rule);
    background: linear-gradient(180deg, color-mix(in srgb, var(--card) 70%, transparent), transparent 85%);
}
.doc-head .eyebrow { color: var(--gold-text); }
.doc-head h1 { font-size: clamp(2.3rem, 4.6vw, 3.5rem); letter-spacing: -0.022em; line-height: 1.04; margin-bottom: 0.4em; }
.doc-head .lede { margin: 0 0 1.4rem; max-width: 60ch; }
.doc-meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; font-size: 0.9rem; color: var(--muted); }
.doc-meta span:not(:last-child)::after { content: "\00b7"; margin: 0 0.7em; color: var(--faint); font-weight: 700; }
.doc-meta span:first-child { color: var(--ink-2); font-weight: 600; }

/* ---- layout: contents | document */
.doc-grid {
    display: grid;
    /* the document track is wider than the measure so a table can have the room it needs;
       running text stays on the measure (.prose > *) */
    grid-template-columns: 15rem minmax(0, calc(var(--measure) + var(--num-gutter) + 9rem));
    column-gap: clamp(32px, 4vw, 64px);
    justify-content: center;
}
.doc-head-text { grid-column: 2; padding-left: var(--num-gutter); }
.doc-layout { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(56px, 8vw, 96px); align-items: start; }
.doc-aside { min-width: 0; height: 100%; }
.doc-body { min-width: 0; padding-left: var(--num-gutter); }

.doc-toc { position: sticky; top: 92px; max-height: calc(100vh - 116px); overflow: auto; overscroll-behavior: contain; font-size: 0.9rem; padding-bottom: 12px; }
.doc-toc summary {
    list-style: none; cursor: default;
    font: 700 0.74rem/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
    padding: 10px 0 14px;
}
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--rule); }
.doc-toc a {
    display: grid; grid-template-columns: 2.4em minmax(0, 1fr); align-items: baseline;
    padding: 6px 10px 6px 14px; margin-left: -1px;
    border-left: 2px solid transparent; border-radius: 0 6px 6px 0;
    color: var(--ink-2); text-decoration: none; line-height: 1.35;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.doc-toc a .n { color: var(--gold-text); font-size: 0.92em; }
.doc-toc a:hover { background: var(--paper-2); color: var(--ink); }
.doc-toc a[aria-current] { border-left-color: var(--plum); background: var(--plum-soft); color: var(--ink); font-weight: 600; }
.doc-toc .sub a { padding-left: 26px; font-size: 0.93em; }

/* ---- the document itself */
.prose { font-size: 1.125rem; line-height: 1.7; color: var(--ink-2); overflow-wrap: break-word; }
.prose > * { max-width: var(--measure); }
.prose [id] { scroll-margin-top: 92px; }
.prose p { margin: 0 0 1em; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--plum); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose a.btn { text-decoration: none; }
.prose a.btn-primary, .prose a.btn-secondary { color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.35em; }
.prose li { margin: 0.4em 0; padding-left: 0.2em; }
.prose li::marker { color: var(--gold-deep); }
.prose code { font: 0.86em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 4px; padding: 0.08em 0.34em; color: var(--ink); }
.prose h2 {
    position: relative;
    font-size: clamp(1.5rem, 2.3vw, 1.8rem); font-weight: 500; letter-spacing: -0.015em;
    margin: 2.3em 0 0.65em; padding-top: 1.05em; border-top: 1px solid var(--rule);
}
.prose > h2:first-child, .prose > .dp-actions + h2 { margin-top: 0.4em; border-top: 0; padding-top: 0; }
.prose h3 { position: relative; font-size: 1.24rem; margin: 1.8em 0 0.5em; }
.prose h4 { font-size: 1.08rem; margin: 1.6em 0 0.4em; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2.2em 0; }
.prose em { font-style: italic; }
.doc-num { font-family: var(--font-display); font-style: italic; font-weight: 400; color: var(--gold-deep); font-variant-numeric: lining-nums tabular-nums; }
.prose .clause { position: relative; }
.clause-no { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
/* Hang the numbers in the margin: section numbers and clause numbers share one gutter, so
   every line of text starts at the same place and the numbering reads as a column. */
.prose > h2 .doc-num, .prose > h3 .doc-num, .prose > .clause .clause-no {
    position: absolute; left: calc(-1 * var(--num-gutter)); width: calc(var(--num-gutter) - 0.85rem); text-align: right;
}
.prose > h3 .doc-num { color: var(--gold-text); font-size: 0.95em; }

/* action row, callouts, the letterhead block */
.prose > .dp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 2.2em; max-width: none; }
.dp-callout, .dp-warn {
    border-radius: var(--r-md); padding: 18px 22px 16px; margin: 1.6em 0; border: 1px solid;
}
.dp-callout { background: var(--teal-soft); border-color: #cbe6e1; box-shadow: inset 4px 0 0 var(--teal); }
.dp-warn { background: var(--warning-soft); border-color: #efd3a6; box-shadow: inset 4px 0 0 var(--warning); }
.dp-callout h3, .dp-warn h3 { font-size: 1.14rem; margin: 0 0 0.45em; }
.dp-callout h3 i { color: var(--teal); margin-right: 4px; }
.dp-warn .doc-num { color: #8a5a1f; }
.dp-callout p:last-child, .dp-warn p:last-child { margin-bottom: 0; }
.prose address, .legal-contact-card {
    display: block; font-style: normal; line-height: 1.7;
    background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--gold);
    border-radius: var(--r-md); padding: 18px 22px; margin: 1em 0 1.4em;
    box-shadow: var(--shadow-1);
}
.prose address strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; }

/* tables - full width of the column, gutter included, because they need the room */
.prose table {
    width: calc(100% + var(--num-gutter)); max-width: none;
    margin: 1.5em 0 1.9em calc(-1 * var(--num-gutter));
    border: 1px solid var(--rule); border-radius: var(--r-md);
    border-collapse: separate; border-spacing: 0; overflow: hidden;
    background: var(--card); box-shadow: var(--shadow-1);
    font-size: 0.94rem; line-height: 1.55;
}
.prose th, .prose td { padding: 0.8rem 1rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--rule); }
.prose tr:last-child > * { border-bottom: 0; }
.prose td + td, .prose th + th, .prose th + td { border-left: 1px solid var(--rule); }
.prose tbody th {
    width: 30%; background: var(--paper-2); color: var(--ink);
    font-size: 0.92rem; letter-spacing: 0; text-transform: none; font-weight: 700;
}
.risk-high, .risk-med, .risk-low {
    display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px; border: 1px solid;
    font-size: 0.8rem; font-weight: 700; white-space: nowrap; line-height: 1.5;
}
.risk-high { background: var(--danger-soft); color: var(--danger); border-color: #e7b9b4; }
.risk-med { background: var(--gold-soft); color: var(--gold-text); border-color: #eedcc0; }
.risk-low { background: var(--teal-soft); color: #115e55; border-color: #cbe6e1; }

/* the DPA's acceptance form, set like a signature page */
.sign-box {
    margin: 2.6em 0; padding: clamp(22px, 3vw, 32px);
    background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--r-lg);
    box-shadow: var(--shadow-2); position: relative; overflow: hidden;
}
.sign-box::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--plum), var(--plum-2)); }
.sign-box h3 { font-size: 1.4rem; font-weight: 500; margin: 0 0 0.4em; }
.sign-box h3 i { color: var(--plum); font-size: 0.85em; margin-right: 4px; }
.sign-lede { color: var(--muted); font-size: 0.97rem; }
.sign-signin { margin: 1.2em 0 0; }
.sign-signin .btn { margin-right: 6px; vertical-align: middle; }
.sign-box > :last-child { margin-bottom: 0; }
.sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 24px; margin: 22px 0 26px; }
.sign-grid .sign-field:first-child { grid-column: 1 / -1; }
.sign-field label { display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.sign-field input {
    border: 0; border-bottom: 1.5px solid var(--ink-2); border-radius: 4px 4px 0 0; background: transparent;
    padding: 8px 4px 6px; min-height: 46px;
    font-family: var(--font-display); font-size: 1.2rem; color: var(--ink);
}
.sign-field input::placeholder { color: var(--muted); font-style: italic; opacity: 0.75; }
.sign-field input:focus { border-bottom-color: var(--plum); background: var(--plum-soft); box-shadow: 0 2px 0 0 var(--plum); }
.sign-status { display: none; border-radius: var(--r-md); padding: 12px 14px; margin-top: 16px; font-size: 0.95rem; }
.sign-status.ok { display: block; background: var(--teal-soft); border: 1px solid #cbe6e1; color: #115e55; }
.sign-status.bad { display: block; background: var(--danger-soft); border: 1px solid #e7b9b4; color: var(--danger); }

/* the quiet sign-up band at the foot of the policies */
.doc-cta { background: var(--paper-2); border-top: 1px solid var(--rule); padding: clamp(48px, 7vw, 80px) 0; text-align: center; }
.doc-cta h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.doc-cta p { color: var(--muted); margin: 0 auto 1.4rem; max-width: 52ch; }
.doc-cta .hero-cta { justify-content: center; }

/* ---- narrower screens: contents become a box above the document */
@media screen and (max-width: 1079px) {
    .doc-grid { grid-template-columns: minmax(0, calc(var(--measure) + var(--num-gutter))); }
    .doc-head-text { grid-column: 1; }
    .doc-aside { height: auto; }
    .doc-toc { position: static; max-height: none; overflow: visible; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-1); margin: 0 0 28px var(--num-gutter); padding: 0; }
    .doc-toc summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; font-size: 0.78rem; color: var(--ink-2); }
    .doc-toc summary::after { content: "\f078"; font-family: 'Font Awesome 6 Free'; font-weight: 900; font-size: 0.8rem; color: var(--muted); letter-spacing: 0; transition: transform 0.2s; }
    .doc-toc[open] summary::after { transform: rotate(180deg); }
    .doc-toc[open] summary { border-bottom: 1px solid var(--rule); }
    .doc-toc ol { border-left: 0; padding: 6px 6px 10px; }
    .doc-toc a { border-left: 0; border-radius: 6px; margin: 0; min-height: 42px; align-items: center; padding: 8px 10px; }
    .doc-toc a[aria-current] { background: transparent; font-weight: inherit; }
}
@media screen and (max-width: 640px) {
    :root { --num-gutter: 0rem; }
    .doc-toc { margin-left: 0; }
    .prose > h2 .doc-num, .prose > h3 .doc-num, .prose > .clause .clause-no { position: static; width: auto; }
    .clause-no { margin-right: 0.15em; }
    .prose h2 { font-size: 1.5rem; margin-top: 1.9em; padding-top: 0.9em; }
    .prose { font-size: 1.0625rem; }
    .dp-actions .btn { flex: 1 1 100%; justify-content: flex-start; min-height: 46px; white-space: normal; text-align: left; }
    .doc-meta { flex-direction: column; }
    .doc-meta span:not(:last-child)::after { content: none; }
    .sign-signin .btn { width: 100%; min-height: 48px; margin: 0 0 10px; }
    .sign-grid { grid-template-columns: 1fr; }
    .sign-box .btn-large { width: 100%; white-space: normal; }
    .doc-cta .btn { width: 100%; }
}
@media screen and (max-width: 720px) {
    /* A three-column table cannot be read at phone width, so each row becomes a card with
       its cells labelled (the labels are copied from the header by doc_base.html). */
    .prose table.stack { width: 100%; margin-left: 0; }
    .prose table.stack, .prose table.stack tbody, .prose table.stack tr, .prose table.stack th, .prose table.stack td { display: block; width: auto; }
    .prose table.stack { border: 0; box-shadow: none; background: transparent; overflow: visible; }
    .prose table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .prose table.stack tr { background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-1); margin-bottom: 12px; padding: 12px 16px 10px; }
    .prose table.stack td, .prose table.stack th { border: 0; padding: 4px 0 8px; }
    .prose table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
    .prose table.stack.rows th { background: none; padding-bottom: 2px; font-family: var(--font-display); font-size: 1.05rem; }
    .prose table.stack td:first-child { font-family: var(--font-display); font-size: 1.14rem; font-weight: 600; color: var(--ink); }
    .prose table.stack td:first-child::before { font-family: var(--font-body); }
    html:not(.js) .prose table { display: block; overflow-x: auto; }
}

/* ---- print: a clean document, no chrome */
@media print {
    @page {
        size: A4; margin: 18mm 17mm 20mm;
        @bottom-right { content: counter(page) " / " counter(pages); font: 8pt var(--font-body); color: #555; }
    }
    body { font-size: 10.5pt; line-height: 1.5; color: #000; }
    .doc-aside, .doc-cta, .dp-actions, .sign-box, .cookie-banner, .no-print { display: none !important; }
    .print-only { display: block; }
    .doc-head { background: none; padding: 0 0 12pt; border-bottom: 1.5pt solid #000; }
    .doc-head h1 { font-size: 24pt; }
    .doc-head .lede { font-size: 11pt; color: #222; max-width: none; }
    .doc-meta { font-size: 9pt; color: #333; }
    .doc-meta span:first-child { color: #000; }
    .doc-source { margin: 6pt 0 0; font-size: 8.5pt; color: #555; }
    .doc-grid { display: block; }
    .doc-head-text { padding-left: 0; }
    .doc-layout { padding: 14pt 0 0; }
    .container { padding: 0; max-width: none; }
    .doc-body { padding-left: 11mm; max-width: none; }
    .prose { font-size: 10.5pt; line-height: 1.5; color: #000; }
    .prose > * { max-width: none; }
    .prose > h2 .doc-num, .prose > h3 .doc-num, .prose > .clause .clause-no { left: -11mm; width: 9mm; }
    .prose h2 { font-size: 14pt; margin: 16pt 0 6pt; padding-top: 8pt; border-top-color: #bbb; break-after: avoid; page-break-after: avoid; }
    .prose h3 { font-size: 12pt; break-after: avoid; page-break-after: avoid; }
    .prose p, .prose li { orphans: 3; widows: 3; }
    .prose p:has(+ table), .prose p:has(+ ul), .prose p:has(+ ol) { break-after: avoid; page-break-after: avoid; }
    .prose a { color: #000; text-decoration: underline; text-decoration-color: #999; }
    .prose strong, .clause-no, .doc-num { color: #000; }
    .prose table { width: calc(100% + 11mm); margin-left: -11mm; box-shadow: none; border-color: #999; font-size: 9pt; }
    .prose th, .prose td { border-color: #bbb !important; }
    .prose thead { display: table-header-group; }
    .prose tr, .dp-callout, .dp-warn, .prose address { break-inside: avoid; page-break-inside: avoid; }
    .dp-callout, .dp-warn, .prose address { box-shadow: none; background: none; border: 1pt solid #999; }
    .risk-high, .risk-med, .risk-low { background: none; color: #000; border-color: #666; }
    .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---- the blog: an index of cards and a readable article */
.blog-head { padding: clamp(40px, 6vw, 80px) 0 clamp(24px, 4vw, 40px); }
.blog-head h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); letter-spacing: -0.025em; line-height: 1.04; max-width: 18ch; }
.blog-head .eyebrow { color: var(--gold-text); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(16px, 2.4vw, 26px); padding-bottom: clamp(56px, 8vw, 96px); }
.post-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); box-shadow: var(--shadow-1);
    color: var(--ink); text-decoration: none;
    transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--rule-strong); color: var(--ink); }
.post-thumb { aspect-ratio: 16 / 8; background: var(--paper-2); overflow: hidden; border-bottom: 1px solid var(--rule); }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* A post without a picture gets a sheet of the ruled paper the product writes on. */
.post-thumb.paper {
    display: flex; align-items: center; padding-left: 64px;
    background:
        linear-gradient(90deg, transparent 40px, var(--margin) 40px, var(--margin) 42px, transparent 42px),
        repeating-linear-gradient(180deg, transparent 0 25px, rgba(66, 37, 104, 0.09) 25px 26px),
        #fff;
}
.post-thumb .initial { font-family: var(--font-display); font-style: italic; font-size: 4.2rem; line-height: 1; color: var(--gold-deep); opacity: 0.85; }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.post-card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.84rem; color: var(--muted); }
.post-card h2 { font-size: 1.36rem; font-weight: 600; line-height: 1.22; letter-spacing: -0.01em; margin: 10px 0 8px; }
.post-card p { color: var(--muted); font-size: 0.97rem; margin: 0 0 16px; }
.read-more { margin-top: auto; font-weight: 700; font-size: 0.94rem; color: var(--plum); display: inline-flex; align-items: center; gap: 8px; }
.post-card:hover .read-more i { transform: translateX(3px); }
.read-more i { transition: transform 0.2s var(--ease); font-size: 0.85em; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin: -28px 0 clamp(56px, 8vw, 96px); flex-wrap: wrap; }
.pagination-info { color: var(--muted); font-size: 0.93rem; }

.article { --num-gutter: 0rem; padding: clamp(28px, 5vw, 60px) 0 clamp(56px, 8vw, 96px); }
.article-wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 0.9rem; color: var(--muted); margin-bottom: 22px; }
.breadcrumb a { color: var(--plum); }
.breadcrumb .sep { color: var(--rule-strong); }
.breadcrumb [aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 36ch; }
.article-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; }
.article-meta i { color: var(--gold-deep); margin-right: 5px; }
.article h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); letter-spacing: -0.024em; line-height: 1.06; margin-bottom: 0.55em; }
.article .prose { line-height: 1.75; }
.article-intro {
    font-family: var(--font-display); font-size: clamp(1.2rem, 1.9vw, 1.36rem); line-height: 1.55; color: var(--ink-2);
    margin: 0 0 1.8em; padding-bottom: 1.5em; border-bottom: 1px solid var(--rule);
}
.article-intro strong { font-weight: 600; color: var(--ink); }
.article-content h2 { font-size: clamp(1.55rem, 2.6vw, 1.95rem); font-weight: 500; margin: 2em 0 0.55em; border-top: 0; padding-top: 0; }
.article-content h3 { font-size: 1.3rem; margin: 1.7em 0 0.45em; }
.article-content h2:first-child { margin-top: 0; }
.hero-image { margin: 0 0 2em; max-width: none; }
@media (min-width: 900px) { .hero-image { margin: 0 -3rem 2.2em; } }
.hero-image img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.inline-blog-image { margin: 2em 0; text-align: center; }
.inline-blog-image img { width: 100%; max-width: 560px; height: auto; border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.callout { background: var(--gold-soft); border-radius: 0 var(--r-md) var(--r-md) 0; box-shadow: inset 4px 0 0 var(--gold); padding: 18px 22px; margin: 1.8em 0; }
.callout p:last-child { margin-bottom: 0; }
/* Example report comments are shown on the ruled page they would be written on. */
.comment-example {
    background:
        linear-gradient(90deg, transparent 34px, var(--margin) 34px, var(--margin) 35.5px, transparent 35.5px),
        repeating-linear-gradient(180deg, transparent 0 29px, rgba(66, 37, 104, 0.09) 29px 30px),
        #fff;
    border: 1px solid var(--rule); border-radius: var(--r-md); box-shadow: var(--shadow-1);
    padding: 15px 20px 15px 52px; margin: 1em 0; line-height: 30px;
    font-family: var(--font-display); font-size: 1.1rem; color: var(--ink);
}
.comparison-table-blog { width: 100%; margin: 1.5em 0 2em; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; overflow: hidden; box-shadow: var(--shadow-1); font-size: 0.95rem; line-height: 1.5; }
.comparison-table-blog th, .comparison-table-blog td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.comparison-table-blog tr:last-child td { border-bottom: 0; }
.comparison-table-blog .check { color: var(--teal); }
.comparison-table-blog .cross { color: var(--danger); }
.comparison-table-blog .check i, .comparison-table-blog .cross i { margin-right: 4px; }
.mid-cta, .end-cta { border-radius: var(--r-lg); padding: clamp(24px, 4vw, 36px); margin: 2.2em 0; text-align: center; }
.mid-cta { background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--gold); box-shadow: var(--shadow-1); }
.mid-cta h3 { margin: 0 0 0.35em; font-size: 1.35rem; }
.mid-cta p { color: var(--muted); max-width: 54ch; margin: 0 auto 1.2em; }
.end-cta { background: var(--ink); color: #d7d5e3; margin-top: 3em; }
.end-cta h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 0.4em; }
.end-cta p { color: #c9c6d8; margin: 0 auto 1.4em; max-width: 50ch; }
.btn-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem; min-height: 46px;
    padding: 0.8rem 1.4rem; border-radius: var(--r-md);
    background: var(--gold); color: var(--ink); font: 600 1rem/1.2 var(--font-body); text-decoration: none;
    box-shadow: inset 0 -2px 0 rgba(27, 26, 46, 0.14), 0 6px 16px -10px rgba(156, 111, 58, 0.8);
    transition: transform 0.15s var(--ease), background-color 0.2s;
}
.prose a.btn-cta, .btn-cta:hover { color: var(--ink); text-decoration: none; }
.btn-cta:hover { background: var(--gold-hi); transform: translateY(-1px); }
.related-posts { margin-top: 3.2em; padding-top: 2em; border-top: 1px solid var(--rule); }
.related-posts h2 { font-size: 1.4rem; margin-bottom: 0.9em; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 14px; }
.related-card { display: block; padding: 16px 18px; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-md); text-decoration: none; color: var(--ink); transition: border-color 0.15s, transform 0.15s; }
.related-card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--ink); }
.related-card h3 { font-size: 1.05rem; font-weight: 600; line-height: 1.3; margin: 0 0 6px; }
.related-meta { font-size: 0.84rem; color: var(--muted); }
@media screen and (max-width: 640px) {
    .breadcrumb a { display: inline-flex; align-items: center; min-height: 40px; }
    .breadcrumb [aria-current] { max-width: 100%; }
    .comparison-table-blog { display: block; overflow-x: auto; }
    .comparison-table-blog th, .comparison-table-blog td { min-width: 150px; }
    .comment-example { font-size: 1.04rem; }
    .btn-cta { width: 100%; }
    .pagination .btn { min-height: 44px; }
}
@media print {
    .end-cta, .mid-cta, .related-posts { display: none !important; }
}

/* ==========================================================================
   Marketing components - shared by home, pricing, schools and the free pages.
   ========================================================================== */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(40px, 6vw, 72px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 5.4vw, 4.5rem); font-weight: 500; letter-spacing: -0.028em; line-height: 1.02; margin-bottom: 0.35em; }
.hero h1 em { font-style: italic; font-weight: 400; color: var(--plum); }
.hero .lede { font-size: clamp(1.08rem, 1.5vw, 1.25rem); margin-bottom: 1.6rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-fine { margin-top: 14px; font-size: 0.9rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.hero-fine span::before { content: "\2713"; color: var(--teal); margin-right: 6px; font-weight: 700; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.facts { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: color-mix(in srgb, var(--card) 60%, transparent); }
.facts .container { display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { padding: 22px 18px; border-left: 1px solid var(--rule); }
.fact:first-child { border-left: 0; }
.fact b { display: block; font-family: var(--font-display); font-size: 2rem; font-weight: 500; line-height: 1.1; color: var(--ink); }
.fact span { font-size: 0.9rem; color: var(--muted); }
@media (max-width: 760px) { .facts .container { grid-template-columns: 1fr 1fr; } .fact:nth-child(3) { border-left: 0; } .fact { border-top: 1px solid var(--rule); } .fact:nth-child(-n+2) { border-top: 0; } }

.section-head { max-width: 720px; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--ink); }
.step { padding: 26px 26px 8px 0; border-right: 1px solid var(--rule); }
.step + .step { padding-left: 26px; }
.step:last-child { border-right: 0; }
.step .num { font-family: var(--font-display); font-size: 3.6rem; line-height: 1; font-weight: 400; color: var(--gold-deep); font-style: italic; }
.step h3 { margin: 12px 0 8px; font-size: 1.35rem; }
.step p { color: var(--muted); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } .step, .step + .step { padding: 22px 0; border-right: 0; border-bottom: 1px solid var(--rule); } }

.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.bento .tile { grid-column: span 2; background: var(--card); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 26px; box-shadow: var(--shadow-1); display: flex; flex-direction: column; }
.bento .tile.wide { grid-column: span 3; }
.bento .tile.hero-tile { grid-column: span 4; grid-row: span 2; background: var(--ink); color: #dddbe8; border-color: var(--ink); }
.bento .tile.hero-tile h3 { color: #fff; font-size: 1.7rem; }
.bento .tile .ico { width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--gold-soft); color: var(--gold-deep); margin-bottom: 16px; font-size: 1.05rem; }
.bento .tile.hero-tile .ico { background: rgba(255, 255, 255, 0.08); color: var(--gold-hi); }
.bento .tile p { color: var(--muted); margin: 0; }
.bento .tile.hero-tile p { color: #c9c6d8; }
.bento .tile h3 { margin-bottom: 8px; }
@media (max-width: 900px) { .bento { grid-template-columns: 1fr 1fr; } .bento .tile, .bento .tile.wide { grid-column: span 1; } .bento .tile.hero-tile { grid-column: span 2; grid-row: auto; } }
@media (max-width: 600px) { .bento { grid-template-columns: 1fr; } .bento .tile.hero-tile { grid-column: span 1; } }

.compare { width: 100%; border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--card); box-shadow: var(--shadow-1); }
.compare th, .compare td { padding: 14px 18px; }
.compare th:not(:first-child), .compare td:not(:first-child) { text-align: center; width: 22%; }
.compare .ours { background: var(--gold-soft); }
.compare .yes { color: var(--teal); font-size: 1.1rem; }
.compare .no { color: var(--faint); }

.band-ink { background: var(--ink); color: #d7d5e3; }
.band-ink h2, .band-ink h3 { color: #fff; }
.band-ink .eyebrow { color: var(--gold-hi); }
.band-ink .section-head p { color: #b9b6c9; }
.band-ink a { color: var(--gold-hi); }
.band-paper { background: var(--paper-2); }
.trust-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.trust-list li { display: flex; gap: 12px; align-items: flex-start; }
.trust-list li i { color: var(--gold-hi); margin-top: 5px; }
@media (max-width: 700px) { .trust-list { grid-template-columns: 1fr; } }

.faq { max-width: 820px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 40px 18px 0; position: relative; font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font-family: var(--font-body); font-size: 1.6rem; color: var(--gold-deep); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 20px; color: var(--ink-2); max-width: 70ch; }

.subject-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.subject-grid a { display: block; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--r-md); background: var(--card); text-decoration: none; color: var(--ink); transition: border-color 0.15s, transform 0.15s; }
.subject-grid a:hover { border-color: var(--gold); transform: translateY(-2px); }
.subject-grid a b { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.subject-grid a span { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 900px) { .subject-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .subject-grid { grid-template-columns: 1fr 1fr; } }

.cta-band { text-align: center; }
.cta-band h2 { font-size: clamp(2rem, 4vw, 3.2rem); }
.cta-band .hero-cta { justify-content: center; }
.cta-band .hero-fine { justify-content: center; }
