/* In-page navigation — Shell-owned, split out of shared.css (Sprint 9.5 Story 22,
   architecture/SHARED-CSS-LAYER-SPLIT.md). Segmented filters, in-page tab strips and their panels.
   Linked once in App.razor's <head>, reaching every Blick's DOM the same way shared.css already did.
   Navigation icons are Font Awesome - do not add a second icon set. */

/* ── Segmented filter (.btn-group[role="radiogroup"]) ──────────────────────────────────────────────────────
   DESIGN-SYSTEM-GRIDS-AND-DIALOGS.md §11. Brian, 2026-09-02: the above-grid single-select filter control.
   NO NEW CLASS NAME: Bootstrap 5.3.3's own .btn-group + .btn-check + .btn, scoped by the standard ARIA role,
   per the class-naming ruling ("try to overwrite standard classes and elements"). role="radiogroup" is both
   the scope and the meaning -- Bootstrap's docs put role="group" on an ordinary button group, so an ordinary
   group can never match this.
   Reframed 2026-09-02 (Arthur's Part 2 review, §3): a .btn-group[role="radiogroup"] IS the segmented control
   and always renders as the track. If you need Bootstrap radio-toggle buttons that look different, you need a
   different control, not a different role -- a styling hook must never dictate ARIA, and role="radiogroup" is
   the CORRECT role for any single-select button-group toggle, not something to withhold to dodge this rule.
   SharedUIContractTests' segmented-filter sweep enforces the one real constraint this leaves: a
   role="radiogroup" copy must be the COMPLETE §11.2 pattern (radios + labels sharing one name, aria-label, no
   tabindex, a narrow-width <select> fallback), never a partial copy.
   No !important anywhere: shared.css loads after bootstrap.min.css (App.razor:8 vs :36) and these selectors
   tie or beat Bootstrap's own. An !important added here later means the selector is wrong. */
.btn-group[role="radiogroup"] {
    background: var(--brand-neutral-bg);
    border-radius: var(--brand-radius-pill);
    padding: var(--brand-space-1);
    gap: var(--brand-space-1);
}

/* min-height 32px + 4px track padding top and bottom = the reference's ~40px overall, from tokens only.
   margin-left: 0 and the restored radius undo Bootstrap's JOINED-group geometry (.btn-group > .btn:nth-child(n+3)
   zeroes the inner corners; .btn-group > :not(.btn-check) + .btn pulls each button 1px left so neighbours share
   a border). A segmented control is separated pills inside one track, not a welded row -- gap does the spacing.
   border-radius is --brand-radius-pill on BOTH the track and the segment ON PURPOSE, and this is what the
   reference's "smaller radius on the inner pill" actually resolves to: 999px clamps to half the box height, so
   the 40px track renders 20px and the 32px segment renders 16px -- concentric with the 4px inset, which is the
   only geometry where the segment does not poke through the track's rounded end. A literal small radius (6px)
   on the segment DOES poke out at the first and last positions. Do not "fix" this to --brand-radius-md.
   2026-09-02 (Arthur's Part 2 review, F1): selector raised from "> .btn" to "> .btn-check + .btn" -- (0,4,0),
   not (0,3,0) -- because Bootstrap's OWN joined-group rules ".btn-group>.btn:not(:last-child):not(.dropdown-toggle)"
   and ".btn-group>:not(.btn-check:first-child)+.btn" are also (0,4,0) and were winning by load order, squaring
   off every segment's right corner except the last and reviving the -1px joined margin. Same load order, this
   selector now wins both instead of tying and losing. */
.btn-group[role="radiogroup"] > .btn-check + .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--brand-space-8);
    padding: 0 var(--brand-space-4);
    margin-left: 0;
    border: 0;
    border-radius: var(--brand-radius-pill);
    background: transparent;
    color: var(--brand-neutral-text);
    font-size: var(--brand-font-size-base);
    font-weight: var(--brand-font-weight-medium);
    white-space: nowrap;
    transition: background-color var(--brand-transition-fast) ease-in-out,
                color var(--brand-transition-fast) ease-in-out,
                box-shadow var(--brand-transition-fast) ease-in-out;
}

/* Hover on an UNSELECTED segment turns the label the accent (--brand-primary-hover, 6.26:1 on the track) and
   adds NO fill: a fill on hover reads as selection, which is the one thing this control must never be
   ambiguous about. This overrides Bootstrap's own .btn-check + .btn:hover, which otherwise restores the
   --bs-btn-* colours. */
.btn-group[role="radiogroup"] > .btn-check + .btn:hover {
    background: transparent;
    color: var(--brand-primary-hover);
}

.btn-group[role="radiogroup"] > .btn-check:checked + .btn {
    background: var(--brand-surface);
    color: var(--brand-text);
    font-weight: var(--brand-font-weight-semibold);
    box-shadow: var(--brand-shadow-sm);
}

/* The ring goes on the LABEL because .btn-check clips the input to 0x0 -- an outline on the input is invisible.
   box-shadow rather than outline, so it also paints on an unselected segment that has no surface of its own;
   the shared formula, verbatim from .app-table__sort (shared.css:1106). The checked case composites the ring
   with the pill's own shadow rather than replacing it. */
.btn-group[role="radiogroup"] > .btn-check:focus-visible + .btn {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

.btn-group[role="radiogroup"] > .btn-check:checked:focus-visible + .btn {
    box-shadow: var(--brand-shadow-sm), 0 0 0 4px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

/* ── In-page tab strip (.app-tabstrip / .app-tab / .app-tab.active / .app-tab:hover) ─────────────────────
   Previously defined four times and had drifted: ProductLibraryChrome.razor.css and SystemChrome.razor.css
   (Shell chrome, pill style, with a hover + active state) vs. CCP.ReferenceDataContext.Blick's and
   CCP.CatalogContext.Blick's blick.css (in-page tabs, boxed folder-tab style, no hover state) — and
   CCP.CustomerContext.Blick's child tabs had no styling at all. Reconciled onto the Shell chrome's pill design:
   it is the more recently established, actively-maintained rule set (explicit "DESIGN-SYSTEM.md §4.32 — one tabstrip look
   across the surface" intent, both a hover and an active state), while the Blick copies were "copied rather
   than reinvented" from each other and never picked up the active-state fix. Every surface listed above now
   renders this one design — a deliberate, visible convergence for the three that didn't already match it. */
/* One row that scrolls, never wraps (DESIGN-SYSTEM.md §4.15a) -- reverses the earlier flex-wrap: wrap, which put the Customer profile's
   trailing tabs on a second row at 960px (Will's FAIL on portal-menu-ready-narrow-960.png). This is the shared shell class, so the fix reaches
   every consumer at once. Four things hold the look together inside a scroll container:
   - overflow clips at the PADDING box, so the strip pads by --brand-space-1 (the focus ring's 4px spread) top, left and right, and the same
     below, or the ring and the selected tab's underline (which sits 1px over the hairline via .app-tab's margin-bottom: -1px) would be cut off;
   - the 1px hairline is therefore painted as a background on the row the tabs' lowest pixel covers (3px above the padding edge), not as a
     border -- a border would sit below that padding and leave a gap under the underline. A background stays put while the content scrolls, so
     the hairline always spans the strip's full visible width;
   - the inline padding is cancelled by an equal negative inline margin, so the first tab's text and the hairline line up with the page content edge;
     the hairline is inset by the same token so it does not overshoot into that margin;
   - overflow-y is hidden so the padding is never mistaken for something to scroll vertically;
   - every direct child is flex: none and the labels are nowrap, so a tab never shrinks or wraps its own label. */
/* 2026-09-03 (Duane, DESIGN-SYSTEM.md §4.15): built to §4.7's underline treatment, replacing the pill above.
   Not a reversal of F13 or of Brian's 2026-08-31 "same blue" ruling — both were about .app-controls (the
   Shell chrome's navigating pill row, unchanged here) and about the ACTIVE COLOUR token (--brand-primary,
   unchanged here too). What changes is the SHAPE of this different, inner control: it swaps a panel in place
   rather than navigating, and §4.7 — the client's own authored design — specifies an underline for it, not a
   pill. This is what stops the Shell chrome's pill row and this strip reading as one repeated control when
   they stack directly on top of each other (worklist item 27, Product Options and Defined Lists). */
.app-tabstrip {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    white-space: nowrap;
    gap: var(--brand-space-4);
    padding: var(--brand-space-1);
    margin-inline: calc(-1 * var(--brand-space-1));
    margin-bottom: calc(var(--brand-space-4) - var(--brand-space-1));
    background: linear-gradient(var(--brand-border), var(--brand-border)) var(--brand-space-1) calc(100% - 3px) / calc(100% - 2 * var(--brand-space-1)) 1px no-repeat;
}

.app-tabstrip > * {
    flex: none;
}

.app-tab {
    display: inline-block;
    padding: var(--brand-space-2) var(--brand-space-2);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    margin-bottom: -1px;
    color: var(--brand-text-muted);
    font-weight: var(--brand-font-weight-medium);
    cursor: pointer;
}

.app-tab:hover {
    background: var(--brand-primary-lighter);
}

.app-tab.active {
    color: var(--brand-primary);
    font-weight: var(--brand-font-weight-semibold);
    border-bottom-color: var(--brand-primary);
}

.app-tab:focus-visible {
    border-radius: var(--brand-radius-sm);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-primary) 30%, transparent);
}

/* ── Tab panel (.app-tabpanel) ───────────────────────────────────────────────────────────────────────────
   Joins .app-tabstrip/.app-tab above — same family, same Shell-owned home (Arthur's sweep §2-MODERATE): the
   strip is styled, the panel content it switches between is not, on CustomerEditor/ProductOptions/KitEditor. */
/* .hidden — CustomerEditor.razor toggles this class on its three tab panels (Locations/Contacts/ExternalIDs,
   built via `@(_activeTab == X ? "" : "hidden")`) to hide the inactive ones. Neither our stylesheets nor
   Bootstrap 5 (which dropped .hidden for .d-none) define it, so every panel rendered stacked at once and
   clicking a tab did nothing visible — a genuinely broken screen, not a cosmetic gap. `d-none` appears nowhere
   else in this codebase, so switching the markup to it would introduce a second hide-a-panel idiom for one
   screen (DESIGN-SYSTEM.md §4.32); this is the minimal, consistent fix. Same screens/concern as .app-tabpanel below, kept
   beside it. */
.hidden {
    display: none;
}

.app-tabpanel {
    padding-top: var(--brand-space-3);
}
