/*
 * cryptopaylist.com - main stylesheet
 *
 * Plain CSS, no preprocessor and no framework (custom engine only). Light theme
 * by default. Design tokens live in :root so every rule reads from the same
 * scale; media queries only widen the layout, so the mobile layout is the base
 * and everything above it is progressive.
 */

/* -------------------------------------------------------------------------
 * Design tokens
 * ---------------------------------------------------------------------- */
:root {
    --color-bg: #ffffff;
    --color-bg-subtle: #f7f8fa;
    --color-surface: #ffffff;
    --color-border: #e3e6eb;
    --color-border-strong: #c9cfd8;
    --color-text: #14181f;
    --color-text-muted: #5a6472;
    --color-accent: #0f62fe;
    --color-accent-hover: #0043ce;
    --color-accent-soft: #eaf1ff;
    --color-focus: #0f62fe;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    --wrap: 1180px;
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        "Noto Sans", sans-serif;
    --shadow-sm: 0 1px 2px rgba(20, 24, 31, 0.06), 0 1px 3px rgba(20, 24, 31, 0.04);
}

/* -------------------------------------------------------------------------
 * Minimal reset
 * ---------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body,
h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote,
dl,
dd {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

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

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
 * Base typography and page frame
 * ---------------------------------------------------------------------- */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--space-4);
}

.site-main {
    flex: 1 0 auto;
    padding-block: var(--space-6) var(--space-8);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--color-accent);
    color: #fff;
    padding: var(--space-2) var(--space-4);
    border-radius: 0 0 var(--radius-sm) 0;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
    color: #fff;
    text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------- */
.site-header {
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    position: sticky;
    top: 0;
    z-index: 20;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    min-height: 60px;
    flex-wrap: wrap;
    padding-block: var(--space-2);

    /* Step 35: 0.75rem instead of the shared .wrap gutter (1rem) below 640px.
     * Phones as narrow as 320px have to fit the logo, the search icon and the
     * sticky header's own border in one row; the 8px saved per side is what
     * keeps the logo text from touching the icon.
     *
     * This overrides .wrap deliberately. Both are single-class selectors on the
     * same element, so this rule wins only because it comes later in the file -
     * which is why each breakpoint re-states its own value in the 640px and
     * 960px blocks below instead of letting .wrap's gutter leak through. The
     * desktop gutter is therefore declared in one place per breakpoint. */
    padding-inline: 0.75rem;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: -0.01em;

    /* Step 35: the logo must never be the element that gives way when row 1 on a
     * 320px phone is tight. The tagline ellipses instead (see
     * .site-header__tagline). */
    flex-shrink: 0;
    white-space: nowrap;
}

.site-logo:hover {
    color: var(--color-text);
    text-decoration: none;
}

.site-logo__mark {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
}

.site-logo__text {
    font-size: 1.0625rem;
}

.site-logo__tld {
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Step 32: optional operator-set tagline beside the logo. Rendered only when the
 * header_tagline setting is non-empty, so an unset tagline leaves no element and
 * the header keeps its normal height. Pairs with .site-logo, sharing its muted
 * colour and baseline. */
.site-header__tagline {
    font-size: 0.85rem;
    color: var(--color-text-muted, #6b7280);
    margin-left: 0.75rem;

    /* Step 35: the tagline is the only header item with an operator-controlled
     * length. Row 1 on a phone must hold logo + tagline + search icon, so the
     * tagline is the one element allowed to shrink and ellipsis rather than push
     * the icon off the row. `min-width: 0` is what lets a flex item shrink below
     * its content width - without it the default `min-width: auto` keeps the
     * full text width and the row overflows. */
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-nav__list {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

/* Step 35: force the nav to its own row on < 640px so the top row (= logo +
 * search toggle) is guaranteed to fit in one line. The 640px block resets this
 * to `flex: 0 1 auto` so the nav shares the row with the inline form again. */
.site-nav {
    flex: 1 0 100%;
}

.site-nav__link {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    font-weight: 500;
}

.site-nav__link:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/*
 * Mobile search disclosure trigger (step 35).
 *
 * The magnifier icon replaces the full form on viewports < 640px. It is the
 * logo's immediate right-hand neighbour; the nav is row-wrapped below, so the
 * top row contains only logo + tagline + toggle, which always fits on one line
 * even at 320px.
 *
 * HIDDEN ABOVE 640px — the form is inline at that width, so the toggle would be
 * a redundant second search affordance beside the live input. The @media rule
 * for .site-search-toggle lives in the 640px block.
 */
.site-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    padding: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.site-search-toggle:hover {
    color: var(--color-accent);
}

.site-search-toggle:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
}

.site-search-toggle__icon {
    display: block;
}

/*
 * Header search (step 35).
 *
 * BASE: hidden (the toggle discloses it). On viewports >= 640px it becomes a
 * static inline form beside the nav. When a visitor on a narrow phone taps the
 * toggle, the expanded bar is shown via `.is-search-open` on .site-header.
 *
 * THE BAR IS ANCHORED TO .site-header, the same containing block the catalog
 * panel uses. Both set `top: 100%` and `left/right: 0`, so they occupy the
 * same boundary. Only one of the two can be open at any moment.
 *
 * z-index: 40 (above the catalog panel's 30) in case both were open.
 */
.site-search {
    display: none;

    /* Declared here rather than only in the two visible states: these are the
     * shared internals of the form, and both consumers (the >= 640px inline
     * field and the < 640px expanded bar) want identical spacing. `display` is
     * the only property that differs between them. Harmless while hidden. */
    align-items: center;
    gap: var(--space-2);
}

.site-search__input {
    width: 11rem;
    min-width: 0;
    padding: 0.3125rem 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
}

.site-search__input:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
    border-color: var(--color-accent);
}

.site-search__submit {
    padding: 0.3125rem 0.625rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.site-search__submit:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

/*
 * Expanded search bar (step 35) — absolute-positioned bar under the header.
 */
.site-header.is-search-open .site-search {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 40;
    align-items: center;
    gap: var(--space-2);
    /* 0.75rem matches .site-header__inner's mobile gutter, so the input's left
     * edge lines up with the logo and the icon above it. The bar itself is
     * full-bleed (left/right: 0), so its own padding is what provides the inset. */
    padding: var(--space-2) 0.75rem;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
}

.site-header.is-search-open .site-search__input {
    flex: 1;
    min-width: 0;
    width: auto;

    /* iOS auto-zoom prevention: when the font-size is < 16px on iOS, Safari
     * zooms the input on focus. The input in the bar is the only place the
     * search input is focused programmatically - it runs on phones - so it is
     * the only place we need this. */
    font-size: 1rem;
}

.site-header.is-search-open .site-search__submit {
    flex-shrink: 0;
}

/* -------------------------------------------------------------------------
 * Header - Catalog dropdown (step 33)
 *
 * THE PANEL IS ALWAYS ANCHORED TO .site-header, NEVER TO THE <li>.
 * .site-header is `position: sticky`, which makes it a containing block for
 * absolutely positioned descendants. The panel uses `position: absolute` with
 * `top: 100%` and `left: 0; right: 0` so it spans edge-to-edge under the
 * header on mobile and stays within a predictable box on desktop — the li is
 * an inline flex item that could overflow 640px off the right edge.
 *
 * VISUAL ADJACENCY STILL HOLDS. The panel is a DOM descendant of the li even
 * though it is not positioned against it, and `top: 100%` puts its top edge
 * flush with the header's bottom border - the same edge the trigger sits on.
 * A mouse leaving the trigger downwards therefore lands inside the panel
 * without crossing a dead strip, which is what keeps the JS mouseleave handler
 * on the li from closing the panel mid-move.
 *
 * VISIBILITY IS DRIVEN BY .is-open ONLY - there is no :hover rule here, and
 * main.js has no hover listener either. The disclosure is click/keyboard only.
 * THIS IS DELIBERATE, and it is what makes the geometry below tractable:
 *
 *   - A CSS :hover rule alongside a JS click toggle is two sources of truth.
 *     With the pointer resting on the trigger, clicking cannot visually close
 *     the panel while aria-expanded (owned by JS) says "false".
 *   - Hover would also couple the panel's position to the trigger's box. The li
 *     is a ~24px-tall flex item inside a 68px header, so a panel hanging off the
 *     header's bottom edge leaves a dead strip between the two. Crossing it
 *     fires mouseleave on the li (the strip is not a descendant) and closes the
 *     panel before the pointer arrives. Bridging it with negative margins or
 *     `align-self: stretch` breaks as soon as .site-header__inner wraps onto a
 *     second row, which it does between 640px and ~1000px because the search
 *     form no longer fits beside the nav.
 *   - The search input sits immediately right of the nav in the same row, so
 *     hover-open would also fire whenever a visitor moved toward the search box.
 *
 * Click-only is the WAI-ARIA "Disclosure Navigation Menu" pattern and behaves
 * identically with a mouse, a touch screen and a keyboard.
 * ---------------------------------------------------------------------- */

/* Dropdown root. `position` is deliberately NEVER set: the panel must anchor to
 * the sticky .site-header, and any positioned box between the two would steal
 * the containing block and reintroduce the overflow described above. */
.site-nav__item--catalog {
    min-width: 0;
}

/* The trigger button looks like a plain text link in the nav row. */
.site-nav__catalog {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

.site-nav__catalog-caret {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.site-nav__item--catalog.is-open .site-nav__catalog-caret {
    transform: rotate(180deg);
}

/* Panel - hidden until the root carries .is-open.
 *
 * THE PANEL IS ALWAYS ANCHORED TO .site-header, NEVER TO THE <li>, AT EVERY
 * BREAKPOINT.
 * The li is a flex item sized by the width of the word "Catalog" (~90px), so
 * positioning the panel against it makes its available width depend on how far
 * along the nav row the item happens to sit. `left: 0; width: 640px` on the li
 * overflowed the viewport by roughly the offset of the trigger whenever the
 * window was narrower than offset + 640px - which was every viewport between
 * 640px and ~1000px, and it got worse as the nav row wrapped and moved the
 * trigger. Anchoring to the header instead gives a predictable box sized against
 * the viewport, so the panel cannot run off the right edge.
 *
 * `.site-nav__item--catalog` therefore must NOT be positioned. Any positioned
 * box between the panel and the header would become the containing block and
 * reintroduce the overflow.
 *
 * .site-header is `position: sticky`, which makes it a containing block for
 * absolutely positioned descendants, so this works without adding a wrapper.
 *
 * `top: 100%` puts the panel's top edge flush with the header's bottom border,
 * so the panel reads as a sheet unfolding from the header rather than as a
 * floating tooltip. Because it is header-anchored rather than li-anchored there
 * is no hover-open path: see the click-only rationale in main.js.
 *
 * BASE = MOBILE SHEET: full-bleed edge to edge, no top border (it continues the
 * header border) and square top corners so it reads as part of the header. The
 * 640px block below narrows it into a centered overlay. */
.catalog-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 30;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: 0;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 8px 24px rgba(20, 24, 31, 0.12), 0 2px 6px rgba(20, 24, 31, 0.08);
}

.site-nav__item--catalog.is-open .catalog-panel {
    display: block;
}

/* Base grid is single-column; the second column arrives at 640px. */
.catalog-panel__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4) var(--space-4);
}

.catalog-panel__group {
    min-width: 0;
}

.catalog-panel__category {
    display: block;
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text);
    padding-block: var(--space-1);
    border-radius: var(--radius-sm);
}

.catalog-panel__category:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.catalog-panel__subcategories {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-1) 0;
}

.catalog-panel__subcategory {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    padding-block: 0.1875rem;
    border-radius: var(--radius-sm);
}

.catalog-panel__subcategory:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* The active row inside the panel. aria-current is the accessible source of
 * truth; this rule only makes it visible, so the two cannot drift apart. */
.catalog-panel__category[aria-current="page"],
.catalog-panel__subcategory[aria-current="page"] {
    color: var(--color-accent);
    font-weight: 700;
}

/* No-JS fallback. <noscript> is only parsed when scripting is off, so no
 * display toggling is needed here - if this rule matches at all, JS is off and
 * the fallback must be visible. It stacks under the nav row as a labelled
 * flat list of categories. */
.site-nav__fallback {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-2) var(--space-4);
    padding-top: var(--space-2);
    margin-top: var(--space-2);
    border-top: 1px solid var(--color-border);
}

.site-nav__fallback-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

.site-nav__fallback-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) var(--space-4);
    list-style: none;
    padding: 0;
    margin: 0;
}

/* -------------------------------------------------------------------------
 * Hero
 * ---------------------------------------------------------------------- */
.hero {
    background: var(--color-bg-subtle);
    border-bottom: 1px solid var(--color-border);
    padding-block: var(--space-7);
    margin-bottom: var(--space-7);
}

.hero__title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
    max-width: 22ch;
}

.hero__text {
    max-width: 62ch;
    color: var(--color-text-muted);
    font-size: 1.0625rem;
}

.hero__actions {
    margin-top: var(--space-5);
}

/* -------------------------------------------------------------------------
 * Hero with a background image (step 31)
 *
 * The background image is set inline by the template as
 * `style="background-image: url('...')"`, and only when the file exists on
 * disk - a stored path whose file was removed degrades to the solid hero
 * above rather than a broken background behind white text.
 *
 * The overlay is a ::before pseudo-element rather than a slightly transparent
 * background-color on the section itself: `background-color` under a
 * `background-image` is invisible, and darkening the IMAGE is what keeps the
 * white title readable over an arbitrary photograph the operator uploaded.
 *
 * ::before mounts as the first child box, so the content needs its own stacking
 * context (the `> *` rule) to sit above the overlay instead of being painted
 * under it. The `.wrap` is the direct child that matters; the rule is written
 * generically so a future sibling still lands on top.
 * ---------------------------------------------------------------------- */
.hero--with-image {
    position: relative;
    width: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #fff;
    /* The background needs a guaranteed area to fill and centre within; the
     * solid hero is content-tall (padding-block only), which is far too shallow
     * for even the widest upload. A 240px floor on small screens (320px from
     * 640px up, see the min-width block below) makes `cover` actually cover and
     * gives `background-position: center` a range to centre across, stopping the
     * image from appearing pinned to the top-left at intrinsic scale. */
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Padding-block only: the inner .wrap owns the horizontal gutters, so the
     * hero's text column aligns exactly with the page sections below it. A
     * mixed `Nrem 1rem` padding would push the text 1rem off the page grid. */
    padding-block: 2rem;
}

.hero--with-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.hero--with-image > * {
    position: relative;
    z-index: 1;
}

/* The muted body-text colour is unreadable on a photograph; the image variant
 * overrides it explicitly rather than inheriting .hero__text. */
.hero--with-image .hero__text,
.hero--with-image .hero__meta {
    color: rgba(255, 255, 255, 0.92);
}

.hero--with-image .hero__title {
    color: #fff;
}

/* -------------------------------------------------------------------------
 * Sections
 * ---------------------------------------------------------------------- */
.section {
    margin-bottom: var(--space-7);
}

.section__title {
    font-size: 1.25rem;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.section__text {
    max-width: 60ch;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.section--cta {
    background: var(--color-accent-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.section--cta .section__title {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: var(--space-2);
}

/* Card grid - the container the catalog listings will fill. Empty until the
 * repository layer exists, so an empty grid must not reserve height or gaps. */
.card-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
}

.card-grid:empty {
    display: none;
}

/* -------------------------------------------------------------------------
 * Error pages (404 and friends)
 *
 * No catalog links here: a visitor who reached a dead URL gets one clear way
 * forward, not a menu that may send them to another dead end.
 * ---------------------------------------------------------------------- */
.error-page {
    padding-block: var(--space-6) var(--space-8);
    text-align: center;
}

.error-page__code {
    font-size: clamp(3rem, 12vw, 5rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--color-border-strong);
    margin-bottom: var(--space-3);
}

.error-page__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
}

.error-page__text {
    max-width: 48ch;
    margin-inline: auto;
    color: var(--color-text-muted);
}

.error-page__actions {
    margin-top: var(--space-5);
}

/* -------------------------------------------------------------------------
 * Service detail page
 * ---------------------------------------------------------------------- */
.service-header {
    display: grid;
    gap: var(--space-4);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-5);
}

.service-header__logo img {
    display: block;
    width: 96px;
    height: 96px;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-subtle);
    padding: var(--space-2);
}

.service-title {
    font-size: clamp(1.5rem, 4.5vw, 2.25rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-3);
}

.service-lead {
    max-width: 66ch;
    color: var(--color-text-muted);
    font-size: 1.0625rem;
    margin-bottom: var(--space-4);
}

.service-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.service-header__share-note {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Two columns on a wide screen: prose on the left, the fact table on the right.
 * On mobile the facts come second, because the description is what a visitor came
 * for and the metadata is reference material. */
.service-body {
    display: grid;
    gap: var(--space-6);
    margin-bottom: var(--space-7);
}

.service-description {
    max-width: 70ch;
}

.service-description > :first-child {
    margin-top: 0;
}

.service-description > :last-child {
    margin-bottom: 0;
}

.service-description p,
.service-description ul,
.service-description ol,
.service-description blockquote,
.service-description pre {
    margin-bottom: var(--space-4);
}

.service-description h2,
.service-description h3,
.service-description h4 {
    margin-block: var(--space-5) var(--space-3);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.service-description h2 {
    font-size: 1.375rem;
}

.service-description h3 {
    font-size: 1.125rem;
}

.service-description h4 {
    font-size: 1rem;
}

.service-description ul,
.service-description ol {
    padding-left: var(--space-5);
}

.service-description li {
    margin-bottom: var(--space-2);
}

.service-description blockquote {
    border-left: 3px solid var(--color-border-strong);
    padding-left: var(--space-4);
    color: var(--color-text-muted);
}

.service-description code,
.service-description pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9375rem;
}

.service-description pre {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    overflow-x: auto;
}

.service-description a {
    color: var(--color-accent);
    text-decoration: underline;
}

.service-meta {
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    align-self: start;
}

.service-meta__title {
    font-size: 1rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.service-meta__row {
    display: grid;
    gap: var(--space-1);
    padding-block: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9375rem;
}

.service-meta__row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.service-meta__row dt {
    font-weight: 600;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.service-meta__muted {
    color: var(--color-text-muted);
}

/* "Listed in" — every linked subcategory on one wrapping line, primary first. */
.service-meta__list-inline a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.service-meta__list-inline a:hover,
.service-meta__list-inline a:focus-visible {
    color: var(--color-accent-hover);
}

/* The parent category in brackets is a disambiguation label, not a second
   emphasis, so it keeps the muted colour while staying clickable. */
.service-meta__list-inline .service-meta__muted a {
    color: var(--color-text-muted);
}

.service-meta__list-inline .service-meta__muted a:hover,
.service-meta__list-inline .service-meta__muted a:focus-visible {
    color: var(--color-accent-hover);
}

.service-meta__sep {
    color: var(--color-text-muted);
    padding-inline: 0.125rem;
}

/* Pill list for coins / networks / processors / tags. */
.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    list-style: none;
    padding: 0;
    margin: 0;
}

.pill {
    display: inline-block;
    padding: 0.125rem var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: 999px;
    background: var(--color-surface);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.pill--tag {
    background: var(--color-accent-soft);
    border-color: var(--color-accent-soft);
    color: var(--color-accent-hover);
}

/* -------------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------- */
.btn {
    display: inline-block;
    padding: 0.6875rem 1.125rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn--primary {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: #fff;
    text-decoration: none;
}

.btn--ghost {
    background: transparent;
    border-color: var(--color-border-strong);
    color: var(--color-text);
}

.btn--ghost:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */
.site-footer {
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    padding-block: var(--space-6);
    font-size: 0.9375rem;
}

.site-footer__inner {
    display: grid;
    gap: var(--space-4);
}

.site-footer__share {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
 * Forms
 * ---------------------------------------------------------------------- */
.field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

/* When .field is also [hidden], display: flex (above) would win over the UA
 * stylesheet's [hidden] { display: none }, making the attribute inert for any
 * form field inside the suggest/a-service toggle groups. This overrides. */
.field[hidden] {
    display: none !important;
}

.field__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.field__input {
    width: 100%;
    padding: 0.625rem 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
}

.field__input:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 1px;
    border-color: var(--color-accent);
}

/* -------------------------------------------------------------------------
 * Admin sign-in
 * ---------------------------------------------------------------------- */
.auth {
    display: flex;
    justify-content: center;
    padding-block: var(--space-6) var(--space-8);
    /* Same edge-flush problem as .admin: the section sits directly inside
     * <main class="site-main">, which has vertical padding only. .auth__card is
     * width:100%, so below ~452px its border touches the viewport edges. These
     * pages are admin-only (login, 2FA, password, recovery codes). */
    padding-inline: var(--space-4); /* 1rem mobile */
}

.auth__card {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
}

.auth__title {
    font-size: 1.375rem;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-1);
}

.auth__subtitle {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: var(--space-5);
}

.auth__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.auth__submit {
    width: 100%;
}

.auth__error {
    padding: var(--space-3) var(--space-4);
    margin-bottom: var(--space-4);
    font-size: 0.9375rem;
    color: #8a1c1c;
    background: #fdf0f0;
    border: 1px solid #f0c2c2;
    border-radius: var(--radius-sm);
}

.auth__note {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.auth__link {
    color: inherit;
    text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Two-factor authentication
 * ---------------------------------------------------------------------- */
.auth__card--wide {
    max-width: 520px;
}

.steps {
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    margin: 0;
    padding: 0;
}

.steps__item {
    counter-increment: step;
    position: relative;
    padding-left: var(--space-6);
}

.steps__item::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-surface);
    background: var(--color-accent);
    border-radius: 999px;
}

.steps__title {
    font-size: 1rem;
    margin-bottom: var(--space-1);
}

.steps__text {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: var(--space-3);
}

.qr {
    display: flex;
    justify-content: center;
    padding: var(--space-3);
}

/* The library emits a table of 1x1 cells; centring keeps it from looking ragged
   when the module count differs between secrets. */
.qr__canvas table {
    border-collapse: collapse;
    margin: 0 auto;
    background: #fff;
}

.qr__canvas td {
    padding: 0;
    line-height: 0;
}

.qr__fallback {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    text-align: center;
}

.qr__manual {
    margin-top: var(--space-2);
    font-size: 0.875rem;
}

.qr__manual summary {
    cursor: pointer;
    color: var(--color-text-muted);
}

.qr__secret {
    margin-top: var(--space-2);
    padding: var(--space-3);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    overflow-wrap: anywhere;
}

.qr__hint {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

.field__input--code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 0.2em;
    text-align: center;
}

.codes {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin: var(--space-4) 0 0;
    padding: var(--space-4);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.codes__item {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9375rem;
    letter-spacing: 0.06em;
}

.auth__actions {
    margin-top: var(--space-4);
}

@media (min-width: 640px) {
    .auth {
        padding-inline: var(--space-5); /* 1.5rem desktop */
    }

    .auth__card {
        padding: var(--space-6);
    }
}

.site-footer__share-note {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.site-footer__disclaimer {
    color: var(--color-text-muted);
    max-width: 70ch;
}

/* Step 32: the copyright span is now operator text of unknown length, so the row
 * needs a comfortable leading when it wraps. The size stays 0.875rem - it is what
 * .site-footer__share-note and every other muted footer line already use, so
 * introducing a second near-identical size would only make the footer ragged. */
.site-footer__legal {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    flex-wrap: wrap;
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.site-footer__dot {
    opacity: 0.6;
}

/* -------------------------------------------------------------------------
 * Admin panel
 *
 * A separate block rather than a variation of .auth: the dashboard is a wide
 * multi-section page, while .auth is a single centred card. What they share -
 * buttons, fields, links - is already generic, so nothing here redefines it.
 * ---------------------------------------------------------------------- */
.admin {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

/* Admin content frame.
 *
 * Public pages place their <section> inside <div class="wrap">, which supplies the
 * max-width and the horizontal gutters. Admin views render <section class="admin">
 * directly inside <main class="site-main">, and that main frame carries vertical
 * padding-block only - no inline gutter and no width cap - so the panel sprawls
 * edge to edge on the viewport. The <body> carries class "admin" on every admin
 * page, so the frame is applied here in CSS instead of editing all 33 admin views.
 *
 * 1280px centres the panel on large monitors (admin screens run wider than the
 * 1180px public page); padding-inline restores the gutter. Vertical breathing room
 * already comes from .site-main's padding-block, so none is re-added here.
 * ---------------------------------------------------------------------- */
body.admin .admin {
    width: 100%;
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: var(--space-4); /* 1rem mobile */
}

/* Tables (held in .admin__table-wrap for horizontal scroll), forms and dashboard
 * tiles keep a little room at the base; the flex-column gap already handles the
 * rhythm between direct siblings, these catch the nested cases. */
body.admin .admin__table-wrap,
body.admin .admin__form,
body.admin .admin__tile {
    margin-bottom: var(--space-4); /* 1rem */
}

@media (min-width: 640px) {
    body.admin .admin {
        padding-inline: var(--space-5); /* 1.5rem desktop */
    }
}

/* Admin section nav bar.
 *
 * Rendered once by the base layout on every authenticated admin page (see
 * partials/admin-nav.php). It is deliberately NOT inside .admin, because that
 * section is per-view markup and the bar must also appear above screens whose
 * body is a plain form. Horizontal scroll on narrow viewports keeps all twelve
 * entries reachable without wrapping into a tall block that pushes the actual
 * content off-screen.
 * ---------------------------------------------------------------------- */
.admin-nav {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: var(--space-4);
    margin-bottom: var(--space-4);
}

.admin-nav__list {
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    gap: var(--space-1);
    margin: 0;
    padding: 0 0 var(--space-2);
    overflow-x: auto;
    border-bottom: 1px solid var(--color-border);
    /* Thin scrollbar: the bar is a navigation aid, not a content area. */
    scrollbar-width: thin;
}

.admin-nav__item {
    flex: 0 0 auto;
}

.admin-nav__link {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--radius-sm);
}

.admin-nav__link:hover {
    color: var(--color-accent-hover);
    background: var(--color-bg-subtle);
    text-decoration: none;
}

.admin-nav__link--current {
    color: var(--color-accent);
    background: var(--color-bg-subtle);
    font-weight: 600;
}

@media (min-width: 640px) {
    .admin-nav {
        padding-inline: var(--space-5); /* 1.5rem desktop, mirrors the admin frame */
    }
}

.admin__bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.admin__title {
    font-size: 1.5rem;
    letter-spacing: -0.01em;
    margin-bottom: var(--space-1);
}

.admin__subtitle {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

/* Logout is a POST form, so the button needs no extra wrapper spacing. */
.admin__logout {
    margin: 0;
}

/* Status messages. Colour carries meaning, so it is paired with role="status" /
 * role="alert" in the markup - the text says what happened, the tint only
 * reinforces it. */
.notice {
    padding: var(--space-3) var(--space-4);
    font-size: 0.9375rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.notice--success {
    color: #0b5c2e;
    background: #eefaf2;
    border-color: #b9e6c9;
}

.notice--error {
    color: #8a1c1c;
    background: #fdf0f0;
    border-color: #f0c2c2;
}

/* Informational banner - used for standing notices rather than the outcome of
 * an action, so it deliberately uses the neutral palette instead of the green
 * success tint that would imply "something just worked". */
.notice--info {
    color: #1c3f5c;
    background: #eff6fc;
    border-color: #c2dcf0;
}

.admin__facts {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
    margin: 0;
    padding: var(--space-4);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.admin__fact {
    min-width: 0;
}

.admin__fact-label {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin__fact-value {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    /* A long email must not widen the whole page. */
    overflow-wrap: anywhere;
}

.admin__section-title {
    font-size: 1.125rem;
    margin-bottom: calc(var(--space-1) * -1);
}

.admin__section-text {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-top: calc(var(--space-2) * -1);
}

.admin__grid {
    list-style: none;
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;
    margin: 0;
    padding: 0;
}

.admin__tile {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.admin__tile-label {
    font-size: 1rem;
    font-weight: 600;
}

.admin__tile-hint {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.admin__tile-path {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    overflow-wrap: anywhere;
}

/* The state, stated in words: a disabled tile must not rely on a grey tint alone. */
.admin__tile-status {
    margin-top: var(--space-1);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.admin__note {
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* Helper text under an input, e.g. the password rule. */
.field__hint {
    margin-top: var(--space-1);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
}

/* -------------------------------------------------------------------------
 * Admin: services list and form
 *
 * Additive to the .admin block above - nothing here redefines a token or an
 * existing class, so the dashboard keeps its current appearance.
 * ---------------------------------------------------------------------- */

/* Bar actions sit next to the page title; wrapping keeps them usable on a phone. */
.admin__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin: 0;
}

.admin__filters {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
    padding: var(--space-4);
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.admin__filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: var(--space-2);
    margin: 0;
}

/* The wrapper scrolls rather than the page: a wide table on a narrow screen
 * would otherwise force the whole layout sideways. */
.admin__table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.admin__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    text-align: left;
}

.admin__table-caption {
    padding: var(--space-3) var(--space-4);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.admin__table th,
.admin__table td {
    padding: var(--space-3) var(--space-4);
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}

.admin__table thead th {
    background: var(--color-bg-subtle);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.admin__table tbody tr:last-child td {
    border-bottom: 0;
}

.admin__table-num {
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.admin__table-title {
    display: block;
    font-weight: 600;
    overflow-wrap: anywhere;
}

/* The generated URL under a title, and the subcategory under a category. */
.admin__table-slug {
    display: block;
    color: var(--color-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.admin__table-date {
    color: var(--color-text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Stated in words, not by colour alone. */
.admin__table-empty {
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    font-style: italic;
}

.admin__table-actions {
    text-align: right;
    white-space: nowrap;
}

/* Placeholder for an action whose route does not exist yet. Deliberately not a
 * button and not a link: a control that does nothing when clicked teaches the
 * operator to distrust the panel. Muted so it reads as "not available now"
 * rather than as a broken action. */
.admin__disabled-action {
    display: inline-block;
    margin-left: var(--space-3);
    color: var(--color-text-muted);
    opacity: 0.55;
    cursor: not-allowed;
    font-size: 0.875rem;
}

/* Status pill. Colour reinforces the word, it does not replace it. */
.status {
    display: inline-block;
    padding: 0.125rem var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status--published {
    color: #0b5c2e;
    background: #eefaf2;
    border-color: #b9e6c9;
}

.status--draft {
    color: #6b4d00;
    background: #fff8e6;
    border-color: #f0dcae;
}

.status--archived {
    color: var(--color-text-muted);
    background: var(--color-bg-subtle);
}

/* Suggestion workflow statuses (new / in_review / approved / rejected / spam). */
.status--new {
    color: #4b3b8e;
    background: #f3f0ff;
    border-color: #d9d1f2;
}

.status--in_review {
    color: #0e5a7a;
    background: #eef8fc;
    border-color: #c3e6f2;
}

.status--approved {
    color: #0b5c2e;
    background: #eefaf2;
    border-color: #b9e6c9;
}

.status--rejected {
    color: #7a1f1f;
    background: #fdf0f0;
    border-color: #f0c4c4;
}

.status--spam {
    color: var(--color-text-muted);
    background: var(--color-bg-subtle);
}

/* Generic status variants used by non-publishing entities (backups). Ok =
 * green tint (completed success), danger = red tint (failed). */
.status--ok {
    color: #0b5c2e;
    background: #eefaf2;
    border-color: #b9e6c9;
}

.status--danger {
    color: #7a1f1f;
    background: #fdf0f0;
    border-color: #f0c4c4;
}

/* ---- Trust badge (public) ---- */

.trust-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.trust-badge--sm {
    font-size: 0.65rem;
    padding: 0 0.375rem;
    line-height: 1.3;
    margin-left: 0.375rem;
    /* The badge sits inside the card title's <h3>, next to the link: keep it on
       the text baseline instead of letting it stretch the line box. */
    vertical-align: middle;
}

.trust--verified {
    color: #0b5c2e;
    background: #eefaf2;
    border-color: #b9e6c9;
}

.trust--admitted {
    color: #566573;
    background: #f4f6f7;
    border-color: #ccd1d5;
}

.trust--questionable {
    color: #7a5c00;
    background: #fffae0;
    border-color: #f0dca0;
}

.trust--scam {
    color: #7a1f1f;
    background: #fdf0f0;
    border-color: #f0c4c4;
}

.trust--unknown {
    color: var(--color-text-muted);
    background: var(--color-bg-subtle);
}

.admin__pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.admin__pages {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin__page {
    display: inline-block;
    min-width: 2.25rem;
    padding: 0.5rem var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Danger button variant (reject, delete). */
.btn--danger {
    color: #fff;
    background: #c02626;
    border-color: #c02626;
}

.btn--danger:hover {
    background: #9e1f1f;
    border-color: #9e1f1f;
}

/* Badge on a dashboard tile. */
.admin__tile-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: #c02626;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
}

/* --- Suggest-a-service public form --------------------------------------- */

/* Structure mirrors the home page: <section> > .wrap. .wrap supplies the outer
 * gutter and centering; this caps every direct child to one 720px column so the
 * heading, intro, notices and the form share a single left edge. Without it the
 * form (a flex column with no auto margins) sat against the left of the viewport
 * while the heading spanned the full wrap. */
.suggest .wrap > * {
    max-width: 45rem; /* 720px */
    margin-inline: auto;
}

.suggest__intro {
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
}

.suggest__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.suggest__toggle-group {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-3) var(--space-4);
    margin: 0;
    /* A fieldset's default min-width is min-content, which can push the column
     * wider than 720px on a long checkbox label or a wide <select>. */
    min-width: 0;
}

.suggest__toggle-legend {
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0 var(--space-1);
    color: var(--color-text);
}

.suggest__captcha {
    min-height: 4.5rem;
}

.suggest__captcha-note {
    font-style: italic;
}

.suggest__actions {
    margin-top: var(--space-2);
}

/* Inline checkbox label (the toggle-group checkboxes). */
.field__label--check {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    cursor: pointer;
    font-weight: 400;
    font-size: 0.9375rem;
}

/* Pre-formatted data block on the admin suggestion detail page. */
.admin__section-text--pre {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875rem;
    background: var(--color-bg-subtle);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

/* Action form rows on the suggestion detail page. */
.admin__action-form {
    display: inline-block;
    margin-right: var(--space-2);
}
.admin__page--current {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    font-weight: 600;
}

/* --- Create/edit form ---------------------------------------------------- */

.admin__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.admin__fieldset {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin: 0;
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    /* A fieldset's default min-width is min-content, which lets a long textarea
     * or table force the whole page wider. */
    min-width: 0;
}

.admin__legend {
    padding: 0 var(--space-2);
    font-size: 1rem;
    font-weight: 600;
}

.admin__form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* Invalid input: the border carries the state, the message says what is wrong,
 * and aria-invalid lets a screen reader announce it too. */
.field__input--invalid {
    border-color: #c02626;
}

.field__error {
    margin: 0;
    color: #8a1c1c;
    font-size: 0.8125rem;
    font-weight: 600;
}

.field__required {
    color: #c02626;
}

/* Radio and checkbox rows: the input keeps its native size and the text wraps
 * beside it instead of under it. */
.field__radio,
.field__checkbox {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    font-size: 0.9375rem;
    cursor: pointer;
}

.field__radio input,
.field__checkbox input {
    /* Nudged down so the control lines up with the first line of text rather
     * than its cap height. */
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

/* Scrollable checkbox group. A long coin list would otherwise push the save
 * button several screens down. */
.checkbox-box {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin: 0;
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    min-width: 0;
}

.checkbox-box__scroll {
    display: grid;
    gap: var(--space-2);
    grid-template-columns: 1fr;
    max-height: 14rem;
    overflow-y: auto;
    padding-right: var(--space-2);
}

.checkbox-box__hint {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* Accessible-only text: read by a screen reader, invisible on screen. Used for
 * table column headers that would otherwise be a bare "Actions". */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* A built dashboard tile is a link, so it gets the affordances of one. */
.admin__tile--built {
    padding: 0;
}

.admin__tile-link {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    color: inherit;
}

.admin__tile-link:hover {
    background: var(--color-accent-soft);
    text-decoration: none;
}

.admin__tile-link:hover .admin__tile-status {
    color: var(--color-accent);
}

/* -------------------------------------------------------------------------
 * Admin: logo upload (sub-step 16b)
 *
 * The thumbnail is a fixed square whatever the source aspect ratio, so a wide
 * wordmark and a tall emblem line up in the same table row. object-fit: contain
 * (not cover) is essential - a logo must never be cropped.
 * ---------------------------------------------------------------------- */

.logo-thumb {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: contain;
    background-color: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    /* Uploads have transparent padding by design (see LogoUpload); a faint
     * checker would be noise, so the white plate above stands in for it. */
    padding: 4px;
}

.logo-thumb--sm {
    width: 32px;
    height: 32px;
    padding: 2px;
}

.admin__table-logo {
    width: 1%;
    white-space: nowrap;
}

/* The stored path under the current thumbnail: monospace and muted, because it
 * is reference information, not something to read at a glance. */
.logo-current__path {
    margin-top: var(--space-2);
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

.field--logo-current {
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

/* A file input cannot be styled like a text field, so it is left native and
 * only the width is constrained - a full-width native control looks broken. */
.field__input[type="file"] {
    max-width: 100%;
    padding: var(--space-2) 0;
}

/* -------------------------------------------------------------------------
 * Admin: Open Graph image upload widget
 * ---------------------------------------------------------------------- */

/* The preview mirror the operator has seen is the honest thing to show: no
 * broken-image shape while the field is empty (the img is hidden then). */
.og-image-field__preview {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    margin-top: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

/* The file input and the manual text field sit one under the other. */
.og-image-field__file {
    margin-top: var(--space-2);
}

.og-image-field__remove {
    margin-top: var(--space-2);
}

/* The same widget markup is reused by the settings form's "Home hero
 * background image" field, so the preview/file rules are shared. Only the
 * upload endpoint differs (hero-image-upload.js). */
.hero-image-field__text,
.hero-image-field__file {
    margin-top: var(--space-2);
}

.hero-image-field__preview {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    margin-top: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.hero-image-field__remove {
    margin-top: var(--space-2);
}

/* -------------------------------------------------------------------------
 * Admin: settings form
 * ---------------------------------------------------------------------- */

/* The settings form is one stacked column of fieldsets, each a bordered group
 * with its own legend. A row is a label + hint + control; every row is the
 * same vertical rhythm so a long form stays skimmable. */
.settings {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.settings__group {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin: 0;
}

.settings__legend {
    font-weight: 600;
    padding: 0 var(--space-2);
}

.settings__row {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding-block: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.settings__row--error {
    border-left: 3px solid var(--color-danger);
    padding-left: var(--space-3);
}

.settings__label {
    font-weight: 600;
}

.settings__desc {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.settings__input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
}

.settings__input--error {
    border-color: var(--color-danger);
}

.settings__error {
    color: var(--color-danger);
    font-size: 0.875rem;
}

.settings__image-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

/* Cap the hero control column: without it, the column-flex stretches the
 * preview img to the full panel width and max-height: 200px then squashes it
 * (object-fit: cover on the img only governs distortion, not the box size). */
.settings__image-field.hero-image-field {
    max-width: 320px;
}

.settings__toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Sticky action bar.
 *
 * The settings form is a long scroll (42 keys in 13 fieldsets); without this the
 * operator has to travel to the bottom to save. `bottom: 0` pins the bar to the
 * viewport edge once it scrolls into view, and it still lands in its natural
 * position at the end of the form on short pages.
 *
 * STICKY REQUIRES A CLEAN ANCESTOR CHAIN. `position: sticky` silently degrades
 * to `static` if any ancestor sets `overflow: hidden/auto/scroll`. The chain here
 * is .settings__actions < form.settings < section.admin < main.site-main < body
 * < html - none of which set overflow, so no wrapper is needed. Re-check that
 * before adding an overflow rule to any of them.
 *
 * --color-bg is opaque on purpose: a translucent bar would let the field labels
 * show through the button row while scrolling.
 * ---------------------------------------------------------------------- */
.settings__actions {
    display: flex;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 10;
    padding: var(--space-4);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
}

/* -------------------------------------------------------------------------
 * Reviews
 * ---------------------------------------------------------------------- */
.service-reviews {
    margin-bottom: var(--space-7);
}

.service-reviews__summary {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.service-reviews__empty {
    color: var(--color-text-muted);
    margin-bottom: var(--space-5);
}

.review-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-6);
    display: grid;
    gap: var(--space-3);
}

.review {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    background: var(--color-surface);
}

.review__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.review__author {
    font-weight: 600;
}

/* Stars are literal glyphs, so the colour is the only styling they need. The
 * count is also printed for screen readers inside a .visually-hidden span. */
.review__stars {
    color: #d98800;
    letter-spacing: 0.08em;
}

.review__date {
    margin-left: auto;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.review__text {
    margin: 0;
    max-width: 78ch;
}

.review-form {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-5);
    max-width: 46rem;
}

.review-form__title {
    font-size: 1.125rem;
    margin-bottom: var(--space-4);
}

/* The public review form reuses .field, but not the admin form grid: it is a
 * single narrow column, so the fields stack with an even gap. */
.service-form {
    display: grid;
    gap: var(--space-4);
}

.service-form__actions {
    margin: 0;
}

/* -------------------------------------------------------------------------
 * Service cards (the "similar services" grid)
 * ---------------------------------------------------------------------- */
.service-cards {
    margin: 0;
    padding: 0;
    list-style: none;
}

.service-card {
    display: flex;
    gap: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    background: var(--color-surface);
}

.service-card__media {
    flex: 0 0 auto;
}

.service-card__logo {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-subtle);
    padding: var(--space-1);
}

.service-card__body {
    min-width: 0;
}

.service-card__title {
    font-size: 1rem;
    line-height: 1.3;
    margin-bottom: var(--space-2);
}

.service-card__title a {
    color: var(--color-text);
}

.service-card__title a:hover {
    color: var(--color-accent);
}

.service-card__text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
    /* Two lines maximum: a card grid of wildly uneven heights reads as broken. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-card__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
    font-size: 0.875rem;
    margin: 0;
}

.service-card__link {
    font-weight: 600;
}

.service-card__visit {
    margin-left: auto;
    font-weight: 600;
    color: var(--color-accent);
}

/* -------------------------------------------------------------------------
 * Category listing pages
 * ---------------------------------------------------------------------- */

/* Search results page: the full form under the heading. Wider input than the
 * header shortcut, because this is the search's home and gets its own row. */
.search-form {
    margin: var(--space-4) 0 var(--space-3);
}

.search-form__inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    max-width: 36rem;
}

.search-form__input {
    flex: 1 1 16rem;
}

.heading {
    font-size: clamp(1.5rem, 4vw, 2rem);
    letter-spacing: -0.02em;
    margin: var(--space-4) 0 var(--space-4);
}

.section__subtitle {
    color: var(--color-text-muted);
    margin: var(--space-3) 0 0;
}

/*
 * On-page lead description on a category / subcategory page.
 *
 * Capped in measure (not full container width) because this is a reading block,
 * not a grid: a 1300px line of text is unreadable. Both the h2/h3 and p resets
 * exist because RichText::toHtml() allows those tags - without the resets the
 * editor's own spacing would fight the surrounding layout.
 */
.category-description {
    margin: var(--space-4) 0 var(--space-5);
    max-width: 800px;
    line-height: 1.6;
}

.category-description p {
    margin: 0 0 0.75rem;
}

.category-description h2,
.category-description h3 {
    margin: var(--space-4) 0 var(--space-2);
}

.category-description > :last-child {
    margin-bottom: 0;
}

.category-description ul,
.category-description ol {
    margin: 0 0 0.75rem;
    padding-left: 1.5rem;
}

/* Links inside the block inherit the global `a` colour; only the underline
   needs forcing, because the toolbar can paste a link without one. */
.category-description a {
    text-decoration: underline;
}

/*
 * Suggest call-to-action on a category / subcategory page (step 35d).
 *
 * Sits between the lead description and the sort control. Top margin is small:
 * when a description is present the block already ends with `--space-5`, and
 * stacking two large gaps would float the button in dead space. The bottom
 * margin is the one that separates it from the listing below.
 */
.category-suggest {
    margin: var(--space-4) 0 var(--space-5);
}

/* Breadcrumb: Home > Category > Subcategory */
.breadcrumb {
    margin-bottom: var(--space-4);
}

.breadcrumb__list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    list-style: none;
    padding: 0;
}

.breadcrumb__item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.breadcrumb__item + .breadcrumb__item::before {
    content: "/";
    color: var(--color-border-strong);
}

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

.breadcrumb__text {
    color: var(--color-text);
}

/* Count badge inside a category/subcategory pill. */
.pill__count {
    display: inline-block;
    margin-left: var(--space-1);
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--color-accent-soft);
    font-size: 0.75rem;
    line-height: 1.4;
    vertical-align: baseline;
}

/* Sort dropdown (GET form). */
.sort-form {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: var(--space-4) 0 var(--space-3);
}

.sort-form__label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.sort-form__select {
    padding: 0.375rem var(--space-3) 0.375rem var(--space-2);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: 0.875rem;
    color: var(--color-text);
}

/* Pagination (prev / numbered / next). */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.pagination__pages {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    list-style: none;
    padding: 0;
}

.pagination__page {
    display: inline-flex;
    min-width: 2.25rem;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--color-text);
}

.pagination__page:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
}

.pagination__page--current {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}

/*
 * Category cards on the home page.
 *
 * A card is a column: a rounded icon tile, the category name, and an optional
 * count line. The whole card is the tap target, so the link fills it and the
 * grid only has to own the gap.
 *
 * The icon tile is a fixed square with the placeholder artwork contained inside
 * it. object-fit keeps the SVG from stretching if the placeholder ever swaps to
 * an image with a different aspect ratio.
 */
.category-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
}

.category-card__link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    height: 100%;
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.category-card__link:hover,
.category-card__link:focus-visible {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-sm);
    color: var(--color-accent);
    text-decoration: none;
}

.category-card__icon {
    display: block;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-subtle);
    overflow: hidden;
    /* The placeholder is grey art on grey: desaturating it keeps the tile from
     * reading as a broken logo rather than a deliberate icon. */
    opacity: 0.85;
}

.category-card__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-card__name {
    margin-top: auto;
    font-weight: 600;
    line-height: 1.3;
    /* Long category names ("VPN, Privacy & Security") wrap instead of forcing the
     * grid column wider than its track. */
    overflow-wrap: anywhere;
}

.category-card__count {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Count meta in the hero. */
.hero__meta {
    margin-top: var(--space-3);
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

/* Small category label above a card's short description. */
.service-card__eyebrow {
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-1);
}

/* Footer columns. */
.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-6);
    margin-bottom: var(--space-4);
}

.site-footer__col {
    min-width: 12rem;
}

.site-footer__heading {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-3);
}

/* -------------------------------------------------------------------------
 * Responsive - mobile-first: the rules above are the mobile layout, these widen
 * it. 640px = large phone/small tablet, 960px = desktop, 1280px = wide 16:9.
 * ---------------------------------------------------------------------- */
@media (min-width: 640px) {
    .wrap {
        padding-inline: var(--space-5);
    }

    /*
     * Step 35 - desktop header, restored to its pre-step-35 geometry.
     *
     * Below 640px the header is: [logo .......... search icon] on row 1 and the
     * nav on row 2, with the search form collapsed behind that icon. From 640px
     * up everything is inline again: the icon disappears, the form reappears as
     * the static inline field it has always been, and the nav shares the row.
     *
     * `.site-nav` is forced to `flex-basis: 100%` in the base (mobile) rules so
     * that the nav takes its own row deterministically instead of depending on
     * whether logo + nav + form happen to fit. That is what guarantees the top
     * row is only logo + toggle and can never overflow at 320px. Undo it here.
     */
    .site-header__inner {
        min-height: 68px;
        padding-inline: var(--space-5);
    }

    .site-nav {
        flex: 0 1 auto;
    }

    .site-search-toggle {
        display: none;
    }

    /* The form returns to a normal inline flex item beside the nav. It must be
     * re-declared with `position: static` because the expanded-bar rule above
     * (`.site-header.is-search-open .site-search`) would otherwise keep it
     * absolute if a visitor resized the window while the bar was open. */
    .site-header .site-search,
    .site-header.is-search-open .site-search {
        display: flex;
        position: static;
        margin-left: auto;
        padding: 0;
        border-bottom: 0;
        box-shadow: none;
        background: none;
    }

    .site-header.is-search-open .site-search__input {
        flex: 0 0 auto;
        width: 11rem;
        font-size: 0.875rem;
    }

    /* Catalog dropdown becomes a centered overlay, still anchored to
     * .site-header.
     *
     * `.site-nav__item--catalog` is deliberately NOT given `position: relative`
     * here. Doing that makes the ~90px-wide li the containing block, so
     * `left: 0; width: 640px` measures from wherever the trigger happens to sit
     * in the nav row. The li follows the logo and "Home", so on a 640px viewport
     * its left edge is already ~290px in and a 640px panel would end ~930px -
     * roughly 250px past the right edge. The nav row also wraps between 640px
     * and ~1000px (the search form no longer fits beside it), which moves the
     * trigger again, so the overflow cannot be fixed with a static offset.
     *
     * Keeping the panel anchored to the sticky `.site-header` and centering it
     * with `left: 0; right: 0; margin-inline: auto` plus `width: 90%` capped by
     * `max-width: 640px` makes the geometry independent of the trigger: at
     * 640px the panel is 576px wide inside 32px gutters, at 760px and above it
     * is the full 640px centred in the viewport, and it can never touch an
     * edge. (`left: 50%; transform: translateX(-50%)` would centre it too, but
     * a transform on the panel introduces a new containing block and a
     * compositing layer for no benefit. The auto-margin form has neither.) It
     * reads as a mega-menu sheet rather than a tooltip pinned to one word,
     * which is the conventional pattern for a two-level taxonomy of this size.
     *
     * The two-column grid makes the taxonomy scannable: 11 categories in one
     * column would be an unreachable ribbon of text, and `max-height` +
     * `overflow-y:auto` keeps the panel inside the viewport even if the
     * operator adds categories later. */
    .catalog-panel {
        left: 0;
        right: 0;
        margin-inline: auto;
        width: 90%;
        max-width: 640px;
        border: 1px solid var(--color-border);
        border-top: 1px solid var(--color-border);
        border-radius: var(--radius-md);
    }

    .catalog-panel__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-3) var(--space-5);
        padding: var(--space-4);
    }

    .catalog-panel__category {
        font-size: 0.875rem;
    }

    .catalog-panel__subcategory {
        font-size: 0.8125rem;
    }

    .hero {
        padding-block: var(--space-8);
    }

    /* From 640px up the image hero gets the full 320px floor (the base rule is
     * the 240px mobile value). */
    .hero--with-image {
        min-height: 320px;
        padding-block: 3rem;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin__facts {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* Filters side by side once there is room; the action row spans the width so
     * the buttons stay aligned with the inputs above them. */
    .admin__filters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: end;
    }

    .admin__filter-actions {
        grid-column: 1 / -1;
    }

    /* Two columns of checkbox groups rather than one long list. */
    .checkbox-box__scroll {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .section--cta {
        padding: var(--space-6);
    }

    /* Logo beside the title instead of above it, once there is width for both. */
    .service-header {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
        gap: var(--space-5);
    }
}

@media (min-width: 960px) {
    .wrap {
        padding-inline: var(--space-6);
    }

    .card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-main {
        padding-block: var(--space-7) var(--space-8);
    }

    .admin__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* Prose left, fact table right - the layout a documentation page uses. */
    .service-body {
        grid-template-columns: minmax(0, 1fr) 20rem;
        align-items: start;
    }

    .service-meta {
        position: sticky;
        top: var(--space-4);
    }

}

/* -------------------------------------------------------------------------
 * Articles
 * ---------------------------------------------------------------------- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: var(--space-4);
}

.article-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    padding: var(--space-3);
    background: var(--color-bg);
}

.article-card__cover {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-sm, 4px);
    background: var(--color-bg-subtle);
}

.article-card__title {
    font-size: var(--font-size-lg, 1.125rem);
    line-height: 1.25;
    margin: 0;
}

.article-card__link:hover .article-card__title {
    text-decoration: underline;
}

.article-card__excerpt {
    color: var(--color-text-muted);
    font-size: 0.925rem;
    margin: 0;
}

.article-card__meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: auto;
}

.result-count {
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.empty-state {
    color: var(--color-text-muted);
    padding: var(--space-6) var(--space-4);
    text-align: center;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md, 8px);
}

/* Rich text content (article bodies) rendered from the sanitizer. */
.cpl-rich-text {
    overflow-wrap: break-word;
}

.cpl-rich-text h2,
.cpl-rich-text h3,
.cpl-rich-text h4 {
    line-height: 1.3;
    margin: var(--space-5) 0 var(--space-2);
}

.cpl-rich-text p {
    margin: var(--space-3) 0;
}

.cpl-rich-text ul,
.cpl-rich-text ol {
    margin: var(--space-3) 0;
    padding-left: var(--space-5);
}

.cpl-rich-text li {
    margin: var(--space-1) 0;
}

.cpl-rich-text blockquote {
    border-left: 3px solid var(--color-border);
    margin: var(--space-4) 0;
    padding: var(--space-1) var(--space-4);
    color: var(--color-text-muted);
}

.cpl-rich-text pre {
    background: var(--color-bg-subtle);
    padding: var(--space-3);
    border-radius: var(--radius-sm, 4px);
    overflow-x: auto;
    line-height: 1.5;
}

.cpl-rich-text code {
    font-family: var(--font-mono, monospace);
    background: var(--color-bg-subtle);
    padding: 0.1em 0.3em;
    border-radius: 3px;
}

.cpl-rich-text a {
    color: var(--color-link, inherit);
    text-decoration: underline;
}

.article-page {
    padding: var(--space-6) 0;
}

.article-header {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 48rem;
    margin-bottom: var(--space-5);
}

.article-breadcrumb a {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.article-title {
    font-size: var(--font-size-3xl, 2rem);
    line-height: 1.15;
    margin: 0;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin: 0;
}

.article-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.article-header__share-note {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.article-cover {
    margin-bottom: var(--space-5);
}

.article-cover img {
    width: 100%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-md, 8px);
}

.article-body {
    max-width: 48rem;
    line-height: 1.7;
    font-size: 1rem;
}

.article-body img {
    max-width: 100%;
    height: auto;
}

.article-body table {
    border-collapse: collapse;
    width: 100%;
    margin: var(--space-3) 0;
}

.article-body th,
.article-body td {
    border: 1px solid var(--color-border);
    padding: var(--space-2);
    text-align: left;
}

.article-body caption {
    caption-side: bottom;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    padding-top: var(--space-1);
}

.article-footer {
    margin-top: var(--space-6);
}

/* -------------------------------------------------------------------------
 * Admin: inline (delete) forms in list rows
 * ---------------------------------------------------------------------- */
.admin__inline-form {
    display: inline;
    margin-left: var(--space-2);
}

/* -------------------------------------------------------------------------
 * Admin: compact buttons inside table action cells
 * ---------------------------------------------------------------------- */
.btn--small {
    padding: 0.3125rem 0.625rem;
    font-size: 0.8125rem;
}

/* -------------------------------------------------------------------------
 * Admin: status filter tabs (reviews moderation queue)
 * ---------------------------------------------------------------------- */
.admin__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.admin__tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin-bottom: -1px;
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    color: var(--color-text-muted);
    font-weight: 600;
}

.admin__tab:hover {
    color: var(--color-text);
    text-decoration: none;
}

.admin__tab--active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    background: var(--color-bg-subtle);
}

.admin__tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.3125rem;
    border-radius: 999px;
    background: #c02626;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
}

.auth__link--danger {
    color: var(--color-danger);
}

/* -------------------------------------------------------------------------
 * Admin: order up/down buttons (categories list)
 * ---------------------------------------------------------------------- */
.admin__order {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.admin__order-form {
    display: contents;
}

.admin__order-btn {
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    font-size: 0.6875rem;
    line-height: 1;
    width: 1.25rem;
    height: 1.125rem;
    cursor: pointer;
}

.admin__order-btn:hover:not(:disabled) {
    background: var(--color-bg-subtle);
    color: var(--color-text);
}

.admin__order-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* -------------------------------------------------------------------------
 * Admin: child row (subcategory inside a category list)
 * ---------------------------------------------------------------------- */
.admin__table-title--child {
    padding-left: 1.25rem;
    font-weight: 400;
}

/* -------------------------------------------------------------------------
 * Admin: number input for sort order
 * ---------------------------------------------------------------------- */
.field__input--num {
    width: 5rem;
}

/* -------------------------------------------------------------------------
 * Admin: textarea
 * ---------------------------------------------------------------------- */
.field__input--textarea {
    width: 100%;
    resize: vertical;
}

/* -------------------------------------------------------------------------
 * Admin: article filter bar
 * ---------------------------------------------------------------------- */
.admin__filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.admin__fieldset {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    padding: var(--space-4);
    margin: 0 0 var(--space-4);
}

.admin__fieldset legend {
    font-weight: 600;
    padding: 0 var(--space-1);
}

.admin__form-static {
    padding: var(--space-2);
    background: var(--color-bg-subtle);
    border-radius: var(--radius-sm, 4px);
    font-family: var(--font-mono, monospace);
    word-break: break-all;
}

.field__error {
    color: var(--color-danger);
    font-size: 0.875rem;
    margin: var(--space-1) 0 0;
}


@media (min-width: 1280px) {
    .card-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Respect the OS-level reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* -------------------------------------------------------------------------
 * Cookie consent banner
 * ----------------------------------------------------------------------
 * A fixed bottom banner shown only before a consent choice is made. It carries
 * two equally-weighted buttons (Accept / Reject) and is a plain, accessible
 * dialog - no backdrop, no forced scroll lock beyond its own height.
 */
.cookie-banner {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 60; /* above navigation/menus, below any admin modal */
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -6px 24px rgba(20, 24, 31, 0.08);
    padding: var(--space-4) var(--space-4) var(--space-5);
}

.cookie-banner__inner {
    max-width: 1100px;
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3) var(--space-5);
}

.cookie-banner__text {
    flex: 1 1 320px;
    margin: 0;
    color: var(--color-text);
    font-size: 0.95rem;
    max-width: 60ch;
}

.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.cookie-banner__btn {
    font: inherit;
    font-weight: 600;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.cookie-banner__btn--accept {
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    color: #ffffff;
}

.cookie-banner__btn--accept:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
}

.cookie-banner__btn--reject {
    background: transparent;
    border: 1px solid var(--color-border-strong);
    color: var(--color-text);
}

.cookie-banner__btn--reject:hover {
    background: var(--color-bg-subtle);
}

@media (prefers-reduced-motion: reduce) {
    .cookie-banner {
        transition: none;
    }
}

/* -------------------------------------------------------------------------
 * Advertising slots (step 22b)
 *
 * Two rules govern everything below:
 *
 * 1. NOTHING IS HIDDEN WITH display:none. App\Core\AdSlot returns an empty
 *    string when a slot has no active block, so an empty slot does not exist in
 *    the DOM at all. There is therefore no "empty box" state to suppress and no
 *    layout gap to compensate for. Adding a display:none rule here would only
 *    hide a bug.
 *
 * 2. THE AD IS A GUEST, NOT A LANDLORD. Vertical and horizontal units are
 *    capped and centred rather than sized by the grid, so an oversized creative
 *    (a 970px banner pasted into a 728px slot) cannot blow out the page width -
 *    `overflow: hidden` on the wrapper contains it instead.
 * ---------------------------------------------------------------------- */

.ad-slot {
    margin-block: var(--space-5);
    text-align: center;
    /* A mis-sized creative must not create a horizontal scrollbar on mobile. */
    max-width: 100%;
    overflow: hidden;
}

.ad-slot--horizontal {
    max-width: 728px;
    margin-inline: auto;
}

/*
 * The vertical unit lives in its own <aside> rail (see layouts/base.php), so it
 * does not need to float: the rail is a grid column at >=960px and a full-width
 * block below that. The max-width stays because an operator may paste a 160x600
 * or a 300x250 unit and neither should stretch to the rail's full width.
 */
.ad-slot--vertical {
    max-width: 300px;
    margin-inline: auto;
}

/* The in-list unit: a dashed row inside a service grid, deliberately unlike a
 * card - no border-radius, no shadow, no hover lift - so it reads as an advert
 * rather than as a listing that lost its logo. It spans the whole grid because
 * it sits between rows of cards. */
.ad-inline {
    grid-column: 1 / -1;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-sm);
    padding: var(--space-3) var(--space-4);
    margin: 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-align: left;
    background: var(--color-bg-subtle);
}

/* The disclosure label. CSS-generated content is not announced reliably by
 * every screen reader, which is why the same information is also carried by the
 * rail's aria-label; for the in-list unit the visible label is the disclosure. */
.ad-inline::before {
    content: "Advertisement";
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-1);
    color: var(--color-text-muted);
    opacity: 0.8;
}

/* -------------------------------------------------------------------------
 * Page frame with an advertising rail
 *
 * The inner wrapper only exists so the content and the rail can sit side by
 * side. Below 960px the rail stacks under the content: a 300px column next to a
 * 360px viewport would leave nothing for the content.
 * ---------------------------------------------------------------------- */
.site-main__inner {
    display: block;
}

@media (min-width: 960px) {
    .site-main__inner--rail {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        gap: var(--space-6);
        align-items: start;
        width: 100%;
        max-width: var(--wrap);
        margin-inline: auto;
        padding-inline: var(--space-4);
    }

    /* The rail's own gutter is already provided by the grid gap, so its inline
     * margin is reset to keep the 300px column exactly 300px wide. */
    .site-main__inner--rail .ad-slot--vertical {
        margin-inline: 0;
    }

    /* Inside the rail grid the column IS the wrap: a nested .wrap would add a
     * second set of 1rem gutters (and a pointless 1180px max-width) inside an
     * already constrained column. */
    .site-main__inner--rail .wrap {
        max-width: none;
        padding-inline: 0;
    }
}


/* =====================================================================
 * Admin help / instruction pages (step 25a)
 * =====================================================================
 * The help section is pure documentation rendered in the admin shell, so it
 * deliberately reuses the existing admin tokens (surface, border, radius,
 * shadow, muted text) instead of introducing a second visual language.
 */

.help__grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .help__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .help__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.help__card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
}

.help__card:hover,
.help__card:focus-visible {
    border-color: var(--color-accent);
}

.help__card-title {
    font-weight: 600;
}

.help__card-arrow {
    color: var(--color-text-muted);
}

/* Body copy of a help topic. Constrained measure: these are paragraphs to be
 * read, and a full-width line in the admin panel is uncomfortable to scan. */
.help__content {
    max-width: 72ch;
}

.help__content h2 {
    margin-top: var(--space-6);
    margin-bottom: var(--space-2);
    font-size: 1.125rem;
}

.help__content h2:first-child {
    margin-top: 0;
}

.help__content ol,
.help__content ul {
    margin-top: var(--space-2);
    margin-bottom: var(--space-3);
    padding-left: 1.5rem;
}

.help__content li {
    margin-bottom: var(--space-1);
}

.help__content code {
    padding: 0.125em 0.375em;
    background: var(--color-bg-subtle, #f4f5f7);
    border-radius: var(--radius-sm, 4px);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.875em;
    overflow-wrap: anywhere;
}

.help__content pre {
    margin: var(--space-2) 0 var(--space-3);
    padding: var(--space-3);
    background: var(--color-bg-subtle, #f4f5f7);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.help__content pre code {
    padding: 0;
    background: none;
}

/* Callouts. The colour is reinforcement; the leading "Important:" / "Tip:" word
 * carries the meaning, so a colour-blind reader loses nothing. */
.help__callout {
    margin: var(--space-4) 0;
    padding: var(--space-3) var(--space-4);
    border-left: 4px solid var(--color-border);
    border-radius: var(--radius-sm, 4px);
    background: var(--color-surface);
    font-size: 0.9375rem;
}

.help__callout--warn {
    border-left-color: #c2410c;
    background: #fff7ed;
}

.help__callout--info {
    border-left-color: #0369a1;
    background: #f0f9ff;
}

/* -------------------------------------------------------------------------
 * Browse categories (step 35e)
 *
 * The compact category index that sits between <main> and <footer> on every
 * page EXCEPT the home page, where the body already carries the step 35b card
 * grid and a second category list was duplication.
 *
 * Deliberately outside .site-footer: the top border plus the spaced block read
 * as a "browse" section, while the footer keeps its own border further down.
 * No background colour - the page background is already light, and a second
 * grey panel stacked directly above the grey footer would read as one slab.
 *
 * Mobile-first like the rest of the sheet: the base rule below is the 2-column
 * mobile layout, and the media queries at the end of this file widen it to 3
 * columns at 640px and 4 at 960px. (The brief expressed the same thing as
 * max-width rules; inverting them keeps a single convention across the sheet
 * and avoids a cascade-order trap where a later min-width rule would win.)
 *
 * Counts are muted and in parentheses rather than badges: this is a typographic
 * index, not a set of cards, so the hierarchy stays in the type.
 * ---------------------------------------------------------------------- */
.browse-categories {
    padding-block: var(--space-6);
    border-top: 1px solid var(--color-border);
}

.browse-categories__title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-4);
}

.browse-categories__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2) var(--space-5);
}

.browse-categories__link {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
}

.browse-categories__link:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

.browse-categories__count {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

@media (min-width: 640px) {
    .browse-categories__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 960px) {
    .browse-categories__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
