﻿
/*
    states should be restricted to one of the following;

    normal (could be implicit so could be omitted)
    active
    inactive
    highlight
    disabled
    readonly
    focus
    hover
    selected
    pressed
    dragging
    dropping

    {prefix}{component name(alphanumeric no spaces)}{component subpart (optional)}{state (optional)}{css property}
 */

/*
    add all custom elements here
*/
cctc-tooltip,
cctc-timeout,
cctc-progress,
cctc-switch,
cctc-animatedplaceholder,
cctc-pill, cctc-pill-content-container,
cctc-button,
cctc-concertina, cctc-concertina-header, cctc-concertina-subheader,
cctc-concertinaitem, cctc-concertinaitem-header, cctc-concertinaitem-subheader, cctc-concertinaitem-content,
cctc-datatextbox, cctc-datatextbox-input, cctc-datatextbox-dropdown, cctc-datatextbox-selected,
cctc-infotext,
cctc-infoicon, cctc-infoicon-image-container,
cctc-lister, cctc-lister-filter-header, cctc-lister-items-container, cctc-lister-display-counts, cctc-lister-item-row, cctc-lister-items-header,
cctc-confirmmodal, cctc-confirmmodal-container, cctc-confirmmodal-header, cctc-confirmmodal-responses,
cctc-panelmenu, cctc-panelmenuheader, cctc-panelmenuitem,
cctc-steps, cctc-steps-controls, cctc-steps-headers, cctc-steps-current-content, cctc-progressstep,
cctc-circle,
cctc-tabs, cctc-tabs-headers, cctc-tabs-selected-content, cctc-tabitem, cctc-tabitem-header,
cctc-input, cctc-input-dropdown-selected, cctc-input-dropdown, cctc-input-dropdown-options, cctc-input-dropdown-option,
cctc-chart,
cctc-richtext,
cctc-rangeselector,
cctc-searcher,
cctc-card, cctc-card-eyebrow, cctc-card-header, cctc-card-actions, cctc-card-body, cctc-card-footer,
cctc-cardgrid,
cctc-statbody,
cctc-sparkline
cctc-avatar,
cctc-imagecropper, cctc-imagecropper-viewport, cctc-imagecropper-zoom
{
    display: block;
}

:root {
    /*
        User-preferences multiplier applied to the root font-size below. Default 1 (no
        scaling). Updated at runtime by the preferences.js module when the user picks
        a larger font scale. Every component uses rem-based sizing, so updating this
        single token reflows all typography for free.
    */
    --cctc-user-font-scale: 1;

    /* general variables for use across components ----------------------------------------------*/
    --cctc-color: white;
    --cctc-success-color: var(--bs-success);
    --cctc-info-color: var(--bs-info);
    --cctc-warning-color: var(--bs-warning);
    --cctc-danger-color: var(--bs-danger);
    /*
        Semi-transparent danger tint for error-summary panels. Layered over the
        parent background so it reads correctly on the default dark theme
        (#505050), the tv theme (#0f2537), and the light theme (white) without
        per-theme overrides. Consumers may hard-code an opaque colour in their
        own theme class if an rgba overlay is unsuitable.
    */
    --cctc-danger-background-color: rgba(220, 53, 69, 0.15);
    /*
        Danger rendered as TEXT or thin graphics ON the page background — inline field
        errors, the required-field indicator, the error-summary copy and glyph. This is
        deliberately separate from --cctc-danger-color: that one is a saturated FILL
        (e.g. the danger pill's background behind white text, where #dc3545 reads fine),
        but as text it is only ~1.8:1 on the #505050 default background — far below the
        4.5:1 WCAG 1.4.3 AA requires. Verified against BOTH contexts this token renders in:
        inline errors on the page background #505050 = 5.09:1, AND the error-summary panel's
        rgba(220,53,69,0.15) tint composited over #505050 = #654c4e (the stricter context)
        = 4.92:1. The previous #ffb0b0 cleared #505050 (4.64:1) but fell to 4.48:1 on the
        tinted panel — just under AA. The darker tv theme only raises contrast further.
        Light-background themes (white) must override it back to a saturated red — see
        custom.css .light — since no single red clears 4.5:1 on both a dark grey and white.
    */
    --cctc-danger-text-color: #ffbdbd;
    /*
        Info rendered as TEXT on a dark background - the info counterpart of
        --cctc-danger-text-color above, for the same reason: --cctc-info-color (#0dcaf0) is a
        saturated FILL, and as text it falls short of the 4.5:1 WCAG 1.4.3 AA requires on the
        ConfirmModal backgrounds the demo themes ship - 4.12:1 on #505050, 4.41:1 on tv #2E4D74,
        4.04:1 on light #4a5353 (issue #212). #6edff6 is Bootstrap 5.3's own dark-mode info text
        colour, and clears all three: 5.20:1, 5.58:1 and 5.11:1. Light-background themes
        (white) must override it with a dark info, as for danger - see custom.css .light.
    */
    --cctc-info-text-color: #6edff6;
    --cctc-inactive-color: #A0A0A0;
    /* #C4C4C4 on --cctc-background-color (#505050) ≈ 4.59:1 — meets WCAG 1.4.3 AA 4.5:1
       for text. Previously #C0C0C0 (≈ 4.43:1) which axe-core rightly flagged. Used by
       tab headers, concertina subheaders, dropdown expand icon, and every component
       that aliases --cctc-highlight-color. */
    --cctc-highlight-color: #C4C4C4;
    --cctc-hover-color: #C4C4C4;
    --cctc-background-color: #505050;
    --cctc-border-radius: 0px;
    --cctc-border-color: var(--cctc-color);
    --cctc-border-width: 1px;
    --cctc-border-style: solid;
    --cctc-hover-background-color: #686868;
    --cctc-active-background-color: #686868;
    --cctc-selected-background-color: #404040;
    --cctc-highlight-background-color: #767676;
    --cctc-highlight-border-color: #A0A0A0;
    --cctc-icon-color: var(--cctc-color);
    --cctc-icon-active-color: var(--cctc-highlight-color);
    --cctc-icon-hover-color: var(--cctc-hover-color);
    --cctc-disabled-color: #595959;
    --cctc-disabled-background-color: #e6e6e6;
    --cctc-link-color: cyan;
    --cctc-code-color: #d7ff47;
    --cctc-emphasis: #ffc700;
    --cctc-webkit-line-clamp: 3;

    /*
        focus ring - WCAG 2.2 AA 2.4.11 Focus Appearance
        Contrast against the panel background and the page background must be >= 3:1.
        --cctc-focus-color picks a bright cyan that sits on both --cctc-background-color (#505050)
        and a white page background with >= 3:1 contrast. Per-theme overrides may re-declare it.
    */
    /* --cctc-focus-color: #005fcc; */
    --cctc-focus-color: var(--cctc-emphasis);
    --cctc-focus-ring-width: 2px;
    --cctc-focus-ring-offset: 4px;

    /* component specific variables ----------------------------------------------*/

    /* form (CCTCEditForm layout + form-field chrome).
       Declared here so the family is themeable from one place and the sampler's
       CSS-variable scan can surface it. Most values match the var(..., fallback)
       previously inlined at each use site. The exception is --cctc-form-label-gap
       (see its note below): it was lowered to 0.375rem and is now the single knob
       for the label-to-control gap on BOTH axes — so the top-label vertical gap and
       the left-layout horizontal column-gap both render tighter than the old
       0.75rem fallbacks. The other vars below are unchanged from their old defaults. */
    --cctc-form-field-gap: 1.5rem;
    /* Label-to-control gap, both axes (vertical for stacked/top, horizontal column-gap
       for the 2-column left layout). See the .cctc-form-label rules for the wiring.
       0.375rem (6px) is the floor: it equals the focus-ring reach (offset 4px + width
       2px), so the highlight just meets the label. Going lower overlaps the label — to
       go tighter, also reduce --cctc-focus-ring-offset. */
    --cctc-form-label-gap: 0.375rem;
    --cctc-form-label-min: min-content;
    --cctc-form-label-max: 16rem;
    /* --cctc-form-label-width intentionally left undeclared: it is an opt-in fixed
       width set per-form by DefaultLabelWidth; absent, the minmax(min,max) auto-sizes. */

    /* tabs */
    --cctc-tabs-color: var(--cctc-color);
    --cctc-tabs-background-color: var(--cctc-background-color);
    /* unselected tab text — picks up --cctc-highlight-color (#C4C4C4, ≈4.59:1 on #505050)
       which is now pegged to the minimum contrast-safe grey. Previously the variable
       aliased an older #C0C0C0 value that axe-core flagged at 4.43:1. */
    --cctc-tabs-header-color: var(--cctc-highlight-color);
    --cctc-tabs-header-selected-color: var(--cctc-color);
    --cctc-tabs-header-background-color: var(--cctc-background-color);
    --cctc-tabs-header-selected-background-color: var(--cctc-selected-background-color);
    --cctc-tabs-header-highlight-color: var(--cctc-highlight-color);

    /* concertina */
    --cctc-concertina-icon-color: var(--cctc-icon-color);
    --cctc-concertina-icon-hover-color: var(--cctc-icon-hover-color);
    --cctc-concertina-header-color: var(--cctc-color);
    --cctc-concertina-header-background-color: var(--cctc-background-color);
    --cctc-concertina-subheader-color: var(--cctc-highlight-color);
    --cctc-concertina-subheader-background-color: var(--cctc-background-color);

    /* concertinaitem */
    --cctc-concertinaitem-icon-color: var(--cctc-icon-color);
    --cctc-concertinaitem-icon-hover-color: var(--cctc-icon-hover-color);
    --cctc-concertinaitem-header-color: var(--cctc-color);
    --cctc-concertinaitem-header-background-color: var(--cctc-background-color);
    --cctc-concertinaitem-subheader-color: var(--cctc-highlight-color);
    --cctc-concertinaitem-subheader-background-color: var(--cctc-background-color);

    /* card */
    --cctc-card-color: var(--cctc-color);
    --cctc-card-background-color: var(--cctc-background-color);
    --cctc-card-border-color: var(--cctc-border-color);
    --cctc-card-border-width: var(--cctc-border-width);
    --cctc-card-border-style: var(--cctc-border-style);
    --cctc-card-border-radius: var(--cctc-border-radius);
    --cctc-card-padding: 1rem;
    --cctc-card-gap: 0.75rem;
    --cctc-card-eyebrow-color: var(--cctc-highlight-color);
    --cctc-card-header-color: var(--cctc-color);
    --cctc-card-footer-color: var(--cctc-highlight-color);

    /* cardgrid */
    --cctc-cardgrid-columns: 12;
    --cctc-cardgrid-gap: 1rem;

    /* panelmenu */
    --cctc-panelmenu-background-color: var(--cctc-background-color);
    --cctc-panelmenu-hover-background-color: var(--cctc-hover-background-color);
    --cctc-panelmenu-active-background-color: var(--cctc-active-background-color);
    /* Subtle wash behind a collapsed active group's icon cluster. Defaulted to the *selected*
       (not hover/active) base token so it stays distinct from --cctc-panelmenu-active-background-color
       — the selected-child fill — and the selected child still reads as selected within the group
       (Decision 5). Consuming apps override this per theme in their own theme blocks. */
    --cctc-panelmenu-group-background-color: var(--cctc-selected-background-color);
    --cctc-panelmenu-highlight-border-color: var(--cctc-highlight-border-color);
    --cctc-panelmenu-border-radius: var(--cctc-border-radius);
    --cctc-panelmenu-border-color: var(--cctc-background-color);
    --cctc-panelmenu-highlight-color: var(--cctc-highlight-color);
    --cctc-panelmenu-color: var(--cctc-color);
    /* flyout: a top-layer panel that sits over page content, so it needs a visible
       border (unlike the rail, whose border matches its background) and a shadow.
       These --cctc-panelmenu-flyout-* tokens are deliberately left UNSET here and
       resolved in PanelMenuHeader.razor.css from the live-themed --cctc-panelmenu-*
       tokens via var() fallbacks. A derived token declared on :root — e.g.
       `--cctc-panelmenu-flyout-background-color: var(--cctc-panelmenu-background-color)`
       — is substituted once against :root's value and then inherits frozen, so it would
       ignore a theme class applied lower in the tree (.panelmenu-tv / .panelmenu-light on
       cctc-panelmenu) and the flyout would keep the default grey while the rail themed.
       Leaving them unset lets the component fall back to the inherited themed tokens; set
       one in a theme class only to override the flyout independently of the rail. */

    /* lister */
    --cctc-lister-color: var(--cctc-color);
    --cctc-lister-background-color: var(--cctc-background-color);
    --cctc-lister-hover-background-color: var(--cctc-hover-background-color);
    --cctc-lister-highlight-background-color: var(--cctc-highlight-background-color);
    --cctc-lister-highlight-color: var(--cctc-highlight-color);
    --cctc-lister-working-template-color: var(--cctc-highlight-color);
    --cctc-lister-filter-header-color: var(--cctc-color);
    --cctc-lister-filter-header-background-color: var(--cctc-background-color);
    /* header row of the list — same AA-contrast bump as rangeselector labels */
    --cctc-lister-items-header-color: var(--cctc-highlight-color);
    --cctc-lister-items-header-background-color: var(--cctc-selected-background-color);
    --cctc-lister-display-counts-color: var(--cctc-color);
    --cctc-lister-display-counts-background-color: var(--cctc-background-color);

    /*
        input - covers Text, TextArea, Date, Time, DateAndTime, Numeric, Dropdown, Radio, CheckBox
    */
    --cctc-input-color: var(--cctc-color);
    --cctc-input-background-color: var(--cctc-background-color);
    --cctc-input-icon-color: var(--cctc-highlight-color);
    --cctc-input-icon-hover-color: var(--cctc-color);
    --cctc-input-readonly-icon-color: var(--cctc-readonly-icon-color);
    --cctc-input-height: 1.8rem;
    --cctc-input-padding-left: 0.5rem;
    --cctc-input-padding-right: 0.5rem;
    --cctc-input-border-radius: var(--cctc-border-radius);
    --cctc-input-border-color: var(--cctc-border-color);
    --cctc-input-border-width: var(--cctc-border-width);
    --cctc-input-border-style: var(--cctc-border-style);
    --cctc-input-disabled-color: var(--cctc-disabled-color);
    --cctc-input-disabled-background-color: var(--cctc-disabled-background-color);
    --cctc-input-webkit-line-clamp: var(--cctc-webkit-line-clamp);

    /* datatextbox */
    --cctc-datatextbox-input-color: var(--cctc-color);
    --cctc-datatextbox-input-background-color: var(--cctc-background-color);
    --cctc-datatextbox-input-border-color: var(--cctc-color);
    --cctc-datatextbox-input-border-style: var(--cctc-border-style);
    --cctc-datatextbox-input-border-width: var(--cctc-border-width);
    --cctc-datatextbox-input-border-top-left-radius: 3px;
    --cctc-datatextbox-input-border-top-right-radius: 3px;
    --cctc-datatextbox-input-border-bottom-right-radius: 0;
    --cctc-datatextbox-input-border-bottom-left-radius: 0;
    --cctc-datatextbox-dropdown-color: var(--cctc-color);
    --cctc-datatextbox-dropdown-border-color: var(--cctc-color);
    --cctc-datatextbox-dropdown-background-color: var(--cctc-active-background-color);
    --cctc-datatextbox-dropdown-height: 20rem;
    --cctc-datatextbox-icon-active-color: var(--cctc-icon-active-color);
    --cctc-datatextbox-icon-hover-color: var(--cctc-icon-hover-color);

    /* steps */
    --cctc-steps-color: var(--cctc-color);
    --cctc-steps-background-color: var(--cctc-background-color);
    --cctc-steps-icon-active-color: var(--cctc-icon-active-color);
    --cctc-steps-icon-hover-color: var(--cctc-icon-hover-color);
    --cctc-steps-icon-disabled-color: var(--cctc-disabled-color);
    --cctc-steps-header-color: var(--cctc-selected-background-color);
    --cctc-steps-header-background-color: var(--cctc-background-color);
    /* inactive step label — same AA-contrast bump as rangeselector labels */
    --cctc-steps-header-inactive-color: var(--cctc-highlight-color);
    --cctc-steps-header-inactive-background-color: var(--cctc-background-color);

    /* infotext */
    --cctc-infotext-icon-color: var(--cctc-icon-color);
    --cctc-infotext-icon-hover-color: var(--cctc-hover-color);
    --cctc-infotext-popover-color: var(--cctc-color);
    --cctc-infotext-popover-background-color: var(--cctc-highlight-background-color);
    --cctc-infotext-webkit-line-clamp: var(--cctc-webkit-line-clamp);

    /*infoicon*/
    --cctc-infoicon-image-container-background-color: var(--cctc-background-color);
    --cctc-infoicon-image-container-border-radius: var(--cctc-border-radius);
    --cctc-infoicon-image-border-radius: var(--cctc-border-radius);
    --cctc-infoicon-popover-color: var(--cctc-color);
    --cctc-infoicon-popover-header-color: var(--cctc-color);
    --cctc-infoicon-popover-background-color: var(--cctc-highlight-background-color);
    --cctc-infoicon-popover-header-background-color: var(--cctc-active-background-color);

    /*animatedplaceholder*/
    --cctc-animatedplaceholder-background-color: rgb(205, 127, 50);
    --cctc-animatedplaceholder-background-image: linear-gradient(to left, rgb(218, 160, 109, .05), rgb(218, 160, 109, .3), rgb(218, 160, 109, .6), rgb(218, 160, 109, .3), rgb(218, 160, 109, .05));
    --cctc-animatedplaceholder-border-radius: var(--cctc-border-radius);

    /*progress*/
    --cctc-progress-accent-color: var(--cctc-highlight-color);
    --cctc-progress-height: 1rem;

    /*sparkline*/
    /* Trend accent (bars/line). Defaults to the theme highlight; override per instance for a tint. */
    --cctc-sparkline-color: var(--cctc-highlight-color);
    /* Ordered palette for part-to-whole (pie/ring) segments, cycled and wrapping past 6.
       Theme-derived so it re-tints with the active theme; override any entry for a custom scheme. */
    --cctc-sparkline-segment-1: var(--cctc-info-color);
    --cctc-sparkline-segment-2: var(--cctc-success-color);
    --cctc-sparkline-segment-3: var(--cctc-warning-color);
    --cctc-sparkline-segment-4: var(--cctc-danger-color);
    --cctc-sparkline-segment-5: var(--cctc-emphasis);
    --cctc-sparkline-segment-6: var(--cctc-highlight-color);

    /*pill*/
    --cctc-pill-color: var(--cctc-color);
    --cctc-pill-background-color: var(--cctc-highlight-background-color);
    --cctc-pill-border-color: var(--cctc-border-color);
    --cctc-pill-success-color: var(--cctc-color);
    --cctc-pill-success-border-color: var(--cctc-success-color);
    --cctc-pill-success-background-color: var(--cctc-success-color);
    /*
        Info and warning are LIGHT fills, so they take dark text where success and
        danger take white. One text colour cannot serve all four: measured against
        the bootstrap fills these tokens resolve to, white gives #0dcaf0 = 1.96:1 and
        #ffc107 = 1.63:1 — far below the 4.5:1 WCAG 1.4.3 AA requires for normal text,
        and illegible rather than marginal (issue #187). #141414 gives #0dcaf0 = 9.41:1
        and #ffc107 = 11.30:1. It is the same dark the light theme already uses for
        pill text, so no new colour enters the palette. Success (#198754 = 4.53:1) and
        danger (#dc3545 = 4.53:1) keep white and are left alone.
    */
    --cctc-pill-info-color: #141414;
    --cctc-pill-info-background-color: var(--cctc-info-color);
    --cctc-pill-info-border-color: var(--cctc-info-color);
    --cctc-pill-warning-color: #141414;
    --cctc-pill-warning-background-color: var(--cctc-warning-color);
    --cctc-pill-warning-border-color: var(--cctc-warning-color);
    --cctc-pill-danger-color: var(--cctc-color);
    --cctc-pill-danger-background-color: var(--cctc-danger-color);
    --cctc-pill-danger-border-color: var(--cctc-danger-color);
    /*
        NOTE: --cctc-pill-outline-color is deliberately NOT declared here. An outline pill
        drops the context fill, so its text sits on the PAGE background and must not use
        the context's on-fill text colour — dark-on-fill would become dark-on-dark
        (#141414 on #505050 = 1.91:1). It therefore falls back to --cctc-pill-color, which
        every theme already sets correctly for its own background: white on #505050 =
        8.06:1 (default), white on #0f2537 = 15.67:1 (tv), #141414 on white = 18.42:1
        (light). Declaring it here with var(--cctc-pill-color) would NOT do that: a custom
        property is substituted where it is DECLARED, so the alias would resolve against
        :root's white once and inherit that literal value into every theme, silently
        giving the light theme white-on-white. The fallback lives at the point of use in
        Pill.razor.css instead, where it resolves per element and so per theme. Set this
        token in a theme to override the outline text colour on its own.
    */

    /*confirmmodal*/
    --cctc-confirmmodal-color: var(--cctc-color);
    --cctc-confirmmodal-background-color: var(--cctc-background-color);
    --cctc-confirmmodal-border-color: var(--cctc-color);
    --cctc-confirmmodal-header-color: var(--cctc-warning-color);
    --cctc-confirmmodal-response-color: var(--cctc-info-text-color);
    --cctc-confirmmodal-response-border-color: var(--cctc-info-color);
    --cctc-confirmmodal-response-hover-color: var(--cctc-color);
    --cctc-confirmmodal-response-hover-border-color: var(--cctc-color);
    --cctc-confirmmodal-border-radius: var(--cctc-border-radius);

    /*
        button - covers Button, RefreshButton
    */
    --cctc-button-color: var(--cctc-color);
    --cctc-button-hover-color: var(--cctc-hover-color);
    --cctc-button-icon-color: var(--cctc-icon-color);
    --cctc-button-icon-hover-color: var(--cctc-icon-hover-color);
    --cctc-button-x-padding: 0.75rem;
    --cctc-button-y-padding: 0.25rem;
    --cctc-button-border-radius: var(--cctc-border-radius);
    --cctc-button-border-color: var(--cctc-border-color);
    --cctc-button-border-hover-color: var(--cctc-hover-color);
    --cctc-button-border-width: var(--cctc-border-width);
    --cctc-button-border-style: var(--cctc-border-style);

    /*switch*/
    --cctc-switch-color: var(--cctc-color);
    --cctc-switch-disabled-color: var(--cctc-disabled-color);
    --cctc-switch-background-color: var(--cctc-color);
    --cctc-switch-disabled-background-color: var(--cctc-disabled-background-color);
    --cctc-switch-active-hover-box-shadow: 0 0 0 1px var(--cctc-highlight-background-color);
    --cctc-switch-inactive-hover-box-shadow: 0 0 0 1px var(--cctc-highlight-color);
    --cctc-switch-slider-active-background-color: var(--cctc-highlight-color);
    --cctc-switch-slider-inactive-background-color: var(--cctc-highlight-background-color);
    --cctc-switch-slider-disabled-background-color: var(--cctc-highlight-background-color);

    /*rangeselector*/
    --cctc-rangeselector-track-height: 0.625rem;
    --cctc-rangeselector-track-background-color: var(--cctc-highlight-background-color);
    --cctc-rangeselector-track-border-radius: var(--cctc-border-radius);
    --cctc-rangeselector-fill-background-color: var(--cctc-info-color);
    --cctc-rangeselector-thumb-size: 1.25rem;
    --cctc-rangeselector-thumb-background-color: var(--cctc-info-color);
    --cctc-rangeselector-thumb-border: 2px solid var(--cctc-color);
    --cctc-rangeselector-thumb-border-radius: 50%;
    --cctc-rangeselector-thumb-hover-box-shadow: 0 0 0 8px rgba(0, 123, 255, 0.2);
    --cctc-rangeselector-thumb-dragging-box-shadow: 0 0 0 12px rgba(0, 123, 255, 0.3);
    --cctc-rangeselector-thumb-focus-box-shadow: 0 0 0 8px rgba(0, 123, 255, 0.3);
    --cctc-rangeselector-thumb-focus-outline-color: var(--cctc-info-color);
    --cctc-rangeselector-labels-font-size: 0.75rem;
    /* was --cctc-inactive-color (#A0A0A0, ≈3.66:1 on #505050) which axe flagged for 1.4.3.
       Bumped to --cctc-highlight-color (#C4C4C4, ≈4.59:1) for AA-safe label contrast. */
    --cctc-rangeselector-labels-color: var(--cctc-highlight-color);
    --cctc-rangeselector-disabled-opacity: 0.5;

    /*richtext*/
    --cctc-richtext-height: calc(var(--cctc-input-height) * 7);
    --cctc-richtext-padding-left: var(--cctc-input-padding-left);
    --cctc-richtext-padding-right: var(--cctc-input-padding-right);
    --cctc-richtext-color: var(--cctc-input-color);
    --cctc-richtext-background-color: var(--cctc-input-background-color);
    --cctc-richtext-border-radius: var(--cctc-input-border-radius);
    --cctc-richtext-border-color: var(--cctc-input-border-color);
    --cctc-richtext-border-width: var(--cctc-input-border-width);
    --cctc-richtext-border-style: var(--cctc-input-border-style);
    --cctc-richtext-font-size: 0.875rem;
    --cctc-richtext-padding: 0.75rem;
    --cctc-richtext-placeholder-color: #999;
    --cctc-richtext-toolbar-color: var(--cctc-color);
    --cctc-richtext-toolbar-background-color: var(--cctc-background-color);
    --cctc-richtext-toolbar-hover-color: var(--cctc-icon-hover-color);
    --cctc-richtext-toolbar-active-color: var(--cctc-icon-active-color);
    --cctc-richtext-focus-border-color: var(--cctc-highlight-color);
    --cctc-richtext-readonly-icon-color: var(--cctc-input-readonly-icon-color);
    --cctc-richtext-disabled-color: var(--cctc-input-disabled-color);
    --cctc-richtext-disabled-background-color: var(--cctc-input-disabled-background-color);

    /*avatar*/
    --cctc-avatar-background: var(--cctc-input-background-color);
    --cctc-avatar-border-colour: var(--cctc-input-border-color);
    --cctc-avatar-border-width: var(--cctc-input-border-width);
    --cctc-avatar-square-radius: var(--cctc-input-border-radius);

    /*imagecropper*/
    --cctc-imagecropper-color: var(--cctc-input-color);
    --cctc-imagecropper-background-color: var(--cctc-input-background-color);
    --cctc-imagecropper-border-color: var(--cctc-input-border-color);
    --cctc-imagecropper-border-width: var(--cctc-input-border-width);
    --cctc-imagecropper-border-style: var(--cctc-input-border-style);
    --cctc-imagecropper-border-radius: var(--cctc-input-border-radius);
    --cctc-imagecropper-viewport-background: #2b2b2b;
    --cctc-imagecropper-viewport-size: min(18.75rem, 78vw);
    --cctc-imagecropper-focus-border-color: var(--cctc-highlight-color);
    --cctc-imagecropper-dropping-border-color: var(--cctc-highlight-color);
    --cctc-imagecropper-disabled-color: var(--cctc-input-disabled-color);
    --cctc-imagecropper-disabled-background-color: var(--cctc-input-disabled-background-color);
    --cctc-imagecropper-control-gap: 0.75rem;
    --cctc-imagecropper-touch-target: 44px;

    /*searcher*/
    --cctc-searcher-icon-color: var(--cctc-input-icon-color);
    --cctc-searcher-icon-hover-color: var(--cctc-input-icon-hover-color);
    --cctc-searcher-icon-active-color: var(--cctc-info-color);
    --cctc-searcher-border-color: var(--cctc-input-border-color);
    --cctc-searcher-border-hover-color: var(--cctc-input-icon-hover-color);
    --cctc-searcher-border-active-color: var(--cctc-info-color);
    --cctc-searcher-active-background-color: var(--cctc-highlight-background-color);
    --cctc-searcher-error-color: var(--cctc-danger-text-color, var(--cctc-danger-color));
    --cctc-searcher-error-background-color: var(--cctc-input-background-color);
    --cctc-searcher-error-border-color: var(--cctc-danger-text-color, var(--cctc-danger-color));
}

input[type="checkbox"], input[type="radio"] {
    transform: scale(1.5);
}

.material-icons {
    font-size: 0.875rem;
}

/* StatCard / AsyncStatCard header icon. Global (not scoped) because the icon markup lives in
   both StatCard.razor and AsyncStatCard.razor — each would otherwise need its own scoped copy. */
.stat-icon {
    font-size: 1.8rem;
    line-height: 1;
    color: var(--cctc-card-footer-color);
}

/*
    Keyboard-only focus indicator. :focus-visible only applies when the browser
    determines the user is navigating via keyboard (or other non-pointer input),
    so mouse clicks do not paint an outline but Tab / Shift-Tab do.
*/
*:focus {
    outline: 0;
}

*:focus-visible {
    outline: var(--cctc-focus-ring-width) solid var(--cctc-focus-color);
    outline-offset: var(--cctc-focus-ring-offset);
}

/*
    Blazored.Modal wraps the dialog in .blazored-modal-focus-trap with empty
    <div tabindex="0"> sentinels before and after the dialog so it can detect
    Tab loop-around. They are implementation-internal and must not paint a
    focus ring — Tabbing through the modal would otherwise flash a stray ring
    around an invisible element along the dialog edge.
*/
.blazored-modal-focus-trap > div[tabindex="0"]:focus,
.blazored-modal-focus-trap > div[tabindex="0"]:focus-visible {
    outline: 0;
}

/*
    SPA navigation focus indicator. Blazor's <FocusOnNavigate> adds tabindex="-1"
    to a non-interactive landing element (typically the page <h1>) and calls
    .focus() on it after each route change. When the user clicked a link to
    trigger the route change, browsers do NOT match :focus-visible on that
    programmatic focus, so the heading receives focus silently and the user
    has no idea where focus has gone — failing WCAG 2.4.7 Focus Visible.
    Painting the ring on plain :focus for headings that were made focusable
    only via tabindex restores a visible target for SPA navigation without
    affecting headings the consumer hasn't opted in.
*/
:is(h1, h2, h3, h4, h5, h6)[tabindex]:focus {
    outline: var(--cctc-focus-ring-width) solid var(--cctc-focus-color);
    outline-offset: var(--cctc-focus-ring-offset);
}

/*
    Visually hidden utility (canonical clip-path pattern).
    Content stays in the accessibility tree for screen readers but is removed
    from the visual layout. Used for labels, announcements, skip-link text, etc.
*/
.cctc-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/*
    Root font-size hook for the user-preferences font-scale. Multiplying the
    browser default 100% by --cctc-user-font-scale rescales every rem-based
    measurement in the library without per-component changes.

    Gated on the [data-cctc-user-font-scale] attribute (written by preferences.js
    only when the user opts into a non-default scale) rather than always-on.
    Always-on caused chromium's font rasteriser to take a slightly different
    sub-pixel path even at scale = 1 — visually identical, but enough to bust
    pixel-level screenshot baselines. Gating keeps the default render
    bit-identical to the pre-preferences era.
*/
html[data-cctc-user-font-scale] {
    font-size: calc(100% * var(--cctc-user-font-scale, 1));
}

/*
    Respect OS-level reduced-motion preference (WCAG 2.3.3 / 2.2.2).
    Cancels every animation and transition inside the library; consumers may
    override on their own elements but the library should never introduce motion
    a user has asked the OS to suppress.

    The user-preference [data-cctc-reduce-motion="force"] rule below mirrors the
    same body so a user can opt in to suppression even when the OS does not
    request it. The two blocks are kept separate (rather than merged with a
    shared selector list) because @media and attribute selectors cannot share
    a single rule.
*/
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

[data-cctc-reduce-motion="force"] *,
[data-cctc-reduce-motion="force"] *::before,
[data-cctc-reduce-motion="force"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
}

/*
    High-contrast token overrides. Triggered either by the user-toggleable
    [data-cctc-high-contrast="on"] attribute or by the OS-level
    @media (prefers-contrast: more) preference. Both write the same token set
    so they are interchangeable and additive.

    Strategy: tighten the existing token aliasing rather than redefining the
    palette. Bumping --cctc-highlight-color up to --cctc-color collapses the
    grey/white split that several components use to distinguish primary vs
    secondary text — every component that reads --cctc-highlight-color
    (range labels, tab inactive text, lister header text, steps inactive
    label, etc.) gets full contrast for free. Border and focus-ring widths
    are bumped to make boundaries unambiguous.
*/
[data-cctc-high-contrast="on"],
[data-cctc-high-contrast="on"] :is(.default, .tv, .light) {
    --cctc-highlight-color: var(--cctc-color);
    --cctc-hover-color: var(--cctc-color);
    --cctc-border-width: 2px;
    --cctc-input-border-width: 2px;
    --cctc-button-border-width: 2px;
    --cctc-focus-ring-width: 3px;
    --cctc-focus-ring-offset: 4px;
}

@media (prefers-contrast: more) {
    :root,
    :root :is(.default, .tv, .light) {
        --cctc-highlight-color: var(--cctc-color);
        --cctc-hover-color: var(--cctc-color);
        --cctc-border-width: 2px;
        --cctc-input-border-width: 2px;
        --cctc-button-border-width: 2px;
        --cctc-focus-ring-width: 3px;
        --cctc-focus-ring-offset: 4px;
    }
}

/*
    Shared form-field scaffolding for Text, TextArea, Numeric, Date, Time,
    DateAndTime, CheckBox, Radio, and Switch. Consumers receive a uniform
    label / helper / error pattern wired via aria-describedby — no per-component
    hand-rolling required.
*/
.cctc-form-label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--cctc-color);
}

.cctc-form-required-indicator {
    margin-left: 0.25rem;
    color: var(--cctc-danger-text-color, var(--cctc-danger-color));
}

.cctc-form-helper {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    color: var(--cctc-highlight-color);
}

.cctc-form-error {
    margin-top: 0.25rem;
    font-size: 0.8125rem;
    /*
        Pin the line-height so it equals the factor the reserved error-row height
        assumes (--cctc-form-error-reserved-height = 0.8125rem * 1.4 + 0.25rem). Without
        this the error inherits the consumer's body line-height (often 1.5), making the
        rendered error taller than the reservation, so showing an error nudges every
        following field down. Keep this 1.4 and the reserved calc in step.
    */
    line-height: 1.4;
    color: var(--cctc-danger-text-color, var(--cctc-danger-color));
}

/*
    Decorative error glyph prepended to .cctc-form-error and the error-summary
    heading. Rendered as a CSS mask so the colour tracks the danger TEXT colour
    (so the icon and the words it sits beside match). The SVG is the Material-style
    filled exclamation-circle; because this is a ::before pseudo-element it is
    invisible to assistive technology and does not contribute to the role="alert"
    announcement.
*/
.cctc-form-error::before,
.cctc-form-error-summary-heading::before {
    content: "";
    display: inline-block;
    width: 1em;
    height: 1em;
    margin-right: 0.35em;
    vertical-align: -0.15em;
    background-color: var(--cctc-danger-text-color, var(--cctc-danger-color));
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z'/%3E%3C/svg%3E");
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/*
    Field-label-vs-control layout grid — the data-label-position hook.

    Shared by every migrated form field. Keyed off all four outer elements because
    Text/TextArea/CheckBox/DropDown/Numeric/Date/Time/DateAndTime/Radio render <cctc-input>,
    Switch renders <cctc-switch>, RichText renders <cctc-richtext>, and DataTextBox renders
    <cctc-datatextbox> (so a cctc-input-only selector would silently skip the others).

    Entirely INERT until a component opts in by emitting data-label-position on
    its outer element AND assigning its control wrapper to the `control` grid area
    in its own scoped stylesheet (done per-component as each migrates). No shipped
    component emits the attribute yet, so this changes no current layout.

    The chrome classes (.cctc-form-label/.cctc-form-helper/.cctc-form-error) are
    assigned to grid areas here; grid-area is ignored outside a grid container, so
    non-migrated components that still use these classes as block siblings are
    unaffected. The error row is reserved (min-height) so showing/hiding an error
    does not shift sibling fields — the no-vertical-shift acceptance criterion.
*/
cctc-input[data-label-position],
cctc-switch[data-label-position],
cctc-richtext[data-label-position],
cctc-datatextbox[data-label-position],
cctc-imagecropper[data-label-position] {
    display: grid;
    width: 100%;
    column-gap: var(--cctc-form-label-gap, 0.75rem);
    row-gap: 0;
}

cctc-input[data-label-position="top"],
cctc-switch[data-label-position="top"],
cctc-richtext[data-label-position="top"],
cctc-datatextbox[data-label-position="top"],
cctc-imagecropper[data-label-position="top"] {
    grid-template-columns: 1fr;
    grid-template-areas:
        "label"
        "control"
        "helper"
        "error";
    align-items: stretch;
}

/* Base (mobile, < 48rem): a left-labelled field stacks like a top-labelled one.
   A 2-column [label][control] grid on a 375px viewport crushes the control
   (~34px) — so left collapses to single-column below the tablet breakpoint.
   Wiki (Media-breakpoints): mobile-first, never use max-width. */
cctc-input[data-label-position="left"],
cctc-switch[data-label-position="left"],
cctc-richtext[data-label-position="left"],
cctc-datatextbox[data-label-position="left"],
cctc-imagecropper[data-label-position="left"] {
    grid-template-columns: 1fr;
    grid-template-areas:
        "label"
        "control"
        "helper"
        "error";
    align-items: stretch;
}

@media (min-width: 48rem) {
    /* Tablet+ : the aligned 2-column left layout (unchanged from before). */
    cctc-input[data-label-position="left"],
    cctc-switch[data-label-position="left"],
    cctc-richtext[data-label-position="left"],
    cctc-datatextbox[data-label-position="left"],
    cctc-imagecropper[data-label-position="left"] {
        grid-template-columns: var(--cctc-form-label-width, max-content) 1fr;
        grid-template-areas:
            "label control"
            "label helper"
            ".     error";
        align-items: center;
    }
}

/*
    Label-to-control gap. --cctc-form-label-gap is the single themeable knob for the
    space between a field's label and its control, and it governs BOTH axes:
      - Stacked layouts (top always; left collapses to stacked below 48rem): the gap
        is vertical, applied here as the label's block margin. The grid row-gap stays
        0, so this margin spaces only label-to-control, not the control/helper/error
        rows below it.
      - 2-column left layout at >=48rem: the gap is horizontal, applied as the grid
        column-gap (the per-field grid rule above and the form-level rule below). The
        label's block margin is then dropped (override in the media query) so the
        column-gap alone owns the spacing and the label/control stay vertically aligned.
    Mobile-first: the margin is the base behaviour; the >=48rem override removes it only
    where the left layout switches to columns.
*/
cctc-input[data-label-position] > .cctc-form-label,
cctc-switch[data-label-position] > .cctc-form-label,
cctc-richtext[data-label-position] > .cctc-form-label,
cctc-datatextbox[data-label-position] > .cctc-form-label,
cctc-imagecropper[data-label-position] > .cctc-form-label {
    grid-area: label;
    margin-bottom: var(--cctc-form-label-gap, 0.75rem);
}

@media (min-width: 48rem) {
    cctc-input[data-label-position="left"] > .cctc-form-label,
    cctc-switch[data-label-position="left"] > .cctc-form-label,
    cctc-richtext[data-label-position="left"] > .cctc-form-label,
    cctc-datatextbox[data-label-position="left"] > .cctc-form-label,
    cctc-imagecropper[data-label-position="left"] > .cctc-form-label {
        margin-bottom: 0;
    }
}

cctc-input[data-label-position] > .cctc-form-helper,
cctc-switch[data-label-position] > .cctc-form-helper,
cctc-richtext[data-label-position] > .cctc-form-helper,
cctc-datatextbox[data-label-position] > .cctc-form-helper,
cctc-imagecropper[data-label-position] > .cctc-form-helper {
    grid-area: helper;
}

cctc-input[data-label-position] > .cctc-form-error,
cctc-switch[data-label-position] > .cctc-form-error,
cctc-richtext[data-label-position] > .cctc-form-error,
cctc-datatextbox[data-label-position] > .cctc-form-error,
cctc-imagecropper[data-label-position] > .cctc-form-error {
    grid-area: error;
}

/*
    Reserve the error row's height even when no error element is rendered, so a field
    does not jump when validation toggles and its siblings stay put (the no-vertical-shift
    criterion). Scoped to the form's DIRECT field children (> combinator), matching the
    field-gap rule below: a standalone input has no siblings to shift, so it pays no
    permanent reserved space. Direct-child scoping is also load-bearing — a descendant
    selector would leak the reserved row onto migrated inputs nested INSIDE a composite
    control (e.g. the DropDown's integrated Searcher renders a Text whose <cctc-input>
    carries data-label-position), inflating that inner control's height and breaking its
    layout. Sized to one line of the error text (font-size 0.8125rem) plus its 0.25rem
    top margin; expose it as a custom property so a theme can zero or grow it.
*/
.cctc-edit-form > cctc-input[data-label-position],
.cctc-edit-form > cctc-switch[data-label-position],
.cctc-edit-form > cctc-richtext[data-label-position],
.cctc-edit-form > cctc-datatextbox[data-label-position],
.cctc-edit-form > cctc-imagecropper[data-label-position] {
    --cctc-form-error-reserved-height: calc(0.8125rem * 1.4 + 0.25rem);
}

.cctc-edit-form > cctc-input[data-label-position]::after,
.cctc-edit-form > cctc-switch[data-label-position]::after,
.cctc-edit-form > cctc-richtext[data-label-position]::after,
.cctc-edit-form > cctc-datatextbox[data-label-position]::after,
.cctc-edit-form > cctc-imagecropper[data-label-position]::after {
    content: "";
    grid-area: error;
    min-height: var(--cctc-form-error-reserved-height);
}

/*
    Vertical rhythm between fields. The reserved error row keeps each field a
    constant height, but without a gap the next field butts straight up against
    a shown error (the country error landing on the terms checkbox). Separate the
    fields with a themeable gap; CCTCEditForm.DefaultGap sets --cctc-form-field-gap
    per form, otherwise this default applies. Scoped to direct-child fields so a
    nested field is not double-spaced.
*/
.cctc-edit-form > cctc-input[data-label-position],
.cctc-edit-form > cctc-switch[data-label-position],
.cctc-edit-form > cctc-richtext[data-label-position],
.cctc-edit-form > cctc-datatextbox[data-label-position],
.cctc-edit-form > cctc-imagecropper[data-label-position] {
    margin-bottom: var(--cctc-form-field-gap, 1.5rem);
}

/*
    Overall form width. With every field stretching to width:100%, a form grows
    uncomfortably wide on large viewports — long line lengths hurt form usability,
    and a full-width Date/Time/DateAndTime pushes its native browser picker (which
    anchors to the control's right edge) hard against the viewport edge, so the
    calendar opens far from the text. Cap the form responsively: full width on
    mobile, 75% at tablet (>=48rem), 50% at desktop (>=80rem). Themeable via
    --cctc-form-max-width — set it once to override every breakpoint with a single
    value. Mobile-first: the cap only narrows as the viewport grows.
*/
.cctc-edit-form {
    max-width: var(--cctc-form-max-width, 100%);
}

@media (min-width: 48rem) {
    .cctc-edit-form {
        max-width: var(--cctc-form-max-width, 75%);
    }
}

@media (min-width: 80rem) {
    .cctc-edit-form {
        max-width: var(--cctc-form-max-width, 50%);
    }
}

/*
    Form-level left-label alignment.

    A left-labelled field on its own is an independent grid, so each field's label
    column sizes to its OWN label — giving a ragged input edge across the form, and
    letting one long label blow its column out to a single line that crushes the
    control. To make the inputs line up, the form itself becomes the grid: it owns
    a single [label][control] column pair, and every left field adopts those tracks
    via `grid-template-columns: subgrid`. The shared label column then auto-sizes to
    the WIDEST label across the form (so all inputs align), bounded by
    --cctc-form-label-min / --cctc-form-label-max so a very long label wraps inside
    the cap instead of pushing the control off the row. A fixed --cctc-form-label-width
    (CCTCEditForm.DefaultLabelWidth) overrides the auto sizing entirely.

    Only engaged when the form's DefaultLabelPosition is Left (data-form-label-position
    on the <form>); a top-default form stays a plain block, unchanged.
*/
/*
    Gated at the tablet breakpoint to stay mobile-first: below 48rem a left field
    stacks (see the per-field rule above), so the form-level aligned column pair only
    engages at >=48rem where there is room for it. Tablet/desktop are unchanged.
*/
@media (min-width: 48rem) {
    .cctc-edit-form[data-form-label-position="left"] {
        display: grid;
        grid-template-columns:
            [label] var(--cctc-form-label-width,
                minmax(var(--cctc-form-label-min, min-content), var(--cctc-form-label-max, 16rem)))
            [control] 1fr;
        column-gap: var(--cctc-form-label-gap, 0.75rem);
        align-items: start;
    }

    /* Non-field children (error summary, submit row, etc.) span the full width. */
    .cctc-edit-form[data-form-label-position="left"] > * {
        grid-column: 1 / -1;
    }

    /*
        Left fields share the form's columns via subgrid, so their labels align to one
        column. Fields explicitly set to top inside a left form keep the `> *` full-width
        span above and lay out as their own single-column grid — they just don't align.
    */
    .cctc-edit-form[data-form-label-position="left"] > cctc-input[data-label-position="left"],
    .cctc-edit-form[data-form-label-position="left"] > cctc-switch[data-label-position="left"],
    .cctc-edit-form[data-form-label-position="left"] > cctc-richtext[data-label-position="left"],
    .cctc-edit-form[data-form-label-position="left"] > cctc-datatextbox[data-label-position="left"],
    .cctc-edit-form[data-form-label-position="left"] > cctc-imagecropper[data-label-position="left"] {
        grid-column: 1 / -1;
        grid-template-columns: subgrid;
    }
}

/* Guard a pathological unbroken label: wrap rather than overflow the capped column. */
.cctc-edit-form[data-form-label-position="left"] cctc-input[data-label-position="left"] > .cctc-form-label,
.cctc-edit-form[data-form-label-position="left"] cctc-switch[data-label-position="left"] > .cctc-form-label,
.cctc-edit-form[data-form-label-position="left"] cctc-richtext[data-label-position="left"] > .cctc-form-label,
.cctc-edit-form[data-form-label-position="left"] cctc-datatextbox[data-label-position="left"] > .cctc-form-label,
.cctc-edit-form[data-form-label-position="left"] cctc-imagecropper[data-label-position="left"] > .cctc-form-label {
    overflow-wrap: break-word;
}

/*
    Touch-target expansion — WCAG 2.2 AA 2.5.8 (24×24 CSS px minimum).
    CheckBox and Radio inputs render smaller than 24×24 to preserve visual design;
    this wrapper gives the pointer hit area a ≥24×24 footprint without changing
    the input's rendered size.
*/
.cctc-input-touch-target {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    flex: 0 0 auto;
}

/*
    Error summary live region used by <ErrorLiveRegion>. role="alert" + aria-live
    guarantee announcement; tabindex="-1" lets consumers move focus to the region
    after failed submission (pairs with CCTCBase.FocusFirstInvalidAsync).
*/
.cctc-form-error-summary {
    margin-bottom: 1rem;
    padding: 1rem;
    border: var(--cctc-border-width) solid var(--cctc-danger-text-color, var(--cctc-danger-color));
    border-radius: var(--cctc-border-radius);
    color: var(--cctc-danger-text-color, var(--cctc-danger-color));
    background-color: var(--cctc-danger-background-color);
}

.cctc-form-error-summary-heading {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.cctc-form-error-summary ul {
    margin: 0;
    padding-left: 1.25rem;
}

.cctc-form-error-summary li + li {
    margin-top: 0.25rem;
}

.cctc-form-error-summary a {
    color: var(--cctc-danger-text-color, var(--cctc-danger-color));
    text-decoration: underline;
    display: inline-flex;      /* box can take a min-height */
    align-items: center;
    min-height: 24px;          /* WCAG 2.5.8 target size at the 16px default font */
}

/*
    Fieldset used to wrap Radio groups when a GroupLabel is supplied. Neutralises the
    default fieldset border/padding so visual parity with the unwrapped variant is preserved;
    semantic fieldset/legend stays intact for assistive technology.
    In the group-label branch the <fieldset> is the direct grid child of <cctc-input>
    (the <legend> is a grandchild the global `> .cctc-form-label` rule can't reach), so the
    fieldset itself carries the `control` placement — otherwise the whole group auto-places
    into the label column and is crushed against sibling fields in a left-label CCTCEditForm.
*/
.cctc-radio-fieldset {
    grid-area: control;
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.cctc-radio-fieldset > legend {
    padding: 0;
    margin-bottom: 0.25rem;
}