/* ==========================================================================
   SunriseStep — site theme (layered on Bootstrap 5.3)
   ========================================================================== */

:root {
    --brand-navy: #0b1526;
    --brand-navy-2: #13223b;
    --brand-navy-light: #1e3a6b;      /* lighter end of navy gradients */
    --brand-accent: #14b8a6;
    --brand-accent-hover: #0d9488;
    --accent-light: #5eead4;          /* gradient partner for the accent */
    --accent-rgb: 20, 184, 166;       /* accent as RGB, for translucent glows */
    --accent-on-dark: #99f6e4;        /* accent-tinted text on navy */
    --accent-soft-bg: #e6fbf8;        /* tinted backgrounds (tiles, pills) */
    --accent-softer-bg: #f0fdfa;      /* very light tint (tips, blockquotes) */
    --accent-soft-border: #99f6e4;
    --accent-strong-text: #0f766e;    /* accent-coloured text on light backgrounds */
    --accent-deep-text: #115e59;      /* darker accent text for headers */
    --accent-btn-text: #042f2e;       /* text on accent-filled buttons */
    --brand-primary: #2563eb;
    --brand-primary-hover: #1d4ed8;
    --brand-primary-soft: #eef3ff;
    --primary-rgb: 37, 99, 235;       /* primary as RGB, for focus rings and shadows */
    --primary-border: #c7d6fb;        /* light primary-tinted borders */
    --primary-border-strong: #a9c0f8;
    --surface: #ffffff;
    --surface-muted: #f6f8fb;
    --border-soft: #e5e9f0;
    --text-strong: #0f172a;
    --text-body: #334155;
    --text-muted: #64748b;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .06);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, .06), 0 10px 24px -6px rgba(15, 23, 42, .10);
    --shadow-lg: 0 20px 40px -12px rgba(15, 23, 42, .25);

    /* Bootstrap overrides */
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--text-body);
    --bs-body-bg: var(--surface-muted);
    --bs-emphasis-color: var(--text-strong);
    --bs-secondary-color: var(--text-muted);
    --bs-border-color: var(--border-soft);
    --bs-link-color: var(--brand-primary);
    --bs-link-color-rgb: var(--primary-rgb);
    --bs-link-hover-color: var(--brand-primary-hover);
    --bs-link-hover-color-rgb: 29, 78, 216;
    --bs-primary: var(--brand-primary);
    --bs-primary-rgb: var(--primary-rgb);
    --bs-border-radius: var(--radius-sm);
    --bs-border-radius-lg: var(--radius);
}

html { scroll-behavior: smooth; }

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: .975rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-strong);
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.25;
}
h1, .h1 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.35rem); }

.text-muted { color: var(--text-muted) !important; }

main.site-main { flex: 1 0 auto; padding-bottom: 4rem; }

/* ----- Buttons ---------------------------------------------------------- */
.btn {
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: .55rem 1.1rem;
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn-sm { padding: .35rem .75rem; font-size: .85rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1.02rem; }
.btn-primary {
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary-hover);
    --bs-btn-hover-border-color: var(--brand-primary-hover);
    --bs-btn-active-bg: var(--brand-primary-hover);
    --bs-btn-active-border-color: var(--brand-primary-hover);
    box-shadow: 0 6px 16px -6px rgba(var(--primary-rgb), .55);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-outline-primary {
    --bs-btn-color: var(--brand-primary);
    --bs-btn-border-color: var(--primary-border);
    --bs-btn-hover-bg: var(--brand-primary-soft);
    --bs-btn-hover-color: var(--brand-primary-hover);
    --bs-btn-hover-border-color: var(--primary-border-strong);
    --bs-btn-active-bg: var(--brand-primary);
    --bs-btn-active-border-color: var(--brand-primary);
}
.btn-outline-secondary {
    --bs-btn-color: var(--text-strong);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--border-soft);
    --bs-btn-hover-bg: var(--surface-muted);
    --bs-btn-hover-color: var(--text-strong);
    --bs-btn-hover-border-color: #cbd5e1;
}
.btn-success {
    --bs-btn-bg: #059669;
    --bs-btn-border-color: #059669;
    --bs-btn-hover-bg: #047857;
    --bs-btn-hover-border-color: #047857;
}
.btn-accent {
    --bs-btn-color: var(--accent-btn-text);
    --bs-btn-bg: var(--brand-accent);
    --bs-btn-border-color: var(--brand-accent);
    --bs-btn-hover-color: var(--accent-btn-text);
    --bs-btn-hover-bg: var(--brand-accent-hover);
    --bs-btn-hover-border-color: var(--brand-accent-hover);
    --bs-btn-active-bg: var(--brand-accent-hover);
    box-shadow: 0 8px 20px -8px rgba(var(--accent-rgb), .7);
}
.btn-accent:hover { transform: translateY(-1px); }
.btn-hero-secondary {
    --bs-btn-color: var(--text-strong);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #cbd5e1;
    --bs-btn-hover-color: var(--text-strong);
    --bs-btn-hover-bg: #fff;
    --bs-btn-hover-border-color: #94a3b8;
    --bs-btn-active-bg: #f8fafc;
    --bs-btn-active-border-color: #94a3b8;
}

/* ----- Navbar ----------------------------------------------------------- */
/* Sticky wrapper for the navbar + certification toolbar; both stay visible while scrolling. */
.site-header { z-index: 1030; }
.site-nav {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border-soft);
    padding: .7rem 0;
}
.site-nav .navbar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--brand-navy);
}
.site-nav .navbar-brand:hover { color: var(--brand-navy); }
.site-nav .brand-word-accent { color: var(--brand-accent-hover); }
.brand-logo { display: block; flex-shrink: 0; }
.brand-word-accent { color: var(--accent-light); }
.brand-sub { color: rgba(255, 255, 255, .55); font-weight: 500; }
.site-nav .nav-link {
    position: relative;
    color: #475569;
    font-weight: 500;
    font-size: .92rem;
    padding: .45rem .85rem !important;
    border-radius: 8px;
}
.site-nav .nav-link:hover, .site-nav .nav-link:focus { color: var(--brand-navy); background: #f1f5f9; }
/* Current page: dark text with a short teal underline. */
.site-nav .nav-link.active { color: var(--brand-navy); font-weight: 600; }
.site-nav .nav-link.active::after {
    content: "";
    position: absolute;
    left: .85rem;
    right: .85rem;
    bottom: 1px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-accent);
}
.site-nav .nav-user {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .75rem .25rem .25rem !important;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: #fff;
    color: var(--text-strong);
    font-weight: 600;
}
.site-nav .nav-user:hover, .site-nav .nav-user:focus { background: #f8fafc; border-color: #cbd5e1; }
.avatar {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, var(--brand-primary-hover));
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.site-nav .dropdown-menu {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: .4rem;
}
.site-nav .dropdown-item { border-radius: 6px; font-size: .9rem; padding: .45rem .75rem; }

/* ----- Hero / page header ---------------------------------------------- */
/* Homepage banner: light background with soft teal, blue and amber tints, and a cluster of exam badges on the right. */
.hero {
    position: relative;
    overflow: hidden;
    color: var(--text-body);
    background:
        radial-gradient(620px 460px at 76% 46%, rgba(var(--primary-rgb), .13), transparent 65%),
        radial-gradient(420px 320px at 92% 90%, rgba(245, 158, 11, .12), transparent 65%),
        radial-gradient(520px 320px at 0% 0%, rgba(var(--accent-rgb), .13), transparent 60%),
        linear-gradient(180deg, #fff 0%, #f3f6fa 100%);
    padding: 4rem 0 6rem;
}
/* Gradient bar along the bottom edge in the vendor colours: AWS amber, Azure blue, purple, ISC2 green. */
.hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b 0%, #3ab0f0 35%, #a77bea 68%, #4ade80 100%);
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 { color: var(--brand-navy); font-size: clamp(2.1rem, 1.5rem + 2.6vw, 3.6rem); font-weight: 800; line-height: 1.05; letter-spacing: -.035em; }
.hero .lead { color: #475569; font-size: 1.15rem; max-width: 34rem; }
.hero .accent { color: var(--brand-accent-hover); }
/* Kicker above a page-header title, e.g. "AWS · SAA-C03 · EXAM OVERVIEW", in the header's vendor ink. */
.eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--v-ink, var(--accent-strong-text));
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.hero-cluster { display: none; position: relative; height: 420px; }
@media (min-width: 992px) {
    .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
    .hero-cluster { display: block; }
}
.hero-orbit { position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.hero-orbit-outer { width: 330px; height: 330px; border: 1px solid #dfe5ee; }
.hero-orbit-inner { width: 220px; height: 220px; border: 1px dashed #b6e9e1; }
/* Each orb is offset from the cluster's centre: the centre orb, then top left, top right, bottom left and bottom right. */
.hero-badge {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px)));
}
.hero-badge-2 { --dx: -125px; --dy: -106px; }
.hero-badge-3 { --dx: 131px; --dy: -88px; }
.hero-badge-4 { --dx: -112px; --dy: 110px; }
.hero-badge-5 { --dx: 125px; --dy: 102px; }
/* Glass orbs: a white highlight over a sphere in the vendor's colours (purple unless the vendor has its own). */
.hero-orb {
    --orb-from: #b48cf2;
    --orb-to: #4b2593;
    display: block;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0, rgba(255, 255, 255, 0) 26%),
        radial-gradient(circle at 50% 50%, var(--orb-from) 0%, var(--orb-to) 100%);
    box-shadow: 0 18px 30px -14px var(--orb-to), inset 0 -8px 18px rgba(0, 0, 0, .12);
}
.hero-orb.provider-aws { --orb-from: #ffd65c; --orb-to: #d97706; }
.hero-orb.provider-microsoft { --orb-from: #3ab0f0; --orb-to: #0a4d9c; }
.hero-orb.provider-isc2 { --orb-from: #4ade80; --orb-to: #047857; }
.hero-badge-1 .hero-orb { width: 104px; height: 104px; }
.hero-badge-2 .hero-orb { width: 76px; height: 76px; }
.hero-badge-4 .hero-orb { width: 64px; height: 64px; }
.hero-badge-5 .hero-orb { width: 56px; height: 56px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2.5rem; }
.hero-stats > div { padding: .85rem 1.25rem; border-radius: 14px; background: #fff; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); }
.hero-stats .stat-value { font-size: 1.4rem; font-weight: 800; color: var(--text-strong); line-height: 1.15; }
.hero-stats .stat-label { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }
{ font-size: .82rem; color: rgba(255, 255, 255, .55); margin-top: .35rem; }

/* Vendor colour tokens shared by the page header and certification toolbar.
   .page-header on its own (e.g. the upgrade page) uses the brand teal; .vendor-theme switches to the
   vendor's colours, purple unless the vendor has its own (as for the badge ring). */
.page-header {
    --v-from: #d3f6f0;
    --v-to: #e8faf6;
    --v-border: #aee6dc;
    --v-rgb: 13, 148, 136;
    --v-ink: #0f766e;
    --v-muted: #4b6b66;
    --v-soft: #ccf5ee;
}
.vendor-theme {
    --v-from: #e9defd;
    --v-to: #f4eefe;
    --v-border: #d6c4f4;
    --v-rgb: 75, 37, 147;
    --v-ink: #4b2593;
    --v-muted: #6b5a8a;
    --v-soft: #efe6fd;
}
.vendor-theme.provider-aws { --v-from: #ffedc2; --v-to: #fff6df; --v-border: #f0d49a; --v-rgb: 217, 119, 6; --v-ink: #9a4b05; --v-muted: #7c5a2a; --v-soft: #fff3d1; }
.vendor-theme.provider-microsoft { --v-from: #d6eaff; --v-to: #eaf4ff; --v-border: #bcd8f7; --v-rgb: 10, 77, 156; --v-ink: #0a4d9c; --v-muted: #3b5b85; --v-soft: #dff0ff; }
.vendor-theme.provider-isc2 { --v-from: #cff3df; --v-to: #e6f9ee; --v-border: #ade4c5; --v-rgb: 4, 120, 87; --v-ink: #047857; --v-muted: #3f6b57; --v-soft: #dcfce7; }

/* A band washed in the vendor colour, with a large faded ring (the badge shape) in the top-right corner. */
.page-header {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, var(--v-from) 0%, var(--v-to) 100%);
    border-bottom: 1px solid var(--v-border);
    color: var(--text-strong);
    padding: 2.75rem 0 3.25rem;
    margin-bottom: -1.5rem;
}
.page-header::before,
.page-header::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.page-header::before { right: -90px; top: -110px; width: 420px; height: 420px; border: 44px solid rgba(var(--v-rgb), .11); }
.page-header::after { right: -20px; top: -40px; width: 280px; height: 280px; border: 2px dashed rgba(var(--v-rgb), .24); }
.page-header > .container { position: relative; z-index: 1; }
.page-header h1 { color: var(--text-strong); margin-bottom: .5rem; }
.page-header p { color: #475569; max-width: 46rem; margin-bottom: 0; }
.page-header .back-link { color: var(--v-muted); }
.page-header .back-link:hover { color: var(--v-ink); }

.overlap { position: relative; z-index: 2; margin-top: -3rem; }

/* ----- Back link / breadcrumbs ----------------------------------------- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: .75rem;
}
.back-link:hover { color: var(--brand-primary); }
.crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .5rem;
    font-size: .88rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: .75rem;
}
.crumbs a { color: var(--brand-primary); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--text-muted); }
.crumbs .sep { opacity: .5; }

/* ----- Section headings ------------------------------------------------- */
.section-title { font-size: 1.35rem; margin-bottom: .25rem; }
.section-sub { color: var(--text-muted); margin-bottom: 1.5rem; }

/* ----- Cards ------------------------------------------------------------ */
.card {
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--border-soft);
    --bs-card-border-radius: var(--radius);
    --bs-card-cap-bg: var(--surface);
    box-shadow: var(--shadow-sm);
}
.card-header { font-weight: 600; color: var(--text-strong); padding: .9rem 1.25rem; }
.card-body { padding: 1.5rem; }

.card-hover {
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-border);
}

.cert-card { overflow: hidden; }
/* Light header with a soft glow in the vendor's colour behind the badge (provider-* classes below).
   Purple is the default for HashiCorp, FinOps and any other vendor without its own colour. */
.cert-card .cert-top {
    --cert-glow: 167, 123, 234;
    --cert-soft: #efe6fd;
    --cert-ink: #4b2593;
    min-height: 9rem;  /* room for the code pill plus a three-line name, so every banner matches */
    padding: 1.4rem 1.5rem 1.2rem;
    background:
        radial-gradient(220px 180px at 100% 0%, rgba(var(--cert-glow), .32), transparent 70%),
        linear-gradient(180deg, #fbfcfe 0%, #f2f5f9 100%);
    border-bottom: 1px solid #eef2f7;
    color: var(--text-strong);
    position: relative;
}
.cert-card .cert-top.provider-aws { --cert-glow: 245, 158, 11; --cert-soft: #fff3d1; --cert-ink: #9a4b05; }
.cert-card .cert-top.provider-microsoft { --cert-glow: 58, 176, 240; --cert-soft: #dff0ff; --cert-ink: #0a4d9c; }
.cert-card .cert-top.provider-isc2 { --cert-glow: 74, 222, 128; --cert-soft: #dcfce7; --cert-ink: #047857; }
.cert-card .cert-code {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    padding: .2rem .55rem;
    border-radius: 6px;
    background: var(--cert-soft);
    color: var(--cert-ink);
}
.cert-card .cert-name {
    color: var(--text-strong);
    font-size: 1.25rem;
    line-height: 1.5;
    margin: .75rem 0 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.feature-card { height: 100%; padding: 1.5rem; }
.feature-card h3 { font-size: 1.02rem; margin: 1rem 0 .4rem; }
.feature-card p { color: var(--text-muted); font-size: .9rem; margin: 0; }

.icon-tile {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    flex-shrink: 0;
}
.icon-tile svg { width: 22px; height: 22px; }
.icon-tile.accent { background: var(--accent-soft-bg); color: var(--accent-strong-text); }
.icon-tile.green { background: #e7f8f1; color: #047857; }
.icon-tile.violet { background: #f1edff; color: #6d28d9; }

.module-card .module-initials {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-light));
    color: #ff9900;
    font-weight: 800;
    font-size: .85rem;
    letter-spacing: .02em;
}
.module-card .card-title { font-size: 1.02rem; margin: 0; }
.module-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--border-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 1.5rem;
}
.module-card .arrow { color: var(--text-muted); transition: transform .2s ease, color .2s ease; }
.module-card:hover .arrow { color: var(--brand-primary); transform: translateX(3px); }

/* Circular topic-progress indicator in the top-right of a Study Guide card */
.progress-ring {
    --pct: 0;
    --ring-color: var(--brand-accent);
    flex-shrink: 0;
    margin-left: auto;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: conic-gradient(var(--ring-color) calc(var(--pct) * 1%), var(--border-soft) 0);
}
.progress-ring::before {
    content: "";
    grid-area: 1 / 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--surface);
}
.progress-ring > span {
    grid-area: 1 / 1;
    position: relative;
    font-size: .68rem;
    font-weight: 700;
    color: var(--text-muted);
}
.progress-ring.complete { --ring-color: #10b981; }
.progress-ring.complete > span { color: #047857; }

/* ----- Action tiles (certification page) ------------------------------- */
.action-tile {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    height: 100%;
    color: inherit;
    text-decoration: none;
}
.action-tile h3 { font-size: 1rem; margin: 0 0 .2rem; }
.action-tile p { font-size: .87rem; color: var(--text-muted); margin: 0; }

/* ----- Domains ---------------------------------------------------------- */
.domain-card + .domain-card { margin-top: 1rem; }
.domain-card .domain-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1.15rem 1.35rem;
    background: none;
    border: 0;
    text-align: left;
}
.domain-card .domain-num,
.landing-domain .domain-num {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-weight: 800;
    flex-shrink: 0;
}
.domain-card .domain-name { font-weight: 650; color: var(--text-strong); font-size: 1.02rem; }
.domain-card .weight { display: block; min-width: 150px; }
.domain-card .weight-bar {
    display: block;
    height: 6px;
    border-radius: 999px;
    background: #e8edf5;
    overflow: hidden;
    margin-top: .35rem;
}
.domain-card .weight-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-primary), #60a5fa);
}
.domain-card .chev { color: var(--text-muted); transition: transform .2s ease; }
.domain-card .domain-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.domain-card .domain-body { border-top: 1px solid var(--border-soft); padding: 1rem 1.35rem 1.35rem; }

.subdomain-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .75rem .9rem;
    border-radius: var(--radius-sm);
    color: var(--text-body);
    text-decoration: none;
    transition: background-color .15s ease;
}
.subdomain-link:hover { background: var(--surface-muted); color: var(--text-strong); }
.subdomain-link .code {
    font-size: .78rem;
    font-weight: 700;
    color: var(--brand-primary);
    background: var(--brand-primary-soft);
    padding: .15rem .5rem;
    border-radius: 6px;
    flex-shrink: 0;
}
.subdomain-link .arrow { margin-left: auto; color: #94a3b8; }

/* ----- Sidebar nav ------------------------------------------------------ */
.side-nav {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: .75rem;
}
.side-nav-section + .side-nav-section {
    margin-top: .5rem;
    padding-top: .75rem;
    border-top: 1px solid var(--border-soft);
}
.side-nav-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: .35rem .65rem .4rem;
}
.side-nav-link {
    display: block;
    padding: .45rem .65rem;
    border-radius: 8px;
    font-size: .9rem;
    color: var(--text-body);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: background-color .15s ease, color .15s ease;
}
.side-nav-link:hover { background: var(--surface-muted); color: var(--text-strong); }
.side-nav-link.active {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-hover);
    font-weight: 600;
    border-left-color: var(--brand-primary);
}
.side-nav-link .code { font-weight: 700; color: var(--brand-primary); margin-right: .3rem; }
.side-nav-empty { padding: .35rem .65rem; font-size: .85rem; color: #94a3b8; }

/* Row icons and progress circles (_nav_icon.html, _step_icon.html). Both sit on the first line of a wrapped label. */
.side-nav-link .nav-icon { flex-shrink: 0; align-self: flex-start; margin-top: .15rem; color: #94a3b8; transition: color .15s ease; }
.side-nav-link:hover .nav-icon { color: var(--text-muted); }
.side-nav-link.active .nav-icon { color: var(--brand-primary); }
.step {
    flex-shrink: 0;
    align-self: flex-start;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: var(--surface);
    display: grid;
    place-items: center;
    position: relative;
    z-index: 1;
}
.step.done { border-color: #059669; background: #059669; color: #fff; }
.side-nav-link.active .step:not(.done) { border-color: var(--brand-primary); background: var(--brand-primary); box-shadow: inset 0 0 0 3px var(--surface); }
/* The lessons are joined by a line through their circles, from the first circle's centre to the last. */
.side-nav-track .side-nav-link { position: relative; }
.side-nav-eyebrow {
    display: block;
    margin-bottom: .1rem;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.side-nav-link.active .side-nav-eyebrow { color: var(--brand-primary); }
.side-nav-track .side-nav-link::before {
    content: "";
    position: absolute;
    left: calc(.65rem + 8px);
    top: 0;
    bottom: 0;
    border-left: 2px solid var(--border-soft);
}
.side-nav-track .side-nav-link:first-of-type::before { top: calc(.45rem + 11px); }
.side-nav-track .side-nav-link:last-of-type::before { bottom: calc(100% - .45rem - 11px); }
.side-nav-wrap { z-index: 1; }

/* Module switcher at the top of the sidebar (_module_switcher.html). */
.module-switch .dropdown { position: relative; }
.module-switch-btn {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .5rem .6rem;
    text-align: left;
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    color: var(--text-body);
    transition: border-color .15s ease;
}
.module-switch-btn:hover, .module-switch-btn[aria-expanded="true"] { border-color: var(--brand-primary); }
.module-switch-btn:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.module-switch-num {
    display: grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-weight: 700;
    font-size: .85rem;
    font-variant-numeric: tabular-nums;
}
.module-switch-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.module-switch-kicker {
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.module-switch-name { font-weight: 600; font-size: .9rem; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-switch-chev { flex: none; color: var(--text-muted); transition: transform .2s ease; }
.module-switch-btn[aria-expanded="true"] .module-switch-chev { transform: rotate(180deg); }
.module-switch-menu {
    width: min(340px, calc(100vw - 2rem));
    max-height: min(60vh, 26rem);
    overflow-y: auto;
    margin-top: .35rem !important;
    padding: .35rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.module-switch-menu-title {
    padding: .4rem .55rem .3rem;
    font-size: .66rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.module-switch-item {
    display: grid;
    grid-template-columns: 1.4rem minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem;
    padding: .4rem .55rem;
    border-radius: 8px;
    font-size: .87rem;
    color: var(--text-body);
    white-space: normal;
}
.module-switch-item:hover, .module-switch-item:focus { background: var(--surface-muted); color: var(--text-strong); }
.module-switch-item.active, .module-switch-item.active:hover { background: var(--brand-primary-soft); color: var(--brand-primary-hover); font-weight: 600; }
.module-switch-item-num { font-size: .75rem; font-weight: 700; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.module-switch-item.active .module-switch-item-num { color: var(--brand-primary); }
.module-switch-item-name { line-height: 1.35; }
.module-switch-bar { width: 2.6rem; height: 5px; border-radius: 3px; background: var(--border-soft); overflow: hidden; }
.module-switch-bar i { display: block; height: 100%; background: #059669; }
/* A little more room than between other sidebar sections, to set the switcher apart from the module's own pages. */
.module-switch + .side-nav-section { margin-top: .85rem; padding-top: 1rem; }
/* Below lg: the "This module / All modules" switch and the inline module list. */
.module-switch-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .2rem;
    padding: .2rem;
    margin-bottom: .5rem;
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
}
.module-switch-tab {
    padding: .3rem .5rem;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text-muted);
}
.module-switch-tab.active { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-sm); }
.module-switch-tab:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.module-switch-all { margin-bottom: .25rem; }
.module-switch-all .module-switch-item { text-decoration: none; }
@media (max-width: 991.98px) {
    .side-nav.show-all-modules > .side-nav-section:not(.module-switch) { display: none; }
}

/* Below lg the sidebar collapses behind a toggle bar showing the current page. */
.side-nav-toggle {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    padding: .7rem .85rem;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-body);
}
.side-nav-toggle:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.side-nav-toggle-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}
.side-nav-toggle-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.side-nav-toggle-kicker {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.side-nav-toggle-current {
    font-weight: 600;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.side-nav-toggle-chev { flex: none; color: var(--text-muted); transition: transform .2s ease; }
.side-nav-toggle[aria-expanded="true"] {
    border-bottom-color: transparent;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.side-nav-toggle[aria-expanded="true"] .side-nav-toggle-chev { transform: rotate(180deg); }
@media (max-width: 991.98px) {
    .side-nav {
        border-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
        max-height: 60vh;
        overflow-y: auto;
    }
}
@media (prefers-reduced-motion: reduce) {
    .side-nav-toggle-chev { transition: none; }
}

/* ----- Further reading -------------------------------------------------- */
.further-reading-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.further-reading-list li + li { border-top: 1px solid var(--border-soft); }
.further-reading-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .7rem .25rem;
    color: var(--text-body);
    text-decoration: none;
}
.further-reading-list a:hover { color: var(--brand-primary); }
.further-reading-list .external-icon { flex-shrink: 0; color: var(--text-muted); }
.further-reading-list a:hover .external-icon { color: var(--brand-primary); }

/* ----- List groups ------------------------------------------------------ */
.list-group {
    --bs-list-group-bg: var(--surface);
    --bs-list-group-border-color: var(--border-soft);
    --bs-list-group-border-radius: var(--radius);
    --bs-list-group-active-bg: var(--brand-primary);
    --bs-list-group-active-border-color: var(--brand-primary);
}
.list-group-item { padding: .9rem 1.25rem; }
.list-group-item-action:hover { background: var(--surface-muted); }

/* ----- Article content -------------------------------------------------- */
.content-card .card-body { padding: 2rem 2.25rem; }
@media (max-width: 575.98px) { .content-card .card-body { padding: 1.4rem 1.25rem; } }

/* Lesson header: position in the module above the lesson title, divided from the content. */
.lesson-header { padding: 1.9rem 2.25rem 1.5rem; border-bottom: 1px solid var(--border-soft); }
.lesson-header-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .2rem .6rem;
    margin-bottom: .6rem;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--accent-strong-text);
}
.lesson-header-kicker .sep { color: #cbd5e1; }
.lesson-header-module { color: var(--text-muted); }
.lesson-header h1 { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.content-card .lesson-header + .card-body { padding-top: 1.5rem; }
@media (max-width: 575.98px) {
    .lesson-header { padding: 1.4rem 1.25rem 1.1rem; }
    .lesson-header h1 { font-size: 1.6rem; }
    .content-card .lesson-header + .card-body { padding-top: 1.1rem; }
}

.keynote-content { color: var(--text-body); font-size: 1rem; line-height: 1.75; }
.keynote-content h1 { font-size: 1.9rem; margin-bottom: 1rem; }
.keynote-content h2 {
    font-size: 1.4rem;
    margin-top: 2.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-soft);
}
.keynote-content h3 { font-size: 1.5rem; margin-top: 2.5rem; }
.keynote-content h4 { margin-top: 1.25rem; font-size: 1.02rem; }
.keynote-content > :first-child:not(.btn-group),
.keynote-content > div:first-child:not(.btn-group) > :first-child,
.keynote-content > .btn-group:first-child + div > :first-child,
.keynote-content h2:first-child, .keynote-content h3:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.keynote-content ul, .keynote-content ol { padding-left: 1.3rem; }
.keynote-content li { margin-bottom: .3rem; }
.keynote-content li::marker { color: var(--brand-primary); }
.keynote-content .paragraph-block li::marker { color: #000; }
.keynote-content a { font-weight: 500; }
.keynote-content code {
    font-size: .87em;
    color: #000;
    background: #f5f2f7;
    padding: .12rem .38rem;
    border-radius: 5px;
}
.keynote-content pre {
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid var(--border-soft);
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    font-size: .87rem;
}
.keynote-content pre code { background: none; padding: 0; color: inherit; }
.keynote-content table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; font-size: .92rem; }
.keynote-content th, .keynote-content td { padding: .6rem .8rem; border: 1px solid var(--border-soft); }
.keynote-content th { background: var(--surface-muted); color: var(--text-strong); font-weight: 600; }
/* Tables outside a worked example: a rounded teal outline, a tinted header row with small uppercase labels, and
   row dividers only. Worked examples keep the plain grid above. */
.keynote-content table:not(.worked-example table) { overflow: hidden; border: 1px solid var(--accent-soft-border); border-radius: var(--radius-sm); border-collapse: separate; border-spacing: 0; line-height: 1.6; }
.keynote-content table:not(.worked-example table) :is(th, td) { padding: .75rem 1rem; text-align: left; vertical-align: top; border: 0; border-bottom: 1px solid var(--border-soft); background: none; }
.keynote-content table:not(.worked-example table) tr:last-child > :is(th, td) { border-bottom: 0; }
.keynote-content table:not(.worked-example table) tbody tr > :first-child { color: var(--text-strong); font-weight: 600; }
/* The header row: a <thead>, or a first row of <th> cells when the table has none. */
.keynote-content table:not(.worked-example table) thead th,
.keynote-content table:not(.worked-example table) > tbody:first-child > tr:first-child > th {
    background: var(--accent-soft-bg);
    color: var(--accent-strong-text);
    border-bottom: 1px solid var(--accent-soft-border);
    font-size: .74rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.keynote-content table:not(.worked-example table) thead tr:last-child > th { border-bottom: 1px solid var(--accent-soft-border); }
.keynote-content table:not(.worked-example table) tbody tr:hover > td { background: var(--accent-softer-bg); }
.keynote-content blockquote {
    border-left: 3px solid var(--brand-accent);
    background: var(--accent-softer-bg);
    padding: .75rem 1rem;
    border-radius: 0 8px 8px 0;
    color: var(--text-body);
}
.keynote-content img { border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }

.tips-card { border-color: var(--accent-soft-border); }
.tips-card .card-header { background: var(--accent-softer-bg); color: var(--accent-deep-text); border-bottom-color: var(--accent-soft-border); }

/* ----- Quiz / exam ------------------------------------------------------ */
.question-card .card-title { font-size: 1.05rem; line-height: 1.5; margin-bottom: 1rem; }
.question-card .q-num {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 28px;
    margin-right: .5rem;
    border-radius: 8px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-size: .82rem;
    font-weight: 700;
    vertical-align: 2px;
}
.question-card .form-check {
    padding: .7rem .9rem .7rem 2.6rem;
    margin-bottom: .5rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, background-color .15s ease;
}
.question-card .form-check:hover { border-color: var(--primary-border); background: #fafcff; }
.question-card .form-check:has(.form-check-input:checked) { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.question-card .form-check-input { margin-left: -1.7rem; }
.question-card .form-check-label { width: 100%; cursor: pointer; }
.question-card.border-success { border-left: 4px solid #059669 !important; }
.question-card.border-danger { border-left: 4px solid #dc2626 !important; }
.form-check-input:checked { background-color: var(--brand-primary); border-color: var(--brand-primary); }

.score-ring {
    --pct: 0;
    --ring: var(--brand-primary);
    width: 132px;
    height: 132px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: conic-gradient(var(--ring) calc(var(--pct) * 1%), #e8edf5 0);
    flex-shrink: 0;
}
.score-ring > div {
    width: 106px;
    height: 106px;
    border-radius: 50%;
    background: var(--surface);
    display: grid;
    place-items: center;
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--text-strong);
}

/* Skill check (end of a skill page) */
.skill-check-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem 1.75rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.skill-check-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand-accent), var(--accent-light));
}
.skill-check-card.is-passed::before { background: linear-gradient(90deg, #059669, #34d399); }
.skill-check-card + form { margin-top: 1rem; }
.skill-check-head { display: flex; align-items: center; gap: 1.1rem; }
.skill-check-head .icon-tile { flex-shrink: 0; align-self: flex-start; }
.skill-check-intro { flex: 1; min-width: 0; }
.skill-check-title { font-size: 1.25rem; margin: 0; }
.skill-check-sub { color: var(--text-muted); margin: .2rem 0 0; }
.skill-check-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; margin-top: .7rem; }
.skill-check-last { font-size: .82rem; color: var(--text-muted); }
.skill-check-start { flex-shrink: 0; }
@media (max-width: 575.98px) {
    .skill-check-card { padding: 1.25rem; }
    .skill-check-head { flex-wrap: wrap; }
    .skill-check-start { width: 100%; }
}

.skill-check-result {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    padding: 1rem 1.2rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}
.skill-check-result.passed { background: #ecfdf5; border-color: #a7f3d0; }
.skill-check-result.retry { background: #fffbeb; border-color: #fde68a; }
.skill-check-result h3 { font-size: 1rem; margin: 0 0 .15rem; }
.skill-check-result.passed h3 { color: #047857; }
.skill-check-result.retry h3 { color: #b45309; }
.skill-check-result p { margin: 0; font-size: .9rem; }
.skill-check-score { font-size: 1.9rem; font-weight: 800; line-height: 1; color: var(--text-strong); white-space: nowrap; }
.skill-check-score small { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.skill-check-tally { display: flex; gap: 4px; margin-top: .75rem; }
.skill-check-tally a { flex: 1; max-width: 48px; height: 6px; border-radius: 999px; background: #dc2626; }
.skill-check-tally a.ok { background: #059669; }

.sticky-submit {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.25rem;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

/* ----- Tables ----------------------------------------------------------- */
.table-modern { margin: 0; }
.table-modern thead th {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border-soft);
    padding: .8rem 1.25rem;
}
.table-modern td { padding: .95rem 1.25rem; vertical-align: middle; border-color: var(--border-soft); }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tbody tr:hover td { background: #fafcff; }
/* Bootstrap tables default to the page background; this keeps the rows white inside a card. */
.table-white { --bs-table-bg: var(--surface); }

/* ----- Badges / pills --------------------------------------------------- */
.badge { font-weight: 600; border-radius: 6px; padding: .35em .6em; }
.pill-soft {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .76rem;
    font-weight: 600;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary-hover);
}
.pill-soft.green { background: #e7f8f1; color: #047857; }
.pill-soft.accent { background: var(--accent-soft-bg); color: var(--accent-strong-text); }
.pill-soft.red { background: #fdecec; color: #b42318; }
.pill-soft.gray { background: #eef1f5; color: var(--text-muted); }

/* ----- Alerts ----------------------------------------------------------- */
.alert { border-radius: var(--radius-sm); border-width: 1px; font-size: .93rem; }

/* ----- Forms (allauth etc.) -------------------------------------------- */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: #d5dce6;
    padding: .6rem .85rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .15);
}
.form-label { font-weight: 500; color: var(--text-strong); font-size: .9rem; }
.auth-card { border: 0; box-shadow: var(--shadow-md); }
.auth-title { font-size: 1.6rem; font-weight: 800; margin-bottom: .4rem; }
.auth-subtitle { color: var(--text-muted); font-size: .92rem; }
.auth-form .mb-3 { margin-bottom: 1rem !important; }
.auth-form .asteriskField { display: none; }  /* every field is required */
.auth-form .form-text { font-size: .8rem; color: var(--text-muted); }
.auth-form .form-text ul { padding-left: 1.1rem; margin: .35rem 0 0; }
.auth-form .form-check-label { font-size: .88rem; line-height: 1.5; }
.auth-terms {
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: .75rem .9rem;
    margin-bottom: 1rem;
}
.auth-terms .mb-3 { margin-bottom: 0 !important; }
.auth-terms .mb-3 + .mb-3 { margin-top: .6rem; }
.auth-terms .form-check { padding-left: 1.75rem; }
.auth-terms .form-check-input { margin-left: -1.75rem; margin-top: .2rem; }
.email-topic { padding: .65rem 0 .65rem 2.75rem; margin: 0; border-bottom: 1px solid var(--border-soft); }
.email-topic:last-of-type { border-bottom: 0; }
.email-topic .form-check-input { margin-left: -2.75rem; margin-top: .3rem; width: 2.2em; height: 1.2em; cursor: pointer; }
.email-topic .form-check-label { line-height: 1.45; cursor: pointer; }
.auth-readonly {
    padding: .6rem .85rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
    color: var(--text-strong);
}
.auth-password > div { position: relative; }
.auth-password .form-text { position: absolute; top: 0; right: 0; margin: 0; line-height: 1.65; }
.auth-password .form-text a { font-weight: 500; text-decoration: none; }
.btn-provider {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .06em;
}
.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--border-soft);
}
.auth-switch {
    margin: 1.5rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-soft);
    text-align: center;
    font-size: .9rem;
    color: var(--text-muted);
}
.auth-switch a { font-weight: 600; text-decoration: none; }

/* ----- Sign-in / sign-up (split layout) -------------------------------- */
/* The page gets a soft teal and blue glow; the brand panel sits on it and only the form is a card. */
body:has(.signin-wrap) {
    background:
        radial-gradient(900px 520px at 8% 0%, rgba(var(--accent-rgb), .20), transparent 60%),
        radial-gradient(800px 520px at 100% 640px, rgba(var(--primary-rgb), .18), transparent 60%),
        var(--surface-muted);
    background-attachment: fixed;
}
body:has(.signin-wrap) .site-nav { background: rgba(255, 255, 255, .55); border-bottom-color: rgba(15, 23, 42, .06); }

.signin-wrap { display: flex; justify-content: center; padding: 2rem 0 3rem; }
.signin-shell {
    width: 100%;
    max-width: 1080px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.signin-brand {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    min-width: 0;
    padding: .5rem 0;
    color: var(--text-body);
}
.signin-slogan { margin: 0; color: var(--text-strong); font-size: clamp(2rem, 1.4rem + 1.8vw, 2.75rem); font-weight: 800; line-height: 1.1; text-wrap: balance; }
.signin-slogan span { color: var(--accent-strong-text); }
.signin-lede { margin: .75rem 0 0; color: #475569; font-size: .95rem; line-height: 1.65; max-width: 30rem; }

/* Learn / Practise / Master cards, each offset further right like a staircase */
.signin-steps { list-style: none; margin: .4rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .9rem; }
.signin-steps li {
    display: flex;
    align-items: center;
    gap: .9rem;
    max-width: 330px;
    padding: .9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    box-shadow: 0 14px 28px -18px rgba(15, 23, 42, .30);
    font-size: .82rem;
    line-height: 1.45;
    color: var(--text-muted);
}
.signin-steps li:nth-child(2) { margin-left: 2.75rem; }
.signin-steps li:nth-child(3) { margin-left: 5.5rem; border-color: #fed7aa; box-shadow: 0 18px 32px -18px rgba(249, 115, 22, .40); }
.signin-steps strong { display: block; color: var(--text-strong); font-size: .94rem; font-weight: 700; }
.signin-step-icon {
    flex: none;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft-bg);
    color: var(--accent-strong-text);
}
.signin-steps li:nth-child(3) .signin-step-icon { background: linear-gradient(180deg, #fde047, #f97316); color: #fff; }

.signin-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.25rem;
    min-width: 0;
    padding: 2.5rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 28px;
    box-shadow: 0 24px 48px -24px rgba(15, 23, 42, .22);
}
.signin-main .auth-title { margin-bottom: .25rem; font-size: 1.9rem; letter-spacing: -.02em; }
.signin-main a { color: var(--accent-strong-text); }
.signin-main a:hover { color: var(--accent-deep-text); }
.signin-main .auth-switch { margin: 0; padding-top: 0; border-top: 0; font-size: .95rem; }

.signin-form { display: flex; flex-direction: column; gap: 1rem; margin: 0; }

/* Fields: label above a pill-shaped input; email and password inputs carry a leading icon */
.signin-field label { display: block; margin-bottom: .35rem; font-size: .9rem; font-weight: 600; color: var(--text-strong); }
.signin-field input:not([type="checkbox"]) {
    width: 100%;
    height: 50px;
    padding: 0 1.1rem;
    border: 1px solid #d5dce6;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-strong);
    font-size: .95rem;
}
.signin-field input:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), .18);
}
.signin-field.has-error input { border-color: #dc2626; }
.signin-error { margin-top: .3rem; padding: 0 .5rem; font-size: .8rem; color: #dc2626; }
.signin-input-wrap { position: relative; }
.signin-input-wrap.has-icon input { padding-left: 2.9rem; }
.signin-input-wrap:has(.signin-show) input { padding-right: 4.6rem; }
.signin-input-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.signin-show {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    height: 38px;
    padding: 0 .9rem;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text-body);
    font-size: .8rem;
    font-weight: 600;
}
.signin-show:hover { background: #e2e8f0; color: var(--text-strong); }
.signin-show:focus-visible { outline: 2px solid var(--brand-accent); outline-offset: 1px; }

.signin-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem; font-size: .88rem; }
.signin-row a { font-weight: 600; text-decoration: none; }
.signin-check { display: flex; align-items: flex-start; gap: .5rem; margin: 0; cursor: pointer; font-size: .88rem; line-height: 1.45; }
.signin-check input { flex: none; width: 16px; height: 16px; margin-top: .15rem; accent-color: var(--accent-strong-text); }

.signin-submit {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--brand-navy);
    --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--brand-navy-light);
    --bs-btn-hover-border-color: var(--brand-navy-light);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--brand-navy-light);
    --bs-btn-active-border-color: var(--brand-navy-light);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    height: 52px;
    border-radius: 999px;
}
.signin-submit svg { color: var(--accent-light); }

/* Sign-up extras: side-by-side name fields, password rules, and the consent box */
.signin-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.signin-help { margin-top: .3rem; padding: 0 .5rem; font-size: .78rem; color: var(--text-muted); }
.signin-help ul { margin: 0; padding-left: 1.1rem; }
.signin-consent {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: .85rem 1rem;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--surface-muted);
}
.signin-consent a { font-weight: 600; text-decoration: none; }

/* Passkey and sign-in code: outlined pill buttons, side by side */
.signin-alt { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .65rem; }
.signin-main .signin-alt a, .signin-alt button {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    border: 1px solid #d5dce6;
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-strong);
    font-size: .88rem;
    font-weight: 600;
    text-decoration: none;
}
.signin-main .signin-alt a:hover, .signin-alt button:hover { border-color: #94a3b8; color: var(--text-strong); }

@media (max-width: 860px) {
    .signin-shell { grid-template-columns: 1fr; gap: 2rem; max-width: 520px; }
    .signin-main { padding: 1.75rem 1.4rem; border-radius: 22px; }
    .signin-steps li:nth-child(2) { margin-left: 1.5rem; }
    .signin-steps li:nth-child(3) { margin-left: 3rem; }
    /* Sign-in shows the form first on phones; sign-up keeps the brand text on top but drops the cards. */
    .form-first .signin-brand { order: 2; }
    .signin-shell:not(.form-first) .signin-steps { display: none; }
}
@media (max-width: 420px) {
    .signin-pair { grid-template-columns: 1fr; }
}

/* ----- Sign-out confirmation ------------------------------------------- */
.signout-wrap { display: flex; justify-content: center; padding: 2rem 0 3rem; }
.signout-card {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.signout-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .9rem;
    padding: 2rem 2rem 1.5rem;
    background: var(--accent-softer-bg);
    border-bottom: 1px solid var(--accent-soft-bg);
    text-align: center;
}
.signout-icon {
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent-strong-text);
    box-shadow: 0 0 0 6px var(--accent-soft-bg);
}
.signout-head .auth-title { margin: 0; text-wrap: balance; }
.signout-head p { margin: -.4rem 0 0; max-width: 32ch; color: var(--text-muted); font-size: .92rem; }
.signout-body { display: flex; flex-direction: column; gap: 1.25rem; padding: 1.5rem 2rem 2rem; }
.signout-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    padding: .7rem .85rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-muted);
}
.signout-avatar {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft-bg);
    color: var(--accent-strong-text);
    font-size: .9rem;
    font-weight: 700;
}
.signout-user div { min-width: 0; line-height: 1.35; }
.signout-user small { display: block; font-size: .75rem; color: var(--text-muted); }
.signout-user strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-strong); font-size: .9rem; font-weight: 600; }
.signout-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 0; }
.signout-stay { background: var(--surface); color: var(--text-strong); border: 1px solid var(--border-soft); }
.signout-stay:hover { background: var(--surface-muted); color: var(--text-strong); border-color: #cbd5e1; }
.signout-tip { margin: 0; font-size: .8rem; color: var(--text-muted); text-align: center; }
@media (max-width: 420px) {
    .signout-head { padding: 1.75rem 1.25rem 1.25rem; }
    .signout-body { padding: 1.25rem; }
    .signout-actions { grid-template-columns: 1fr; }
    .signout-actions .btn-primary { order: -1; }
}

/* ----- Empty states ----------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px dashed #d5dce6;
    border-radius: var(--radius);
}

/* ----- Reading cards (key concept flashcards) -------------------------- */
.read-deck { max-width: 720px; }
.read-card {
    position: relative;
    min-height: 300px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.read-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
}
.read-card .card-body { padding: 2.25rem 2.5rem; }
@media (max-width: 575.98px) { .read-card .card-body { padding: 1.75rem 1.4rem; } }
.read-card-term { font-size: 1.45rem; margin-bottom: 1rem; }
.read-card .keynote-content > :last-child { margin-bottom: 0; }

/* ----- Lab mode toggle -------------------------------------------------- */
.btn-group .btn-outline-primary.active { color: #fff; }

/* ----- Footer ----------------------------------------------------------- */
.site-footer {
    flex-shrink: 0;
    background: var(--brand-navy);
    color: rgba(255, 255, 255, .55);
    font-size: .87rem;
    padding: 2.25rem 0;
}
.site-footer a { color: rgba(255, 255, 255, .75); text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ----- Module search ---------------------------------------------------- */
.module-search { position: relative; width: 100%; max-width: 320px; flex-shrink: 0; }
.module-search svg {
    position: absolute;
    left: .85rem;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.module-search .form-control { padding-left: 2.5rem; background: var(--surface); }
@media (max-width: 767.98px) { .module-search { max-width: none; } }
/* Search matches on the homepage certification cards; inherits the text colour so it works on the navy banner too */
.cert-card mark { background: rgba(var(--accent-rgb), .35); color: inherit; border-radius: 3px; padding: 0 1px; }
#study-guide { scroll-margin-top: 80px; }

/* ----- Report a problem ------------------------------------------------- */
.report-link {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: 0;
    border: 0;
    background: none;
    font-size: .82rem;
    color: var(--text-muted);
}
.report-link:hover, .report-link:focus-visible { color: var(--brand-primary); text-decoration: underline; }
.report-footer { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-soft); }

/* ----- Login-only content ---------------------------------------------- */
.lock-icon { flex-shrink: 0; color: var(--text-muted); opacity: .8; }
.side-nav-link.active .lock-icon { color: inherit; }
.unlock-card {
    position: relative;
    overflow: hidden;
    margin: .15rem 0;
    padding: 1rem;
    border-radius: var(--radius-sm);
    color: #fff;
    background:
        radial-gradient(220px 120px at 100% 0%, rgba(var(--accent-rgb), .35), transparent 70%),
        linear-gradient(145deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%);
}
.unlock-head { display: flex; align-items: center; gap: .65rem; margin-bottom: .75rem; }
.unlock-badge {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    color: var(--accent-btn-text);
    background: linear-gradient(135deg, var(--brand-accent), var(--accent-light));
}
.unlock-title { font-weight: 700; font-size: .95rem; line-height: 1.2; }
.unlock-sub { font-size: .78rem; color: var(--accent-on-dark); margin-top: .1rem; }
.unlock-list { list-style: none; padding: 0; margin: 0 0 .9rem; font-size: .85rem; }
.unlock-list li {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .2rem 0;
    color: rgba(255, 255, 255, .85);
}
.unlock-list li::before {
    content: "";
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23042f2e' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat,
        var(--brand-accent);
}
.unlock-login { margin-top: .6rem; text-align: center; font-size: .8rem; color: rgba(255, 255, 255, .65); }
.unlock-login a { color: #fff; font-weight: 600; }
.unlock-login a:hover { color: var(--accent-on-dark); }

/* ----- Progress tracking ------------------------------------------------ */
.complete-row { margin-top: 1.5rem; }
.complete-row + .report-footer { margin-top: 1rem; }
.complete-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid var(--border-soft);
    background: var(--surface);
    color: var(--text-body);
    font-weight: 600;
}
.complete-btn:hover { border-color: var(--brand-accent); color: var(--accent-strong-text); background: var(--accent-softer-bg); }
.complete-btn.is-complete { background: #e7f8f1; border-color: #a7e3c9; color: #047857; }
.complete-btn.is-complete:hover { background: #d5f2e5; color: #065f46; }
/* Floating copy of the button (added by base.html), always shown in the corner. */
.complete-fab {
    position: fixed;
    right: 1.25rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
}
.complete-fab .complete-btn { border-radius: 999px; padding: .55rem 1rem; box-shadow: var(--shadow-md); }
/* Pages with the scroll-to-top button keep that in the corner, with this one beside it. */
body:has(.scroll-top-btn) .complete-fab { right: calc(1.25rem + 46px + .75rem); }

/* ----- Previous / next through a module -------------------------------- */
.module-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    margin-top: 1.5rem;
}
.module-pager-link {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    padding: .75rem 1rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface);
    text-decoration: none;
    transition: border-color .15s, background-color .15s;
}
.module-pager-link:hover { border-color: var(--brand-accent); background: var(--accent-softer-bg); }
.module-pager-link.next { grid-column: 2; text-align: right; }
.module-pager-label { font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.module-pager-name { font-weight: 600; color: var(--text-strong); overflow-wrap: anywhere; }
.module-pager-link:hover .module-pager-name { color: var(--accent-strong-text); }
.module-pager-name .lock-icon { margin-left: .25rem; vertical-align: -1px; }
.module-pager-link.cross { border-style: dashed; }
.module-pager-link.cross .module-pager-label { color: var(--accent-strong-text); }
.module-done-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1rem;
    margin-top: 1.5rem;
    padding: .9rem 1.1rem;
    border: 1px solid var(--accent-soft-border);
    border-radius: var(--radius-sm);
    background: var(--accent-softer-bg);
}
.module-done-title { font-weight: 700; color: var(--text-strong); }
.module-done-sub { font-size: .88rem; color: var(--text-body); }
.module-done-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.module-done-card + .module-pager { margin-top: .75rem; }
@media (max-width: 575.98px) {
    .module-pager { grid-template-columns: 1fr; }
    .module-pager > span:empty { display: none; }
    .module-pager-link.next { grid-column: auto; }
}

/* ----- Module overview: hero, exam focus and roadmap -------------------- */
.overview-card { overflow: hidden; }
.overview-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.75rem;
    align-items: center;
    padding: 2rem 2.25rem 1.9rem;
    background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 55%, var(--brand-navy-light) 100%);
    color: #fff;
    overflow: hidden;
}
.overview-hero::after {
    content: "";
    position: absolute;
    right: -80px;
    top: -120px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), .28), rgba(var(--accent-rgb), 0) 70%);
    pointer-events: none;
}
.overview-hero-main { position: relative; z-index: 1; min-width: 0; }
.overview-kicker { font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-on-dark); }
.overview-hero h1 { color: #fff; font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem); margin: .4rem 0 .5rem; text-wrap: balance; }
.overview-lead { color: #b6c3d8; font-size: 1.02rem; max-width: 58ch; margin: 0; }
.overview-chips { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; margin: 1.1rem 0 0; padding: 0; }
.overview-chips li {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .14);
    font-size: .8rem;
    font-weight: 600;
}
.overview-chips .nav-icon { width: 14px; height: 14px; color: var(--accent-light); }
.overview-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.overview-actions:empty { display: none; }
.overview-actions .lock-icon { color: inherit; vertical-align: -1px; }
.overview-btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.overview-btn-ghost:hover, .overview-btn-ghost:focus-visible { color: #fff; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); }
.overview-ring { position: relative; z-index: 1; width: 112px; height: 112px; flex-shrink: 0; }
.overview-ring svg { transform: rotate(-90deg); }
.overview-ring circle { fill: none; stroke-width: 9; }
.overview-ring-track { stroke: rgba(255, 255, 255, .12); }
.overview-ring-fill { stroke: var(--brand-accent); stroke-linecap: round; }
.overview-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.overview-ring-num { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.overview-ring-sub { font-size: .7rem; color: #b6c3d8; margin-top: .2rem; }
@media (max-width: 575.98px) {
    .overview-hero { grid-template-columns: minmax(0, 1fr); padding: 1.5rem 1.25rem; }
    .overview-ring { display: none; }
}

/*.overview-intro .paragraph-block:first-child > p:first-child { font-size: 1.06rem; color: var(--text-strong); }*/
.overview-focus {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    margin: 2rem 0;
    padding: 1.25rem 1.4rem;
    background: var(--accent-softer-bg);
    border: 1px solid var(--accent-soft-border);
    border-radius: var(--radius);
}
.overview-focus-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--accent-soft-bg);
    border: 1px solid var(--accent-soft-border);
    color: var(--accent-strong-text);
}
.keynote-content .overview-focus h2 { font-size: 1.05rem; color: var(--accent-deep-text); margin: 0 0 .35rem; padding: 0; border: 0; }
.overview-focus .paragraph-block:last-child, .overview-focus .paragraph-block > :last-child { margin-bottom: 0; }
.overview-focus + h2 { margin-top: 0; padding-top: 0; border-top: 0; }

.keynote-content .overview-road { display: grid; gap: .6rem; list-style: none; margin: 1.1rem 0 0; padding: 0; }
.keynote-content .overview-road li { margin: 0; }
.overview-road-step a {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr) auto;
    gap: .9rem;
    align-items: center;
    padding: .8rem 1rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-body);
    font-weight: 400;
    text-decoration: none;
    transition: border-color .15s, background-color .15s, transform .15s;
}
.overview-road-step a:hover { border-color: var(--primary-border); background: var(--brand-primary-soft); transform: translateX(2px); }
.overview-road-step.next a { border-color: var(--primary-border); }
.overview-road-num {
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--surface-muted);
    border: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.overview-road-step.done .overview-road-num { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--accent-btn-text); }
.overview-road-step.next .overview-road-num { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.overview-road-text { display: flex; flex-direction: column; min-width: 0; }
.overview-road-name { font-weight: 600; color: var(--text-strong); line-height: 1.35; overflow-wrap: anywhere; }
.overview-road-detail { font-size: .78rem; color: var(--text-muted); }
.overview-road-pill { padding: .2rem .6rem; border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: .72rem; font-weight: 700; white-space: nowrap; }
.overview-road-pill.done { background: var(--accent-soft-bg); color: var(--accent-strong-text); }
.overview-road-pill.next { background: var(--brand-primary-soft); color: var(--brand-primary); }
.keynote-content .overview-road-split { padding: .6rem 0 .1rem; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
@media (max-width: 575.98px) {
    .overview-road-step a { grid-template-columns: 2.25rem minmax(0, 1fr); }
    .overview-road-step a > :last-child:not(.overview-road-text) { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
    .overview-road-step a { transition: none; }
    .overview-road-step a:hover { transform: none; }
}

.done-icon { flex-shrink: 0; color: #059669; }
.side-nav-link.active .done-icon { color: #047857; }
.side-nav-link .done-icon { margin-top: .2rem; }
.quiz-best {
    flex-shrink: 0;
    font-size: .75rem;
    font-weight: 700;
    padding: .05rem .45rem;
    border-radius: 999px;
    background: #fdecec;
    color: #b42318;
}
.quiz-best.pass { background: #e7f8f1; color: #047857; }
.subdomain-link .pill-soft + .arrow { margin-left: .5rem; }

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: #e8edf5;
    overflow: hidden;
}
.progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-accent), var(--accent-light));
}
.progress-track.thin { height: 5px; margin-top: .25rem; }

.progress-strip {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.1rem 1.35rem;
    text-decoration: none;
    color: var(--text-body);
}
.progress-strip h3 { font-size: 1rem; font-weight: 700; color: var(--text-strong); }
.progress-strip-pct { font-size: 1.25rem; font-weight: 800; color: var(--accent-strong-text); }
.progress-strip .arrow { color: #94a3b8; font-size: 1.2rem; }

.score-ring.sm { width: 64px; height: 64px; }
.score-ring.sm > div { width: 50px; height: 50px; font-size: .9rem; }

.progress-card.not-started { opacity: .85; }
.progress-card-title { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.progress-card-badge { flex-shrink: 0; }
.progress-card-badge .cert-badge { width: 56px; height: 62px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25)); }
.progress-card-badge .cert-badge-img { width: 56px; height: 56px; }
.progress-page-title { gap: 1.1rem; }
.progress-page-title .cert-badge { width: 80px; height: 88px; }
.progress-page-title .cert-badge-img { width: 80px; height: 80px; }
@media (max-width: 575.98px) {
    .progress-page-title .cert-badge { width: 60px; height: 66px; }
    .progress-page-title .cert-badge-img { width: 60px; height: 60px; }
}
.progress-items { display: grid; gap: .6rem; margin-bottom: 1rem; }
.progress-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
}
.stat-value { font-size: 1.35rem; font-weight: 800; color: var(--text-strong); line-height: 1.2; }
.stat-label { font-size: .75rem; color: var(--text-muted); }

.task-rows { display: grid; gap: .15rem; margin-top: .5rem; }
.task-row {
    display: grid;
    grid-template-columns: 1fr auto 6.5rem;
    align-items: center;
    gap: .75rem;
    padding: .35rem 0;
    font-size: .875rem;
    border-top: 1px solid var(--border-soft);
}
.task-row:first-child { border-top: 0; }
.task-name { color: var(--text-body); text-decoration: none; }
.task-name:hover { color: var(--brand-primary); }
.task-name .code { font-weight: 700; color: var(--brand-primary); margin-right: .35rem; }
.task-count { font-weight: 600; color: var(--text-muted); }
.task-next { font-size: .8rem; text-align: right; }
@media (max-width: 575.98px) {
    .task-row { grid-template-columns: 1fr auto; }
    .task-next { display: none; }
}

.focus-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .5rem 0;
    border-top: 1px solid var(--border-soft);
    color: var(--text-body);
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
}
.focus-row:hover { color: var(--brand-primary); }
.focus-heading {
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 1.1rem 0 .3rem;
}
.focus-domain { display: grid; gap: .1rem; padding: .6rem 0; border-top: 1px solid var(--border-soft); }
.focus-domain-name { font-weight: 600; font-size: .88rem; color: var(--text-strong); min-width: 0; }
.focus-domain-meta { font-size: .78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.focus-domain-link { font-size: .8rem; font-weight: 600; text-decoration: none; }
.focus-domain-link:hover { text-decoration: underline; }
.focus-basis { font-size: .76rem; color: var(--text-muted); margin: .6rem 0 0; }

.activity-row { display: flex; gap: .75rem; padding: .5rem 0; border-top: 1px solid var(--border-soft); }
.activity-row:first-of-type { border-top: 0; padding-top: 0; }
.activity-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: .4rem; flex-shrink: 0; background: var(--brand-accent); }
.activity-dot.quiz { background: var(--brand-primary); }
.activity-dot.exam { background: #8b5cf6; }
.activity-title { font-size: .9rem; overflow-wrap: anywhere; }
.min-w-0 { min-width: 0; }
.attempt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .55rem 0;
    border-top: 1px solid var(--border-soft);
}
.attempt-row:first-of-type { border-top: 0; }

/* ----- Profile ---------------------------------------------------------- */
.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent-btn-text);
    background: linear-gradient(135deg, var(--brand-accent), var(--accent-light));
}
.profile-facts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: .4rem 1rem;
    margin-bottom: 0;
    font-size: .9rem;
}
.profile-facts dt { font-weight: 600; color: var(--text-muted); }
.profile-facts dd { margin: 0; overflow-wrap: anywhere; }
.goal-card { border-left: 4px solid var(--brand-accent); }
.goal-countdown { font-weight: 700; color: var(--accent-strong-text); margin-bottom: .25rem; }
.goal-countdown.soon { color: #b45309; }
.goal-countdown.past { color: var(--text-muted); font-weight: 600; }

/* ----- Certification badges (homepage tiles) ---------------------------- */
.cert-card .cert-top { display: flex; align-items: flex-start; gap: 1rem; }
.cert-top-text { flex: 1 1 auto; min-width: 0; position: relative; z-index: 1; }
.cert-badge-wrap { flex-shrink: 0; position: relative; z-index: 1; margin: -.2rem -.3rem 0 0; }
.cert-badge-img { display: block; width: 84px; height: 84px; object-fit: contain; transition: transform .2s ease; }
/* Every vendor uses the same ring medallion (white disc in a gradient ring, dark text); the ring is coloured by vendor.
   Purple is the default for HashiCorp, FinOps and any other vendor without its own colour. */
.cert-badge {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .2));
    transition: transform .2s ease;
    --ring-from: #b48cf2;
    --ring-to: #4b2593;
    --badge-ink: #4b2593;
    --badge-code-ink: #0b1426;
}
.cert-card:hover .cert-badge,
.cert-card:hover .cert-badge-img { transform: scale(1.08); }
.cert-badge.provider-aws { --ring-from: #ffd65c; --ring-to: #d97706; --badge-ink: #9a4b05; }
.cert-badge.provider-microsoft { --ring-from: #3ab0f0; --ring-to: #0a4d9c; --badge-ink: #0a4d9c; }
.cert-badge.provider-isc2 { --ring-from: #4ade80; --ring-to: #047857; --badge-ink: #047857; }
.cert-badge .badge-ring-from { stop-color: var(--ring-from); }
.cert-badge .badge-ring-to { stop-color: var(--ring-to); }
.cert-badge .badge-disc { fill: #fff; }
.cert-badge .badge-stamp { fill: none; stroke: var(--badge-ink); stroke-width: .8; stroke-dasharray: 2 2.4; }
.cert-badge text { fill: var(--badge-ink); text-anchor: middle; font-family: "Inter", system-ui, sans-serif; font-weight: 800; }
.cert-badge .badge-provider { font-size: 6.5px; letter-spacing: .12em; }
.cert-badge .badge-code { font-size: 14px; font-weight: 900; fill: var(--badge-code-ink); }
.cert-badge.badge-code-long .badge-code { font-size: 12.5px; }  /* seven-character codes such as SAA-C03 */
.cert-badge .badge-level { font-size: 6.3px; letter-spacing: .08em; }

/* Badge in the certification page banner */
.cert-hero { display: flex; align-items: center; gap: 2rem; margin-top: .5rem; }
.cert-hero-text { flex: 1; min-width: 0; }
.cert-hero-badge { flex-shrink: 0; }
.cert-hero-badge .cert-badge { width: 128px; height: 141px; }
.cert-hero-badge .cert-badge-img { width: 128px; height: 128px; }
@media (max-width: 575.98px) {
    .cert-hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .cert-hero-badge .cert-badge { width: 88px; height: 97px; }
    .cert-hero-badge .cert-badge-img { width: 88px; height: 88px; }
}

/* ----- Practice exams --------------------------------------------------- */
.practice-exam-card h2 { color: var(--text-strong); }
.mode-choice { display: grid; gap: .4rem; }
.mode-option {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    padding: .55rem .7rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
}
.mode-option:has(input:checked) { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.mode-option input { margin-top: .3rem; accent-color: var(--brand-primary); }
.mode-option strong { display: block; font-size: .88rem; color: var(--text-strong); }
.mode-option small { display: block; color: var(--text-muted); font-size: .78rem; line-height: 1.35; }

.esl-form { border-top: 1px solid var(--border-soft); padding-top: .9rem; }
.esl-switch { display: flex; gap: .75rem; align-items: flex-start; cursor: pointer; margin: 0; }
.esl-switch input {
    appearance: none;
    flex: none;
    width: 38px;
    height: 22px;
    margin: .1rem 0 0;
    border-radius: 999px;
    background: var(--border-soft);
    position: relative;
    cursor: pointer;
    transition: background-color .15s ease;
}
.esl-switch input::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease;
}
.esl-switch input:checked { background: var(--brand-primary); }
.esl-switch input:checked::after { transform: translateX(16px); }
.esl-switch input:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.esl-switch strong { display: block; font-size: .88rem; color: var(--text-strong); }
.esl-switch small { display: block; color: var(--text-muted); font-size: .78rem; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .esl-switch input, .esl-switch input::after { transition: none; } }

.exam-question-text { font-weight: 500; }
/* Revealed answers disable their inputs; keep the labels readable instead of Bootstrap's faded style. */
.question-card .form-check-input:disabled ~ .form-check-label { opacity: 1; cursor: default; }

.exam-progress { height: 6px; border-radius: 999px; background: #e8edf5; overflow: hidden; }
.exam-progress > div { height: 100%; background: var(--brand-primary); border-radius: inherit; }
.exam-progress > div.pass { background: #059669; }
.exam-progress > div.fail { background: #f59e0b; }
.domain-score-row + .domain-score-row { margin-top: .9rem; }

.exam-topbar {
    position: sticky;
    top: 5.5rem;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: .7rem 1rem;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.exam-topbar .min-w-0 { min-width: 0; }
.exam-timer {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary-hover);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.exam-timer.warning { background: #fff4e5; color: #b45309; }
.exam-timer.danger { background: #fdecec; color: #b42318; }

.btn-flag { border: 1px solid var(--border-soft); color: var(--text-muted); display: inline-flex; align-items: center; gap: .35rem; }
.btn-flag:hover { color: #b45309; border-color: #f5c27a; }
.btn-flag.active { background: #fff4e5; color: #b45309; border-color: #f5c27a; }

.exam-navigator { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: .4rem; }
.nav-cell {
    display: grid;
    place-items: center;
    height: 36px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-body);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
}
.nav-cell:hover { border-color: var(--brand-primary); color: var(--brand-primary); }
.nav-cell.answered { background: var(--brand-primary-soft); border-color: var(--primary-border); color: var(--brand-primary-hover); }
.nav-cell.correct { background: #e7f8f1; border-color: #a7e3cb; color: #047857; }
.nav-cell.incorrect { background: #fdecec; border-color: #f5b5b0; color: #b42318; }
.nav-cell.current { outline: 2px solid var(--brand-primary); outline-offset: 1px; }
.nav-cell.flagged::after {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #f59e0b;
}
.legend-swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: .3rem;
    border: 1px solid var(--border-soft);
    border-radius: 3px;
    vertical-align: -1px;
    position: relative;
}
.legend-swatch.answered { background: var(--brand-primary-soft); border-color: var(--primary-border); }
.legend-swatch.flagged { background: #f59e0b; border-color: #f59e0b; border-radius: 50%; }
.exam-navigator-card summary { cursor: pointer; list-style: revert; }

html:not(.exam-js) .js-only { display: none !important; }
.exam-js .no-js-only { display: none !important; }

@media (max-width: 575.98px) {
    .exam-topbar { top: 4rem; flex-wrap: wrap; gap: .4rem .75rem; }
}

/* ----- Readiness test --------------------------------------------------- */
.readiness-card { border-left: 4px solid var(--brand-primary); }
.focus-list { margin: 0; padding-left: 1.25rem; }
.focus-item + .focus-item { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-soft); }
.readiness-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
}
.readiness-strip h3 { font-size: 1rem; font-weight: 700; color: var(--text-strong); }
.readiness-strip p { font-size: .87rem; color: var(--text-muted); margin-top: .2rem; }
@media (max-width: 575.98px) {
    .readiness-strip { flex-direction: column; align-items: flex-start; }
}

/* ----- Certification landing page --------------------------------------- */
.landing-progress { color: var(--text-muted); font-size: .95rem; }
.landing-progress a { color: var(--brand-primary); font-weight: 600; }
.landing-hero { padding-bottom: 4rem; }
.landing-hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 46rem; margin: 1rem auto 0; }
.landing-hero-inner p { margin-inline: auto; }
.landing-sidebar { position: sticky; top: calc(var(--header-offset, 4rem) + 1.5rem); padding: 1.5rem; }
.landing-includes { list-style: none; margin: 1rem 0 1.5rem; padding: 0; display: grid; gap: 1rem; }
.landing-includes li { display: flex; align-items: flex-start; gap: .85rem; font-size: .88rem; color: var(--text-muted); }
.landing-includes .icon-tile { width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; }
.landing-includes .icon-tile svg { width: 18px; height: 18px; }
.landing-includes strong { display: block; font-size: .95rem; color: var(--text-strong); }
@media (max-width: 991.98px) {
    .landing-sidebar { position: static; }
}
.landing-domains { overflow: hidden; }
.landing-domain + .landing-domain { border-top: 1px solid var(--border-soft); }
.landing-domain-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.35rem;
    background: none;
    border: 0;
    text-align: left;
}
.landing-domain-head:not(:disabled):hover { background: var(--brand-primary-soft); }
.landing-domain-head:disabled { cursor: default; }
.landing-domain-head:disabled .chev { visibility: hidden; }
.landing-domain-head .chev { flex-shrink: 0; color: var(--text-muted); transition: transform .2s ease; }
.landing-domain-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.landing-subdomains { list-style: none; margin: 0; padding: .25rem 1.35rem 1rem calc(1.35rem + 38px + 1rem); }
.landing-subdomains li { display: flex; align-items: baseline; gap: .6rem; padding: .3rem 0; font-size: .92rem; }
.landing-subdomains .code { flex-shrink: 0; min-width: 2.2rem; font-weight: 700; color: var(--brand-primary); font-size: .85rem; }
.landing-subdomains .item-name { color: var(--text-strong); text-decoration: none; }
.landing-subdomains li { position: relative; }
.landing-subdomains li:hover .item-name { color: var(--brand-primary); }
@media (max-width: 575.98px) {
    .landing-subdomains { padding-left: 1.35rem; }
}
.faq-list { overflow: hidden; }
.faq-list .accordion-button { font-size: 1rem; font-weight: 650; color: var(--text-strong); padding: 1.1rem 1.35rem; }
.faq-list .accordion-button:not(.collapsed) { background: var(--brand-primary-soft); color: var(--brand-primary); box-shadow: none; }
.faq-list .accordion-button:focus { box-shadow: none; }
.faq-list .accordion-button:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.faq-list .accordion-item { border-color: var(--border-soft); }
.faq-list .accordion-body { padding: 1rem 1.35rem 1.25rem; color: var(--text-muted); }
.faq-list .accordion-body p:last-child { margin-bottom: 0; }
.syllabus { overflow: hidden; }
.syllabus-module + .syllabus-module,
.syllabus .collapse > .syllabus-module:first-child,
.syllabus .collapsing > .syllabus-module:first-child { border-top: 1px solid var(--border-soft); }
.syllabus-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: .9rem 1.35rem;
    background: none;
    border: 0;
    text-align: left;
}
.syllabus-head:hover { background: var(--brand-primary-soft); }
.syllabus-head .module-initials {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-light));
    color: #ff9900;
    font-weight: 800;
    font-size: .8rem;
    letter-spacing: .02em;
}
.syllabus-name { display: block; font-weight: 650; color: var(--text-strong); }
.syllabus-desc {
    display: block;
    font-size: .85rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.syllabus-counts { flex-shrink: 0; font-size: .82rem; color: var(--text-muted); white-space: nowrap; }
.syllabus-head .chev { flex-shrink: 0; color: var(--text-muted); transition: transform .2s ease; }
.syllabus-head[aria-expanded="true"] .chev { transform: rotate(180deg); }
.syllabus-items { list-style: none; margin: 0; padding: .35rem .85rem .85rem; }
.syllabus-items li { display: flex; align-items: center; gap: .85rem; padding: .55rem .5rem; border-radius: var(--radius-sm); font-size: .92rem; }
.syllabus-items li + li { border-top: 1px solid var(--border-soft); }
.syllabus-items li:hover { background: #f8fafc; }
.syllabus-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
}
.syllabus-icon.lab { background: var(--accent-soft-bg); color: var(--accent-strong-text); }
.syllabus-icon.notes { background: #f1edff; color: #6d28d9; }
.syllabus-icon.quiz { background: #f1edff; color: #6d28d9; }
.syllabus-text { flex: 1; min-width: 0; }
.syllabus-text .item-name { display: block; font-weight: 500; line-height: 1.35; color: var(--text-strong); }
.syllabus-items li { position: relative; }
.syllabus-items a.item-name { text-decoration: none; }
.syllabus-items li:hover a.item-name { color: var(--brand-primary); }
.syllabus-text .item-kind { display: block; font-size: .76rem; line-height: 1.35; color: var(--text-muted); }
.syllabus-locked { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; font-size: .76rem; color: var(--text-muted); }
.syllabus-more {
    display: block;
    width: 100%;
    padding: .85rem;
    background: none;
    border: 0;
    border-top: 1px solid var(--border-soft);
    font-weight: 600;
    color: var(--brand-primary);
}
.syllabus-more:hover { background: var(--brand-primary-soft); }
.syllabus-more[aria-expanded="true"] .when-collapsed,
.syllabus-more[aria-expanded="false"] .when-expanded { display: none; }
@media (max-width: 575.98px) {
    .syllabus-items { padding-left: .4rem; padding-right: .4rem; }
}

/* Scroll-to-top button (app/_scroll_top.html) */
.scroll-top-btn {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 1030;
    width: 46px;
    height: 46px;
    border: 1px solid var(--border-soft);
    border-radius: 50%;
    background: var(--surface);
    color: var(--accent-strong-text);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s, color .15s ease;
}
.scroll-top-btn.is-visible { opacity: .5; visibility: visible; transform: none; }
.scroll-top-btn.is-visible:hover,
.scroll-top-btn.is-visible:focus-visible { opacity: 1; color: var(--accent-deep-text); }
.scroll-top-btn:focus-visible { outline: 3px solid rgba(var(--accent-rgb), .45); outline-offset: 2px; }

/* ----- Key Concepts (list or one card at a time) ------------------------- */
.kc-toolbar {
    position: sticky;
    top: var(--header-offset, 64px);
    transition: top .25s ease;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
    align-items: center;
    padding-block: .65rem;
    background: var(--surface-muted);
    border-bottom: 1px solid var(--border-soft);
}
.kc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.kc-chip {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-body);
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    padding: .3rem .8rem;
}
.kc-chip:hover { border-color: var(--brand-accent); color: var(--accent-strong-text); }
.kc-chip[aria-pressed="true"] { background: var(--accent-soft-bg); border-color: var(--brand-accent); color: var(--accent-strong-text); }
.kc-weight { color: var(--text-muted); font-variant-numeric: tabular-nums; margin-left: .2rem; }
.kc-seg { display: inline-flex; margin-left: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.kc-seg button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: .82rem;
    font-weight: 600;
    padding: .45rem .9rem;
}
.kc-seg button + button { border-left: 1px solid var(--border-soft); }
.kc-seg button[aria-pressed="true"] { background: var(--accent-soft-bg); color: var(--accent-strong-text); }
.kc-chip:focus-visible, .kc-seg button:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

.kc-domain { padding-top: 1.75rem; scroll-margin-top: 140px; }
.kc-domain-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-bottom: .75rem; }
.kc-domain-head h2 { margin: 0; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-strong); }
.kc-meta { font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kc-list {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.kc-concept { position: relative; padding: .85rem 1.15rem .85rem 2.1rem; font-size: .96rem; line-height: 1.65; }
.kc-concept + .kc-concept { border-top: 1px solid var(--border-soft); }
.kc-concept::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1.4rem;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-accent);
}
.kc-concept > :last-child, .kc-card-text > :last-child { margin-bottom: 0; }
.kc-concept p { max-width: 80ch; }

.kc-deck { padding-top: 1.75rem; }
.kc-card {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    min-height: 240px;
    padding: 1.75rem 2rem;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.kc-card-domain { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-strong-text); }
.kc-card-text { flex: 1; display: flex; flex-direction: column; justify-content: center; font-size: 1.08rem; line-height: 1.7; }
.kc-card-text p { max-width: 62ch; }
.kc-deck-bar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-top: .9rem; }
.kc-progress { flex: 1 1 160px; display: flex; align-items: center; gap: .65rem; font-size: .82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.kc-track { flex: 1; height: 4px; background: var(--border-soft); border-radius: 2px; overflow: hidden; }
.kc-fill { width: 0; height: 100%; background: var(--brand-accent); transition: width .2s; }
.kc-nav { display: flex; gap: .5rem; }
.kc-hint { margin-top: .6rem; font-size: .78rem; color: var(--text-muted); }
@media (max-width: 575.98px) {
    .kc-card { min-height: 280px; padding: 1.25rem; }
    .kc-card-text { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) { .kc-fill { transition: none; } }

/* Module Key Notes: the Key Concepts list/cards inside the study guide content card */
.kn-intro { color: var(--text-muted); }
.kn-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    justify-content: space-between;
    align-items: center;
    padding-block: .6rem;
    margin-top: 1rem;
    border-block: 1px solid var(--border-soft);
}
.keynote-content .kn-topic h2 { margin: 0; padding: 0; border: 0; font-size: .82rem; }
.kn-topic .kc-list { box-shadow: none; }
.kn-topic .kc-concept { line-height: 1.65; }
.kn-topic .kc-concept p { margin: 0; }

/* ----- Certification shortcut toolbar ------------------------------------ */
.cert-toolbar {
    background: #f8fafc;
    border-bottom: 1px solid var(--border-soft);
    padding: .45rem 0;
}
.cert-toolbar-code {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--v-ink);
    background: var(--v-soft);
    border-radius: 7px;
    padding: .2rem .55rem;
}
.cert-toolbar-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-right: auto;
    min-width: 0;
    text-decoration: none;
}
.cert-toolbar-name {
    color: var(--text-strong);
    font-size: .85rem;
    font-weight: 600;
    min-width: 0;
}
.cert-toolbar-title:hover .cert-toolbar-name,
.cert-toolbar-title:focus-visible .cert-toolbar-name { color: var(--text-strong); text-decoration: underline; }
.cert-toolbar-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .82rem;
    font-weight: 600;
    color: var(--accent-strong-text);
    background: var(--accent-soft-bg);
    text-decoration: none;
    padding: .3rem .8rem;
    border-radius: 999px;
    border: 1px solid transparent;
}
.cert-toolbar-link svg { width: 15px; height: 15px; }
.cert-toolbar-link:hover, .cert-toolbar-link:focus-visible { color: var(--accent-deep-text); border-color: var(--accent-soft-border); }
.cert-toolbar-link.active { background: var(--brand-accent); border-color: var(--brand-accent); color: var(--accent-btn-text); }
/* Below lg (where the navbar collapses to the menu button) the toolbar is not shown, and the navbar stays pinned. */
@media (max-width: 991.98px) {
    .cert-toolbar { display: none; }
}

/* ----- Premium (paid mode, see app/access.py) --------------------------- */
.premium-pill {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .1rem .5rem;
    border: 1px solid var(--accent-soft-border);
    border-radius: 999px;
    background: var(--accent-soft-bg);
    color: var(--accent-strong-text);
    font-size: .7rem;
    font-weight: 700;
    white-space: nowrap;
}
.tile-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .2rem; }
.tile-title-row h3 { margin: 0; }
.pill-soft.amber { background: #fff4e5; color: #9a4d00; }

.upgrade-hero { padding-bottom: 7rem; }
.upgrade-lede { max-width: 620px; margin: .75rem auto 0; color: #475569; font-size: 1.05rem; }
.upgrade-includes { padding: 1.75rem 2rem; }
.upgrade-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.1rem 1.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}
.upgrade-features li { display: flex; gap: .75rem; font-size: .85rem; color: var(--text-muted); }
.upgrade-features .icon-tile { width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--radius-sm); }
.upgrade-features .icon-tile svg { width: 18px; height: 18px; }
.upgrade-features strong { display: block; color: var(--text-strong); font-size: .9rem; }
.upgrade-price { padding: 1.75rem; border: 2px solid var(--brand-accent); box-shadow: var(--shadow-lg); }
.upgrade-plan { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-strong-text); }
.upgrade-amount { display: flex; align-items: baseline; gap: .4rem; margin: .5rem 0 .25rem; }
.upgrade-amount span { font-size: 2.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--text-strong); }
.upgrade-amount small { font-size: .95rem; color: var(--text-muted); }
.upgrade-amount .upgrade-amount-tbc { font-size: 1.5rem; }
.upgrade-login { margin: .75rem 0 0; text-align: center; font-size: .85rem; color: var(--text-muted); }
.upgrade-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    margin-top: .75rem;
    font-size: .75rem;
    color: var(--text-muted);
}
.upgrade-terms {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-soft);
    font-size: .8rem;
    line-height: 1.5;
    color: var(--text-muted);
}
.upgrade-faq h2 { font-size: .9rem; font-weight: 700; color: var(--text-strong); margin-bottom: .25rem; }
.upgrade-faq p { font-size: .85rem; line-height: 1.5; color: var(--text-muted); margin: 0; }
@media (max-width: 575.98px) {
    .upgrade-includes { padding: 1.25rem; }
    .upgrade-features { grid-template-columns: minmax(0, 1fr); }
}

/* ----- Sign-up prompt on the certification page (trial, signed out) ----- */
.signup-tile {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    height: 100%;
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius);
    color: #fff;
    background:
        radial-gradient(260px 140px at 100% 0%, rgba(var(--accent-rgb), .35), transparent 70%),
        linear-gradient(145deg, var(--brand-navy) 0%, var(--brand-navy-light) 100%);
    box-shadow: var(--shadow-md);
}
.signup-tile .unlock-badge { width: 44px; height: 44px; border-radius: 12px; }
.signup-tile .unlock-badge svg { width: 22px; height: 22px; }
.signup-tile h3 { font-size: 1rem; margin: 0 0 .2rem; color: #fff; }
.signup-tile p { font-size: .87rem; margin: 0; color: #cbd5e1; }
.signup-tile-actions { display: flex; flex-direction: column; align-items: center; gap: .35rem; flex-shrink: 0; }
.signup-tile-actions a:not(.btn) { color: #fff; font-size: .8rem; font-weight: 600; }
.signup-tile-actions a:not(.btn):hover { color: var(--accent-on-dark); }
@media (max-width: 575.98px) {
    .signup-tile { flex-wrap: wrap; }
    .signup-tile-actions { flex-direction: row; gap: 1rem; }
}

/* ----- Analytics consent card (templates/analytics/consent_banner.html) ---- */
.consent-card {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 1045;
    width: 400px;
    max-width: calc(100vw - 24px);
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.consent-card[hidden] { display: none; }
.consent-title { font-size: 1rem; margin: 0 0 6px; }
.consent-card p { margin: 0; font-size: .9rem; line-height: 1.6; }
.consent-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.consent-actions .btn { min-height: 44px; }
@media (max-width: 575.98px) {
    .consent-card { left: 12px; right: 12px; bottom: 12px; width: auto; max-width: none; padding: 20px 18px; }
    .consent-actions { gap: 10px; }
}

/* ----- Page blocks: callout, comparison, command (app/_page_block.html) ---- */
.callout {
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
    padding: .9rem 1.1rem;
    border: 1px solid var(--callout-border);
    border-radius: var(--radius-sm);
    background: var(--callout-bg);
}
.callout > svg { flex: 0 0 auto; margin-top: .3rem; color: var(--callout-fg); }
.callout-body { min-width: 0; }
.callout-body > :last-child { margin-bottom: 0; }
.keynote-content .callout-body p { margin-bottom: .5rem; }
.keynote-content .callout-body .callout-title { margin-bottom: .15rem; font-weight: 600; color: var(--callout-fg); }
.callout-tip { --callout-bg: var(--accent-softer-bg); --callout-border: var(--accent-soft-border); --callout-fg: var(--accent-strong-text); }
.callout-note { --callout-bg: #f8fafc; --callout-border: #cbd5e1; --callout-fg: #475569; }
.callout-outcomes { --callout-bg: var(--brand-primary-soft); --callout-border: var(--primary-border); --callout-fg: var(--brand-primary-hover); }
.callout-warning { --callout-bg: #fff7ed; --callout-border: #fed7aa; --callout-fg: #b45309; }
.callout-trap { --callout-bg: #fef2f2; --callout-border: #fecaca; --callout-fg: #b91c1c; }
.keynote-content .callout-tip li::marker { color: #000; }

/* Every column shares one colour so that no option looks preferred. */
.comparison { margin-bottom: 1rem; }
.comparison-scroll { overflow-x: auto; padding-bottom: 2px; }
/* One grid: the row-label column and a card per column, all sharing --rows rows through subgrid. */
.comparison-grid {
    display: grid;
    grid-template-rows: repeat(var(--rows), auto);
    column-gap: .75rem;
    font-size: .92rem;
    line-height: 1.55;
}
.comparison-grid.comparison-cols-2 { grid-template-columns: 18% repeat(2, minmax(0, 1fr)); min-width: 520px; }
.comparison-grid.comparison-cols-3 { grid-template-columns: 16% repeat(3, minmax(0, 1fr)); min-width: 680px; }
.comparison-grid.comparison-cols-4 { grid-template-columns: 14% repeat(4, minmax(0, 1fr)); min-width: 840px; }
.comparison-labels, .comparison-card { display: grid; grid-row: span var(--rows); grid-template-rows: subgrid; }
.comparison-labels > div {
    padding: .8rem .5rem .8rem 0;
    border-top: 1px dashed var(--border-soft);
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.comparison-labels > div:first-child, .comparison-labels > div:last-child:empty { border-top: 0; }
.comparison-card {
    --col-bg: var(--accent-soft-bg); --col-fg: var(--accent-strong-text); --col-tint: var(--accent-softer-bg); --col-line: var(--accent-strong-text);
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px rgba(15, 23, 42, .06);
}
.comparison-head {
    padding: .85rem 1rem;
    border-top: 4px solid var(--col-line);
    background: var(--col-bg);
    color: var(--col-fg);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}
.comparison-cell { min-width: 0; padding: .8rem 1rem; border-top: 1px solid var(--border-soft); }
.comparison-head + .comparison-cell { border-top: 0; }
.comparison-cell > :last-child { margin-bottom: 0; }
/* Each cell's own row label is for screen readers on wide screens and shown when the cards stack. */
.comparison-cell-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.comparison-choose {
    padding: .75rem 1rem;
    border-top: 1px solid var(--border-soft);
    background: var(--col-tint);
    font-size: .88rem;
}
.comparison-choose.is-empty { background: none; }
.comparison-choose strong {
    display: block;
    margin-bottom: .1rem;
    color: var(--col-fg);
    font-size: .7rem;
    letter-spacing: .07em;
    text-transform: uppercase;
}
@media (max-width: 767.98px) {
    .comparison-grid, .comparison-grid[class*="comparison-cols-"] {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: none;
        row-gap: .75rem;
        min-width: 0;
    }
    .comparison-labels { display: none; }
    .comparison-card { display: block; grid-row: auto; }
    .comparison-cell-label {
        position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal;
        display: block;
        color: var(--text-muted);
        font-size: .7rem;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .comparison-choose.is-empty { display: none; }
}

.command { margin-bottom: 1rem; overflow: hidden; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: #f8fafc; }
.command-bar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .75rem .45rem 1.2rem;
    border-bottom: 1px solid var(--border-soft);
    background: #f1f5f9;
    color: #64748b;
    font-size: .8rem;
}
.command-env { color: var(--accent-strong-text); font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.command-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.command-copy {
    margin-left: auto;
    padding: .15rem .6rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #475569;
    font-size: .76rem;
}
.command-copy:hover, .command-copy:focus-visible { border-color: var(--accent-strong-text); color: var(--accent-strong-text); outline: none; }
.keynote-content .command pre { margin: 0; border: 0; border-radius: 0; background: none; }
.command-cloudshell pre:first-of-type code::before,
.command-azure pre:first-of-type code::before,
.command-bash pre:first-of-type code::before { content: "$ "; color: #94a3b8; user-select: none; }
.keynote-content .command .command-output { padding-top: .7rem; border-top: 1px solid var(--border-soft); color: #64748b; font-size: .8rem; }

/* Steps: numbered circles joined by a line. */
.keynote-content .step-list { list-style: none; margin: 0 0 1rem; padding: 0; counter-reset: step; }
.keynote-content .step-list li { position: relative; margin: 0; padding: 0 0 1.1rem 2.9rem; counter-increment: step; }
.keynote-content .step-list li:last-child { padding-bottom: 0; }
.step-list li::before {
    content: counter(step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid var(--accent-soft-border);
    border-radius: 50%;
    background: var(--accent-soft-bg);
    color: var(--accent-strong-text);
    font-size: .85rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.step-list li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 2.15rem;
    bottom: .25rem;
    left: .95rem;
    width: 1px;
    background: var(--accent-soft-border);
}
.keynote-content .step-list p { margin: 0; }
.keynote-content .step-list .step-title { margin-top: .15rem; color: var(--text-strong); font-weight: 600; }

/* Key terms: a grid of definition cards. */
.term-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
@media (max-width: 767.98px) { .term-grid { grid-template-columns: minmax(0, 1fr); } }
.term-card { padding: .8rem 1rem; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); }
.term-card dt { color: var(--text-strong); font-weight: 600; }
.term-full { margin-left: .3rem; color: var(--text-muted); font-size: .82rem; font-weight: 500; }
.term-card dd { margin: .25rem 0 0; font-size: .93rem; line-height: 1.6; }

/* Key figures: numbers to remember, in a row of up to four. */
.key-figures { display: grid; gap: .75rem; margin-bottom: 1rem; }
.key-figures-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.key-figures-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.key-figures-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 767.98px) { .key-figures-3, .key-figures-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.key-figure { min-width: 0; padding: .8rem 1rem; border-radius: var(--radius-sm); background: var(--surface-muted); }
.keynote-content .key-figure p { margin: 0; }
.keynote-content .key-figure-value {
    color: var(--text-strong);
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.key-figure-unit { margin-left: .2rem; color: var(--text-muted); font-size: .82rem; font-weight: 600; }
.keynote-content .key-figure-label { margin-top: .3rem; color: var(--text-muted); font-size: .84rem; line-height: 1.45; }

/* Check yourself: a question with an answer that opens on request. */
.self-check { margin-top: 2.5rem; margin-bottom: 1rem; overflow: hidden; border: 1px solid #ddd6fe; border-radius: var(--radius-sm); }
.self-check-question { padding: .8rem 1rem; background: #f5f3ff; }
.self-check-label { display: flex; align-items: center; gap: .45rem; color: #6d28d9; font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.self-check-label svg { flex: 0 0 auto; }
.keynote-content .self-check-question p { margin: .1rem 0 0; color: var(--text-strong); font-weight: 500; }
.self-check details { padding: 0 1rem; }
.self-check summary { padding: .6rem 0; color: #6d28d9; font-size: .9rem; font-weight: 600; cursor: pointer; }
.self-check summary:focus-visible { outline: 2px solid #6d28d9; outline-offset: 2px; border-radius: 4px; }
.keynote-content .self-check details p { margin: 0 0 .8rem; }

/* Worked example: a sky-blue box with a header strip (label and title), the scenario in italics. */
.worked-example { margin: 2.5rem 0 1rem; overflow: hidden; border: 1px solid #bae6fd; border-radius: var(--radius-sm); }
.worked-example-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .65rem; padding: .65rem 1rem; background: #e0f2fe; color: #0369a1; }
.worked-example-head svg { flex: 0 0 auto; }
.worked-example-label { font-size: .7rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.worked-example-label:not(:last-child) { padding-right: .65rem; border-right: 1px solid #bae6fd; }
.keynote-content .worked-example-title { margin: 0; padding: 0; border: 0; font-size: 1rem; font-weight: 600; line-height: 1.4; color: var(--text-strong); }
.worked-example-body { padding: .9rem 1rem .1rem; background: #f0f9ff; }
.worked-example-scenario { margin-bottom: 1rem; font-style: italic; }
.keynote-content .worked-example-scenario > p:last-child { margin-bottom: 0; }
.keynote-content .worked-example-body table { background: var(--surface); }

/* Image with text: side by side, stacked on small screens. */
.media-block { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
.media-block figure { margin: 0; }
.media-right figure { order: 2; }
.media-text { min-width: 0; }
.media-text > :last-child { margin-bottom: 0; }
@media (max-width: 767.98px) {
    .media-block { grid-template-columns: minmax(0, 1fr); }
    .media-right figure { order: 0; }
}

/* Diagram: an inline SVG figure that scrolls sideways on phones rather than shrinking its labels. */
.diagram { position: relative; margin: 0 0 1.25rem; padding: 1rem; border: 1px solid var(--border-soft); border-radius: var(--radius); background: var(--surface); }
.diagram-scroll { overflow-x: auto; }
.diagram-scroll svg, .diagram-scroll img { display: block; width: 100%; min-width: 560px; height: auto; }
/* The caption line ends with the site's watermark, so the mark never covers the drawing. */
.diagram figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-top: .75rem; color: var(--text-muted); font-size: .875rem; line-height: 1.5; }
.diagram-mark { flex: none; display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 600; opacity: .75; user-select: none; }
/* Full-screen viewer (static/js/diagram_viewer.js). The expand button shows only once the script has run. */
.diagram-expand { display: none; position: absolute; top: .6rem; right: .6rem; z-index: 1; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; padding: 0; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted); cursor: pointer; opacity: .85; transition: opacity .15s, color .15s, border-color .15s; }
.dv-js .diagram-expand { display: inline-flex; }
.diagram:hover .diagram-expand, .diagram-expand:focus-visible { opacity: 1; color: var(--brand-primary); border-color: var(--primary-border); }
.diagram-expand:focus-visible, .dv-btn:focus-visible { outline: 3px solid rgba(var(--primary-rgb), .35); outline-offset: 2px; }
.dv-open { overflow: hidden; }
.diagram-viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #eef1f6; display: flex; flex-direction: column; }
.diagram-viewer:not([open]) { display: none; }
.diagram-viewer::backdrop { background: rgba(11, 21, 38, .6); }
.dv-bar { display: flex; align-items: center; gap: .5rem; padding: calc(.55rem + env(safe-area-inset-top, 0px)) max(.75rem, env(safe-area-inset-right, 0px)) .55rem max(.75rem, env(safe-area-inset-left, 0px)); background: var(--brand-navy); color: #e2e8f0; }
.dv-title { flex: 1; min-width: 0; font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-tools { display: flex; align-items: center; gap: .25rem; }
.dv-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 2.25rem; height: 2.25rem; padding: 0 .5rem; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.dv-btn:hover { background: var(--brand-navy-light); }
.dv-zoom { min-width: 3.4rem; font-variant-numeric: tabular-nums; }
.dv-sep { width: 1px; height: 1.4rem; margin: 0 .25rem; background: rgba(226, 232, 240, .25); }
.dv-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; cursor: grab; touch-action: none; }
.dv-stage.is-dragging { cursor: grabbing; }
.dv-canvas { position: absolute; left: 0; top: 0; padding: 1rem; transform-origin: 0 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }
.dv-canvas svg, .dv-canvas img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.dv-caption { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem max(1rem, env(safe-area-inset-right, 0px)) calc(.6rem + env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--border-soft); background: var(--surface); color: var(--text-muted); font-size: .85rem; }
.dv-caption:has(> span:first-child:empty) .dv-hint { margin-left: auto; }
.dv-hint { flex: none; font-size: .75rem; }
@media (max-width: 575.98px) {
    .dv-title, .dv-hint { display: none; }
    .dv-tools { flex: 1; justify-content: space-between; }
}
@media (prefers-reduced-motion: no-preference) {
    .dv-canvas.is-animating { transition: transform .18s ease-out; }
}

/* ----- Practice activities (static/js/activities.js) ------------------------ */
/* One question at a time: a start screen, a segmented progress bar, a feedback panel that slides up after each
   answer and a results screen. Orange marks activities; green and red are kept for right and wrong answers. */
.act {
    --act: #ea580c; --act-hover: #c2410c; --act-soft: #ffedd5; --act-softer: #fff7ed; --act-border: #fdba74; --act-text: #9a3412;
    --act-ok: #15803d; --act-ok-bg: #ecfdf3; --act-ok-border: #a7e3bd; --act-bad: #b42318; --act-bad-bg: #fef3f2; --act-bad-border: #f6c3bd;
    margin: 1.75rem 0 1.25rem; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-md); outline: none;
}
.act-i { width: 18px; height: 18px; flex: none; }
.act-head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.25rem .85rem; }
.act-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--act-soft); color: var(--act); }
.act-ico .act-i { width: 20px; height: 20px; }
.act-hgroup { flex: 1; min-width: 0; display: grid; }
.act-type { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--act-text); }
.keynote-content .act-title { margin: 0; font-size: 1.03rem; }
.act-skill { padding: .15rem .6rem; border: 1px solid var(--border-soft); border-radius: 999px; color: var(--text-muted); font-size: .75rem; white-space: nowrap; }
.act-bar { display: flex; align-items: center; gap: .75rem; padding: 0 1.25rem .85rem; }
.act-bar[hidden], .act-sheet[hidden] { display: none; }
.act-segs { flex: 1; display: flex; gap: 4px; }
.act-segs span { flex: 1; height: 6px; border-radius: 3px; background: var(--border-soft); transition: background .25s; }
.act-segs .cur { background: var(--act); }
.act-segs .ok { background: var(--act-ok); }
.act-segs .bad { background: var(--act-bad); }
.act-count { color: var(--text-muted); font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.act-stage { padding: .25rem 1.5rem 1.5rem; border-top: 1px solid var(--border-soft); }
.act-stage p { margin-bottom: 0; }
.act-q { margin: 1.25rem 0 .9rem !important; color: var(--text-strong); font-size: 1.1rem; font-weight: 650; line-height: 1.45; }
.act-hint { margin: -.5rem 0 .9rem !important; color: var(--text-muted); font-size: .85rem; }
.act-code { margin: 0 0 1rem; padding: .75rem 1rem; overflow-x: auto; border-radius: 12px; background: #0f1b2e; color: #e2e8f0; font-size: .8rem; line-height: 1.6; white-space: pre; }
.act-context { margin-top: 1.1rem; }
.act-context h4 { margin: 0 0 .35rem; font-size: 1.05rem; }
.act-context p { margin: 0 0 .6rem !important; }

.act-intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1.1rem 1.75rem; padding-top: 1.25rem; }
.act-goal { margin: 1rem 0 .75rem !important; color: var(--text-strong); font-weight: 600; }
.act-intro .act-goal { margin-top: 0 !important; }
/* A signed-out learner sees the header, goal and this login prompt instead of the player. */
.act-lock { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; padding: .9rem 1rem; border: 1px dashed var(--act-border); border-radius: 14px; background: var(--act-softer); }
.act-lock-ico { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); color: var(--act); box-shadow: var(--shadow-sm); }
.act-lock-text { flex: 1 1 16rem; min-width: 0; }
.act-lock-text b { display: block; color: var(--text-strong); }
.act-lock-text span { color: var(--text-muted); font-size: .88rem; }
.act-lock-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.act-lock-alt { font-size: .88rem; font-weight: 600; text-decoration: none; }
.act-how { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.act-how li { display: flex; gap: .6rem; font-size: .9rem; counter-increment: how; }
.act-how li::before { content: counter(how); display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--act-soft); color: var(--act-text); font-size: .75rem; font-weight: 800; }
.act-intro-side { display: grid; justify-items: end; gap: .5rem; }
.act-meta { color: var(--text-muted); font-size: .8rem; }

.act-tiles { display: grid; gap: .6rem; }
.act-tile { display: flex; align-items: flex-start; gap: .75rem; width: 100%; padding: .75rem .9rem; border: 2px solid var(--border-soft); border-radius: 14px; background: var(--surface); color: var(--text-strong); font-size: .95rem; text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.act-tile:hover:not([disabled]) { border-color: var(--act-border); background: var(--act-softer); transform: translateY(-1px); }
.act-tile[disabled] { cursor: default; }
.act-key { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface-muted); color: var(--text-muted); font-size: .78rem; font-weight: 700; }
.act-key .act-i { width: 14px; height: 14px; }
.act-tt { min-width: 0; padding-top: 2px; overflow-wrap: anywhere; }
.act-tile.sel { border-color: var(--act); background: var(--act-softer); }
.act-tile.sel .act-key { border-color: var(--act); background: var(--act); color: #fff; }
.act-tile.ok { border-color: var(--act-ok-border); background: var(--act-ok-bg); }
.act-tile.ok .act-key { border-color: var(--act-ok); background: var(--act-ok); color: #fff; }
.act-tile.bad { border-color: var(--act-bad-border); background: var(--act-bad-bg); }
.act-tile.bad .act-key { border-color: var(--act-bad); background: var(--act-bad); color: #fff; }
.act-tile.missed { border-style: dashed; border-color: var(--act-ok); }

.act-card { position: relative; max-width: 520px; margin: .4rem auto 1.6rem; padding: 1.75rem 1.4rem 1.5rem; border: 2px solid var(--act-border); border-radius: 16px; background: var(--act-softer); text-align: center; box-shadow: 0 8px 0 -3px var(--act-soft), 0 15px 0 -7px var(--act-border); }
.act-card-n { position: absolute; top: .5rem; right: .75rem; color: var(--act-text); font-size: .75rem; font-weight: 700; }
.act-card-t { color: var(--text-strong); font-size: 1.15rem; font-weight: 700; }
.act-bins { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: .6rem; }
.act-bin { position: relative; flex-direction: column; gap: .5rem; min-height: 92px; }
.act-bin .act-tt { padding-right: 1.9rem; font-weight: 700; }
.act-count-pill { position: absolute; top: .6rem; right: .6rem; min-width: 24px; padding: 1px 8px; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: .75rem; font-weight: 700; text-align: center; }
.act-bin small { display: block; color: var(--text-muted); font-size: .78rem; font-weight: 500; }

.act .act-ord { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.act-ord-item { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; border: 2px solid var(--border-soft); border-radius: 14px; background: var(--surface); color: var(--text-strong); font-size: .95rem; cursor: grab; }
.act-ord-item .act-tt { flex: 1; padding: 0; }
.act-ord-n { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--act-soft); color: var(--act-text); font-size: .8rem; font-weight: 800; }
.act-ord-mv { display: flex; gap: .25rem; }
.act-ord-mv button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border-soft); border-radius: 10px; background: var(--surface-muted); color: var(--text-body); cursor: pointer; }
.act-ord-mv button[disabled] { opacity: .35; cursor: default; }
.act-ord-item.ok { border-color: var(--act-ok-border); background: var(--act-ok-bg); }
.act-ord-item.ok .act-ord-n { background: var(--act-ok); color: #fff; }
.act-ord-item.bad { border-color: var(--act-bad-border); background: var(--act-bad-bg); }
.act-ord-item.bad .act-ord-n { background: var(--act-bad); color: #fff; }

.act-sent { margin: 1.1rem 0 !important; color: var(--text-strong); font-size: 1.1rem; line-height: 2.1; }
.act-slot { display: inline-block; min-width: 8em; padding: 0 .5rem; border-bottom: 3px solid var(--act); border-radius: 6px 6px 0 0; background: var(--act-softer); color: var(--act-text); font-family: var(--bs-font-monospace); font-size: 1rem; font-weight: 700; text-align: center; }
.act-slot.ok, .act-num.ok { border-color: var(--act-ok); background: var(--act-ok-bg); color: var(--act-ok); }
.act-slot.bad, .act-num.bad { border-color: var(--act-bad); background: var(--act-bad-bg); color: var(--act-bad); }
.act-words { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.act-words .act-tt { font-family: var(--bs-font-monospace); font-size: .88rem; }
.act-num { display: inline-flex; align-items: center; gap: .4rem; padding: 0 .5rem; border-bottom: 3px solid var(--act); border-radius: 6px 6px 0 0; background: var(--act-softer); }
.act-num:focus-within { box-shadow: 0 0 0 3px var(--act-soft); }
.act-num input { width: 5em; padding: 2px; border: 0; outline: none; background: transparent; color: var(--text-strong); font-size: 1.1rem; font-weight: 800; text-align: center; }
.act-num span { color: var(--text-muted); font-size: .95rem; font-weight: 600; }

.act-match { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.act-match > div { display: grid; align-content: start; gap: .5rem; }
.act-m { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 50px; padding: .6rem .8rem; border: 2px solid var(--border-soft); border-radius: 12px; background: var(--surface); color: var(--text-strong); font-size: .9rem; font-weight: 600; text-align: left; cursor: pointer; }
.act-m:hover:not([disabled]) { border-color: var(--act-border); }
.act-m.sel { border-color: var(--act); background: var(--act-softer); }
.act-m.matched { border-color: var(--act-ok-border); background: var(--act-ok-bg); color: var(--act-ok); cursor: default; }
.act-m.shake { border-color: var(--act-bad-border); background: var(--act-bad-bg); }
.act-m-n { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--act-ok); color: #fff; font-size: .75rem; }

.act-symptoms { margin: 0 0 .9rem; padding-left: 1.25rem; font-size: .9rem; }
.act-bugcode { padding: .5rem 0; overflow-x: auto; border-radius: 12px; background: #0f1b2e; color: #e2e8f0; }
.act-ln { display: flex; gap: .75rem; width: 100%; padding: 3px 1rem; border: 0; background: transparent; color: inherit; font-family: var(--bs-font-monospace); font-size: .82rem; text-align: left; white-space: pre; cursor: pointer; }
.act-ln:hover:not([disabled]) { background: rgba(251, 146, 60, .12); }
.act-ln[disabled] { cursor: default; }
.act-ln-n { min-width: 1.6em; color: #7d8da6; text-align: right; user-select: none; }
.act-ln.on { background: rgba(251, 146, 60, .24); box-shadow: inset 3px 0 0 #fb923c; }
.act-ln.ok { background: rgba(74, 222, 128, .18); box-shadow: inset 3px 0 0 #4ade80; }
.act-ln.bad { background: rgba(248, 113, 113, .18); box-shadow: inset 3px 0 0 #f87171; }
.act-ln.missed { box-shadow: inset 3px 0 0 #4ade80; outline: 1px dashed #4ade80; outline-offset: -1px; }

/* Fill in the table */
.act-grid-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 14px; }
/* Each select is as wide as its longest value, so no value is cut off; a table too wide for the page scrolls. */
.act .act-grid { width: 100%; margin: 0; border-collapse: collapse; font-size: .88rem; }
.act-grid th, .act-grid td { padding: .6rem .75rem; border-bottom: 1px solid var(--border-soft); text-align: left; vertical-align: top; }
.act-grid tbody tr:last-child th, .act-grid tbody tr:last-child td { border-bottom: 0; }
.act-grid thead th { background: var(--surface-muted); color: var(--text-muted); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }
.act-grid tbody th { padding-top: 1.1rem; color: var(--text-strong); font-weight: 650; }
.act-cell { width: auto; min-width: 9rem; padding: .45rem .55rem; border: 2px solid var(--border-soft); border-radius: 10px; background: var(--surface); color: var(--text-strong); font: inherit; font-size: .88rem; cursor: pointer; }
.act-cell:focus { border-color: var(--act); outline: none; }
.act-cell.filled { border-color: var(--act-border); background: var(--act-softer); }
.act-cell.ok { border-color: var(--act-ok-border); background: var(--act-ok-bg); color: var(--act-ok); opacity: 1; }
.act-cell.bad { border-color: var(--act-bad-border); background: var(--act-bad-bg); color: var(--act-bad); opacity: 1; }
.act-cell-fix { display: block; margin-top: .3rem; color: var(--act-ok); font-size: .78rem; font-weight: 650; }
.act-cell-fix:empty { display: none; }
.act-cell-fix::before { content: "Answer: "; color: var(--text-muted); font-weight: 500; }

/* Incident simulation */
.act-inc { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 1.4rem; padding-top: 1.1rem; }
.act-inc-main { min-width: 0; }
.keynote-content .act-inc-main h4 { margin: .75rem 0 .35rem; font-size: 1.1rem; }
.act-inc-main p { margin: 0 0 .75rem !important; }
.act-inc-status { display: inline-flex; align-items: center; gap: .5rem; padding: .2rem .75rem; border: 1px solid var(--act-bad-border); border-radius: 999px; background: var(--act-bad-bg); color: var(--act-bad); font-size: .78rem; font-weight: 700; }
.act-inc-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.act-inc-status.warn { border-color: var(--act-border); background: var(--act-softer); color: var(--act-text); }
.act-inc-status.good { border-color: var(--act-ok-border); background: var(--act-ok-bg); color: var(--act-ok); }
.act-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; margin-bottom: .25rem; }
.act-facts div { padding: .6rem .75rem; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface-muted); }
.act-facts span { display: block; color: var(--text-muted); font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.act-facts b { color: var(--text-strong); font-size: .9rem; }
.act-inc-log { min-width: 0; padding-left: 1.1rem; border-left: 1px solid var(--border-soft); }
.keynote-content .act-inc-log h5 { margin: 0 0 .6rem; color: var(--text-muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.act .act-inc-log ol { display: grid; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.act-inc-log li { position: relative; padding-left: 1.1rem; font-size: .82rem; line-height: 1.45; }
.act-inc-log li::before { content: ""; position: absolute; top: 6px; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); }
.act-inc-log li.ok::before { background: var(--act-ok); }
.act-inc-log li.bad { color: var(--act-bad); }
.act-inc-log li.bad::before { background: var(--act-bad); }

/* Odd one out */
.act-odd { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.act-odd .act-tile { align-items: center; min-height: 74px; font-weight: 600; }

/* Label the diagram */
.act-lab-scroll { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 14px; background: var(--surface-muted); }
.act-lab { position: relative; min-width: 640px; }
.act-lab > svg { display: block; width: 100%; height: auto; }
.act-lab-slot { position: absolute; display: grid; place-content: center; gap: 2px; padding: 2px 6px; border: 2px dashed var(--act-border); border-radius: 10px; background: var(--surface); color: var(--text-muted); font: inherit; font-size: .8rem; font-weight: 650; line-height: 1.25; text-align: center; cursor: pointer; }
.act-lab-slot:hover:not([disabled]) { border-color: var(--act); }
.act-lab-slot[disabled] { cursor: default; }
.act-lab-slot.filled { border-style: solid; border-color: var(--act); background: var(--act-softer); color: var(--text-strong); }
.act-lab-slot.ok { border-style: solid; border-color: var(--act-ok); background: var(--act-ok-bg); color: var(--act-ok); }
.act-lab-slot.bad { border-style: solid; border-color: var(--act-bad); background: var(--act-bad-bg); color: var(--act-bad); }
.act-lab-slot small { color: var(--act-ok); font-size: .72rem; font-weight: 700; }
.act-lab-pool { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .9rem; }
.act-chip { padding: .35rem 1rem; border: 2px solid var(--border-soft); border-radius: 999px; background: var(--surface); color: var(--text-strong); font-size: .88rem; font-weight: 600; cursor: pointer; }
.act-chip:hover:not([disabled]) { border-color: var(--act-border); }
.act-chip[aria-pressed="true"] { border-color: var(--act); background: var(--act); color: #fff; }
.act-chip[hidden] { display: none; }

.act-sheet { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.25rem; border-top: 1px solid var(--border-soft); }
.act-sheet.neutral { background: var(--surface-muted); }
.act-sheet.ok { border-top-color: var(--act-ok-border); background: var(--act-ok-bg); }
.act-sheet.bad { border-top-color: var(--act-bad-border); background: var(--act-bad-bg); }
.act-sheet-ico { display: grid; place-items: center; flex: none; align-self: flex-start; width: 38px; height: 38px; border-radius: 50%; color: #fff; }
.act-sheet.ok .act-sheet-ico { background: var(--act-ok); }
.act-sheet.bad .act-sheet-ico { background: var(--act-bad); }
.act-sheet-msg { flex: 1; min-width: 0; font-size: .9rem; }
.act-sheet.neutral .act-sheet-msg { color: var(--text-muted); font-size: .85rem; }
.act-sheet-msg > b { display: block; font-size: 1.03rem; }
.act-sheet.ok .act-sheet-msg > b { color: var(--act-ok); }
.act-sheet.bad .act-sheet-msg > b { color: var(--act-bad); }
.act-ans { display: block; margin-top: .4rem; }
.act-sheet-btns { display: flex; flex: none; gap: .5rem; }
.act-list { display: grid; gap: .4rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.act-list li { display: flex; gap: .5rem; font-size: .85rem; }
.act-list .act-i, .act-end-list .act-i { width: 15px; height: 15px; margin-top: 3px; }
.act-ol { margin: .5rem 0 0; padding-left: 1.25rem; font-size: .85rem; }
.act-fixed summary { margin-top: .5rem; font-size: .85rem; font-weight: 600; cursor: pointer; }
.act-fixed .act-code { margin: .5rem 0 0; }
.act-btn, .act-btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1.1rem; border-radius: 12px; font-size: .95rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.act-btn { border: 0; background: var(--act); color: #fff; box-shadow: 0 2px 0 var(--act-hover); }
.act-btn:hover { background: var(--act-hover); }
.act-btn[disabled] { opacity: .4; box-shadow: none; cursor: not-allowed; }
.act-btn .act-i { width: 16px; height: 16px; }
.act-btn-ghost { border: 2px solid #d3dbe7; background: var(--surface); color: var(--text-strong); font-weight: 600; }
.act-btn-ghost:hover { border-color: var(--act-border); }
.act :focus-visible { outline: 3px solid var(--act); outline-offset: 2px; }

.act-end { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem 1.6rem; padding-top: 1.5rem; }
.act-ring { flex: none; width: 120px; height: 120px; }
.act-ring-bg { fill: none; stroke: var(--border-soft); stroke-width: 10; }
.act-ring-fg { fill: none; stroke: var(--act); stroke-width: 10; stroke-linecap: round; }
.act-ring-fg.full { stroke: var(--act-ok); }
.act-ring text { fill: var(--text-strong); font-size: 24px; font-weight: 800; }
.act-end-kicker { color: var(--act-text); font-size: .72rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.keynote-content .act-end h4 { margin: .1rem 0 .25rem; font-size: 1.35rem; }
.act-end p { color: var(--text-muted); }
.keynote-content .act-end-list h4 { margin: 1.25rem 0 .5rem; color: var(--text-muted); font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; }
.act-end-list ul { display: grid; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.act-end-list li { display: flex; gap: .6rem; padding: .6rem .75rem; border: 1px solid var(--border-soft); border-radius: 12px; background: var(--surface-muted); font-size: .88rem; }
.act-end-list li .act-i { color: var(--act-bad); }
.act-end-list b { display: block; color: var(--text-strong); font-weight: 600; }
.act-end-clean { margin-top: 1rem !important; color: var(--act-ok); font-weight: 600; }
.act-end-btns { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }

/* The portal's preview of an activity (SiteActivities.open). */
.act-dialog { width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); padding: 0; overflow: auto; border: 0; border-radius: 18px; background: var(--surface-muted); }
.act-dialog::backdrop { background: rgba(11, 21, 38, .6); }
.act-dialog-bar { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem 1rem; border-bottom: 1px solid var(--border-soft); background: var(--surface); color: var(--text-muted); font-size: .85rem; }
.act-dialog .act { margin: 1rem; }
.act-dialog .act-title { margin: 0; font-size: 1.03rem; }
.act-dialog .act-end h4 { margin: .1rem 0 .25rem; font-size: 1.35rem; }

@media (prefers-reduced-motion: no-preference) {
    .act-step { animation: act-in .28s ease; }
    .act-sheet { animation: act-sheet-in .25s ease; }
    .act-tile.ok { animation: act-pop .3s ease; }
    .act-tile.bad, .act-m.shake { animation: act-shake .35s ease; }
    .act-ring-fg { transition: stroke-dashoffset 1s cubic-bezier(.2, .7, .2, 1); }
}
@keyframes act-in { from { opacity: .2; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes act-sheet-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes act-pop { 50% { transform: scale(1.015); } }
@keyframes act-shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (max-width: 575.98px) {
    .act-head { flex-wrap: wrap; padding: .9rem 1rem .75rem; }
    .act-hgroup { flex-basis: calc(100% - 52px); }
    .act-skill { order: 3; margin-left: 52px; }
    .act-stage { padding: .25rem 1rem 1.25rem; }
    .act-intro { grid-template-columns: minmax(0, 1fr); }
    .act-intro-side { justify-items: start; }
    .act-bins { grid-template-columns: minmax(0, 1fr); }
    .act-bin { min-height: 0; }
    .act-sheet { flex-wrap: wrap; padding: .9rem 1rem; }
    .act-sheet-btns { width: 100%; }
    .act-sheet-btns > * { flex: 1; }
    .act-match { gap: .5rem; }
    .act-m { padding: .5rem .6rem; font-size: .85rem; }
    .act-odd { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767.98px) {
    .act-inc { grid-template-columns: minmax(0, 1fr); }
    .act-inc-log { padding: .9rem 0 0; border-top: 1px solid var(--border-soft); border-left: 0; }
}

/* ----- Module checkpoint (templates/app/module_checkpoint.html, static/js/checkpoint.js) ---------------------- */
/* A hub of activity tiles under a navy panel with the "x of n tried" count; the tiles open one activity at a time. */
.cp-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; margin: .4rem 0 1.1rem; padding: 1.35rem 1.5rem; border-radius: 18px; background: linear-gradient(135deg, var(--brand-navy), var(--brand-navy-light)); color: #e2e8f0; }
.cp-hero > div:first-child { flex: 1 1 22rem; min-width: 0; }
.keynote-content .cp-hero h2 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .3rem; color: #fff; font-size: 1.3rem; }
.cp-hero h2 svg { flex: none; color: #fdba74; }
.keynote-content .cp-hero p { max-width: 58ch; margin: 0; color: #cbd5e1; font-size: .92rem; }
.keynote-content .cp-hero .cp-signin { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-top: .75rem; }
.cp-hero .cp-signin a { color: #fdba74; font-weight: 600; text-decoration: none; }
.cp-hero .cp-signin .cp-signin-btn { --bs-btn-bg: #ea580c; --bs-btn-border-color: #ea580c; --bs-btn-hover-bg: #c2410c; --bs-btn-hover-border-color: #c2410c; --bs-btn-active-bg: #c2410c; --bs-btn-color: #fff; --bs-btn-hover-color: #fff; color: #fff; }
.cp-hero .cp-signin-alt { font-size: .88rem; }
.cp-progress { display: grid; justify-items: end; gap: .4rem; }
.cp-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-dots span { width: 16px; height: 16px; border: 2px solid #fdba74; border-radius: 50%; }
.cp-dots span.on { border-color: #fb923c; background: #fb923c; }
.cp-progress b { color: #fff; font-size: .9rem; white-space: nowrap; }
.cp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; }
.cp-tile { display: grid; align-content: start; gap: .45rem; padding: 1rem; border: 2px solid var(--border-soft); border-radius: 16px; background: var(--surface); color: var(--text-body); text-decoration: none; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s; }
.cp-tile:hover { border-color: #fdba74; color: var(--text-body); transform: translateY(-2px); }
.cp-tile[aria-current="true"] { border-color: #ea580c; }
.cp-tile:focus-visible { outline: 3px solid #ea580c; outline-offset: 2px; }
.cp-tile-type { color: #9a3412; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.cp-tile b { color: var(--text-strong); font-size: .97rem; line-height: 1.3; }
.cp-status { justify-self: start; padding: .1rem .6rem; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface-muted); color: var(--text-muted); font-size: .75rem; font-weight: 700; }
.cp-status.done { border-color: #a7e3bd; background: #ecfdf3; color: #15803d; }
.cp-activity[hidden] { display: none; }
@media (max-width: 575.98px) {
    .cp-hero { padding: 1.1rem 1.1rem; }
    .cp-progress { justify-items: start; }
}
@media (prefers-reduced-motion: reduce) {
    .cp-tile { transition: none; }
    .cp-tile:hover { transform: none; }
}

/* ----- Study plan --------------------------------------------------------- */
.plan-strip { display: flex; flex-direction: row; align-items: center; gap: 1rem; padding: 1.1rem 1.35rem; }
.plan-strip h3 { font-size: 1rem; font-weight: 700; color: var(--text-strong); }
.plan-strip p { font-size: .87rem; color: var(--text-muted); margin: .2rem 0 0; }
.plan-strip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; margin-bottom: .4rem; }
@media (max-width: 575.98px) {
    .plan-strip { flex-direction: column; align-items: flex-start; }
}

.plan-today { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.plan-today li { display: flex; gap: .5rem; align-items: baseline; font-size: .87rem; min-width: 0; }
.plan-today a { color: var(--text-strong); font-weight: 500; overflow-wrap: anywhere; }
.plan-today a:hover { color: var(--brand-primary); }
.plan-kind { flex: 0 0 4.75rem; white-space: nowrap; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); }
.plan-kind.overdue { color: #9a4d00; }

.plan-track { position: relative; overflow: visible; }
.plan-due { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--brand-navy-light); border-radius: 1px; }
.plan-legend { display: flex; justify-content: space-between; gap: .75rem; margin-top: .35rem; font-size: .76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.plan-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem 1.5rem; align-items: center; }
.plan-stats { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.plan-summary-bar { grid-column: 1 / -1; }
@media (max-width: 575.98px) {
    .plan-summary { grid-template-columns: minmax(0, 1fr); }
}

.plan-alert { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: 1rem; padding: .7rem 1rem; border: 1px solid #f6d7a7; border-radius: var(--radius-sm); background: #fff8ec; color: #7a3e00; font-size: .88rem; }
.plan-alert.info { border-color: var(--primary-border); background: var(--brand-primary-soft); color: var(--brand-primary-hover); }

.plan-week { margin-top: 1.5rem; }
.plan-week > summary { margin-bottom: .6rem; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); cursor: pointer; }
.plan-week > summary:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; border-radius: 4px; }
.plan-days { display: grid; gap: .6rem; }
.plan-day { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 1rem; padding: .9rem 1.1rem; }
.plan-day.today { border-color: var(--brand-accent); box-shadow: 0 0 0 1px var(--brand-accent), var(--shadow-sm); }
.plan-day.rest { padding: .55rem 1.1rem; background: transparent; border-style: dashed; box-shadow: none; }
.plan-day.review { background: var(--brand-primary-soft); border-color: var(--primary-border); }
.plan-date b { display: block; font-size: .92rem; color: var(--text-strong); }
.plan-date span { font-size: .76rem; color: var(--text-muted); }
.plan-day-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .45rem; }
@media (max-width: 575.98px) {
    .plan-day { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
}

.plan-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.plan-item { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr) auto; gap: .65rem; align-items: start; font-size: .9rem; }
.plan-item-name { color: var(--text-strong); font-weight: 500; overflow-wrap: anywhere; }
.plan-item-name:hover { color: var(--brand-primary); }
.plan-item-meta { display: block; font-size: .76rem; color: var(--text-muted); }
.plan-item.done .plan-item-name { color: var(--text-muted); text-decoration: line-through; text-decoration-color: #cbd5e1; }
.plan-tick { display: grid; place-items: center; width: 18px; height: 18px; margin-top: .2rem; border: 2px solid var(--border-soft); border-radius: 50%; }
.plan-tick svg { width: 11px; height: 11px; color: #fff; }
.plan-item.done .plan-tick { background: var(--brand-accent); border-color: var(--brand-accent); }
.plan-item.missed .plan-tick { border-color: #d97706; }
.plan-item.activity { grid-template-columns: 1.25rem minmax(0, 1fr); }
.plan-dot { width: 8px; height: 8px; margin: .5rem 0 0 .3rem; border-radius: 50%; background: var(--brand-primary); }

.plan-form { display: grid; gap: 1.5rem; padding: 1.35rem; }
.plan-form fieldset { min-width: 0; }
.plan-label { display: block; float: none; margin-bottom: .5rem; font-size: .95rem; font-weight: 600; color: var(--text-strong); }
.plan-inline { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.plan-inline[hidden] { display: none; }
.plan-days-input { width: 6rem; }
.plan-inline input[type="date"] { width: auto; }
.plan-review-select { width: 5rem; }
.plan-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.plan-chip { padding: .35rem .8rem; border: 1px solid var(--border-soft); border-radius: 999px; background: var(--surface); color: var(--text-muted); font-size: .82rem; font-weight: 600; cursor: pointer; user-select: none; }
.btn-check:checked + .plan-chip { border-color: var(--brand-accent); background: var(--accent-soft-bg); color: var(--accent-strong-text); }
.btn-check:focus-visible + .plan-chip { outline: 3px solid rgba(var(--primary-rgb), .3); outline-offset: 1px; }

.plan-preview { position: sticky; top: 1rem; }
.plan-preview-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.plan-preview-nums .stat-value { font-variant-numeric: tabular-nums; }
.plan-timeline { display: flex; height: 26px; overflow: hidden; border: 1px solid var(--border-soft); border-radius: 8px; font-size: .68rem; font-weight: 700; }
.plan-timeline span { display: grid; place-items: center; }
.plan-timeline .learn { flex: 1; background: var(--accent-soft-bg); color: var(--accent-strong-text); }
.plan-timeline .review { background: var(--brand-primary-soft); color: var(--brand-primary); }
.plan-timeline .review[hidden] { display: none; }
@media (max-width: 991.98px) {
    .plan-preview { position: static; }
}

/* ----- Ordering, matching and hotspot questions (templates/app/_question_types.html) ----------------------- */
html:not(.qt-js) .qt-js-only { display: none !important; }
.qt-js .qt-nojs-only { display: none !important; }
.qt { display: grid; gap: .75rem; }
.qt-instr { font-size: .85rem; color: var(--text-muted); margin: 0; }
.qt-subhead { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .35rem; }
.qt-fix { font-size: .8rem; font-weight: 600; color: #b42318; white-space: nowrap; }
.qt-note { font-size: .85rem; color: var(--text-muted); margin: 0; }

.qt-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.qt-order-item {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .6rem .55rem .7rem;
    border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface);
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.qt:not(.is-revealed) .qt-order-item:hover { border-color: var(--primary-border); background: #fafcff; }
.qt-order-item.dragging { border-color: var(--brand-primary); background: var(--brand-primary-soft); box-shadow: var(--shadow-lg); position: relative; z-index: 2; }
.qt-order-item.ok { border-color: #a7e3c9; background: #f0fbf6; }
.qt-order-item.bad { border-color: #f5c2c0; background: #fef3f2; }
.qt-pos {
    display: inline-grid; place-items: center; flex-shrink: 0; min-width: 28px; height: 28px; border-radius: 8px;
    background: var(--brand-primary-soft); color: var(--brand-primary); font-size: .82rem; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.qt-handle { display: grid; place-items: center; flex-shrink: 0; width: 22px; height: 30px; color: var(--text-muted); cursor: grab; touch-action: none; user-select: none; }
.qt-handle:active { cursor: grabbing; }
.qt-label { flex: 1; min-width: 0; }
.qt-move { display: flex; gap: .25rem; flex-shrink: 0; }
.qt-icon-btn {
    width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
    border: 1px solid var(--border-soft); border-radius: 8px; background: var(--surface); color: var(--text-body); line-height: 1;
}
.qt-icon-btn:hover:not(:disabled) { border-color: var(--primary-border); color: var(--brand-primary); }
.qt-icon-btn:disabled { opacity: .35; }
.qt-order-item .form-select { width: 4.5rem; }
.qt-correct { padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--surface-muted); }
.qt-correct-list { margin: 0; padding-left: 1.3rem; font-size: .92rem; }

.qt-bank {
    display: flex; flex-wrap: wrap; gap: .5rem; min-height: 3.2rem; padding: .6rem;
    border: 1px dashed var(--primary-border); border-radius: var(--radius-sm); background: #fafcff;
}
.qt-bank.is-empty::after { content: "All items placed. Select a placed item to move it back."; align-self: center; font-size: .85rem; color: var(--text-muted); padding-left: .25rem; }
.qt-bank.hover { border-color: var(--brand-primary); background: var(--brand-primary-soft); }
.qt-chip {
    font: inherit; font-size: .9rem; font-weight: 600; line-height: 1.35; text-align: center;
    padding: .35rem .8rem; border-radius: 999px;
    border: 1px solid var(--primary-border); background: var(--surface); color: var(--text-strong);
    cursor: grab; touch-action: none; user-select: none;
}
.qt-chip:hover { border-color: var(--brand-primary); }
.qt-chip.selected { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.qt-chip.placeholder { opacity: .35; }
.qt-chip.ghost { position: fixed; z-index: 1080; pointer-events: none; box-shadow: var(--shadow-lg); background: var(--brand-primary-soft); border-color: var(--brand-primary); }
.qt-chip.is-static { cursor: default; }
.qt-targets { display: grid; gap: .5rem; }
.qt-target {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(9rem, 13rem); align-items: center; gap: .5rem .75rem;
    padding: .6rem .6rem .6rem .9rem; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: var(--surface);
}
.qt-target.ok { border-color: #a7e3c9; background: #f0fbf6; }
.qt-target.bad { border-color: #f5c2c0; background: #fef3f2; }
.qt-desc { min-width: 0; font-size: .93rem; }
.qt-slot { display: flex; min-height: 2.5rem; border-radius: 999px; }
.qt-slot .qt-chip { width: 100%; }
.qt-slot-empty {
    width: 100%; font: inherit; font-size: .82rem; color: var(--text-muted);
    border: 1.5px dashed var(--primary-border); border-radius: 999px; background: #fafcff; padding: .3rem .6rem;
}
.qt-slot.hover .qt-slot-empty, .is-arming .qt-slot-empty { border-color: var(--brand-primary); background: var(--brand-primary-soft); color: var(--brand-primary); }
.qt-slot.hover .qt-chip { border-color: var(--brand-primary); }
.qt-result { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; justify-content: flex-end; }
.qt-empty { font-size: .85rem; color: var(--text-muted); }

.qt-diagram-wrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); background: #f8fafc; }
.qt-diagram { position: relative; min-width: 34rem; }
.qt-diagram img { display: block; width: 100%; height: auto; user-select: none; }
.qt-region-input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0 !important; pointer-events: none; }
.qt-region {
    position: absolute; display: grid; place-items: center; margin: 0;
    border: 2px dashed var(--brand-primary); border-radius: 8px; background: rgba(var(--primary-rgb), .06);
    color: var(--brand-primary); font-weight: 700; font-size: .8rem; line-height: 1; cursor: pointer;
    transition: background-color .15s ease;
}
.qt-region:hover { background: rgba(var(--primary-rgb), .16); }
.qt-region-input:focus-visible + .qt-region { outline: 3px solid rgba(var(--primary-rgb), .4); outline-offset: 2px; }
.qt-region-input:checked + .qt-region { border-style: solid; border-width: 3px; background: rgba(var(--primary-rgb), .22); }
.is-revealed .qt-region { cursor: default; border-color: #94a3b8; color: var(--text-muted); background: transparent; }
.is-revealed .qt-region.correct { border: 3px solid #059669; background: rgba(5, 150, 105, .16); color: #047857; }
.is-revealed .qt-region.wrong { border: 3px solid #dc2626; background: rgba(220, 38, 38, .12); color: #b91c1c; }
.qt-hot-status { font-size: .88rem; color: var(--text-muted); margin: 0; min-height: 1.4em; }
.qt-hot-summary { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; font-size: .92rem; }
.qt-hot-summary .ok { color: #047857; }
.qt-hot-summary .bad { color: #b91c1c; }

@media (max-width: 575.98px) {
    .qt-target { grid-template-columns: minmax(0, 1fr); }
    .qt-result { justify-content: flex-start; }
}

/* ----- Blog ------------------------------------------------------------- */
/* Tags take the exam provider's colours (provider-*), or teal for general categories. */
.blog-tag {
    --tag-bg: var(--accent-soft-bg);
    --tag-ink: var(--accent-strong-text);
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 6px;
    background: var(--tag-bg);
    color: var(--tag-ink);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    line-height: 1.5;
}
.blog-tag.provider-aws { --tag-bg: #fff3d1; --tag-ink: #9a4b05; }
.blog-tag.provider-microsoft { --tag-bg: #dff0ff; --tag-ink: #0a4d9c; }
.blog-tag.provider-isc2 { --tag-bg: #dcfce7; --tag-ink: #047857; }
.blog-tag:is(.provider-hashicorp, .provider-finops, .provider-redhat, .provider-other) { --tag-bg: #efe6fd; --tag-ink: #4b2593; }

.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .75rem; color: var(--text-muted); font-size: .82rem; }
.blog-meta-sep::before { content: "\00b7"; margin-right: .75rem; }
.blog-eyebrow { color: var(--accent-strong-text); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.blog-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.25rem; margin-bottom: 1.75rem; }
.blog-head h1 { margin: .35rem 0 .5rem; }
.blog-head .section-sub { max-width: 62ch; }
.blog-filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.blog-chip {
    padding: .3rem .8rem;
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-body);
    font-size: .83rem;
    font-weight: 500;
    text-decoration: none;
}
.blog-chip:hover { border-color: #cbd5e1; color: var(--text-strong); }
.blog-chip.active { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }

.blog-featured {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-md);
}
.blog-featured-art {
    --art-glow: var(--accent-rgb);
    display: grid;
    place-items: center;
    min-height: 15rem;
    background:
        radial-gradient(260px 200px at 85% 15%, rgba(var(--art-glow), .38), transparent 70%),
        radial-gradient(300px 220px at 15% 90%, rgba(var(--accent-rgb), .28), transparent 70%),
        linear-gradient(160deg, var(--brand-navy-2), var(--brand-navy-light));
}
.blog-featured-art.provider-aws { --art-glow: 245, 158, 11; }
.blog-featured-art.provider-microsoft { --art-glow: 58, 176, 240; }
.blog-featured-art.provider-isc2 { --art-glow: 74, 222, 128; }
.blog-featured-art img { width: 100%; height: 100%; object-fit: cover; }
.blog-featured-code { padding: 0 1.5rem; color: #fff; font-size: clamp(1.8rem, 1.2rem + 2vw, 2.6rem); font-weight: 800; letter-spacing: -.03em; text-align: center; }
.blog-featured-body { display: flex; flex-direction: column; gap: .7rem; padding: 1.75rem; }
.blog-featured-body h2 { margin: 0; font-size: 1.5rem; }
.blog-featured-body p { margin: 0; }
.blog-featured h2 a, .blog-card h3 a { color: var(--text-strong); text-decoration: none; }
.blog-featured:hover h2 a, .blog-card:hover h3 a { color: var(--brand-primary); }

.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    padding: 1.4rem;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s ease, transform .15s ease;
}
.blog-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.blog-card h3 { margin: 0; font-size: 1.08rem; }
.blog-card p { margin: 0; }
.blog-card-foot { margin-top: auto; padding-top: .4rem; }
.blog-empty { padding: 2.5rem; border: 1px dashed #cbd5e1; border-radius: var(--radius); background: var(--surface); text-align: center; }
.blog-pager { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2rem; }

.blog-post { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 2rem; align-items: start; margin-top: 1rem; }
.blog-post-head { padding: 2rem 2.25rem 0; }
.blog-post-head h1 { margin: .7rem 0 .8rem; }
.blog-lede { max-width: 62ch; margin: 0 0 1.25rem; color: var(--text-muted); font-size: 1.1rem; }
.blog-byline { display: flex; align-items: center; gap: .65rem; padding: 1rem 0; border-top: 1px solid var(--border-soft); }
.blog-byline strong { display: block; color: var(--text-strong); font-size: .9rem; line-height: 1.3; }
.blog-avatar { display: grid; place-items: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, var(--brand-primary-hover)); color: #fff; font-size: .78rem; font-weight: 700; }
.blog-cover { display: block; width: 100%; max-height: 420px; object-fit: cover; border-block: 1px solid var(--border-soft); }
.blog-post .keynote-content { border-top: 1px solid var(--border-soft); }
.blog-post .keynote-content > h2[id] { scroll-margin-top: calc(var(--header-offset, 0px) + 1rem); }
.blog-side { position: sticky; top: calc(var(--header-offset, 0px) + 1rem); display: flex; flex-direction: column; gap: 1rem; }
.blog-side-card { gap: .5rem; padding: 1.2rem; }
.blog-side-title { margin: 0 0 .5rem; color: var(--text-muted); font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.blog-toc { display: flex; flex-direction: column; gap: .35rem; margin: 0; padding: 0; list-style: none; font-size: .9rem; line-height: 1.45; }
.blog-toc a { color: var(--text-body); text-decoration: none; }
.blog-toc a:hover { color: var(--brand-primary); }
.blog-cta { --bs-card-bg: var(--brand-navy); --bs-card-border-color: var(--brand-navy); color: #e2e8f0; }
.blog-cta .blog-side-title { color: var(--accent-on-dark); }
.blog-cta p { margin: 0 0 .9rem; font-size: .92rem; }
.blog-cta .btn { align-self: flex-start; }
.blog-related { margin-top: 3rem; }
.blog-related h2 { margin-bottom: 1rem; font-size: 1.2rem; }

@media (max-width: 991.98px) {
    .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .blog-post { grid-template-columns: minmax(0, 1fr); }
    .blog-side { position: static; }
}
@media (max-width: 575.98px) {
    .blog-grid, .blog-featured { grid-template-columns: minmax(0, 1fr); }
    .blog-featured-art { min-height: 9rem; }
    .blog-post-head { padding: 1.4rem 1.25rem 0; }
}

/* Error pages (templates/404.html, 403.html). 500.html is standalone and carries its own styles. */
.error-page { display: grid; justify-items: center; text-align: center; padding: 3.5rem 0 4rem; }
.error-card { max-width: 560px; display: grid; justify-items: center; gap: .9rem; }
.error-eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
                 color: var(--accent-strong-text); background: var(--accent-soft-bg); padding: .25rem .65rem; border-radius: 999px; }
.error-code { font-weight: 800; font-size: clamp(4rem, 14vw, 7rem); line-height: 1; letter-spacing: -0.04em;
              background: linear-gradient(180deg, var(--brand-navy-2), var(--brand-navy-light));
              -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { margin: 0; font-size: 1.65rem; font-weight: 700; color: var(--text-strong); text-wrap: balance; }
.error-page p { margin: 0; line-height: 1.6; max-width: 48ch; }
.error-actions { display: flex; gap: .65rem; flex-wrap: wrap; justify-content: center; margin-top: .4rem; }
.error-small { font-size: .85rem; color: var(--text-muted); }
