/* ==========================================================================
   Lolly Central — brand stylesheet
   Hand-written, no framework. Targets WCAG 2.2 AAA.
   Headings: Poppins (self-hosted) · Body: Calibri (system) / Carlito (self-hosted fallback)
   ========================================================================== */

/* ----- Fonts ------------------------------------------------------------- */
/* Poppins — headings */
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/poppins-500-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/poppins-500-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/poppins-600-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/poppins-600-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/poppins-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/poppins-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
/* Carlito — metric-compatible Calibri fallback for body */
@font-face {
    font-family: 'Carlito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/carlito-400-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Carlito';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/carlito-400-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
    font-family: 'Carlito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/carlito-700-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
    font-family: 'Carlito';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/carlito-700-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}

/* ----- Design tokens ----------------------------------------------------- */
:root {
    /* Brand */
    --brand: #F78E20;          /* primary orange — fills & large non-text accents only */
    --brand-hover: #E07A0E;    /* darker orange for hover/active on fills */
    --brand-deep: #8A3F00;     /* AAA-safe "orange" text on light (≈7.5:1 on white) */
    --brand-tint: #FFF3E6;     /* soft wash for section backgrounds */
    --brand-tint-2: #FDE7CC;

    /* Ink & surfaces */
    --ink: #1A1A1A;            /* body text — ≈16:1 on white */
    --ink-soft: #3D3D3D;       /* secondary text — ≈10:1 on white */
    --surface: #FFFFFF;
    --surface-alt: #FFFFFF;    /* light mode: keep the whole page white */
    --line: #DCDCD8;
    --nav-hover: #DFE0DF;      /* neutral grey hover for the top menu pills */
    --focus: #0B3DD1;          /* high-contrast focus ring */
    --header-bg: rgba(255, 255, 255, 0.92);
    --footer-bg: #1A1A1A;

    /* Type */
    --font-head: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-body: Calibri, 'Carlito', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Shape & depth */
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 4px 16px rgba(26, 26, 26, 0.08);
    --shadow-lg: 0 12px 32px rgba(26, 26, 26, 0.14);

    /* Spacing scale (8px base) */
    --sp-1: 0.5rem;
    --sp-2: 1rem;
    --sp-3: 1.5rem;
    --sp-4: 2rem;
    --sp-5: 3rem;
    --sp-6: 4.5rem;

    --container: 1200px;
    --content: 70ch;
}

/* ----- Reset / base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1.0625rem;          /* 17px */
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
    margin: 0 0 var(--sp-2);
    text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem); font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 var(--sp-2); }

a {
    color: var(--brand-deep);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 0.08em;
}
a:hover { text-decoration-thickness: 0.16em; }

ul, ol { margin: 0 0 var(--sp-2); padding-left: 1.4em; }
li { margin-bottom: 0.4em; }

strong { font-weight: 700; }

hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-4) 0; }

:target { scroll-margin-top: 6rem; }

/* ----- Focus visibility (WCAG 2.4.7 / 2.4.13) ---------------------------- */
:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
    border-radius: 4px;
}
/* Remove default outline only where we provide :focus-visible */
:focus:not(:focus-visible) { outline: none; }

/* ----- Skip link (WCAG 2.4.1) -------------------------------------------- */
.skip-link {
    position: absolute;
    left: var(--sp-2);
    top: -4rem;
    z-index: 1000;
    background: var(--ink);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 600;
    transition: top 0.2s ease;
}
.skip-link:focus { top: var(--sp-2); }

/* ----- Layout helpers ---------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--sp-3);
}
.section { padding-block: var(--sp-6); }
.section--alt { background: var(--surface-alt); }
.section--tint { background: var(--brand-tint); }
.section--soft-grey { background: rgba(223, 224, 223, 0.2); }   /* 20% of #DFE0DF */
.prose { max-width: var(--content); }
.lead { font-size: 1.2rem; color: var(--ink-soft); }
.text-center { text-align: center; }

main { flex: 1 0 auto; }

/* ----- Header & brand ---------------------------------------------------- */
.site-header {
    position: sticky;
    top: 2.25rem;   /* sits directly below the sticky top contact bar */
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--line);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    min-height: 4.5rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.3rem;
    padding: 0.4rem 0.2rem;
    flex-shrink: 0;   /* never shrink/truncate the wordmark — the menu flexes instead */
}
.brand img { width: 2.6rem; height: 2.6rem; flex-shrink: 0; }
.brand__name { white-space: nowrap; }
.brand__name span { color: var(--brand); }   /* "Lolly" in brand orange, "Central" stays ink */

/* ----- Primary navigation ------------------------------------------------ */
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--ink);
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle__bars { display: inline-block; width: 1.25rem; height: 0.875rem; position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after,
.nav-toggle__bars span {
    content: "";
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: var(--ink);
    border-radius: 2px;
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 50%; transform: translateY(-50%); }
.nav-toggle__bars::after { bottom: 0; }

.primary-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: clamp(0.05rem, -0.15rem + 0.5vw, 0.25rem);
    margin: 0;
    padding: 0;
}
.primary-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.5rem clamp(0.45rem, 0.1rem + 0.6vw, 0.9rem);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(0.82rem, 0.62rem + 0.5vw, 1rem);
    border-radius: 999px;
}
.primary-nav a:hover { background: var(--nav-hover); color: var(--ink); }
.primary-nav a[aria-current="page"] {
    color: var(--brand);
}
/* Nudge the menu options down slightly so they sit a touch lower in the header. */
@media (min-width: 801px) {
    .primary-nav { transform: translateY(5px); }
}

/* ----- Buttons ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    border: 2px solid transparent;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: #1A1A1A; color: #fff; transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

/* ----- Hero -------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    background: var(--surface);
}
/* Side-by-side hero, mirroring the inner-page .page-head__grid: the search column sits on the LEFT
   (capped like the inner headline column), the mascot on the RIGHT in its own `bot` cell, and a 1fr
   spacer column absorbs any mascot size change — so a larger mascot can never widen, narrow or move
   the search column. Collapses to a single stacked column on mobile (see the 800px block below). */
.hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 40rem) auto 1fr;
    grid-template-areas: "search bot .";
    align-items: center;
    column-gap: var(--sp-5);
    row-gap: var(--sp-3);
    text-align: left;
    max-width: 72rem;
    margin-inline: auto;
    padding-block: var(--sp-4) var(--sp-5);
}
.hero__inner .hero-search { grid-area: search; }
.hero__eyebrow {
    display: inline-block;
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: var(--brand);
    margin-bottom: var(--sp-2);
}

/* Home hero greeting "speech bubble" — sits over the bot so it reads as the bot greeting you.
   Thin lolly-orange outline, white fill, with a tail pointing down toward the robot. */
.bot-bubble {
    position: absolute;
    top: 10%;
    right: 51%;
    z-index: 3;
    white-space: nowrap;
    margin: 0;
    background: #fff;
    border: 2px solid var(--brand);
    border-radius: var(--radius);
    padding: var(--sp-1) var(--sp-3);
    color: #1A1A1A;   /* always dark — the bubble is white in both themes */
    font-size: clamp(1rem, 0.8rem + 0.6vw, 1.35rem);
    line-height: 1.2;
    box-shadow: var(--shadow);
    text-align: center;
}
/* Tail on the bottom edge, pointing down toward the bot's head below it. */
.bot-bubble::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%) rotate(45deg);
    width: 18px;
    height: 18px;
    background: #fff;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
}
/* Desktop only: nudge the greeting bubble LEFT so its body clears the top of Ali's head, and slide
   its tail RIGHT along the bottom edge so it stays attached and still points back at the mascot.
   The base rules above (right:51% / tail left:50%) are left untouched, so the ≤800px mobile hero
   and its bubble are unchanged. Two tunables: the bubble's `right` and the tail's `left`. */
@media (min-width: 801px) {
    .bot-bubble {
        right: 60%;                              /* bubble offset — higher % moves the bubble further LEFT */
        padding-bottom: calc(var(--sp-1) + 7px); /* clear the tail: its notch pokes ~12px up into the bubble and
                                                    paints over the text, so give the last word room below it.
                                                    Raise the +7px if any clip remains, lower it if too bottom-heavy. */
    }
    .bot-bubble::after { left: 80%; }       /* tail position — higher % moves the tail further RIGHT along the bubble edge */
}
/* Mobile only (≤800px): after the recent Ali size increase he grew UP into the bubble, so the tail
   landed on his hand/head. Lift the bubble above his head and nudge the tail toward him so it stays
   attached and points cleanly at him. The bubble is positioned as a % of Ali's box, so it tracks his
   size — these are the tuned offsets for the current mobile size. Complements the desktop block above;
   the desktop bubble (≥801px) is untouched. All three mobile knobs live here. */
@media (max-width: 800px) {
    .bot-bubble {
        top: -4%;                           /* lift above Ali's head — MORE NEGATIVE = higher (primary fix) */
        right: 51%;                         /* horizontal offset — higher % = further LEFT */
    }
    .bot-bubble::after { left: 62%; }       /* tail toward Ali — higher % = further RIGHT along the bubble edge */
}

/* ----- Search inputs: shared, theme-aware styling ------------------------ */
/* One consistent, premium look for every search box — the Home hero, the library
   section toolbars, the FAQ filter and the all-library search page. Every colour
   comes from a theme token, so the field reads correctly in light and dark mode.
   Layout/sizing per context is set in each component's own rule below. */
.hero-search__field,
.library-search,
.faq-search { position: relative; }

/* Magnifier affordance, drawn on the wrapper (not the input, which can't take a
   pseudo-element) and tinted with the secondary-ink token so it adapts per theme. */
.hero-search__field::before,
.library-search::before,
.faq-search::before {
    content: "";
    position: absolute;
    left: 1.15rem;
    top: 50%;
    width: 1.15rem;
    height: 1.15rem;
    transform: translateY(-50%);
    background: var(--ink-soft);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") center / contain no-repeat;
    pointer-events: none;
    z-index: 1;
}

.hero-search input,
.library-search input,
.faq-search input {
    min-width: 0;                         /* allow the field to shrink (no 320px overflow) */
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 0.7rem 1.2rem 0.7rem 3rem;   /* left room for the magnifier */
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.hero-search input::placeholder,
.library-search input::placeholder,
.faq-search input::placeholder { color: var(--ink-soft); opacity: 1; }

.hero-search input:hover,
.library-search input:hover,
.faq-search input:hover { border-color: var(--brand); }

/* Strong, on-brand focus — layered (border + offset outline + soft glow) so it
   stays clearly visible in both themes; keeps the pill radius (overrides the
   global 4px focus radius). */
.hero-search input:focus-visible,
.library-search input:focus-visible,
.faq-search input:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-color: var(--brand);
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(247, 142, 32, 0.18);
}

/* Inline image documents in the viewer. */
.viewer-image {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.hero__media {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 10;
}
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* decorative brand "blob" */
.hero__media::after {
    content: "";
    position: absolute;
    inset: auto -20% -25% auto;
    width: 60%;
    aspect-ratio: 1;
    background: radial-gradient(circle, rgba(247,142,32,0.35), transparent 70%);
    z-index: -1;
}
/* Mascot variant: a transparent PNG that floats free of the photo "card" chrome. */
.hero__media--mascot {
    grid-area: bot;
    align-self: center;
    /* Mascot size — the SINGLE tunable value (min, preferred, max). Because it lives in the `bot`
       cell with a 1fr spacer to its right, resizing only eats into that spacer — it never touches
       the search column. Capped so the greeting + full search row stay above the fold on ~700px-tall
       laptops; if space is tight the mascot shrinks, never the search. Bump this to fine-tune desktop. */
    --home-bot-size: clamp(220px, 26vw, 340px);
    width: var(--home-bot-size);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    background: transparent;
    aspect-ratio: auto;
}
.hero__media--mascot img { width: 100%; height: auto; object-fit: contain; }
.hero__media--mascot::after { display: none; }

/* Blink: the eyes-closed image stacks over the bot and flashes in briefly on a loop. */
.bot-blink { position: relative; width: 100%; margin-inline: auto; }
.hero__media--mascot .bot-blink__lids {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    /* Clip off the bottom (feet + baked-in orange glow) so only the head/eyes area of the overlay
       renders. The glow is semi-transparent in both PNGs, so without this it doubles up and pulses
       with the blink. The feet/glow are identical to the base image, so hiding them is invisible. */
    clip-path: inset(0 0 18% 0);
    /* BLINK TEMPORARILY DISABLED — the overlay frame (Welcome-Bot-closed.png) is still the older
       1529x1456 art and no longer registers against the 1500x1500 base. The keyframes below are
       kept intact. TO RE-ENABLE: un-comment the line below and restore the overlay <img> in
       Pages/Index.cshtml. Left commented out, this layer stays at opacity: 0, so even if the
       markup comes back on its own nothing blinks. */
    /* animation: bot-blink 20s infinite; */
}
@keyframes bot-blink {
    /* Eyes open ~19.7s, then a quick ~0.3s blink (tight percentages = fast close/open). */
    0%, 98.5%, 100% { opacity: 0; }
    99%, 99.4% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .hero__media--mascot .bot-blink__lids { animation: none; }
}

/* ----- Cards ------------------------------------------------------------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: var(--sp-3);
}
.card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--sp-3);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
a.card { text-decoration: none; color: inherit; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.card__icon {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    background: transparent;
    color: var(--brand);
    margin-bottom: var(--sp-1);
}
.card__icon svg { width: 100%; height: 100%; }
.card h3 { margin-bottom: 0.25rem; }
.card p { color: var(--ink-soft); margin-bottom: 0; }
/* Icon + heading on one row, content below. */
.card__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: var(--sp-1); }
.card__head .card__icon { margin-bottom: 0; flex-shrink: 0; }
.card__head h3 { margin-bottom: 0; }
.card__image {
    width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    margin-bottom: var(--sp-2);
}
.card__zoom { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.card__doclink { display: block; width: 100%; text-decoration: none; }
.card__video { width: 100%; border-radius: var(--radius-sm); margin-bottom: var(--sp-2); background: #000; }

/* Heading spans the card top; description + media sit alongside each other beneath it. */
.card__body-split { display: flex; align-items: flex-start; gap: var(--sp-3); }
.card__body-split .card__desc { flex: 1 1 40%; min-width: 0; margin: 0; color: var(--ink-soft); line-height: 1; }
.card__body-split .card__media { flex: 1 1 60%; min-width: 0; }
/* Video and the Carbon image share the same 16:9 box, so both cards are the same height. */
.card__body-split .card__media video,
.card__body-split .card__media .card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 0;
}
.card__body-split .card__media video { object-fit: cover; background: #000; }
.card__body-split .card__media .card__image { object-fit: contain; background: var(--surface); }
@media (max-width: 600px) {
    .card__body-split { flex-direction: column; align-items: stretch; }
}

/* Horizontal "Latest Release Notes" box below the cards. */
.release-banner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    max-width: 51rem;
    margin-inline: auto;
    margin-top: var(--sp-4);
    padding: var(--sp-3);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.release-banner:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.release-banner__icon { flex-shrink: 0; width: 3rem; height: 3rem; color: var(--brand); display: inline-grid; place-items: center; }
.release-banner__icon svg { width: 100%; height: 100%; }
.release-banner__text { flex: 1; min-width: 0; }
.release-banner__title { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.25rem; color: var(--ink); margin-bottom: 0.2rem; }
.release-banner__desc { display: block; color: var(--ink-soft); }
.release-banner__arrow { flex-shrink: 0; color: var(--brand); font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; }
@media (max-width: 560px) {
    .release-banner { flex-direction: column; text-align: center; }
    .release-banner__arrow { display: none; }
}

/* Lightbox: enlarge a card image over a dimmed backdrop with a close button. */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-4);
    background: rgba(26, 26, 26, 0.6);
}
.lightbox[hidden] { display: none; }
.lightbox__frame { position: relative; display: inline-block; max-width: 92vw; max-height: 88vh; }
.lightbox__img,
.lightbox__video {
    display: block;
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.lightbox__video { width: min(92vw, 960px); background: #000; }
.lightbox__img[hidden], .lightbox__video[hidden] { display: none; }

/* Video preview thumbnail (opens in the lightbox) with a play badge. */
.card__video-trigger { position: relative; }
.card__play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.lightbox__close {
    position: absolute;
    top: -1rem;
    right: -1rem;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--ink);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.lightbox__close:hover { background: var(--brand); color: #fff; }
.card__more {
    margin-top: auto;
    padding-top: var(--sp-1);
    font-family: var(--font-head);
    font-weight: 600;
    color: var(--brand);
}

/* ----- Prose / legal pages ----------------------------------------------- */
.page-head {
    background:
        radial-gradient(40rem 24rem at 100% 0%, var(--brand-tint) 0%, transparent 60%),
        var(--surface-alt);
    border-bottom: 1px solid var(--line);
    padding-block: var(--sp-5);
}
/* Library listing header: no gradient, no divider line, and the gap down to the
   search box reduced to ~10% of the default. */
.page-head--tight {
    background: var(--surface-alt);
    border-bottom: 0;
    padding-bottom: 0.4rem;
}
.page-head--tight .lead { margin-bottom: 0; }
.section--tight { padding-top: 0.35rem; }

/* Plain header: drop the gradient (keeps the divider line + spacing) — used on document/video views. */
.page-head--plain { background: var(--surface-alt); }

/* ----- FAQ accordion ----------------------------------------------------- */
.faq-search { margin-top: 5px; margin-bottom: var(--sp-3); max-width: 30rem; }
.faq-search input { flex: 1; min-height: 52px; }
.faq-list { max-width: 60rem; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item__q {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    list-style: none;
    cursor: pointer;
    padding: var(--sp-3) 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--ink);
}
.faq-item__q::-webkit-details-marker { display: none; }
.faq-item__q::marker { content: ""; }
.faq-item__q:hover { color: var(--brand); }
.faq-item__toggle {
    position: relative;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
}
.faq-item__toggle::before,
.faq-item__toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #fff;
    border-radius: 2px;
    transform: translate(-50%, -50%);
}
.faq-item__toggle::before { width: 12px; height: 2px; }   /* horizontal bar */
.faq-item__toggle::after { width: 2px; height: 12px; }    /* vertical bar (hidden when open) */
.faq-item[open] .faq-item__toggle::after { display: none; }
.faq-item__a { padding-bottom: var(--sp-3); color: var(--ink-soft); }
.faq-item__summary { font-weight: 600; color: var(--ink); margin-bottom: var(--sp-1); }
.faq-item__a ul { margin: var(--sp-1) 0 0; }
.faq-item__a li { margin-bottom: 0.35em; }

/* Section header: title + intro + search bar form a capped header block, with a small mascot
   accent sitting RIGHT BESIDE it as a connected pair (column 1 is capped so the bot is
   adjacent, not pushed to the far edge; the leftover width goes to a spacer on the right, and
   the bot is vertically centred against the title+intro+search rows). The tag filters then
   span the full width beneath, free to use the reclaimed space.
   The search & filter must stay inside one <form> (their behaviour depends on it), so
   display:contents promotes them into the grid to occupy separate areas. */
.page-head__grid {
    display: grid;
    grid-template-columns: minmax(0, 40rem) auto 1fr;
    grid-template-areas:
        "head    bot     ."
        "search  bot     ."
        "filters filters filters";
    column-gap: var(--sp-4);
    row-gap: var(--sp-3);
    align-items: start;
}
.page-head__head { grid-area: head; }
.page-head__grid .page-head__tools,
.page-head__grid .library-toolbar { display: contents; }   /* promote search + filter into the grid */
.page-head__grid .library-search { grid-area: search; }
.page-head__grid .tag-filter { grid-area: filters; min-width: 0; }   /* min-width:0 lets the tag row wrap */
.page-head__bot {
    grid-area: bot;
    align-self: center;          /* centred against the title + intro + search rows only */
    /* Mascot size — the SINGLE tunable value (min, preferred, max). The 1fr spacer column to the
       bot's right absorbs the change, so resizing never widens the text column or moves the search
       bar. Bump this to fine-tune the desktop size. */
    --page-head-bot-size: clamp(200px, 26vw, 300px);
    width: var(--page-head-bot-size);
}
.page-head__bot img { width: 100%; height: auto; display: block; margin-inline: auto; }
/* Per-section scale so each mascot renders at ~the previous-setup size (the new section art fills
   its frame by different amounts, so the busier ones are scaled down to match). No column cap —
   the bots sit at the previous, prominent size and position. */
.page-head__bot--faq img { width: 87%; }
.page-head__bot--guides img { width: 82%; }
.page-head__bot--videos img { width: 84%; }
.page-head__bot--product img { width: 85%; }
/* The search/filter toolbar now lives in the header, just under the intro. */
.page-head .library-toolbar { margin-top: var(--sp-3); margin-bottom: 0; }
@media (max-width: 800px) {
    /* Mobile two-column band: headline/intro on the LEFT, the mascot on the RIGHT, with the search
       bar and filter pills dropping to their own FULL-WIDTH rows beneath — reclaiming the vertical
       space the old full-width stacked mascot wasted, and surfacing the search + content sooner.
       The search/filter display:contents promotion and their grid-area names ("search"/"filters")
       are inherited from the desktop rules above, so their behaviour (incl. the pills' "More"
       overflow) is unchanged — only the area template and the mascot size differ here. Below ~400px
       this falls back to the single-column stack (see the next media block) so tight phones stay
       uncramped. The bot keeps its inherited align-self:center, so it centres beside the text. */
    .page-head__grid {
        grid-template-columns: minmax(0, 1fr) auto;    /* text takes the room; mascot sizes to its own column */
        grid-template-areas:
            "head    bot"
            "search  search"
            "filters filters";
        column-gap: var(--sp-3);                       /* tighter gap than desktop to give the text column room */
    }
    .page-head__bot {
        /* Mobile mascot size — the SINGLE tunable for the two-column band. Because the mascot's grid
           column is `auto`, this value sets BOTH his size and his share of the row (bigger value =>
           wider mascot column, narrower text). Sized so he reads as a deliberate character while the
           left column still fits the longest headline ("How To Documents") on two lines down to the
           ~400px floor (~189px text at the floor vs ~175px for "Documents"). Raise the max/preferred
           for more presence; if the headline ever crushes, raise the 400px floor below instead.
           The per-section img modifiers (--guides/--faq/…) still scale within this width. */
        --page-head-bot-size: clamp(140px, 35vw, 210px);
    }
}
@media (max-width: 400px) {
    /* Floor (raised 380px -> 400px so the two-column mascot can be bigger without crushing the
       headline): below this, fall back to the single-column stack (headline → mascot → search →
       filters), where the mascot is large and full-width — better than squeezing on tiny phones. */
    .page-head__grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "head"
            "bot"
            "search"
            "filters";
    }
    .page-head__bot {
        justify-self: center;                          /* centre the bot above the search */
        --page-head-bot-size: clamp(120px, 30vw, 180px);
    }
}

/* Two-tone library page titles (e.g. "How To" orange + "Documents" ink). */
.ttl-orange { color: var(--brand); }
.ttl-ink { color: var(--ink); }
.legal h2 { margin-top: var(--sp-4); padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.legal h3 { margin-top: var(--sp-3); color: var(--brand-deep); }
.legal :is(h2, h3):first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.meta-note { color: var(--ink-soft); font-size: 0.95rem; }

.callout {
    background: var(--brand-tint);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: var(--sp-2) var(--sp-3);
    margin: var(--sp-3) 0;
}

/* ----- Footer ------------------------------------------------------------ */
.site-footer {
    flex-shrink: 0;
    background: var(--footer-bg);
    color: #ECECEC;
    padding-block: var(--sp-5) var(--sp-3);
    margin-top: var(--sp-6);
}
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: var(--sp-4);
}
.site-footer h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #fff;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: var(--sp-2); }
.footer-brand img { width: 2.4rem; height: 2.4rem; }
.footer-brand span { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.18);
    margin-top: var(--sp-4);
    padding-top: var(--sp-3);
    font-size: 0.9rem;
    color: #C9C9C9;
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    justify-content: space-between;
}

/* ----- Error / status pages ---------------------------------------------- */
.status-page { text-align: center; padding-block: var(--sp-6); }
.status-page__code {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: clamp(4rem, 2rem + 12vw, 9rem);
    line-height: 1;
    color: var(--brand);
    margin: 0;
}

/* ----- Visually-hidden (for screen-reader-only text) --------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

/* ----- Responsive: collapse nav on small screens ------------------------- */
@media (max-width: 800px) {
    .nav-toggle { display: inline-flex; }
    .primary-nav {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: 100%;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
        padding: var(--sp-2) var(--sp-3) var(--sp-3);
    }
    .primary-nav.is-open { display: block; }
    .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0.15rem; }
    .primary-nav a { width: 100%; }
    .site-header__inner { position: relative; }

    /* Stack in the inner-page order — mascot (with its greeting) then search near the top. */
    .hero__inner {
        grid-template-columns: 1fr;
        grid-template-areas:
            "bot"
            "search";
        justify-items: center;
        text-align: center;
        gap: var(--sp-2);
        padding-block: var(--sp-3) var(--sp-4);
    }
    /* Mobile Ali size — the SINGLE tunable for the home hero on narrow widths. Bumped up for clear
       presence (his speech bubble is absolutely positioned inside this box, so it stays anchored and
       scales with him — the tail keeps pointing at him). The inline button row below reclaims the
       vertical space this uses, so "Lolly Central Latest" still sits near the fold. */
    .hero__media--mascot { --home-bot-size: clamp(150px, 40vw, 220px); }
    .site-footer__grid { grid-template-columns: 1fr; gap: var(--sp-3); }
}

/* ----- Dark mode (AAA-checked) ------------------------------------------------
   Default: follow the OS setting (prefers-color-scheme), UNLESS the user has
   explicitly chosen light (data-theme="light"). An explicit data-theme="dark"
   forces dark even on a light OS. The two dark blocks below are intentionally
   identical — keep them in sync. */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --brand-deep: #FFB35C;     /* light orange for text on dark ≈8:1 */
        --brand-tint: #2A2118;
        --brand-tint-2: #34281A;
        --ink: #F2F2F0;
        --ink-soft: #C9C9C5;
        --surface: #161616;
        --surface-alt: #1F1F1F;
        --line: #3A3A38;
        --nav-hover: #2E2E2E;
        --focus: #F78E20;          /* lolly-orange focus ring in dark mode (was blue) */
        --header-bg: rgba(22, 22, 22, 0.92);
        --footer-bg: #0D0D0D;
    }
}
:root[data-theme="dark"] {
    --brand-deep: #FFB35C;
    --brand-tint: #2A2118;
    --brand-tint-2: #34281A;
    --ink: #F2F2F0;
    --ink-soft: #C9C9C5;
    --surface: #161616;
    --surface-alt: #1F1F1F;
    --line: #3A3A38;
    --nav-hover: #2E2E2E;
    --focus: #F78E20;          /* lolly-orange focus ring in dark mode (was blue) */
    --header-bg: rgba(22, 22, 22, 0.92);
    --footer-bg: #0D0D0D;
}

/* ----- Reduced motion (WCAG 2.3.3) --------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ----- High-contrast / forced colours ------------------------------------ */
@media (forced-colors: active) {
    .btn, .card, .nav-toggle { border: 1px solid; }
    .primary-nav a[aria-current="page"] { box-shadow: none; text-decoration: underline; }
}

/* ==========================================================================
   Support library (SharePoint-driven)
   ========================================================================== */

/* ----- Navigation dropdowns (folders with sub-folders) ------------------- */
.has-sub { position: relative; }
.nav-sub-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 44px;
    padding: 0.5rem clamp(0.45rem, 0.1rem + 0.6vw, 0.9rem);
    background: none;
    border: 0;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: clamp(0.82rem, 0.62rem + 0.5vw, 1rem);
    color: var(--ink);
    border-radius: 999px;
    cursor: pointer;
}
.nav-sub-toggle:hover { background: var(--nav-hover); color: var(--ink); }
.nav-sub-toggle[aria-current="page"] { color: var(--brand); }
.nav-sub-toggle__caret { transition: transform 0.18s ease; }
.nav-sub-toggle[aria-expanded="true"] .nav-sub-toggle__caret { transform: rotate(180deg); }

.subnav { display: none; }
.has-sub:hover > .subnav,
.has-sub:focus-within > .subnav,
.nav-sub-toggle[aria-expanded="true"] + .subnav { display: block; }

.subnav__list { list-style: none; margin: 0; padding: 0; }
.subnav__list .subnav__list {
    margin-left: 0.6rem;
    padding-left: 0.4rem;
    border-left: 2px solid var(--line);
}
.subnav__list a {
    display: block;
    min-height: 44px;
    padding: 0.5rem 0.7rem;
    color: var(--ink);
    text-decoration: none;
    border-radius: 999px;
    font-family: var(--font-head);
    font-weight: 600;
}
.subnav__list a:hover { background: var(--nav-hover); color: var(--ink); }
.subnav__list a[aria-current="page"] { color: var(--brand); }

@media (min-width: 801px) {
    .subnav {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 16rem;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        box-shadow: var(--shadow-lg);
        padding: 0.5rem;
        z-index: 200;
    }
}
@media (max-width: 800px) {
    .nav-sub-toggle { width: 100%; justify-content: space-between; }
    .subnav { padding-left: 0.6rem; }
}

/* ----- Breadcrumb -------------------------------------------------------- */
.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 0;
    margin: 0 0 var(--sp-2);
    font-size: 0.95rem;
}
.breadcrumb li + li::before { content: "/"; margin: 0 0.5rem; color: var(--ink-soft); }
.breadcrumb a { color: var(--brand); }
.breadcrumb [aria-current="page"] { color: var(--ink-soft); }

/* ----- Library toolbar: search + tag pills ------------------------------- */
.library-toolbar { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.library-search { display: flex; align-items: stretch; gap: 0.5rem; max-width: 38rem; }
.library-search input { flex: 1; min-height: 52px; }

/* My Favourites: search box + content-type section grouping (reuses .library-search + .doc-grid). */
.favourites-search { max-width: 30rem; margin-bottom: var(--sp-3); }
.fav-section { margin-bottom: var(--sp-5); }
.fav-section[hidden] { display: none; }
.fav-section__heading {
    font-family: var(--font-head);
    font-size: 1.3rem;
    margin: 0 0 var(--sp-3);
    color: var(--ink);
}

/* My Favourites: search box + content-type section grouping (reuses .library-search + .doc-grid). */
.favourites-search { max-width: 30rem; margin-bottom: var(--sp-3); }
.fav-section { margin-bottom: var(--sp-5); }
.fav-section[hidden] { display: none; }
.fav-section__heading {
    font-family: var(--font-head);
    font-size: 1.3rem;
    margin: 0 0 var(--sp-3);
    color: var(--ink);
}
.tag-filter { border: 0; padding: 0; margin: 0; }
.tag-filter legend {
    font-family: var(--font-head);
    font-weight: 600;
    padding: 0;
    margin-bottom: 0.5rem;
}
/* Base / no-JS: a simple wrapping cloud. JS adds .tag-filter--enhanced to switch to a single
   line — priority-plus on desktop (overflow tags collapse behind "More"), swipe-scroll on
   mobile. Every colour below is a theme token so the bar reads in light AND dark mode. */
.tag-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; }

.tag-filter--enhanced .tag-pills { flex-wrap: nowrap; padding-block: 5px; }   /* padding keeps focus rings clear of the clip */
.tag-filter--enhanced.is-priority .tag-pills { overflow: hidden; }      /* desktop: clip, JS collapses */
.tag-filter--enhanced.is-scroll .tag-pills {                            /* mobile: swipe-scroll */
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.tag-filter--enhanced.is-scroll .tag-pills::-webkit-scrollbar { display: none; }
/* In scroll mode "More" flows inline as the last item (reached by scrolling) — it must NOT be
   pinned/sticky, or it would sit on top of the pills that scroll beneath it. */
.tag-pill.is-collapsed { display: none; }
.tag-more { order: 9999; }   /* always the last item on the line */

/* Wrapper anchors the hidden checkbox at the pill (not the page origin), so focusing it on
   toggle never makes the browser jump-scroll. The label is the clickable, visible pill. */
.tag-pill { position: relative; display: inline-flex; flex: 0 0 auto; }
.tag-pill__input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.tag-pill__label,
.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;                 /* WCAG 2.5.5 tap target */
    padding: 0.4rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--nav-hover);     /* subtle neutral fill: #DFE0DF light / #2E2E2E dark */
    color: var(--ink);
    cursor: pointer;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tag-pill__label:hover,
.tag-chip:hover { border-color: var(--brand); }
/* Active (orange). Fixed near-black text reads ≈8.8:1 on the orange fill in BOTH themes
   (the fill is orange regardless of theme), unlike theme --ink which would flip to light. */
.tag-pill:has(.tag-pill__input:checked) .tag-pill__label,
.tag-chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #1A1A1A; }
.tag-pill:has(.tag-pill__input:focus-visible) .tag-pill__label,
.tag-chip:focus-visible,
.tag-more:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* "More" disclosure button. */
.tag-more {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}
.tag-more[hidden] { display: none; }
.tag-more:hover { border-color: var(--brand); color: var(--brand); }
.tag-more__count { color: var(--ink-soft); }
/* Fallback dot when a *selected* tag is collapsed behind More (rare — selected pull to front). */
.tag-more.has-selected-hidden::after {
    content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
}

/* ----- "More" panel: popover (desktop) / bottom sheet (mobile) -------------- */
.tag-sheet { position: fixed; inset: 0; z-index: 1000; }
.tag-sheet[hidden] { display: none; }
.tag-sheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); }
.tag-sheet__panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    display: flex; flex-direction: column;
    max-height: 80vh;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: transform 0.25s ease;
    touch-action: none;
}
.tag-sheet__grab { flex: 0 0 auto; cursor: grab; }
.tag-sheet__handle { display: block; width: 40px; height: 4px; margin: 10px auto 4px; border-radius: 999px; background: var(--line); }
.tag-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 8px; }
.tag-sheet__title { margin: 0; font-family: var(--font-head); font-size: 1rem; color: var(--ink); }
.tag-sheet__close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-soft); cursor: pointer; font-size: 1.1rem; }
.tag-sheet__close:hover { color: var(--ink); }
.tag-sheet__close:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tag-sheet__body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; padding: 8px 16px 16px; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag-chip { flex: 0 0 auto; }
.tag-chip[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tag-sheet__panel { transition: none; } }

/* Desktop: render the panel as a popover anchored to the button (JS sets top/left). */
@media (min-width: 700px) {
    .tag-sheet { position: static; }
    .tag-sheet__backdrop { position: fixed; background: transparent; }   /* invisible outside-click catcher */
    .tag-sheet__panel {
        position: fixed; left: 0; right: auto; bottom: auto;
        width: min(360px, 92vw); max-height: 60vh;
        border-radius: var(--radius); box-shadow: var(--shadow-lg);
        transform: none; touch-action: auto;
    }
    .tag-sheet__grab { cursor: default; }
    .tag-sheet__handle { display: none; }
}

.result-count { font-family: var(--font-head); font-weight: 600; color: var(--ink-soft); margin: var(--sp-2) 0; }
.result-count a { margin-left: 0.5rem; color: var(--brand); }

/* ----- File list --------------------------------------------------------- */
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.file-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--sp-2) var(--sp-3);
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.file-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.file-card__link {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 15rem;
}
.file-card__icon { font-size: 1.8rem; flex-shrink: 0; line-height: 1; }
.file-card__title { display: block; font-family: var(--font-head); font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.file-card__meta { display: block; color: var(--ink-soft); font-size: 0.9rem; }
.file-card__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
    display: inline-block;
    padding: 0.16rem 0.52rem;
    border-radius: 999px;
    background: #DFE0DF;
    color: #41413B;
    font-family: var(--font-head);
    font-size: 0.64rem;
    font-weight: 600;
    text-decoration: none;
}
a.chip:hover { background: #d1d2d0; }

/* ----- Document viewer --------------------------------------------------- */
.viewer-layout { display: grid; grid-template-columns: 1fr 18rem; gap: var(--sp-4); align-items: start; }
.viewer-frame {
    width: 100%;
    height: 80vh;
    min-height: 32rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface-alt);
}
/* Viewer links (Download the file / Back to …) in lolly orange. */
.viewer-main a, .viewer-meta > p > a { color: var(--brand); }
/* Book a Demo CTA under the document Details block. */
.viewer-demo-btn { display: flex; width: 100%; justify-content: center; margin-top: var(--sp-3); }
.viewer-video { width: 100%; border-radius: var(--radius); background: #000; }
.viewer-meta {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: var(--sp-3);
}
/* Keep the Details card + Book a Demo button pinned while scrolling a long document. */
.viewer-side { position: sticky; top: 6rem; align-self: start; }
.viewer-meta h2 { font-size: 1.1rem; margin-top: 0; }
.viewer-meta dt {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ink-soft);
    margin-top: var(--sp-2);
}
.viewer-meta dd { margin: 0; }
.viewer-meta__tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.3rem; }
@media (max-width: 800px) {
    .viewer-layout { grid-template-columns: 1fr; }
    .viewer-side { position: static; }
    .viewer-frame { height: 60vh; min-height: 20rem; }
    .viewer-image { max-height: 60vh; width: auto; max-width: 100%; margin-inline: auto; }
}

/* ----- Home / site-wide search box --------------------------------------- */
.hero-search { display: flex; gap: 0.5rem; width: 100%; max-width: 44rem; margin-inline: auto; position: relative; z-index: 2; }

/* Search field wrapper holding the input + voice (mic) button. */
.hero-search__field { position: relative; flex: 1; min-width: 0; display: flex; }
.hero-search__field input { flex: 1; padding-right: 2.6rem; }
.search-mic {
    position: absolute;
    right: 0.55rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--brand);
    cursor: pointer;
}
.search-mic[hidden] { display: none; }
.search-mic:hover { background: var(--brand-tint); }
.search-mic.is-listening { color: #fff; background: var(--brand); animation: search-mic-pulse 1.2s infinite; }
@keyframes search-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(247, 142, 32, 0.5); }
    50% { box-shadow: 0 0 0 6px rgba(247, 142, 32, 0); }
}

/* Orange clear (✕) button inside search inputs instead of the browser's default. */
input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    cursor: pointer;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F78E20' stroke-width='2.5' stroke-linecap='round'><path d='M6 6l12 12M18 6 6 18'/></svg>") center / contain no-repeat;
}
/* Hero search is the page's primary action — make it the biggest, most confident field. */
.hero-search input { flex: 1; min-height: 56px; padding-right: 2.6rem; font-size: 1.05rem; }
.hero-search .btn { min-height: 56px; }   /* match the field height for a unified bar */
@media (max-width: 520px) {
    /* Full-width search input on its own row, then the Search + Ask ALI buttons INLINE on a second
       row — instead of three stacked full-width rows. Removes a row so "Lolly Central Latest" sits
       higher. (Home hero only: .hero-search is used only here.) */
    .hero-search { flex-wrap: wrap; }              /* stay a row, but let the buttons wrap onto line 2 */
    .hero-search__field { flex: 1 0 100%; }        /* input keeps its full, thumb-friendly width, forcing the wrap */
    .hero-search .btn { flex: 1 1 0; }             /* Search + Ask ALI share the second row equally */
}

/* "Ask ALI" sits beside search as a deliberate, on-brand pairing (used on the hero
   and on the search-results page). brand-deep is an AAA-safe ink in both themes. */
.askali-search-btn { border-color: var(--brand); color: var(--brand-deep); }
.askali-search-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ----- Predictive search (typeahead) dropdown ---------------------------- */
/* The list is portaled to <body> and positioned by JS (so the hero's overflow:hidden
   never clips it). Every colour is a theme token, so it reads in light and dark. */
.ta-list {
    position: absolute;
    z-index: 1000;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    max-height: min(60vh, 22rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.ta-list[hidden] { display: none; }
.ta-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;                 /* comfortable tap target */
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--ink);
    font-family: var(--font-body);
}
.ta-option__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-option__kind {
    flex: 0 0 auto;
    font-family: var(--font-head);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ink-soft);
}
/* Mouse hover and keyboard highlight share one active style. */
.ta-option.is-active,
.ta-option:hover { background: var(--brand-tint); }
.ta-option.is-active .ta-option__kind,
.ta-option:hover .ta-option__kind { color: var(--brand-deep); }
/* Matched portion of the label. brand-deep is AAA-legible on surface and on the tint. */
.ta-mark { color: var(--brand-deep); font-weight: 700; background: transparent; }
.ta-empty {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 0.75rem;
    color: var(--ink-soft);
    font-family: var(--font-body);
}
@media (prefers-reduced-motion: reduce) { .ta-list { scroll-behavior: auto; } }

/* ----- Predictive search (typeahead) dropdown ---------------------------- */
/* The list is portaled to <body> and positioned by JS (so the hero's overflow:hidden
   never clips it). Every colour is a theme token, so it reads in light and dark. */
.ta-list {
    position: absolute;
    z-index: 1000;
    margin: 0;
    padding: 0.35rem;
    list-style: none;
    max-height: min(60vh, 22rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}
.ta-list[hidden] { display: none; }
.ta-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;                 /* comfortable tap target */
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--ink);
    font-family: var(--font-body);
}
.ta-option__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ta-option__kind {
    flex: 0 0 auto;
    font-family: var(--font-head);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--brand);              /* document type (SECTION / GUIDE) in lolly orange */
}
/* Mouse hover and keyboard highlight share one active style: a light-orange wash. */
.ta-option.is-active,
.ta-option:hover { background: var(--brand-tint); }
/* Matched search words: bold and in the primary text colour (black in light mode). */
.ta-mark { color: var(--ink); font-weight: 700; background: transparent; }
.ta-empty {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 0.75rem;
    color: var(--ink-soft);
    font-family: var(--font-body);
}
@media (prefers-reduced-motion: reduce) { .ta-list { scroll-behavior: auto; } }

/* ----- Document grid (folder contents + search results) ------------------ */
.doc-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: var(--sp-3);
}
.doc-card {
    position: relative;   /* containing block for the top-right "remove from saved" button */
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, opacity 0.2s ease;
}
/* Optimistic fade while a saved card is being removed on the Saved documents page. */
.doc-card.is-unsaving { opacity: 0; pointer-events: none; }
.doc-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.doc-card__link { display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.doc-card__thumb {
    position: relative;
    display: grid;
    place-items: center;
    aspect-ratio: 4 / 3;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}
.doc-card__thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.doc-card__icon { font-size: 3.2rem; line-height: 1; }
.doc-card__kind {
    position: absolute;
    left: 0.6rem;
    bottom: 0.6rem;
    background: rgba(26, 26, 26, 0.82);
    color: #fff;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
/* Interactive "remove from saved" badge, top-right of the card (the free corner — .doc-card__kind
   sits bottom-left). Rendered only on saved cards. Mirrors the Details-panel bookmark's saved state:
   brand fill, white filled icon. Clicking it removes the item from favourites (see site.js); it lives
   outside the card's <a>, so it never navigates. */
.doc-card__saved {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.doc-card__saved:hover { transform: scale(1.08); box-shadow: var(--shadow-lg); }
.doc-card__saved:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.doc-card__saved-icon { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.doc-card__body { display: flex; flex-direction: column; gap: 0.25rem; padding: var(--sp-2) var(--sp-3); }
.doc-card__title { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; color: var(--ink); line-height: 1.3; }
.doc-card__meta { color: var(--ink-soft); font-size: 0.85rem; }
.doc-card__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0 var(--sp-3) var(--sp-3); margin-top: auto; }

/* ----- Header cluster (nav + theme toggle) ------------------------------- */
.site-header__end { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

/* ----- Theme toggle ------------------------------------------------------ */
/* Light/dark switch — white track + orange thumb (light), inverts when dark. */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
    transform: translateY(3px);   /* line up with the nudged-down menu (5px down, then 2px up) */
}
.theme-toggle__track {
    position: relative;
    display: block;
    width: 39px;
    height: 21px;
    border-radius: 999px;
    border: 2px solid var(--brand);
    background: #fff;
    transition: background-color 0.18s ease, border-color 0.18s ease;
}
.theme-toggle__thumb {
    position: absolute;
    top: 50%;
    left: 2px;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--brand);
    transition: left 0.18s ease, background-color 0.18s ease;
}
.theme-toggle[aria-checked="true"] .theme-toggle__track { background: var(--brand); }
.theme-toggle[aria-checked="true"] .theme-toggle__thumb { left: calc(100% - 17px); background: #fff; }
.theme-toggle:hover .theme-toggle__track { border-color: var(--brand-hover); }

/* Keep the header on one row on small phones (burger + theme toggle must fit). */
@media (max-width: 480px) {
    .brand { font-size: 1.1rem; gap: 0.4rem; }
    .brand img { width: 2rem; height: 2rem; }
    .brand__name { min-width: 0; }
    .site-header__end { gap: 0.5rem; }
}

/* ----- Pagination -------------------------------------------------------- */
.pager { margin-top: var(--sp-4); }
.pager ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0;
    margin: 0;
}
.pager a,
.pager__current,
.pager__disabled {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    font-family: var(--font-head);
    font-weight: 600;
    text-decoration: none;
}
.pager a { color: var(--ink); background: var(--surface); }
.pager a:hover { background: var(--brand-tint); color: var(--brand-deep); border-color: var(--brand); }
.pager__current { background: var(--brand); color: #1A1A1A; border-color: var(--brand); }
.pager__disabled { color: var(--ink-soft); opacity: 0.5; }
.pager__gap { display: inline-flex; align-items: center; min-width: 1.5rem; justify-content: center; color: var(--ink-soft); }

/* ----- Cookie consent banner --------------------------------------------- */
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    background: var(--surface);
    border-top: 3px solid var(--brand);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.16);
    padding: var(--sp-3);
}
.cookie-banner__inner {
    max-width: var(--container);
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sp-2) var(--sp-3);
    justify-content: space-between;
}
.cookie-banner__text { flex: 1; min-width: 16rem; margin: 0; color: var(--ink); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
@media (max-width: 560px) {
    .cookie-banner__inner { flex-direction: column; align-items: stretch; }
    .cookie-banner__text { min-width: 0; }
    .cookie-banner__actions { width: 100%; }
    .cookie-banner__actions .btn { flex: 1 1 0; justify-content: center; min-width: 0; }
}

/* ----- Top contact bar --------------------------------------------------- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: 101;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9rem;
}
.top-bar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.25rem;
    gap: var(--sp-2);
}
.top-bar a { color: #fff; text-decoration: none; }
.top-bar a:hover { text-decoration: underline; }
.top-bar__links { display: flex; align-items: center; gap: var(--sp-2); }

/* Support / Book a Demo: heading + intro on top, the embedded JotForm full-width below. Giving the
   form the full page width lets it lay its fields out horizontally (like itslolly.com) and cuts the
   vertical scroll. No card frame — the form sits directly on the page, matching the main website. */
.support-layout { display: block; }
.support-intro { max-width: 60rem; margin-bottom: var(--sp-1); }
.support-intro .lead { margin-bottom: var(--sp-2); }
/* Negative top margin pulls the embed up to absorb some of the JotForm's internal top padding
   (which we can't remove, being cross-origin), tightening the gap under the intro text. */
.support-form iframe { display: block; width: 100%; margin-top: -2.5rem; }
/* Dark mode: the JotForm is a cross-origin iframe whose interior we can't restyle directly, so we
   invert the whole embed to get a dark background. hue-rotate(180deg) swings the hues back so the
   orange stays roughly orange. Mirrors the site's dark-mode logic (explicit data-theme="dark", or
   OS dark unless the user forced light). NOTE: inverting a cross-origin form is a blunt whole-frame
   flip — it cannot recolour individual elements, so the Submit button / field text shift hue. */
[data-theme="dark"] .support-form iframe { filter: invert(1) hue-rotate(180deg); }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .support-form iframe { filter: invert(1) hue-rotate(180deg); }
}

/* ----- Document engagement (likes + views) ------------------------------- */
.engagement {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    padding: 0.4rem 0.9rem;
    border: 2px solid var(--brand);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand);
    font-family: var(--font-head);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease;
}
.like-btn__icon { width: 1.25rem; height: 1.25rem; transition: fill 0.18s ease; }
.like-btn:hover { background: var(--brand-tint); }
.like-btn[aria-pressed="true"] { background: var(--brand); color: #fff; }
.like-btn[aria-pressed="true"] .like-btn__icon { fill: #fff; }

/* Bookmark (favourites) toggle in the document Details panel: outline when unsaved, filled orange
   when saved. Icon-only, 44px tap target, no hover reliance — driven by aria-pressed. */
.bookmark-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--ink-soft);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bookmark-btn__icon { width: 1.4rem; height: 1.4rem; transition: fill 0.18s ease; }
.bookmark-btn:hover { border-color: var(--brand); color: var(--brand); }
.bookmark-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.bookmark-btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.bookmark-btn[aria-pressed="true"] .bookmark-btn__icon { fill: currentColor; }
.view-count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--ink-soft);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
}
.view-count svg { width: 1.2rem; height: 1.2rem; }

/* "Did you find this helpful?" thumbs in the document Details panel. Two icon buttons, each a 44px
   tap target; active thumb filled brand (driven by aria-pressed, no hover reliance). Tokens reused
   from the bookmark control so light/dark themes are handled automatically. */
.helpful { margin-top: var(--sp-2); text-align: center; }
.helpful__msg {
    margin: 0 0 var(--sp-1);
    color: var(--ink-soft);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9rem;
}
.helpful__buttons { display: flex; justify-content: center; gap: var(--sp-1); flex-wrap: wrap; }
.helpful-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--ink-soft);
    cursor: pointer;
    transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
/* Outline by default, brand fill when selected — the same technique as .bookmark-btn. */
.helpful-btn__icon { width: 1.15rem; height: 1.15rem; transition: fill 0.18s ease; }
.helpful-btn:hover { border-color: var(--brand); color: var(--brand); }
.helpful-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.helpful-btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.helpful-btn[aria-pressed="true"] .helpful-btn__icon { fill: currentColor; }

/* Read-only like/view counts on document cards. */
.doc-card__stats {
    display: flex;
    gap: var(--sp-2);
    margin-top: 0.25rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
}
.doc-card__stat { display: inline-flex; align-items: center; gap: 0.3rem; }
.doc-card__stat svg { width: 1rem; height: 1rem; }

/* ----- Footer accreditations --------------------------------------------- */
.footer-accreditations {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    margin-top: var(--sp-4);
    padding-top: var(--sp-3);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.accreditation-logo { height: 64px; width: auto; }
.accreditation {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-sm);
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: #fff;
}

/* ==========================================================================
   "Ask ALI" support bot
   Themed entirely with the site design tokens, so light/dark follows the rest
   of the site with no extra rules. Launcher pinned bottom-right; drawer slides
   in from the right.
   ========================================================================== */

/* ----- Launcher (floating, bottom-right) --------------------------------- */
.askali-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.askali-launcher:hover { background: var(--brand-hover); transform: translateY(-2px); }
.askali-launcher__label { white-space: nowrap; }

/* Inline launcher next to the home-page search button: an on-brand outline button that reads in
   both themes (brand-deep is contrast-checked in light AND dark), filling orange on hover. */
.askali-search-btn { background: transparent; color: var(--brand); border-color: var(--brand); }
.askali-search-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.askali-search-btn svg { color: currentColor; }

/* The HTML `hidden` attribute must win over the component's display rules below. */
#askali-drawer [hidden] { display: none !important; }

/* ----- Drawer ------------------------------------------------------------ */
.askali-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1101;
    width: 460px;
    max-width: 92vw;
    background: var(--surface);
    color: var(--ink);
    box-shadow: -4px 0 30px rgba(26, 26, 26, 0.22);
    transform: translateX(110%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.askali-drawer.is-open { transform: translateX(0); }
.askali-drawer__inner { display: flex; flex-direction: column; height: 100%; }

/* ----- Header ------------------------------------------------------------ */
.askali-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    /* Dark bar (echoes the site footer) with white text — strong contrast, unlike white-on-orange. */
    background: var(--footer-bg);
    color: #fff;
}
.askali-header__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;   /* allow the text block to shrink/ellipsis rather than push the buttons */
}
.askali-header__titletext { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.askali-header__name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.askali-header__sub {
    font-weight: 400;
    font-size: 0.72rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.askali-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
    flex-shrink: 0;
}
.askali-header__actions { display: flex; gap: 0.15rem; flex-shrink: 0; }
.askali-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.askali-iconbtn:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.askali-iconbtn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.28); color: #fff; }

/* ----- Messages ---------------------------------------------------------- */
.askali-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.1rem 1rem;
    background: var(--surface);
}
.askali-welcome {
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: var(--radius-sm);
    background: var(--brand-tint);
    text-align: center;
}
.askali-welcome__title { font-family: var(--font-head); font-weight: 700; margin-bottom: 0.3rem; }
.askali-welcome__sub { color: var(--ink-soft); font-size: 0.92rem; line-height: 1.5; }

.askali-msg {
    display: flex;
    flex-direction: column;
    max-width: 90%;
    animation: askaliFade 0.25s ease-out;
}
@keyframes askaliFade {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.askali-msg.is-user { align-self: flex-end; }
.askali-msg.is-assistant { align-self: flex-start; max-width: 96%; }

.askali-msg__bubble {
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1.55;
    word-wrap: break-word;
}
.askali-msg.is-user .askali-msg__bubble {
    background: var(--brand);
    color: #fff;
    border-bottom-right-radius: 4px;
    white-space: pre-wrap;
}
.askali-msg.is-assistant .askali-msg__bubble {
    background: var(--surface-alt);
    color: var(--ink);
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
}

/* Markdown inside assistant bubbles */
.askali-msg.is-assistant .askali-msg__bubble p { margin: 0 0 0.5rem; }
.askali-msg.is-assistant .askali-msg__bubble p:last-child { margin-bottom: 0; }
.askali-msg.is-assistant .askali-msg__bubble ul,
.askali-msg.is-assistant .askali-msg__bubble ol { padding-left: 1.3rem; margin: 0.4rem 0; }
.askali-msg.is-assistant .askali-msg__bubble li { margin: 0.15rem 0; }
.askali-msg.is-assistant .askali-msg__bubble h1,
.askali-msg.is-assistant .askali-msg__bubble h2,
.askali-msg.is-assistant .askali-msg__bubble h3 {
    font-family: var(--font-head);
    margin: 0.6rem 0 0.25rem;
    font-size: 1rem;
}
.askali-msg.is-assistant .askali-msg__bubble a { color: var(--brand-deep); text-decoration: underline; }
.askali-msg.is-assistant .askali-msg__bubble code {
    background: rgba(127, 127, 127, 0.16);
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.85em;
}
.askali-msg.is-assistant .askali-msg__bubble pre {
    background: #1f2937;
    color: #f1f5f9;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 0.5rem 0;
}
.askali-msg.is-assistant .askali-msg__bubble pre code { background: transparent; color: inherit; padding: 0; }

/* ----- Thinking indicator ------------------------------------------------ */
.askali-thinking {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.5rem 1.1rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.9rem;
}
.askali-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    animation: askaliBounce 1.2s infinite ease-in-out;
}
.askali-dot:nth-child(2) { animation-delay: 0.15s; }
.askali-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes askaliBounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.4; }
    40%           { transform: scale(1);   opacity: 1; }
}
.askali-thinking__text { margin-left: 0.4rem; }

/* ----- Error banner ------------------------------------------------------ */
.askali-error {
    flex-shrink: 0;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--line);
    background: var(--brand-tint-2);
    color: var(--brand-deep);
    font-size: 0.9rem;
}

/* ----- Input row --------------------------------------------------------- */
.askali-input {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.7rem 0.8rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.askali-input textarea {
    flex: 1;
    max-height: 140px;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.4;
    resize: none;
}
.askali-input textarea:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 1px;
    border-color: var(--brand);
}
.askali-sendbtn,
.askali-micbtn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.askali-sendbtn { border: none; background: var(--brand); color: #fff; }
.askali-sendbtn:hover { background: var(--ink); transform: scale(1.05); }
.askali-sendbtn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.askali-micbtn { border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); }
.askali-micbtn:hover { color: var(--brand); border-color: var(--brand); }
.askali-micbtn.is-listening {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: askaliMicPulse 1.2s ease-in-out infinite;
}
@keyframes askaliMicPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50%      { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}

/* ----- Mobile ------------------------------------------------------------ */
@media (max-width: 600px) {
    .askali-drawer { width: 100vw; max-width: 100vw; }
    .askali-launcher__label { display: none; }
    .askali-launcher { padding: 0.7rem; }
    .askali-header__sub { display: none; }

    /* Launcher clearance for bottom-of-page content. Here the launcher is a ~48px icon button pinned
       20px off the bottom, so it floats over whatever sits at the foot of the viewport. The FAQ
       accordion is the one that actually loses a control to it: .faq-item__toggle is a 28px circle
       right-aligned to the container edge (viewport - 24px), which lands inside the launcher's own
       column, so the + is covered and mis-taps hit the launcher. Reserve the launcher's band
       (48px + 20px) plus a little breathing room, and do the same under the library/search results
       so the pages sharing the launcher behave alike. Content only — the launcher itself is untouched. */
    .faq-list,
    #library-results { padding-bottom: 5.25rem; }
}

/* ==========================================================================
   Ranked search results
   ========================================================================== */
.result-count__badge {
    display: inline-block;
    margin: 0 0.4rem;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    border: 1px solid var(--brand);
    font-family: var(--font-head);
    font-size: 0.72rem;
    font-weight: 600;
    vertical-align: 1px;
}

.search-results {
    list-style: none;
    margin: var(--sp-2) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.search-result {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-alt);
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
}
.search-result:hover { border-color: var(--brand); box-shadow: var(--shadow); }

.search-result__rank {
    flex-shrink: 0;
    width: 1.9rem;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--brand);
    text-align: right;
    line-height: 1.6;
}
.search-result__thumb {
    flex-shrink: 0;
    width: 84px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: var(--brand-tint);
    color: var(--brand-deep);
}
.search-result__thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result__icon svg { width: 28px; height: 28px; }
.search-result__icon { display: inline-flex; }

.search-result__body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.search-result__title {
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
    text-decoration: none;
}
.search-result__title:hover { color: var(--brand); text-decoration: underline; }
.search-result__desc {
    color: var(--ink-soft);
    font-size: 0.92rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.search-result__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    margin-top: 0.15rem;
    color: var(--ink-soft);
    font-size: 0.82rem;
}
.search-result__stat { display: inline-flex; align-items: center; gap: 0.3rem; }
.search-result__stat svg { width: 15px; height: 15px; }
.chip--sm { font-size: 0.72rem; padding: 0.1rem 0.5rem; }

/* "Not finding what you need? Why not ask ALI?" prompt under the results */
.ask-ali-prompt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: var(--sp-3);
    padding: var(--sp-2);
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink-soft);
    text-align: center;
}

@media (max-width: 560px) {
    .search-result__thumb { display: none; }
    .search-result__rank { width: 1.4rem; }
}

/* ==========================================================================
   Authentication: welcome gate, account chip
   ========================================================================== */
.welcome-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 600px at 50% -10%, var(--brand-tint), transparent),
        var(--surface);
    color: var(--ink);
    font-family: var(--font-body);
}
.welcome { width: 100%; max-width: 34rem; padding: var(--sp-3); text-align: center; }
.welcome__card {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: var(--sp-4) var(--sp-3);
}
.welcome__logo { display: block; margin: 0 auto var(--sp-1); }
.welcome__title { font-family: var(--font-head); font-size: 1.8rem; margin: 0 0 var(--sp-2); }
.welcome__title span { color: var(--brand); }
.welcome__lead { font-size: 1.05rem; line-height: 1.6; }
.welcome__hint { color: var(--ink-soft); font-size: 0.95rem; }
.welcome__cta { margin-top: var(--sp-2); }
.welcome__error {
    background: var(--brand-tint-2);
    color: var(--brand-deep);
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    margin-bottom: var(--sp-2);
}
.welcome__staff { margin-top: var(--sp-3); font-size: 0.9rem; }
.welcome__staff a { color: var(--ink-soft); }
.welcome__staff-muted { color: var(--ink-soft); opacity: 0.7; }

/* Account chip in the header */
.user-chip { position: relative; }
.user-chip__menu summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
}
.user-chip__menu summary::-webkit-details-marker { display: none; }
.user-chip__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-family: var(--font-head);
    font-weight: 700;
}
.user-chip__pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 0.75rem;
    z-index: 1200;
    text-align: left;
}
.user-chip__name { font-family: var(--font-head); font-weight: 700; }
.user-chip__site { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 0.5rem; }
.user-chip__link {
    display: block;
    padding: 0.35rem 0;
    color: var(--brand-deep);
    border-top: 1px solid var(--line);
}
.user-chip__signout {
    margin-top: 0.4rem;
    width: 100%;
    border: 1px solid var(--line);
    background: var(--surface-alt);
    color: var(--ink);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    cursor: pointer;
    font-family: var(--font-body);
}
.user-chip__signout:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ==========================================================================
   Admin area
   ========================================================================== */
.btn--sm { min-height: 36px; padding: 0.4rem 0.9rem; font-size: 0.9rem; }

.admin-nav { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: var(--sp-1); }
.admin-nav a {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.9rem;
}
.admin-nav a:hover { border-color: var(--brand); }
.admin-nav a.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

.admin-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.admin-window { display: inline-flex; gap: 0.4rem; align-items: center; color: var(--ink-soft); }
.admin-window a { padding: 0.25rem 0.7rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 0.85rem; }
.admin-window a.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }
.admin-export { display: inline-flex; gap: 0.5rem; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-2); margin-bottom: var(--sp-3); }
.stat-card { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-2); text-align: center; }
.stat-card__num { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.9rem; color: var(--brand-deep); }
.stat-card__lbl { color: var(--ink-soft); font-size: 0.85rem; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--sp-2); }
.admin-panel { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2); }
.admin-panel h2 { font-size: 1.1rem; margin: 0 0 var(--sp-1); }
.admin-subh { font-size: 0.95rem; margin: var(--sp-2) 0 0.4rem; color: var(--ink-soft); }
.admin-flag { font-size: 0.7rem; font-weight: 600; color: var(--brand-deep); background: var(--brand-tint); border-radius: 999px; padding: 0.05rem 0.5rem; vertical-align: 2px; }

/* Sparkline (page views per day) */
.spark { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.spark__bar { flex: 1; min-height: 2px; background: var(--brand); border-radius: 2px 2px 0 0; opacity: 0.85; }

/* Horizontal bar rows */
.barrow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.5rem; padding: 0.2rem 0; font-size: 0.9rem; }
.barrow__lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barrow__track { grid-column: 1 / 2; height: 6px; background: var(--brand-tint); border-radius: 999px; overflow: hidden; }
.barrow__fill { display: block; height: 100%; background: var(--brand); }
.barrow__num { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th { text-align: left; color: var(--ink-soft); font-weight: 600; padding: 0.3rem 0.4rem; }
.admin-table td { padding: 0.3rem 0.4rem; border-top: 1px solid var(--line); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.admin-table--bordered { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }

.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-top: 1px solid var(--line); }
.kv li:first-child { border-top: none; }
.kv span { color: var(--ink-soft); }

.admin-list { margin: 0.3rem 0 0; padding-left: 1.2rem; }
.admin-list li { margin: 0.2rem 0; }
.admin-list__n { color: var(--ink-soft); font-size: 0.82rem; }
.admin-list--warn li { color: var(--brand-deep); }

.admin-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: var(--sp-1) 0; }
.admin-pick select { padding: 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); min-width: 16rem; max-width: 100%; font-family: var(--font-body); }

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-top: 1px solid var(--line); }

/* ==========================================================================
   Related documents (View page)
   ========================================================================== */
.related-docs { margin-top: var(--sp-3); border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.related-docs h2 { font-size: 1.05rem; margin: 0 0 var(--sp-1); }
.related-docs ul { list-style: none; margin: 0; padding: 0; }
.related-docs li { margin: 0.3rem 0; }
.related-docs a { display: flex; align-items: center; gap: 0.5rem; color: var(--ink); text-decoration: none; padding: 0.4rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.related-docs a:hover { border-color: var(--brand); color: var(--brand-deep); }
.related-docs__icon svg { width: 20px; height: 20px; }
.related-docs__icon { display: inline-flex; color: var(--brand-deep); }
