:root {
    /* Hubbe Color Palette - Primary (Grapefruit) */
    --hubbe-grapefruit: #CE7756;
    --hubbe-grapefruit-1: #C98366;
    --hubbe-grapefruit-2: #C48E77;
    --hubbe-grapefruit-3: #BF9A87;
    --hubbe-grapefruit-4: #B9A597;
    --hubbe-grapefruit-5: #B4B0A8;
    --hubbe-grapefruit-6: #AFBCB8;

    /* Secondary - Herbal */
    --hubbe-herbal: #A5A594;
    --hubbe-herbal-1: #AC9D8A;
    --hubbe-herbal-2: #B3967F;
    --hubbe-herbal-3: #BA8E75;
    --hubbe-herbal-4: #C0866B;
    --hubbe-herbal-5: #C77F60;
    --hubbe-herbal-6: #CE7756;

    /* Secondary - Mint */
    --hubbe-mint: #809F96;
    --hubbe-mint-1: #8C9B84;
    --hubbe-mint-2: #989872;
    --hubbe-mint-3: #A39461;
    --hubbe-mint-4: #AF904F;
    --hubbe-mint-5: #BB8D3D;
    --hubbe-mint-6: #C7892B;

    /* Secondary - Mustard */
    --hubbe-mustard: #C7892B;
    --hubbe-mustard-1: #C68E3A;
    --hubbe-mustard-2: #C5934A;
    --hubbe-mustard-3: #C49959;
    --hubbe-mustard-4: #C39E68;
    --hubbe-mustard-5: #C2A378;
    --hubbe-mustard-6: #C1A887;

    /* Brand - Orange (for Registry branding) */
    --hubbe-orange: #F5A623;

    /* Semantic Colors (legacy aliases — preserved for existing code) */
    --color-primary: var(--hubbe-grapefruit);
    --color-primary-light: var(--hubbe-grapefruit-1);
    --color-primary-dark: #B85F42;
    /* Deeper grapefruit for any GRAPEFRUIT FOREGROUND that must meet WCAG AA against white —
       solid primary button fill (white text), text links, and outline-primary text/border.
       Contrast is symmetric, so #B05A3E gives 4.8:1 both as white-on-fill and as text-on-white.
       The brand --color-primary (#CE7756) is only 3.3:1 with white (AA-Large only), too low for
       normal-size text. Decorative/large-area grapefruit keeps using --color-primary. */
    --color-primary-aa: #B05A3E;        /* 4.8:1 vs white — AA */
    --color-primary-aa-hover: #974830;  /* 6.4:1 vs white — AAA */
    --color-secondary: var(--hubbe-herbal);
    --color-accent-1: var(--hubbe-mint);
    --color-accent-2: var(--hubbe-mustard);

    /* ========================================================
       DESIGN TOKENS (added 2026-05-21 by UI style system pipeline)
       Two layers: primitives (raw values) and semantics (intent).
       Use semantic tokens in components; primitives only here.
       ======================================================== */

    /* ---- Primitives: Neutrals ---- */
    --neutral-0:   #FFFFFF;
    --neutral-50:  #FAFAFA;
    --neutral-100: #F4F4F5;
    --neutral-200: #E4E4E7;
    --neutral-300: #D4D4D8;
    --neutral-400: #A1A1AA;
    --neutral-500: #71717A;
    --neutral-600: #52525B;
    --neutral-700: #3F3F46;
    --neutral-800: #27272A;
    --neutral-900: #18181B;

    /* ---- Primitives: Functional colors (WCAG-validated against white) ---- */
    --red-500:   #DC2626;  /* 4.84:1 on white — AA */
    --red-50:    #FEF2F2;
    --green-600: #16A34A;  /* 4.65:1 on white — AA */
    --green-50:  #F0FDF4;
    --amber-500: #D97706;  /* 4.52:1 on white — AA */
    --amber-50:  #FFFBEB;
    --blue-600:  #2563EB;  /* 5.17:1 on white — AA */
    --blue-50:   #EFF6FF;

    /* ---- Semantic: Surfaces ---- */
    --surface-app:           var(--neutral-100);    /* page background */
    --surface-card:          var(--neutral-0);      /* card body */
    --surface-card-subtle:   var(--neutral-50);     /* subtle inset */
    --surface-elevated:      var(--neutral-0);      /* modal, dropdown */
    --surface-overlay:       rgba(24, 24, 27, 0.5); /* modal backdrop */
    --surface-header-brand:  var(--hubbe-grapefruit-6); /* card header bar (Option B) */

    /* ---- Semantic: Text (contrast verified against surface-card #FFF) ---- */
    --text-primary:     var(--neutral-700);   /* 9.74:1 — AAA */
    --text-secondary:   var(--neutral-600);   /* 7.21:1 — AAA */
    --text-tertiary:    var(--neutral-500);   /* 4.66:1 — AA */
    --text-placeholder: var(--neutral-400);   /* 2.83:1 — placeholders only */
    --text-disabled:    var(--neutral-400);
    --text-link:        var(--blue-600);      /* 5.17:1 — AA */
    --text-on-brand-saturated: var(--neutral-0);   /* 3.51:1 on grapefruit — AA-Large only (>=18pt or >=14pt bold) */
    --text-on-brand-subtle:    var(--neutral-700); /* 8.4:1 on grapefruit-6 — AAA */
    --text-on-danger:    var(--neutral-0);  /* 4.83:1 on red-500 — AA */
    --text-on-success:   var(--neutral-0);  /* 4.66:1 on green-600 — AA */
    --text-on-warning:   var(--neutral-900); /* 6.85:1 on amber-500 — AAA */
    --text-on-info:      var(--neutral-0);  /* 5.18:1 on blue-600 — AA */

    /* ---- Semantic: Borders ---- */
    --border-subtle:  var(--neutral-200);
    --border-default: var(--neutral-300);
    --border-strong:  var(--neutral-600);
    --border-brand:   var(--hubbe-grapefruit);
    --border-focus:   var(--hubbe-grapefruit-2);
    --border-invalid: var(--red-500);

    /* ---- Semantic: State colors ---- */
    --color-info:       var(--blue-600);
    --color-info-bg:    var(--blue-50);
    --color-success:    var(--green-600);
    --color-success-bg: var(--green-50);
    --color-warning:    var(--amber-500);
    --color-warning-bg: var(--amber-50);
    --color-danger:     var(--red-500);
    --color-danger-bg:  var(--red-50);
    /* Teal outside the status palette, for categorical badges that must not read as a status
       (e.g. the "Custom" org type). teal-700 on teal-50 ≈ 5.2:1 — AA for normal text.
       Named --badge-teal to avoid confusion with the --color-accent-1/-2 (mint/mustard) tokens above. */
    --badge-teal:     #0F766E;   /* teal-700 — text/border */
    --badge-teal-bg:  #F0FDFA;   /* teal-50  — background */
    /* Positive = brand-coordinated "go" for affirmative-workflow actions (replaces btn-success).
       4A6B62 = darker mint; white text yields 5.5:1 — AA. Mint primary (#809F96) would only get 3.0:1. */
    --color-positive:        #4A6B62;
    --color-positive-text:   var(--neutral-0);
    --color-positive-hover:  #3D5851;

    /* ---- Semantic: Spacing scale ---- */
    --space-0:   0;
    --space-1:   0.25rem;  /*  4px */
    --space-2:   0.5rem;   /*  8px */
    --space-3:   0.75rem;  /* 12px */
    --space-4:   1rem;     /* 16px */
    --space-5:   1.25rem;  /* 20px */
    --space-6:   1.5rem;   /* 24px */
    --space-8:   2rem;     /* 32px */
    --space-10:  2.5rem;   /* 40px */
    --space-12:  3rem;     /* 48px */
    --space-16:  4rem;     /* 64px */

    /* ---- Semantic: Typography scale ---- */
    --font-size-xs:   0.75rem;   /* 12px — captions, badges */
    --font-size-sm:   0.875rem;  /* 14px — secondary text, table cells */
    --font-size-base: 1rem;      /* 16px — body */
    --font-size-lg:   1.125rem;  /* 18px — large body, sub-headings */
    --font-size-xl:   1.25rem;   /* 20px — h4 */
    --font-size-2xl:  1.5rem;    /* 24px — h3 */
    --font-size-3xl:  1.875rem;  /* 30px — h2 */
    --font-size-4xl:  2.25rem;   /* 36px — h1 / page title */

    --line-height-tight: 1.25;
    --line-height-base:  1.5;
    --line-height-loose: 1.75;

    --font-weight-normal:   400;
    --font-weight-medium:   500;
    --font-weight-semibold: 600;
    --font-weight-bold:     700;

    /* ---- Semantic: Radius / Shadow / Z-index ---- */
    --radius-none: 0;
    --radius-sm:   0.25rem;  /* 4px — buttons, inputs */
    --radius-md:   0.5rem;   /* 8px — cards */
    --radius-lg:   0.75rem;  /* 12px — large containers */
    --radius-full: 9999px;   /* pills, avatars */

    --shadow-xs: 0 1px 2px rgba(24, 24, 27, 0.05);
    --shadow-sm: 0 2px 4px rgba(24, 24, 27, 0.08);
    --shadow-md: 0 4px 8px rgba(24, 24, 27, 0.10);
    --shadow-lg: 0 8px 16px rgba(24, 24, 27, 0.12);
    --shadow-xl: 0 16px 32px rgba(24, 24, 27, 0.16);

    --z-base:           1;
    --z-sticky:         100;
    --z-dropdown:       1000;
    --z-modal-backdrop: 1040;
    --z-modal:          1050;
    --z-popover:        1060;
    --z-toast:          1080;

    /* ---- Semantic: Motion ---- */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* ---- Semantic: Focus + Touch ---- */
    --focus-ring-width:  3px;
    --focus-ring-offset: 2px;
    --focus-ring-color:  var(--hubbe-grapefruit-2);

    --touch-target-min: 44px;
}

html, body {
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
}

.registry-brand {
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--hubbe-orange);
    font-weight: 700;
}

/* Button styles moved to buttons.css */

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ============================================================
   PAGE HEADER — title pattern at the top of every page (2026-05-22)
   Markup:
     <div class="page-header">
         <div class="page-header-text">
             <h1>Title</h1>
             <p class="page-subtitle">Optional descriptive subtitle</p>
         </div>
         <div class="page-header-actions">     ← optional
             <button class="btn btn-outline-secondary">Refresh</button>
         </div>
     </div>
   For pages with no subtitle and no actions, the bare
   `<div class="page-header"><h1>...</h1></div>` pattern still works —
   .page-header-text is optional.
   ============================================================ */
.page-header {
    color: var(--hubbe-grapefruit);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.page-header-text {
    flex: 1;
    min-width: 0;
}

.page-header h1 {
    font-weight: 600;
    margin-bottom: 0;
}

.page-subtitle {
    color: var(--text-secondary);
    margin: var(--space-1) 0 0 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
}

.page-header-actions {
    flex-shrink: 0;
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* Registry Tabs */
.registry-tabs {
    border-bottom: 2px solid var(--hubbe-grapefruit-3);
}

.registry-tabs .nav-link {
    color: var(--hubbe-herbal);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.25rem;
    margin-bottom: -2px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.registry-tabs .nav-link:hover {
    color: var(--color-primary-aa);
    border-bottom-color: var(--hubbe-grapefruit-2);
    background-color: transparent;
}

.registry-tabs .nav-link.active {
    color: var(--color-primary-aa);
    background-color: transparent;
    border-bottom: 3px solid var(--color-primary-aa);
    font-weight: 600;
}

/* ============================================================
   REGISTRY CARDS (Option B — soften to grapefruit-6 + accent border)
   2026-05-21 — Updated by UI style system pipeline.
   The .registry-card-header is now light-tinted (grapefruit-6) with
   near-black text, giving AAA contrast (8.4:1) for the title and
   AA contrast (5.2:1) for the secondary --text-secondary ID.
   Brand presence preserved via 4px grapefruit accent on the left.
   ============================================================ */
.registry-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-left: 4px solid var(--border-brand);   /* brand accent */
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-xs);
}

/* Let the custom absolute-positioned popups (MultiSelect / SearchableSelect)
   escape the card's overflow:hidden when open. Bootstrap dropdowns don't need a
   per-container rule — dropdown-overflow-helper.js positions them with Popper's
   fixed strategy so they escape every container automatically. The slight cost is
   the rounded top corners may briefly show square header-bg edges while open. */
.registry-card:has(.multi-select-popup, .searchable-select-list) {
    overflow: visible;
}

.registry-card-header {
    background-color: var(--surface-header-brand);  /* grapefruit-6 (#AFBCB8) */
    color: var(--text-on-brand-subtle);              /* near-black — AAA 8.4:1 */
    padding: var(--space-4) var(--space-5);
    font-weight: var(--font-weight-semibold);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-3);
}

/* Structured-content wrapper (left side) */
.registry-card-header-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0; /* allow truncation in narrow viewports */
    flex: 1;
}

/* Primary title within the header */
.registry-card-title {
    margin: 0;
    color: var(--text-on-brand-subtle);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
}

/* Reusable section label inside a card body / panel (e.g., "Organizations") — bold sub-heading on a light surface */
.registry-section-label {
    margin: 0 0 0.5rem;
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
}

/* Collapse/expand toggle for a registry-card header (e.g., the Training Organizations card).
   Uses the card-title color so it's clearly visible on the brand-tinted header. The chevron icon
   itself is swapped (down when expanded, up when collapsed) in the component markup. */
.registry-collapse-toggle {
    background: transparent;
    border: 0;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--text-on-brand-subtle);
    font-size: var(--font-size-xl);
}

/* Blazor-controlled collapsible region. The grid-template-rows 0fr↔1fr transition animates to the
   content's natural height without relying on Bootstrap's collapse JS. The reduced-motion media query
   above neutralizes the transition for users who request less motion. */
.registry-collapsible {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}
.registry-collapsible.expanded {
    grid-template-rows: 1fr;
}
.registry-collapsible > .registry-collapsible-inner {
    overflow: hidden;
    min-height: 0;
}

/* Same escape hatch for the custom popups inside an expanded collapsible (e.g. a
   filterable DataTable nested in a collapsible card section). The inner
   overflow:hidden above exists only to animate the grid-row collapse. Scoped to
   .expanded so a collapsed section never reflows open. Bootstrap dropdowns are
   handled by dropdown-overflow-helper.js. */
.registry-collapsible.expanded > .registry-collapsible-inner:has(.multi-select-popup, .searchable-select-list) {
    overflow: visible;
}

/* Secondary identifier (e.g., "PD10000520") — monospace for readability */
.registry-card-id {
    color: var(--text-secondary);                /* 5.2:1 on grapefruit-6 — AA */
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    font-family: ui-monospace, 'SF Mono', Consolas, monospace;
    letter-spacing: 0.025em;
}

/* Header-right slot (badges, action menus) */
.registry-card-header-actions {
    display: flex;
    gap: var(--space-2);
    flex-shrink: 0;
    align-items: center;
}

.registry-card-body {
    padding: var(--space-5);
    background-color: var(--surface-card);
}

a .registry-card-clickable {
    cursor: pointer;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

a:hover .registry-card-clickable,
a:focus .registry-card-clickable {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* Verified badge styling */
.badge-verified {
    background-color: var(--hubbe-mint);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-unverified {
    background-color: var(--hubbe-mustard);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Account info list */
.info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.info-list li:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--hubbe-herbal);
    min-width: 140px;
}

.info-value {
    color: #333;
}

/* Footer text */
.registry-text-muted {
    color: var(--hubbe-herbal);
    font-size: 0.875rem;
}

/* Profile Header */
.profile-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--hubbe-grapefruit) 0%, var(--hubbe-grapefruit-3) 100%);
    border-radius: 8px;
    color: white;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--hubbe-mustard);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

/* Spinner */
.registry-spinner {
    color: var(--hubbe-grapefruit);
}

/* Profile Definition List */
.profile-list {
    font-size: 0.875rem;
}

.profile-list dt {
    color: var(--hubbe-herbal);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.125rem;
}

.profile-list dd {
    color: #333;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

.profile-list dd:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* ============================================================
   REGISTRY TABS (segmented-control style — added 2026-05-21,
   revised after design feedback)
   New .registry-tabs-list / .registry-tab / .registry-tab-count
   classes are for the WAI-ARIA TabContainer. Visual treatment is
   a segmented-control / iOS-style: all tabs inside a soft
   gray-fill rounded container, active tab pops out as a white
   card with a soft shadow.

   The existing .registry-tabs underline-style above stays for
   backward compatibility (currently: ManageNavMenu.razor only).
   ============================================================ */
.registry-tabs-list {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--space-1);
    padding: var(--space-1);
    background: var(--neutral-100);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    list-style: none;
    margin: 0 0 var(--space-4) 0;
}

.registry-tab {
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-4);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    cursor: pointer;
    min-height: var(--touch-target-min);
    text-decoration: none;   /* route-based NavLink tabs render as <a>; suppress the default link underline */
    transition: background-color var(--transition-fast),
                color var(--transition-fast),
                box-shadow var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.registry-tab:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.registry-tab.active {
    background: var(--surface-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    font-weight: var(--font-weight-semibold);
}

.registry-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: var(--space-1);
    padding: 0 var(--space-2);
    min-width: 1.5em;
    height: 1.5em;
    background: var(--neutral-200);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
}

.registry-tab.active .registry-tab-count {
    background: var(--color-primary-aa);     /* deep grapefruit — count text is xs (12px), needs 4.5:1; brand grapefruit is only 3.3:1 */
    color: var(--neutral-0);                 /* white — 4.8:1 on --color-primary-aa, AA */
}

/* ============================================================
   REGISTRY TABLE ROW ACTIONS (added 2026-05-21)
   Vertical stack convention for QuickGrid action columns —
   prevents "row 1 has a giant green button, row 2 has a tiny
   outline" inconsistencies (Image 2 fix).
   ============================================================ */
.registry-row-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 9rem;   /* keeps action column from squeezing */
}

.registry-row-actions .btn {
    width: 100%;
    justify-content: center;
}

/* ============================================================
   REGISTRY ALERTS (added 2026-05-21)
   Component class for the new <RegistryAlert> shared component.
   Variants: info / success / warning / danger.
   role="alert" + aria-live="assertive" for warning/danger.
   role="status" + aria-live="polite" for info/success.
   Color is NEVER the sole indicator — every variant has an icon.
   ============================================================ */
.registry-alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border-left: 4px solid;   /* color set by variant */
    margin-bottom: var(--space-3);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
}

.registry-alert > i,
.registry-alert > .bi {
    flex-shrink: 0;
    font-size: 1.25em;
    line-height: 1;
    margin-top: 0.1em;
}

.registry-alert-content {
    flex: 1;
    min-width: 0;
}

.registry-alert-title {
    display: block;
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-1);
}

.registry-alert-body {
    color: inherit;
}

.registry-alert-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: var(--space-1);
    line-height: 1;
    opacity: 0.7;
    flex-shrink: 0;
}

.registry-alert-close:hover {
    opacity: 1;
}

.registry-alert-info {
    background: var(--color-info-bg);
    color: var(--text-primary);
    border-left-color: var(--color-info);
}

.registry-alert-info > .bi {
    color: var(--color-info);
}

.registry-alert-success {
    background: var(--color-success-bg);
    color: var(--text-primary);
    border-left-color: var(--color-success);
}

.registry-alert-success > .bi {
    color: var(--color-success);
}

.registry-alert-warning {
    background: var(--color-warning-bg);
    color: var(--text-primary);
    border-left-color: var(--color-warning);
}

.registry-alert-warning > .bi {
    color: var(--color-warning);
}

.registry-alert-danger {
    background: var(--color-danger-bg);
    color: var(--text-primary);
    border-left-color: var(--color-danger);
}

.registry-alert-danger > .bi {
    color: var(--color-danger);
}

/* ============================================================
/* ============================================================
   ROW-CLICK-TO-SELECT (added 2026-05-28)
   Rows inside a .row-click-select container toggle their checkbox
   when clicked anywhere (see wwwroot/js/checkbox-helper.js).
   Pointer cursor signals the affordance.
   ============================================================ */
.row-click-select tbody tr {
    cursor: pointer;
}

/* ============================================================
   FIT-TO-CONTENT COLUMN (added 2026-05-28)
   Shrinks a table column to just its header/content width
   (header text stays on one line) instead of stretching.
   ============================================================ */
.col-fit {
    width: 1%;
    white-space: nowrap;
}

/* ============================================================
   REGISTRY BADGES (added 2026-05-21)
   New semantic .registry-badge variants. Existing
   .badge-verified / .badge-unverified are preserved untouched
   for backward compat; new code uses .registry-badge.
   Color is NEVER the sole indicator — pair with text + icon.
   ============================================================ */
.registry-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1;
    white-space: nowrap;
}

.registry-badge > .bi {
    font-size: 0.95em;
    line-height: 1;
}

.registry-badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.registry-badge-warning {
    background: var(--color-warning-bg);
    color: var(--neutral-900);                  /* amber-bg needs dark text */
    border: 1px solid var(--color-warning);
}

.registry-badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}

.registry-badge-info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--color-info);
}

.registry-badge-neutral {
    background: var(--neutral-100);
    color: var(--text-secondary);
    border: 1px solid var(--border-default);
}

.registry-badge-accent {
    background: var(--badge-teal-bg);
    color: var(--badge-teal);
    border: 1px solid var(--badge-teal);
}

/* ============================================================
   FORM REQUIRED MARKER (added 2026-05-21)
   The visual asterisk shown next to required field labels.
   aria-hidden in markup because the screen reader hears the
   validator's "X is required" message; the asterisk is
   visual reinforcement only.
   ============================================================ */
.required-marker {
    color: var(--color-danger);
    margin-right: var(--space-1);
    font-weight: var(--font-weight-semibold);
}

/* ============================================================
   FORM FIELD ERROR-SPACE RESERVATION (added 2026-05-21)

   Reserves a constant ~1.25rem strip below every form-field
   container so that <ValidationMessage> errors (which appear
   on blur per Blazored.FluentValidation defaults) slide INTO
   that reserved space rather than pushing every field below
   them downward. Prevents the "controls jumping up and down"
   layout-shift problem on form validation.

   Targets the canonical .mb-3 form-field wrapper used across
   the codebase. Uses CSS :has() (Chrome/Edge 105+, Safari 15.4+,
   Firefox 121+ — ~90% browser support). Browsers without :has()
   fall back to the current shift-on-error behavior gracefully.

   No markup changes needed — applies to all existing forms.
   ============================================================ */
.mb-3:has(> .form-control, > .form-select, > .form-check, > .input-group) {
    padding-bottom: 1.25rem;
    position: relative;
}

.mb-3:has(> .form-control, > .form-select, > .form-check, > .input-group) > .validation-message {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin-top: 0;
    font-size: var(--font-size-sm);
    line-height: 1.25rem;
}

/* ============================================================
   ACCESSIBILITY PRIMITIVES (added 2026-05-21)
   Skip link, screen-reader-only utility, focus standard,
   motion + forced-colors media queries.
   ============================================================ */

/* Screen-reader-only utility (visually hidden, AT-readable) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip-to-main-content link — focus-only visible */
.skip-link {
    position: absolute;
    top: -100px;
    left: var(--space-2);
    z-index: var(--z-toast);
    padding: var(--space-2) var(--space-3);
    background: var(--text-primary);
    color: var(--neutral-0);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-semibold);
    transition: top var(--transition-fast);
}

.skip-link:focus,
.skip-link:focus-visible {
    top: var(--space-2);
    color: var(--neutral-0);
}

/* Global focus indicator standard */
*:focus-visible {
    outline: var(--focus-ring-width) solid var(--focus-ring-color);
    outline-offset: var(--focus-ring-offset);
}

/* Honor reduced-motion user preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Forced-colors mode (Windows High Contrast) — preserve UI semantics */
@media (forced-colors: active) {
    .btn,
    .form-control,
    .form-select,
    .form-check-input,
    .card,
    .registry-card,
    .modal-dialog {
        border: 1px solid ButtonText;
    }

    /* Don't strip color from semantic indicators that need it */
    .alert-danger,
    .alert-success,
    .alert-warning,
    .alert-info,
    .is-invalid,
    .badge-verified,
    .badge-unverified {
        forced-color-adjust: none;
    }

    /* Use system Highlight for focus */
    *:focus-visible {
        outline: 3px solid Highlight !important;
        outline-offset: 2px;
    }
}

/* ---------------------------------------------------------------------------
   Blazor Server reconnect modal (custom, see App.razor #components-reconnect-modal)

   Blazor toggles these classes on the element when the SignalR circuit drops:
     .components-reconnect-show     - connection lost, retrying
     .components-reconnect-failed   - retries exhausted (manual reload)
     .components-reconnect-rejected - server reached but circuit is gone (reload)
   ...and removes them once reconnected.

   The banner is held invisible AND non-interactive for --reconnect-show-delay,
   then fades in. Tab-switch / background-tab drops recover in well under a
   second, so they never reach the fade-in and no banner flashes. Only an outage
   that outlasts the delay becomes visible. Lower the delay to surface real
   outages sooner; raise it to hide longer blips.
   --------------------------------------------------------------------------- */
:root {
    --reconnect-show-delay: 6s;
}

#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    padding: 0.65rem 1rem;
    text-align: center;
    font-size: 0.95rem;
    color: #842029;
    background-color: #f8d7da;
    border-bottom: 1px solid #f5c2c7;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    /* Hidden + non-interactive until the delay elapses, then fade in. */
    visibility: hidden;
    opacity: 0;
    animation: reconnect-appear 0.3s ease-out var(--reconnect-show-delay) forwards;
}

@keyframes reconnect-appear {
    to {
        visibility: visible;
        opacity: 1;
    }
}

.reconnect-modal__reload {
    color: #842029;
    font-weight: 600;
    text-decoration: underline;
}

/* Show only the message that matches the current circuit state. */
.reconnect-modal__msg {
    display: none;
}

.components-reconnect-show .reconnect-modal__msg--show,
.components-reconnect-failed .reconnect-modal__msg--failed,
.components-reconnect-rejected .reconnect-modal__msg--rejected {
    display: inline;
}

/* ============================================================
   MY TRAINING CALENDAR — DAY/HEADER LINK SUPPRESSION (Bug #21, added 2026-06-25)

   FullCalendar renders the day-of-week column headers
   (.fc-col-header-cell-cushion) and the calendar day numbers
   (.fc-daygrid-day-number) as <a> elements. With navLinks off they
   go nowhere, but they still read as links — pointer cursor plus a
   hover color change. Neutralize them so they look like plain text.
   Scoped to #my-training-calendar so other FullCalendar instances
   (e.g. the public Training Calendar) are unaffected.
   ============================================================ */
#my-training-calendar .fc-col-header-cell-cushion,
#my-training-calendar .fc-daygrid-day-number {
    color: inherit;
    text-decoration: none;
    cursor: default;
    pointer-events: none;
}

#my-training-calendar .fc-col-header-cell-cushion:hover,
#my-training-calendar .fc-daygrid-day-number:hover {
    color: inherit;
    text-decoration: none;
}
