/*
 * site.css -- the ROOT.war design system (PLAN-3 S7.1).
 *
 * No framework, no build step, no JavaScript: one file, custom properties for the palette,
 * mobile first, and a budget of 30 KB that tools/site/run-design-check.ps1 enforces.
 *
 * Palette: navy for the hero and the footer, a light blue-grey page, one blue for links and
 * controls, gold for the primary call to action. Marketing pages are meant to look LIGHTER
 * than the application -- nothing here imitates SmartClient chrome.
 *
 * Contrast: every foreground/background pair below is checked against WCAG 2.1 AA by
 * DesignCheck (4.5:1 for body text, 3:1 for large text and UI edges). Two consequences that
 * are easy to undo by accident:
 *   - gold carries NAVY text, never white (white on #d4a017 is 2.4:1);
 *   - --blue is the lightest blue allowed on white (5.3:1); hover goes darker, not lighter.
 *
 * Order: tokens, base, layout, header, footer, components, buttons, then the public
 * pages built in S2.2 - S6.5 (forms, data primitives, pricing, checkout, account), then
 * print. The /admin/* back office is assets/css/admin.css -- it is a third of the bytes
 * and no visitor ever loads it, which is how this file stays inside its budget.
 */

/* ============================================================ 1. tokens */

:root {
    /* S7.1 palette */
    --navy:       #0b1b3a;
    --navy-soft:  #14294d;
    --blue:       #2a6fb0;
    --blue-dark:  #1f5588;
    --blue-light: #dbe9f7;
    --gold:       #d4a017;
    --gold-dark:  #b8880c;
    --bg:         #f6f9fc;
    --surface:    #ffffff;
    --text:       #1d2733;
    --muted:      #55606f;
    --rule:       #d7e1ec;
    --field:      #7b8fa6;

    /* states */
    --ok:     #1d6b3a;
    --warn:   #7a5a00;
    --bad:    #8a1f1f;
    --danger: #b3261e;

    /* names the S2.2 - S6.5 rules were written against; re-skinned by pointing them here */
    --ink:    var(--text);
    --accent: var(--blue);
    --panel:  #eef4fa;

    --measure: 44rem;   /* reading column */
    --grid:    72rem;   /* full page grid */
    --radius:  8px;
    --shadow:  0 1px 2px rgba(11, 27, 58, 0.06), 0 6px 18px rgba(11, 27, 58, 0.06);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /*
     * The hero's star field: two repeating tiles of different sizes, so the pattern does
     * not read as a grid. Defined here because .hero and .hero-photo both use it and a
     * background shorthand cannot append a layer to another rule's.
     */
    --stars:
        radial-gradient(1.4px 1.4px at 24px 38px, #fff, transparent 100%) 0 0/170px 170px repeat,
        radial-gradient(1.2px 1.2px at 112px 22px, #cfe2f7, transparent 100%) 0 0/170px 170px repeat,
        radial-gradient(1.8px 1.8px at 66px 132px, #fff, transparent 100%) 0 0/230px 230px repeat,
        radial-gradient(1px 1px at 190px 88px, #dbe9f7, transparent 100%) 0 0/230px 230px repeat;
}

/* ============================================================ 2. base */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font: 16px/1.6 var(--font);
    color: var(--text);
    background: var(--bg);
}

h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 0.5rem; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.4rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }

p { margin: 0 0 1rem; }

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

img, svg, video { max-width: 100%; }
img { height: auto; }

hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }

/* One visible focus style for everything, so no control can lose it by being restyled. */
:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
    border-radius: 2px;
}

.lead { color: var(--muted); font-size: 1.125rem; }
.small { font-size: 0.8125rem; color: var(--muted); }
.links { padding-left: 1.25rem; }
.error-code { color: var(--muted); font-variant-numeric: tabular-nums; }
.error-ref code { background: var(--panel); padding: 0.1rem 0.35rem; border-radius: 3px; }

/* The first thing in the tab order: visible only once it has focus. */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 20;
    padding: 0.6rem 1rem;
    background: var(--gold);
    color: var(--navy);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ============================================================ 3. layout */

.site-main {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}
.site-main-wide { max-width: var(--grid); }

/* The pricing and account pages set their own width; kept from S5.1 / S5.5. */
.site-main:has(.pricing), .site-main:has(.account) { max-width: var(--grid); }

/*
 * A hero bleeds to the edge of the page column: it cancels .site-main's padding and its
 * own .hero-inner puts the same padding back, so the hero's first line sits on exactly the
 * same left edge as the body text under it. Getting that wrong by 1rem is visible.
 */
.site-main > .hero:first-child { margin: -2rem -1rem 0; }

.flash {
    max-width: var(--measure);
    margin: 1rem auto 0;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--rule);
    background: var(--surface);
}
.flash-error   { border-color: #e0b4b4; background: #fdf3f3; }
.flash-success { border-color: #b4e0c4; background: #f3fdf6; }
.flash-warn    { border-color: #e3d09a; background: #fdfaf0; }

.dev-note {
    margin-top: 2rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--blue);
    background: var(--panel);
    color: var(--muted);
    font-size: 0.875rem;
}

/* ============================================================ 4. header */

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
}
.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    max-width: var(--grid);
    margin: 0 auto;
    padding: 0.7rem 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.01em;
    color: var(--navy);
    text-decoration: none;
}
.brand-mark { color: var(--blue); flex: none; }
.brand-name { white-space: nowrap; }

/*
 * The mobile menu button is the checkbox itself: one element that is focusable, operable
 * with the keyboard and announced by its aria-label, with no script anywhere. The three
 * bars are drawn with a gradient so there is no image and no extra markup.
 */
.nav-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 40px;
    margin: 0 0 0 auto;
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: linear-gradient(var(--navy), var(--navy)) center/20px 2px no-repeat,
                linear-gradient(var(--navy), var(--navy)) center top 12px/20px 2px no-repeat,
                linear-gradient(var(--navy), var(--navy)) center bottom 12px/20px 2px no-repeat,
                var(--surface);
    cursor: pointer;
}
.nav-toggle:checked { background-color: var(--blue-light); border-color: var(--blue); }

.nav-panel { display: none; flex-basis: 100%; }
.nav-toggle:checked ~ .nav-panel { display: block; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-list > li > a, .nav-sub a {
    display: block;
    padding: 0.55rem 0.2rem;
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}
.nav-list > li > a:hover, .nav-sub a:hover { color: var(--blue); }
.nav-list a[aria-current] { color: var(--blue); }
.nav-sub { padding-left: 0.9rem !important; }
.nav-sub a { font-weight: 400; color: var(--muted); }

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0 0.2rem;
    border-top: 1px solid var(--rule);
    margin-top: 0.4rem;
}

.lang-switch { display: flex; gap: 0.15rem; margin-right: auto; }
.lang-switch a {
    padding: 0.3rem 0.45rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-radius: 4px;
}
.lang-switch a:hover { background: var(--panel); color: var(--blue); }
.lang-switch a[aria-current] { background: var(--blue-light); color: var(--blue-dark); }

@media (min-width: 56rem) {
    .nav-toggle { display: none; }
    .nav-panel {
        display: flex;
        flex: 1 1 auto;
        flex-basis: auto;
        align-items: center;
        gap: 1.5rem;
        justify-content: space-between;
    }
    .nav-list { display: flex; gap: 0.3rem; }
    .nav-list > li > a { padding: 0.5rem 0.6rem; border-radius: 6px; }
    .nav-list > li > a:hover { background: var(--panel); }
    .nav-list a[aria-current] { background: var(--blue-light); }
    .header-actions { border-top: 0; margin: 0; padding: 0; }
    .lang-switch { margin-right: 0; }

    /*
     * The dropdown, without script. display:none keeps the sub-links out of the tab order
     * until the parent link has focus -- at which point :focus-within shows the list and
     * Tab walks straight into it, which is the whole reason this works for the keyboard.
     */
    .nav-item.has-children { position: relative; }
    .nav-sub {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 10;
        min-width: 12rem;
        padding: 0.4rem !important;
        background: var(--surface);
        border: 1px solid var(--rule);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
    .nav-item.has-children:hover > .nav-sub,
    .nav-item.has-children:focus-within > .nav-sub { display: block; }
    .nav-sub a { padding: 0.4rem 0.6rem; border-radius: 4px; }
    .nav-sub a:hover { background: var(--panel); }
}

/* ============================================================ 5. footer */

.site-footer {
    margin-top: 3rem;
    background: var(--navy);
    color: var(--blue-light);
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--gold); text-decoration: underline; }
.site-footer .brand { color: #fff; }
.site-footer .brand-mark { color: var(--gold); }

.footer-inner {
    display: grid;
    gap: 2rem;
    max-width: var(--grid);
    margin: 0 auto;
    padding: 2.5rem 1rem 1.5rem;
}
.footer-brand .brand { font-size: 1.05rem; }
.footer-blurb { color: var(--blue-light); font-size: 0.9375rem; max-width: 30rem; margin: 0.75rem 0 0; }
.footer-social { display: flex; flex-wrap: wrap; gap: 1rem; margin: 1rem 0 0; }

.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav > ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem 1.5rem; }
.footer-nav > ul > li > a { font-weight: 600; }
.footer-nav ul ul { margin-top: 0.4rem; }
.footer-nav ul ul a { font-weight: 400; color: var(--blue-light); font-size: 0.9375rem; }
.footer-nav li { margin: 0 0 0.35rem; }

.footer-legal {
    max-width: var(--grid);
    margin: 0 auto;
    padding: 1rem;
    border-top: 1px solid rgba(219, 233, 247, 0.2);
    color: var(--blue-light);
    font-size: 0.875rem;
}
/* S8.3.6: a link inside a sentence needs more than colour (WCAG 1.4.1; Lighthouse link-in-text-block). */
.footer-legal a { text-decoration: underline; }

@media (min-width: 56rem) {
    .footer-inner { grid-template-columns: 1.2fr 2fr; }
}

/* ============================================================ 6. components */

/*
 * Hero. The background is a navy gradient with a CSS star field over it -- no request, no
 * layout shift, and a guaranteed contrast floor under the white text. Adding the class
 * hero-photo replaces the star field with sdata/images/site/andromeda.jpg, under the same
 * dark overlay; a missing file falls back to the gradient rather than to unreadable text.
 */
.hero {
    background: var(--stars), radial-gradient(120% 90% at 20% 0%, var(--navy-soft), var(--navy) 70%);
    color: #fff;
}
/*
 * The photo sits between the overlay and the star field, NOT on top of the navy: a node
 * that has not been given andromeda.jpg simply drops that layer and gets the designed
 * gradient, rather than a flat navy slab that looks like something failed.
 */
.hero-photo {
    background:
        linear-gradient(rgba(11, 27, 58, 0.45), rgba(11, 27, 58, 0.72)),
        url("/images/site/andromeda.jpg") center/cover no-repeat,
        var(--stars),
        radial-gradient(120% 90% at 20% 0%, var(--navy-soft), var(--navy) 70%);
}
.hero-inner {
    max-width: var(--grid);
    margin: 0 auto;
    padding: 3rem 1rem;      /* must equal .site-main's horizontal padding */
}
.hero h1 { font-size: 2rem; color: #fff; max-width: 20ch; }
.hero-eyebrow {
    margin: 0 0 0.6rem;
    color: var(--gold);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hero-lead { color: var(--blue-light); font-size: 1.125rem; max-width: 46ch; }
.hero .btn-quiet { color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.hero .btn-quiet:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.hero-plain { background: var(--navy); }

/* Feature grid */
.features-block { margin: 2.5rem 0; }
.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.25rem;
}
.feature {
    display: block;
    padding: 1.1rem 1.25rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}
.feature h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.feature p:last-child { margin-bottom: 0; }
.feature-link { color: inherit; text-decoration: none; }
.feature-link:hover { border-color: var(--blue); box-shadow: var(--shadow); color: inherit; }
.feature-link h3 { color: var(--blue); }

/* Screenshot figure */
.shot { margin: 1.75rem 0; }
.shot img {
    display: block;
    width: 100%;
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    background: var(--surface);
}
.shot figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.875rem; }

/* Callout */
.callout {
    margin: 1.5rem 0;
    padding: 0.9rem 1.1rem;
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    background: var(--blue-light);
}
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin-bottom: 0.3rem; }
.callout-tip  { border-left-color: var(--ok);   background: #eaf5ee; }
.callout-warn { border-left-color: var(--gold); background: #fdf6e3; }

/* Breadcrumb (the plain .crumbs paragraph of the admin/account pages is kept below) */
.crumbs { color: var(--muted); font-size: 0.875rem; margin: 0 0 1rem; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; color: var(--rule); }

/* Home slots and the legal page (S7.5); the rest reuses .feature-grid / .feature / .small */
.feature-grid .shot { margin: 0; }
.quote blockquote { margin: 0; }
.toc li.lvl3 { margin-left: 1rem; }

/* Table of contents */
.toc {
    margin: 1.5rem 0;
    padding: 0.9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
}
.toc-title { font-weight: 700; margin: 0 0 0.4rem; font-size: 0.9375rem; }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: 0.2rem 0; }

/*
 * Article body (S7.2 renders the CMS body inside .prose). The editor produces plain HTML,
 * so the styling has to come from the element names, not from classes nobody will add.
 */
/* S8.3: the migrated bodies are 2014 markup -- floated tables of screenshots, presentational
   attributes, the occasional element that simply is wider than a phone. The block SCROLLS
   rather than widening the document: an overflow a reader can swipe is a small annoyance,
   one that moves the header and the cookie banner sideways is a broken page. */
.prose { overflow-x: auto; }
.prose > :first-child { margin-top: 0; }
.prose img { border-radius: var(--radius); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin: 0.3rem 0; }
.prose blockquote {
    margin: 1.5rem 0;
    padding: 0.2rem 0 0.2rem 1.1rem;
    border-left: 4px solid var(--blue-light);
    color: var(--muted);
}
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--panel); padding: 0.1rem 0.3rem; border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 0.9rem 1rem; background: var(--panel); border-radius: var(--radius); }
.prose pre code { background: none; padding: 0; }
/* S8.3: display:block + overflow-x is what makes a 2014 table fit a phone. A table whose
   cells hold 300 px screenshots has a minimum width of its own that width:100% cannot
   shrink, and the page then scrolls sideways instead of the table. */
.prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.25rem 0; background: var(--surface); }
.prose th, .prose td { padding: 0.5rem 0.65rem; border: 1px solid var(--rule); text-align: left; overflow-wrap: anywhere; }
.prose th { background: var(--panel); }
.prose figure { margin: 1.5rem 0; }
/* S7.2: the one line a D8 language fallback adds -- a note, not an error. */
.page-fallback { margin-top: 2.5rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.9375rem; }

@media (min-width: 40rem) {
    h1 { font-size: 2.25rem; }
    .hero h1 { font-size: 2.6rem; }
    .hero-inner { padding: 4rem 2rem; }
    .site-main > .hero:first-child { margin: -2rem -2rem 0; }
    .header-inner, .footer-inner, .footer-legal { padding-left: 2rem; padding-right: 2rem; }
    .site-main { padding: 2rem; }
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
    .feature-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================ 7. buttons */

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--blue);
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover, .btn:focus { background: var(--blue-dark); color: #fff; }

/* The primary call to action. Gold carries navy text -- white on gold is 2.4:1. */
.btn-cta { background: var(--gold); color: var(--navy); }
.btn-cta:hover, .btn-cta:focus { background: var(--gold-dark); color: var(--navy); }

.btn-quiet { background: transparent; color: var(--blue); border-color: var(--rule); }
.btn-quiet:hover, .btn-quiet:focus { background: var(--panel); color: var(--blue-dark); }

.btn-ghost { background: var(--panel); color: var(--blue-dark); }
.btn-ghost:hover, .btn-ghost:focus { background: var(--blue-light); color: var(--blue-dark); }

.btn-secondary { background: var(--blue-light); color: var(--blue-dark); }
.btn-secondary:hover, .btn-secondary:focus { background: #cbdff4; color: var(--blue-dark); }

.btn-small { padding: 0.4rem 0.9rem; font-size: 0.875rem; }
.btn-danger { background: var(--danger); }
.btn-danger:hover, .btn-danger:focus { background: var(--bad); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ============================================================ 8. forms (S2.2 auth, reused by S5.5 and S6.5) */

.form { max-width: 26rem; }
.form-wide { max-width: 38rem; }

.field { margin: 0 0 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field textarea,
.field select {
    display: block;
    width: 100%;
    padding: 0.55rem 0.7rem;
    font: inherit;
    color: var(--text);
    border: 1px solid var(--field);
    border-radius: 6px;
    background: var(--surface);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); }

/*
 * S6.5 honeypot: a real field a bot can read and fill in, and nobody else can reach.
 * display:none would be read as "not a field" by the better bots, so it is moved off the
 * page instead; the template also marks it aria-hidden and tabindex="-1".
 */
.field-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field-check label { font-weight: 400; }
.field-check input { margin-right: 0.4rem; }
.field-captcha { min-height: 78px; }

.form-help { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.875rem; }
.form-error {
    margin: 0 0 1rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid #e0b4b4;
    border-radius: 6px;
    background: #fdf3f3;
    color: var(--bad);
}
.auth-links { margin-top: 1.5rem; color: var(--muted); font-size: 0.9375rem; }

.search { display: flex; gap: 0.5rem; max-width: 36rem; margin: 1rem 0; }
.search input[type="search"] {
    flex: 1;
    padding: 0.55rem 0.7rem;
    font: inherit;
    border: 1px solid var(--field);
    border-radius: 6px;
}

/* ============================================================ 9. data primitives
   Shared by the account pages, the checkout result and the admin back office. The
   severity, selection and admin-badge variants of these are in admin.css -- only the
   back office has rows that can be wrong.
   ============================================================ */

.grid { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.875rem; }
.grid th, .grid td { padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.grid th { background: var(--panel); font-weight: 600; white-space: nowrap; }
.grid form { margin: 0; }
.scroll { overflow-x: auto; }

.badge {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
    background: #eee;
}
.badge-ok    { background: #e3f6e9; color: var(--ok); }
.badge-warn  { background: #fff3c4; color: var(--warn); }
.badge-bad   { background: #fbe3e3; color: var(--bad); }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.5rem 1rem 1rem; }
.card h2 { margin-top: 0.5rem; }
.props { display: grid; grid-template-columns: max-content 1fr; gap: 0.3rem 1rem; margin: 0; font-size: 0.9375rem; }
.props dt { color: var(--muted); }
.props dd { margin: 0; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0; }
form.inline { display: inline; margin: 0; }
.form-inline { margin: 0.5rem 0; }
.form-inline label { font-weight: 600; margin-right: 0.5rem; }
.form-inline input[type="email"], .form-inline input[type="text"] { font: inherit; padding: 0.3rem 0.4rem; }

details.panel {
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    margin: 1rem 0;
}
details.panel > summary { font-weight: 600; cursor: pointer; }
details.panel[open] > summary { margin-bottom: 0.8rem; }

/* S5.7 admin actions and the email editor */
/* ============================================================ 9b. content sections (S8.3)
   The dated listings, one dated page, and the two blocks a migrated body needs. Everything
   else these templates use -- .prose, .feature-grid, .toc, .crumbs, .scroll -- is above.
   ============================================================ */

.post-list { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.post { padding: 1rem 0; border-top: 1px solid var(--rule); }
.post h2, .post h3 { margin: 0.1rem 0 0.3rem; font-size: 1.15rem; }
.post p { margin: 0; color: var(--muted); }
.post-date, .article-meta { display: block; color: var(--muted); font-size: 0.85rem; }
.article-meta { margin: -0.4rem 0 1rem; }

.article-nav { display: flex; flex-wrap: wrap; gap: 1rem; margin: 2rem 0 0; border-top: 1px solid var(--rule); padding-top: 1rem; }
.article-nav a { flex: 1 1 14rem; text-decoration: none; }
.article-nav span { display: block; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.article-next { text-align: right; }
.series { margin-top: 2.5rem; }

.ed-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.9375rem; }
.ed-table caption { text-align: left; padding: 0 0 0.5rem; color: var(--muted); }
.ed-table th, .ed-table td { padding: 0.45rem 0.6rem; border: 1px solid var(--rule); text-align: center; }
.ed-table th[scope="row"] { text-align: left; white-space: nowrap; }
.ed-table thead th { background: var(--panel); }
.ed-table .is-self { color: var(--muted); }

/* A 2014 iframe with width="560" fitted to a phone: the padding IS the aspect ratio. */
.video { position: relative; padding-top: 56.25%; margin: 1.5rem 0; background: var(--navy); border-radius: var(--radius); overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ============================================================ 10. pricing (S5.1 - S5.3) */

.pricing h1 { text-align: center; }
.pricing .lead { text-align: center; max-width: 40rem; margin: 0 auto 1.5rem; }

.pricing-controls { display: flex; flex-direction: column; align-items: center; gap: 1rem; margin: 0 0 1.5rem; }
.billing-toggle { display: inline-flex; border: 1px solid var(--field); border-radius: 999px; overflow: hidden; }
.toggle-btn { padding: 0.45rem 1.1rem; font: inherit; font-weight: 600; color: var(--muted); background: var(--surface); border: 0; cursor: pointer; }
.toggle-btn.is-active { background: var(--blue); color: #fff; }

.coupon-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; justify-content: center; }
.coupon-form label { font-weight: 600; }
.coupon-form input[type="text"] {
    width: 11rem;
    padding: 0.45rem 0.6rem;
    font: inherit;
    text-transform: uppercase;
    border: 1px solid var(--field);
    border-radius: 6px;
}
.coupon-status { flex-basis: 100%; text-align: center; font-size: 0.9rem; color: var(--muted); min-height: 1.4em; }
.coupon-status.is-ok { color: var(--ok); }
.coupon-status.is-bad { color: var(--bad); }

.cards { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.card-plan {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 10px;
    padding: 1.25rem 1.25rem 1.5rem;
}
.card-featured { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(42, 111, 176, 0.18); }
.card-plan h2 { margin: 0 0 0.25rem; font-size: 1.4rem; }
.card-plan .tagline { margin: 0 0 0.75rem; color: var(--muted); font-size: 0.95rem; }
.card-plan .price { margin: 0.25rem 0; }
.card-plan .amount { font-size: 2rem; font-weight: 700; line-height: 1.1; }
.card-plan .cycle { color: var(--muted); }
.card-plan .was { display: block; color: var(--muted); text-decoration: line-through; font-size: 0.9rem; }
.card-plan .trial { margin: 0 0 0.5rem; color: var(--ok); font-size: 0.9rem; font-weight: 600; }

.terms { border: 0; padding: 0; margin: 0.5rem 0 0.75rem; }
.terms legend { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); padding: 0; }
.term { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.2rem 0; cursor: pointer; }
.term .term-name { flex: 0 0 5.5rem; }
.term .term-price small { color: var(--muted); font-weight: 400; }

.features { margin: 0.5rem 0 1rem; padding-left: 1.2rem; font-size: 0.95rem; }
.features li { margin: 0.2rem 0; }

.card-action { margin-top: auto; }
.card-action .btn { width: 100%; text-align: center; }
.card-action .btn + .btn { margin-top: 0.5rem; }
.card-action .state { margin: 0 0 0.5rem; color: var(--muted); font-size: 0.95rem; }
.card-action .state.small { margin: 0.5rem 0 0; font-size: 0.875rem; }
/* S5.3: PayPal's own brand colour is fixed; its dark text is what makes it legible. */
.btn-paypal { background: #ffc439; color: #111; }
.btn-paypal:hover, .btn-paypal:focus { background: #f2b727; color: #111; }
.pay-note { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); }
.pricing-notes { margin-top: 2rem; color: var(--muted); font-size: 0.875rem; }

@media (min-width: 40rem) {
    .cards { grid-template-columns: repeat(2, 1fr); }
    .pricing-controls { flex-direction: row; justify-content: center; }
    .coupon-status { flex-basis: auto; }
}
@media (min-width: 64rem) {
    .cards { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================ 11. checkout result (S5.2) */

.checkout-result { max-width: 40rem; margin: 2rem auto; text-align: center; }
.checkout-result h1 { margin-bottom: 0.5rem; }
.cr-message { font-size: 1.1rem; }
.cr-spinner { color: var(--muted); }
.cr-spinner .spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid var(--muted);
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: cr-spin 0.8s linear infinite;
}
@keyframes cr-spin { to { transform: rotate(360deg); } }
.cr-details { display: inline-grid; grid-template-columns: auto auto; gap: 0.25rem 1.5rem; margin: 1rem auto; text-align: left; }
.cr-details div { display: contents; }
.cr-details dt { color: var(--muted); }
.cr-details dd { margin: 0; font-weight: 600; }
.cr-actions { margin: 1.25rem 0; display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.cr-ref, .cr-note { color: var(--muted); }
.cr-note { max-width: 32rem; margin: 1rem auto; }

/* ============================================================ 12. account pages (S5.5) */

.account { display: block; }
.account-nav ul {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    border-bottom: 1px solid var(--rule);
}
.account-nav li a { display: block; padding: 0.5rem 0.9rem; color: var(--text); text-decoration: none; border-bottom: 2px solid transparent; }
.account-nav li a:hover { background: var(--panel); }
.account-nav li.current a { color: var(--blue-dark); font-weight: 600; border-bottom-color: var(--blue); }
.account-main h1 { margin-top: 0; }
.account-main h2 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.account-main .card { margin: 0 0 1.25rem; }
.account-main .card h2 { margin-top: 0.5rem; }
.account-main .card .form { max-width: none; }
.sub-card h2 { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sub-card .state { margin: 0 0 0.75rem; color: var(--muted); }
.sub-card .actions { margin-top: 1rem; }
.invoice { max-width: 34rem; }
.invoice h1 { font-size: 1.4rem; }

@media (min-width: 48rem) {
    .account { display: flex; gap: 2rem; align-items: flex-start; }
    .account-nav { flex: 0 0 12rem; }
    .account-nav ul { flex-direction: column; border-bottom: 0; border-right: 1px solid var(--rule); margin-bottom: 0; }
    .account-nav li a { border-bottom: 0; border-right: 2px solid transparent; }
    .account-nav li.current a { border-bottom-color: transparent; border-right-color: var(--blue); }
    .account-main { flex: 1 1 auto; min-width: 0; }
}

/* S7.8: the "see also" line under a legal document, derived rather than written into a body
   whose text is asserted unchanged. */
.legal-related { margin: 2rem 0 0; padding-top: 1rem; border-top: 1px solid var(--rule);
    font-size: 0.9375rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 1rem; }

/* ============================================================ 13. cookie banner (S7.8)

   Over the page rather than pushing it down: a banner that reflows the page it appears on is
   the layout shift this design spends width and height attributes avoiding. Hidden in the
   markup and shown by the script, so a returning visitor never sees it flicker.

   The three choices are ONE class, on purpose (D25: equal prominence, no dark pattern) --
   the day somebody makes Accept gold and Reject a grey link, this rule and the check that
   counts the class are what say why they were the same.
   ============================================================ */

.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--navy); color: #fff; border-top: 3px solid var(--gold);
    max-height: 85vh; overflow-y: auto; box-shadow: 0 -6px 18px rgba(11, 27, 58, 0.25); }
.cookie-banner[hidden] { display: none; }
.cookie-inner { max-width: var(--grid); margin: 0 auto; padding: 1rem; display: grid; gap: 0.7rem; }
.cookie-banner h2 { margin: 0; font-size: 1.05rem; color: #fff; }
.cookie-banner h2:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.cookie-banner p { margin: 0; font-size: 0.9375rem; }
.cookie-banner a { color: var(--blue-light); }
.cookie-banner .small { color: var(--blue-light); display: block; font-weight: 400; }

.cookie-choices { display: grid; gap: 0.7rem; padding-top: 0.7rem;
    border-top: 1px solid rgba(219, 233, 247, 0.25); }
.cookie-choices[hidden] { display: none; }
.cookie-cat label { display: flex; gap: 0.5rem; align-items: baseline; font-weight: 600; }
.cookie-cat input { width: auto; margin: 0; accent-color: var(--gold); }

.cookie-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.cookie-btn { flex: 1 1 13rem; background: var(--gold); color: var(--navy); border: 0;
    min-height: 2.75rem; font-weight: 600; }
.cookie-btn:hover { background: var(--gold-dark); color: var(--navy); }
.cookie-btn[hidden] { display: none; }

/* ============================================================ 14. print */

@media print {
    .site-header, .site-footer, .account-nav, .cookie-banner,
    .skip-link, .no-print, .flash, .toc, .crumbs, .hero-actions,
    .article-nav, .series, .video { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .site-main { max-width: none; padding: 0; }
    .invoice { border: 0; max-width: none; }
    .hero { background: none !important; color: #000; }
    .hero h1, .hero-lead, .hero-eyebrow { color: #000; }
    .card, .feature, .callout, .shot img { border: 1px solid #999; box-shadow: none; }
    /* A printed link is useless unless it says where it goes -- except the ones on itself. */
    .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 85%; word-break: break-all; }
    .grid { font-size: 9pt; }
    h1, h2, h3 { page-break-after: avoid; }
    .shot, .card, .feature, blockquote, table { page-break-inside: avoid; }
}

/* A visitor who asked for less motion gets none of ours. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
