/* Shell theme defaults — single source of truth for portal colors */
:root {
    --shell-default-primary: #095ADB;

    --shell-light-bg: #FFFFFF;
    --shell-light-text: #140802;
    --shell-light-muted: #64748b;
    --shell-light-surface: #f9fafb;

    --shell-dark-bg: #111214;
    --shell-dark-text: #ecedee;
    --shell-dark-muted: #94a3b8;

    /* Left side nav (Luigi strip) background. Leave empty to use the tenant/page background.
       Derived from the defaults above: light = dark bg tinted 15% with primary, then darkened (#0A1220);
       dark = dark bg darkened (#0A0A0B). */
    --shell-light-sidenav-bg: color-mix(in srgb, color-mix(in srgb, var(--shell-default-primary) 15%, var(--shell-dark-bg)) 64%, #000);
    --shell-dark-sidenav-bg: color-mix(in srgb, var(--shell-dark-bg) 56%, #000);

    /* Left side nav text + icon color. Leave empty to use the tenant/page text color. */
    /* The side nav is dark in both modes, so both use the dark text; dark mode fades it 64% toward the dark bg (#9D9EA0). */
    --shell-light-sidenav-text: var(--shell-dark-text);
    --shell-dark-sidenav-text: color-mix(in srgb, var(--shell-dark-text) 64%, var(--shell-dark-bg));

    /* Selected side nav item pill. Leave empty: background = tenant primary, text/icon = white. */
    --shell-light-sidenav-selected-bg: ;
    --shell-dark-sidenav-selected-bg: ;
    --shell-light-sidenav-selected-text: ;
    --shell-dark-sidenav-selected-text: ;

    /* Image (png/svg) nav icons such as TeamsBoss: 1 inverts black artwork to white, 0 leaves it as is. */
    --shell-light-sidenav-icon-invert: 1;
    --shell-dark-sidenav-icon-invert: 1;

    /* Side nav logo (expanded) and icon (collapsed) */
    --shell-sidenav-logo-height: 1.5rem;
    --shell-sidenav-icon-size: 1.75rem;

    --luigi__shellbar--height: 3.5rem;
    /* Widest the page content gets: its width on a 1920px (24") screen beside the expanded side nav
       (1920 - 240). Wider screens add margins instead. AppShell.svelte (egs-shared) uses the same
       number for module pages; keep them in step. */
    --shell-content-max-width: 1680px;
    /* The browser's classic scrollbar width; luigi-config.js measures and sets it. */
    --shell-scrollbar-width: 0px;
    /* Collapsed side nav width: 2 x item inset (0.75rem) + item size (2.5rem) */
    --luigi__leftnav_collapsed--width: 4rem;

    font-family: 'Inter, sans-serif';

    /* Card borders: each mode's bg with a touch of its muted color (#E5E7EB / #23262B). */
    --card-light-border: color-mix(in srgb, var(--shell-light-bg) 83%, var(--shell-light-muted));
    --card-dark-border: color-mix(in srgb, var(--shell-dark-bg) 86%, var(--shell-dark-muted));

}

/* ── Left side nav ──
   Colors come from --shell-sidenav-* (bg, text, selected-bg, selected-text, icon-invert), which
   luigi-config.js applyShellTheme picks from the light/dark tokens above. The --sap* overrides are
   scoped to the sidebar so Luigi's list items pick them up without touching popovers etc.
   Layout, top to bottom: brand (logo / icon) → nav items → additional menu options → divider → Collapse. */
.fd-app__sidebar {
    --shell-sidenav-inset: 0.75rem;        /* strip edge → item pill */
    --shell-sidenav-item-size: 2.5rem;     /* item height, and icon column width */
    --shell-sidenav-radius: 0.5rem;
    --shell-sidenav-divider: color-mix(in srgb, var(--shell-sidenav-text) 15%, transparent);

    --sapList_Background: var(--shell-sidenav-bg);
    --sapBackgroundColor: var(--shell-sidenav-bg);
    --sapGroup_ContentBackground: var(--shell-sidenav-bg);
    --sapList_TextColor: var(--shell-sidenav-text);
    --sapTextColor: var(--shell-sidenav-text);
    --sapContent_IconColor: var(--shell-sidenav-text);
    --sapList_Hover_Background: transparent;
    --sapList_Active_Background: transparent;
    --sapList_SelectionBackgroundColor: var(--shell-sidenav-selected-bg);
    --sapList_Hover_SelectionBackground: var(--shell-sidenav-selected-bg);
    --sapList_BorderColor: transparent;
    --sapGroup_ContentBorderColor: transparent;
    background-color: var(--shell-sidenav-bg) !important;
    color: var(--shell-sidenav-text);
}

/* Column layout: brand and footer keep their size, the item list scrolls in between */
.fd-app__sidebar .fd-side-nav {
    display: flex !important;
    flex-direction: column;
    background-color: var(--shell-sidenav-bg) !important;
    border-right: none !important;
}
.fd-app__sidebar .fd-side-nav__main-navigation {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
}
.fd-app__sidebar .lui-fd-side-nav-wrapper { flex: 1 1 auto; min-height: 0; height: auto !important; }
.fd-app__sidebar .fd-side-nav__utility {
    flex: none;
    margin: 0 !important;
    padding: 0 0 0.75rem !important;
    border: none !important;
    background-color: var(--shell-sidenav-bg) !important;
}
.fd-app__sidebar .fd-side-nav__utility::before { display: none !important; }

/* Brand — injected by luigi-config.js setupSideNavBrand. Logo when expanded, icon when collapsed;
   same height as the shellbar so it lines up with the page title. */
.shell-sidenav-brand {
    flex: none;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    height: var(--luigi__shellbar--height);
    margin-bottom: 1rem;
    padding: 0 calc(var(--shell-sidenav-inset) + 0.5rem);
    overflow: hidden;
}
.shell-sidenav-brand img { display: block; flex: none; }
.shell-sidenav-brand__logo { height: var(--shell-sidenav-logo-height); width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.shell-sidenav-brand__icon { display: none !important; width: var(--shell-sidenav-icon-size); height: var(--shell-sidenav-icon-size); }
body.semiCollapsed .shell-sidenav-brand { justify-content: center; padding: 0; }
body.semiCollapsed .shell-sidenav-brand__logo { display: none !important; }
body.semiCollapsed .shell-sidenav-brand__icon { display: block !important; }

/* Items — inset rounded pills: icon column + label */
.fd-app__sidebar .fd-nested-list,
.fd-app__sidebar .lui-category,
.fd-app__sidebar .fd-nested-list__group-header,
.fd-app__sidebar .fd-nested-list__content { border-top: none !important; border-bottom: none !important; }
.fd-app__sidebar .fd-side-nav__separator { display: none !important; }
.fd-app__sidebar .fd-nested-list {
    box-sizing: border-box;
    padding: 0 var(--shell-sidenav-inset) !important;
    background: transparent !important;
}
.fd-app__sidebar .fd-nested-list__item { background: transparent !important; margin-bottom: 0.25rem; }
.fd-app__sidebar .fd-nested-list__link {
    box-sizing: border-box;
    height: var(--shell-sidenav-item-size) !important;
    padding: 0 !important;
    border: none !important;
    border-radius: var(--shell-sidenav-radius);
    background: transparent !important;
    color: var(--shell-sidenav-text) !important;
    text-decoration: none;
    overflow: hidden;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.fd-app__sidebar .fd-nested-list__icon,
.fd-app__sidebar .fd-nested-list__icon[class*=sap-icon] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: none;
    width: var(--shell-sidenav-item-size);
    min-width: var(--shell-sidenav-item-size) !important;
    height: 100%;
    font-size: 1rem !important;
    color: inherit !important;
    background: transparent !important;
}
.fd-app__sidebar .fd-nested-list__icon img { filter: invert(var(--shell-sidenav-icon-invert, 0)); }
/* Product SVGs from PRODUCT_ICONS (luigi-config.js); drawn with currentColor, so they follow the
   icon color rules below (hover, selected) and need no invert filter. */
.fd-app__sidebar .fd-nested-list__icon svg.shell-product-icon {
    display: block;
    flex: none;
    width: 1.125rem;
    height: 1.125rem;
    color: inherit;
}
.fd-app__sidebar .fd-nested-list__title {
    min-width: 0;
    padding-inline: 0 0.75rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: inherit !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fd-app__sidebar .fd-nested-list__title:first-child { padding-inline-start: 0.75rem !important; } /* item without an icon */
body.semiCollapsed .fd-app__sidebar .fd-nested-list__title { display: none !important; }

/* Hover: background stays, icon takes the primary color */
.fd-app__sidebar .fd-nested-list__link:hover .fd-nested-list__icon { color: var(--shell-primary) !important; }
/* Press: no flash of Fundamental's active background / text color */
.fd-app__sidebar .fd-nested-list__link:active { background: transparent !important; color: var(--shell-sidenav-text) !important; }
/* Selected: filled pill (declared after hover/press so it wins over both) */
.fd-app__sidebar .fd-nested-list__link.is-selected,
.fd-app__sidebar .is-selected .fd-nested-list__link {
    background: var(--shell-sidenav-selected-bg) !important;
    color: var(--shell-sidenav-selected-text) !important;
}
.fd-app__sidebar .fd-nested-list__link.is-selected .fd-nested-list__icon,
.fd-app__sidebar .is-selected .fd-nested-list__link .fd-nested-list__icon { color: var(--shell-sidenav-selected-text) !important; }
.fd-app__sidebar .fd-nested-list__link:focus,
.fd-app__sidebar .fd-nested-list__link:focus-visible {
    outline: 2px solid var(--shell-sidenav-text) !important;
    outline-offset: -2px;
    box-shadow: none !important;
}

/* Additional menu options (Privacy Policy, Support, Log Out… from the backend) — injected by
   luigi-config.js setupAdditionalMenuOptions above the footer; they reuse the item styles above. */
.additional-menu-options { border-top: none !important; overflow: hidden; }

/* Footer: divider, then the Collapse toggle styled as an item ("Collapse" label added by luigi-config.js) */
.fd-app__sidebar .lui-side-nav__footer {
    justify-content: flex-start !important;
    margin: 0.5rem var(--shell-sidenav-inset) 0;
    padding-top: 0.5rem;
    border-top: 1px solid var(--shell-sidenav-divider) !important;
    background-color: var(--shell-sidenav-bg) !important;
}
.fd-app__sidebar .lui-side-nav__footer--text { display: none !important; }
.fd-app__sidebar .lui-side-nav__footer .lui-semi-btn {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    width: 100% !important;
    min-width: 0 !important;
    height: var(--shell-sidenav-item-size) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: var(--shell-sidenav-radius) !important;
    background: transparent !important;
    color: var(--shell-sidenav-text) !important;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
}
.fd-app__sidebar .lui-semi-btn > i {
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: none;
    width: var(--shell-sidenav-item-size);
    padding: 0 !important;
    font-size: 1rem;
    color: inherit !important;
}
.fd-app__sidebar .lui-semi-btn:hover > i { color: var(--shell-primary) !important; }
.fd-app__sidebar .lui-semi-btn:focus,
.fd-app__sidebar .lui-semi-btn:focus-visible {
    outline: 2px solid var(--shell-sidenav-text) !important;
    outline-offset: -2px;
    box-shadow: none !important;
}
.shell-semi-btn__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.semiCollapsed .shell-semi-btn__label { display: none; }

/* Shellbar — the module apps' app bar look: page surface (light or dark), bordered bottom,
   bold site name, no logo. */
.fd-shellbar {
    background-color: var(--shell-background, var(--shell-light-bg)) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--shell-text, var(--shell-light-text)) 12%, transparent) !important;
    box-shadow: none !important;
    padding-inline: 1rem !important;
}
.fd-shellbar .fd-shellbar__title {
    color: var(--shell-text, var(--shell-light-text)) !important;
    font-weight: 700 !important;
    font-size: 1.5rem !important;
    line-height: 100%;
}
.fd-shellbar .fd-shellbar__logo { display: none !important; }
.fd-shellbar .fd-shellbar__branding,
.fd-shellbar .fd-shellbar__branding:hover,
.fd-shellbar .fd-shellbar__branding:active {
    background: transparent !important;
    border-color: transparent !important;
}
.fd-shellbar .fd-shellbar__action .fd-button { color: var(--shell-text) !important; border-color: transparent !important; }
.fd-shellbar .fd-shellbar__action .fd-button:hover { background-color: color-mix(in srgb, var(--shell-text) 6%, transparent) !important; }

/* Side nav runs the full height of the window; the shellbar starts to its right.
   Luigi pins the side nav below the shellbar (top: --luigi__shellbar--height), so lift it to
   the top over the shellbar, and pad the shellbar's left edge by the nav's width (expanded or
   collapsed) so the title isn't hidden under it.
   On wide screens the page content stops at --shell-content-max-width and centers in the content
   frame; the bar stays full width but insets its title and controls by the same margin, so they
   line up with the content below. */
.fd-app__sidebar {
    top: 0 !important;
    z-index: 2 !important;
}
/* Pages in the content frame keep a scrollbar's width free on the right (scrollbar-gutter: stable)
   and center in what's left, so the bar leaves the same space: --shell-scrollbar-width is measured
   by luigi-config.js (e.g. 15px on Windows, 0 with overlay scrollbars). */
.fd-shellbar {
    --shell-nav-width: var(--luigi__left-sidenav--width);
    --shell-content-gutter: max(0px, (100vw - var(--shell-nav-width) - var(--shell-scrollbar-width) - var(--shell-content-max-width)) / 2);
    padding-left: calc(var(--shell-nav-width) + var(--shell-content-gutter) + 1rem) !important;
    padding-right: calc(var(--shell-content-gutter) + var(--shell-scrollbar-width) + 1rem) !important;
    transition: padding-left 0.1s linear;
}
/* Fundamental pads the title block (4px + a 1px transparent border); drop it so the title starts on
   the content's edge. */
.fd-shellbar .fd-shellbar__branding {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left-width: 0 !important;
}
body.semiCollapsed .fd-shellbar {
    --shell-nav-width: var(--luigi__leftnav_collapsed--width, 2.75rem);
}

/* Luigi alert / message strip, always dark text so it's readable on light strip backgrounds */
.fd-message-strip,
.fd-message-strip__text { color: var(--shell-light-text) !important; }

/* Luigi popovers (e.g. the shellbar overflow menu) */
.fd-popover,
.fd-popover__body {
    max-width: min(24rem, calc(100vw - 2rem));
}
.fd-popover__body .fd-menu__link { color: var(--shell-text) !important; }
/* Reset Fundamental's :active text-color var so .fd-menu__title (which reads --fdMenu_Text_Color) doesn't flash white */
.fd-popover__body .fd-menu__link:active { --fdMenu_Text_Color: var(--shell-text); color: var(--shell-text) !important; }
.fd-popover__body .fd-menu__item:hover { background-color: var(--shell-hover-bg) !important; }

/* ── Shellbar controls: settings dropdown + user card (luigi-config.js setupShellControls) ──
   Same look as the module apps' design; the --sc-* tokens map it onto the tenant's shell colors. */
.shell-controls {
    --sc-surface: var(--shell-background, var(--shell-light-bg));
    --sc-text: var(--shell-text, var(--shell-light-text));
    --sc-text-secondary: color-mix(in srgb, var(--sc-text) 70%, var(--sc-surface));
    --sc-border: color-mix(in srgb, var(--sc-text) 12%, var(--sc-surface));
    --sc-border-strong: color-mix(in srgb, var(--sc-text) 22%, var(--sc-surface));
    --sc-hover: color-mix(in srgb, var(--sc-text) 5%, var(--sc-surface));
    --sc-primary: var(--shell-primary, var(--shell-default-primary));
    --sc-primary-tint: color-mix(in srgb, var(--sc-primary) 12%, var(--sc-surface));
    --sc-on-primary: var(--shell-dark-text);
    --sc-radius: 0.5rem;
    --sc-shadow: 0px 6px 14px 0px rgba(0, 0, 0, 0.09);

    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}
body[data-theme="dark"] .shell-controls {
    --sc-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 6px 14px rgba(0, 0, 0, 0.55);
}
.shell-popover-wrap { position: relative; display: inline-flex; }
/* SHELL_ICONS (luigi-config.js) carry only a viewBox, so size them here. */
.shell-controls svg { display: block; flex: none; width: 1rem; height: 1rem; }
.shell-icon-button svg { width: 1.125rem; height: 1.125rem; }
.shell-tenant-badge svg { width: 0.875rem; height: 0.875rem; }

/* Triggers: the settings button and avatar from the module apps' old app bar */
.shell-icon-button,
.shell-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    font: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.shell-icon-button {
    color: var(--sc-text-secondary);
    background-color: var(--sc-surface);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
}
.shell-icon-button:hover { background-color: var(--sc-hover); }
.shell-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    background-color: var(--sc-primary-tint);
    color: var(--sc-primary);
    font-size: 0.875rem;
    font-weight: 550;
    user-select: none;
}
.shell-icon-button:focus-visible,
.shell-avatar:focus-visible { outline: 2px solid var(--sc-primary); outline-offset: 2px; }

.shell-popover {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 1100;
    box-sizing: border-box;
    background-color: var(--sc-surface);
    color: var(--sc-text);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    box-shadow: var(--sc-shadow);
    font-size: 0.875rem;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
}
.shell-popover[hidden] { display: none; }

/* Settings panel */
.shell-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 15rem;
    padding: 0.75rem 1rem;
}
.shell-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.shell-switch {
    position: relative;
    flex-shrink: 0;
    width: 2.25rem;
    height: 1.25rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background-color: var(--sc-border-strong);
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.shell-switch.active { background-color: var(--sc-primary); }
.shell-switch-thumb {
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease-in-out;
}
.shell-switch.active .shell-switch-thumb { transform: translateX(1rem); }

.shell-segmented {
    display: inline-flex;
    flex-shrink: 0;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    overflow: hidden;
}
.shell-segmented button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    color: var(--sc-text-secondary);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}
.shell-segmented button + button { border-left: 1px solid var(--sc-border); }
.shell-segmented button:hover:not(.active) { background-color: var(--sc-hover); }
.shell-segmented button.active { background-color: var(--sc-primary); color: var(--sc-on-primary); }

.shell-switch:focus-visible,
.shell-segmented button:focus-visible,
.shell-link-button:focus-visible,
.shell-user-links a:focus-visible { outline: 2px solid var(--sc-primary); outline-offset: 2px; }

/* User card */
.shell-user-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    width: 20rem;
    max-width: calc(100vw - 2rem);
    padding: 1rem;
}
.shell-user-photo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background-color: var(--sc-primary-tint);
    color: var(--sc-primary);
    font-size: 1.75rem;
    font-weight: 600;
    user-select: none;
}
.shell-user-details { display: flex; flex: 1; flex-direction: column; gap: 0.125rem; min-width: 0; }
.shell-user-name,
.shell-user-upn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-user-name { font-size: 1rem; font-weight: 600; }
.shell-user-upn { color: var(--sc-text-secondary); }
.shell-user-links { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.shell-user-links a { color: var(--sc-primary); text-decoration: none; }
.shell-user-links a:hover { text-decoration: underline; }
.shell-user-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 0.75rem; }
.shell-link-button {
    padding: 0;
    border: none;
    background: none;
    color: var(--sc-primary);
    font: inherit;
    cursor: pointer;
}
.shell-link-button:hover { text-decoration: underline; }

/* Tenant picker — first item in .shell-controls, left of the settings button.
   Not acting: outlined "Act as customer" trigger with a searchable, A–Z customer list.
   Acting (customer view tab): filled primary "Acting as <name>" card with an Exit button. */
.shell-tenant-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    max-width: 22rem;
    height: 2.25rem;
    padding: 0 0.5rem 0 0.25rem;
    font: inherit;
    font-size: 0.875rem;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.shell-tenant-trigger:focus-visible { outline: 2px solid var(--sc-primary); outline-offset: 2px; }
.shell-tenant-trigger--picker { color: var(--sc-text); background-color: var(--sc-surface); }
.shell-tenant-trigger--picker:hover { background-color: var(--sc-hover); }
.shell-tenant-trigger--picker[aria-expanded="true"] { border-color: var(--sc-primary); }
.shell-tenant-trigger--acting {
    padding-right: 0.25rem;
    cursor: default;
    color: var(--sc-on-primary);
    background-color: var(--sc-primary);
    border-color: var(--sc-primary);
}
.shell-tenant-exit {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.25rem;
    height: 1.75rem;
    margin-left: 0.25rem;
    padding: 0 0.5rem;
    border-radius: 0.375rem;
    background-color: rgba(255, 255, 255, 0.16);
    color: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}
.shell-tenant-exit:hover { background-color: rgba(255, 255, 255, 0.28); }
.shell-tenant-exit:focus-visible { outline: 2px solid var(--sc-on-primary); outline-offset: 1px; }
.shell-tenant-trigger-text { display: inline-flex; align-items: baseline; gap: 0.375rem; min-width: 0; }
.shell-tenant-trigger-caption { flex: none; font-size: 0.8125rem; opacity: 0.85; }
.shell-tenant-trigger-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.shell-tenant-trigger--acting .shell-tenant-trigger-name { font-size: 0.9375rem; }
.shell-tenant-chevrons { display: inline-flex; flex: none; opacity: 0.7; }

/* Initials (or icon) tile used by the trigger and each list row */
.shell-tenant-badge {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.375rem;
    background-color: color-mix(in srgb, var(--sc-text) 7%, var(--sc-surface));
    color: var(--sc-text-secondary);
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    user-select: none;
}
.shell-tenant-trigger--acting .shell-tenant-badge {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--sc-on-primary);
}

.shell-tenant-panel {
    display: flex;
    flex-direction: column;
    width: 20rem;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem;
}

.shell-tenant-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.25rem;
    margin-bottom: 0.25rem;
    padding: 0 0.625rem;
    color: var(--sc-text-secondary);
    border: 1px solid var(--sc-border);
    border-radius: var(--sc-radius);
    cursor: text;
}
.shell-tenant-search:focus-within { border-color: var(--sc-primary); box-shadow: 0 0 0 1px var(--sc-primary); }
.shell-tenant-search-icon { display: inline-flex; flex: none; }
.shell-tenant-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    outline: none;
    background: none;
    color: var(--sc-text);
    font: inherit;
}
.shell-tenant-search input::placeholder { color: var(--sc-text-secondary); opacity: 1; }

.shell-tenant-heading {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.5rem 0.25rem;
    color: var(--sc-text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.shell-tenant-count {
    padding: 0.0625rem 0.375rem;
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--sc-text) 7%, var(--sc-surface));
    letter-spacing: 0;
}

.shell-tenant-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    max-height: min(20rem, 60vh);
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}
.shell-tenant-list[hidden],
.shell-tenant-list li[hidden],
.shell-tenant-empty[hidden] { display: none; }

.shell-tenant-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: none;
    border-radius: 0.375rem;
    background: none;
    color: var(--sc-text);
    font: inherit;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.shell-tenant-option:hover,
.shell-tenant-option:focus-visible { background-color: var(--sc-hover); }
.shell-tenant-option:focus-visible { outline: 2px solid var(--sc-primary); outline-offset: -2px; }
.shell-tenant-option-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.shell-tenant-empty {
    padding: 1rem 0.5rem;
    color: var(--sc-text-secondary);
    text-align: center;
}

/* Phones: the picker collapses to its badge and chevrons, the acting card to badge and Exit icon. */
@media (max-width: 600px) {
    .shell-tenant-trigger-text,
    .shell-tenant-exit-text { display: none; }
}
