/* Shared view switches keep equal-width choices and one blue selection treatment. */
.segmented-navigation {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    justify-self: start;
    width: max-content;
    max-width: 100%;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--interface-border);
    border-radius: var(--interface-tile-radius);
    background: #fff;
    box-shadow: var(--shadow-small);
}

/* Page-level switches sit close to the top bar and align with the content below. */
.segmented-navigation--page-top {
    margin-block-start: -10px;
    margin-inline: 0;
}

.content > .segmented-navigation--page-top {
    margin-block-end: 18px;
}

.segmented-navigation > :is(a, button) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 108px;
    border: 0;
    background: transparent;
    box-shadow: none;
    min-height: 34px;
    padding: 8px 13px;
    border-radius: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    transition: color .15s ease, background .15s ease;
}

.segmented-navigation > :is(a, button):hover,
.segmented-navigation > :is(a, button)[aria-current="page"],
.segmented-navigation > [role="tab"][aria-selected="true"] {
    background: var(--blue-050);
    color: var(--blue-700);
}

.segmented-navigation > :is(a, button)[aria-current="page"],
.segmented-navigation > [role="tab"][aria-selected="true"] {
    box-shadow: inset 0 0 0 1px var(--blue-200);
}

/* In-page editors expose the shared controller's validation state on their blue tabs. */
.segmented-navigation > [role="tab"].has-validation-error {
    color: var(--danger);
    box-shadow: inset 0 0 0 1px var(--danger);
}

.segmented-navigation > :is(a, button):focus-visible {
    outline: 2px solid var(--blue-700);
    outline-offset: 1px;
}

.segmented-navigation svg {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
