/* <Tabs /> — lm-tabs-* convention. Radix-style underline strip. Consumes the
   global token spine, but every reference carries an original-value fallback,
   so the strip renders standalone with NO global stylesheet (catalog rule). */

.lm-tabs[data-position="bottom"] {
    display: flex;
    justify-content: center;
    flex-direction: column-reverse;
}

.lm-tabs .lm-tabs-headers {
    display: flex;
    align-items: stretch;
    width: 100%;
    border-bottom: 1px solid var(--lm-border-color, #e4e4e7);
}

.lm-tabs[data-position="center"] .lm-tabs-headers {
    margin: 0 auto;
    justify-content: center;
}

.lm-tabs .lm-tabs-headers > ul {
    list-style-type: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: stretch;
    /* flex:0 1 auto + min-width:0 keeps the strip its natural width while
       still allowing it to shrink below content width — which turns on the
       horizontal scroll when the tabs overflow. */
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;       /* Firefox: hide the scrollbar, use arrows */
    -ms-overflow-style: none;    /* legacy Edge */
}

.lm-tabs .lm-tabs-headers > ul::-webkit-scrollbar {
    display: none;               /* Chrome / Safari */
}

/* Overflow arrows: rendered only while the strip overflows */
.lm-tabs .lm-tabs-scroll {
    flex: 0 0 auto;
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    margin: 0; /* host pages often style bare <button> with margins */
    padding: 0;
    border: 0;
    background: var(--lm-background-color, #fff);
    color: var(--lm-icon-color, #777);
    cursor: pointer;
    font-family: "Material Symbols Outlined", "Material Icons", "FontAwesome";
    font-size: 20px;
    font-weight: 400; /* icon glyphs must not bold up */
    font-variation-settings: 'wght' 400, 'opsz' 24;
    line-height: 1;
}

.lm-tabs .lm-tabs-scroll:hover {
    background: var(--lm-background-color-highlight, #ececec);
}

.lm-tabs .lm-tabs-scroll:disabled {
    opacity: 0.35;
    cursor: default;
}

.lm-tabs .lm-tabs-tab {
    position: relative; /* anchors the drag-sort insertion indicator */
    cursor: pointer;
    user-select: none;
    padding: 10px var(--lm-space-4, 16px);
    border: 0;
    /* transparent underline reserves the space so selection doesn't shift */
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; /* overlap the strip's 1px border */
    background: transparent;
    color: var(--lm-font-grayout, #6b7280);
    font: 500 14px/1.45 system-ui, sans-serif;
    white-space: nowrap;
    /* icon INLINE with the label (not stacked above), gap-spaced */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition:
        color var(--lm-duration, 0.15s) var(--lm-ease, ease),
        border-color var(--lm-duration, 0.15s) var(--lm-ease, ease),
        background var(--lm-duration, 0.15s) var(--lm-ease, ease);
}

.lm-tabs .lm-tabs-tab:hover {
    color: var(--lm-font-color, #1f2937);
    background: color-mix(in srgb, var(--lm-main-color, #2563eb) 8%, transparent);
    border-radius: var(--lm-radius, 6px) var(--lm-radius, 6px) 0 0;
}

.lm-tabs .lm-tabs-tab.lm-tabs-selected {
    color: var(--lm-main-color, #2563eb);
    border-bottom-color: var(--lm-main-color, #2563eb);
    background: transparent;
}

/* leading icon: sized proportional to the 14px label (not the old 22px
   stacked block), optically centered, and pinned to weight 400 — the tab
   label is 500 and a variable icon font would bold up with it */
.lm-tabs .lm-tabs-tab[data-icon]:before {
    content: attr(data-icon);
    font-family: "Material Symbols Outlined", "Material Icons", "FontAwesome";
    font-size: 18px;
    font-weight: 400;
    font-variation-settings: 'wght' 400, 'opsz' 24;
    width: 18px;
    height: 18px;
    line-height: 1;
    text-align: center;
    color: inherit;
}

/* Drag sorting: an accent insertion bar at the SLOT where the tab will
   land — left edge of the slot's tab, or the right edge of the last tab
   for the end slot. Pure decoration, zero layout shift. */
.lm-tabs .lm-tabs-tab.lm-tabs-drop::after,
.lm-tabs .lm-tabs-tab.lm-tabs-drop-end::after {
    content: '';
    position: absolute;
    left: -2px;
    top: 15%;
    bottom: 15%;
    width: 3px;
    border-radius: 2px;
    background: var(--lm-main-color, #2563eb);
}

/* the strip clips at its scroll edges: the FIRST tab draws the bar fully
   inside (at -2px half of it vanished and it looked thinner) — same for
   the end-slot bar on the right edge */
.lm-tabs .lm-tabs-tab.lm-tabs-drop:first-child::after {
    left: 0;
}

.lm-tabs .lm-tabs-tab.lm-tabs-drop-end::after {
    left: auto;
    right: 0;
}

/* Segmented variant — the inset "quick tabs" look: the strip is a soft
   well [ xxx | yyyy ] and the selected tab is a raised card */
.lm-tabs[data-variant='segmented'] .lm-tabs-headers {
    border-bottom: 0;
    background: var(--lm-background-color-highlight, #f0f0f1);
    border-radius: var(--lm-radius-lg, 10px);
    padding: 3px;
    width: fit-content;
    max-width: 100%;
}

.lm-tabs[data-variant='segmented'] .lm-tabs-tab {
    border-bottom: 0;
    margin-bottom: 0;
    padding: 7px 14px;
    border-radius: calc(var(--lm-radius-lg, 10px) - 3px);
}

.lm-tabs[data-variant='segmented'] .lm-tabs-tab:hover {
    background: transparent;
    border-radius: calc(var(--lm-radius-lg, 10px) - 3px);
    color: var(--lm-font-color, #1f2937);
}

/* selected: a raised white card (Paul: nicer than a colored fill) */
.lm-tabs[data-variant='segmented'] .lm-tabs-tab.lm-tabs-selected {
    background: var(--lm-tabs-selected, var(--lm-background-color, #fff));
    color: var(--lm-tabs-selected-text, var(--lm-font-color, #111827));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* dark: the white card token inverts to near-black and would sink INTO
   the well — lift it one neutral step ABOVE the well instead (forced
   class + OS paths share the values) */
.lm-dark-mode .lm-tabs[data-variant='segmented'] .lm-tabs-tab.lm-tabs-selected {
    background: var(--lm-tabs-selected, var(--lm-neutral-6, #3a3a3a));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not(.lm-light-mode) .lm-tabs[data-variant='segmented'] .lm-tabs-tab.lm-tabs-selected {
        background: var(--lm-tabs-selected, var(--lm-neutral-6, #3a3a3a));
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }
}

.lm-tabs[data-variant='segmented'] .lm-tabs-scroll {
    background: transparent;
}

/* Basic variant — the documented v5 BOXED look (never shipped until now:
   basic and modern rendered identically): tabs are bordered boxes and the
   selected one joins the panel by masking the strip's bottom border */
.lm-tabs[data-variant='basic'] .lm-tabs-tab {
    border: 1px solid transparent;
    margin-bottom: -1px;
    border-radius: var(--lm-radius, 6px) var(--lm-radius, 6px) 0 0;
}

.lm-tabs[data-variant='basic'] .lm-tabs-tab.lm-tabs-selected {
    background: var(--lm-background-color, #fff);
    border-color: var(--lm-border-color, #e4e4e7);
    border-bottom-color: var(--lm-background-color, #fff);
    color: var(--lm-font-color, #111827);
}

/* Panels live in the DOM permanently — selection is just visibility */
.lm-tabs .lm-tabs-content > * {
    display: none;
    padding: var(--lm-space-4, 16px) var(--lm-space-1, 4px);
}

.lm-tabs .lm-tabs-content > .lm-tabs-selected {
    display: block;
}

/* "add" button: a quiet 28px hover chip with a text-proportional glyph
   (was a bare 24px glyph — read as huge next to the 14px labels) */
.lm-tabs .lm-tabs-insert-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: var(--lm-space-1, 4px);
    align-self: center;
    border-radius: var(--lm-radius, 6px);
    color: var(--lm-icon-color, #777);
    cursor: pointer;
    font-family: "Material Symbols Outlined", "Material Icons", "FontAwesome";
    font-size: 18px;
    font-weight: 400;
    font-variation-settings: 'wght' 400, 'opsz' 24;
    line-height: 1;
    transition: background var(--lm-duration, 0.15s) var(--lm-ease, ease);
}

.lm-tabs .lm-tabs-insert-button:hover {
    background: var(--lm-background-color-highlight, #ececec);
    color: var(--lm-font-color, #1f2937);
}
