/* 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: var(--surface);
    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(--hover-surface);
    color: var(--link);
}

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

/* 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(--link);
    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;
}

/* Secondary view choices keep a quiet frame without enlarging the compact heading control. */
.segmented-navigation--compact {
    width: 140px;
    gap: 2px;
    padding: 2px;
    border: 1px solid var(--interface-border);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: none;
}
.segmented-navigation--compact > :is(a, button) {
    min-width: 0;
    min-height: 22px;
    gap: 5px;
    padding: 3px 5px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
}
.segmented-navigation--compact > :is(a, button)[aria-current="page"],
.segmented-navigation--compact > [role="tab"][aria-selected="true"] {
    box-shadow: none;
}
.segmented-navigation--compact svg {
    flex-basis: 14px;
    width: 14px;
    height: 14px;
}
