/* ==========================================================================
   HALO BENTO — LAYER 3: SHELL & OVERLAYS
   Navbar · Workspace tabs · Page header · Menus · Modals · Drawers
   Alerts · Banners · Empty states · Account
   Requires halo-tokens.css.
   ========================================================================== */

/* ==========================================================================
   1. NAVBAR
   Brand left, a floating capsule of destinations in the middle, tools right.
   ========================================================================== */
.halo-navbar {
    position: sticky; top: 0; z-index: var(--halo-z-nav);
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--halo-4);
    padding: var(--halo-4) 28px var(--halo-2);
    background: var(--halo-canvas);
}

.halo-navbar__brand {
    display: inline-flex; align-items: center; gap: 10px; justify-self: start;
    color: var(--halo-text); text-decoration: none;
    font-family: var(--halo-font-display); font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.03em;
    border-radius: var(--halo-radius-md);
}
.halo-navbar__brand:focus-visible { outline: none; box-shadow: var(--halo-focus-ring); }
.halo-navbar__mark {
    display: grid; place-items: center; width: 34px; height: 34px; flex: none;
    border-radius: 12px; color: var(--halo-on-fill); background: var(--halo-fill-red);
    transform: rotate(-6deg);
    transition: transform var(--halo-duration-4) var(--halo-ease-spring);
}
.halo-navbar__brand:hover .halo-navbar__mark { transform: rotate(0deg) scale(1.04); }

.halo-navbar__capsule {
    position: relative; justify-self: center;
    display: flex; align-items: center; gap: 2px;
    padding: 5px;
    border-radius: var(--halo-radius-pill);
    background: color-mix(in srgb, var(--halo-surface) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    backdrop-filter: saturate(1.6) blur(16px);
    border: 1px solid var(--halo-hairline);
    box-shadow: var(--halo-shadow-2);
}
.halo-navbar__indicator {
    position: absolute; top: 0; left: 0; z-index: 0;
    border-radius: var(--halo-radius-pill);
    background: var(--halo-indicator);
    opacity: 0;
    transition: transform var(--halo-duration-4) var(--halo-ease-spring),
                width var(--halo-duration-4) var(--halo-ease-spring),
                opacity var(--halo-duration-2) var(--halo-ease-out);
    pointer-events: none;
}
.halo-navbar__link {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 17px;
    border: 0; border-radius: var(--halo-radius-pill);
    background: transparent; color: var(--halo-text-secondary);
    font: 600 0.84375rem/1 var(--halo-font); white-space: nowrap;
    text-decoration: none; cursor: pointer;
    transition: color var(--halo-duration-2) var(--halo-ease-out), background-color var(--halo-duration-1) var(--halo-ease-out);
}
.halo-navbar__link:hover { color: var(--halo-text); }
.halo-navbar__link[aria-current="page"] { color: var(--halo-on-indicator); }
.halo-navbar__link:focus-visible { outline: none; box-shadow: var(--halo-focus-ring); }
.halo-navbar__badge {
    padding: 2px 7px; border-radius: var(--halo-radius-pill);
    background: var(--halo-fill-red); color: var(--halo-on-fill);
    font: 700 0.6875rem/1.2 var(--halo-font);
}
.halo-navbar__chevron { transition: transform var(--halo-duration-3) var(--halo-ease-spring); }
.halo-navbar__more-toggle[aria-expanded="true"] .halo-navbar__chevron { transform: rotate(180deg); }
.halo-navbar__more { position: relative; }
.halo-navbar__menu {
    position: absolute; top: calc(100% + 12px); right: 0; z-index: var(--halo-z-drawer);
    min-width: 240px;
}
.halo-navbar__scrim { position: fixed; inset: 0; z-index: calc(var(--halo-z-drawer) - 1); }

.halo-navbar__tools { justify-self: end; display: flex; align-items: center; gap: var(--halo-1); }
.halo-navbar__tool[aria-pressed="true"] { background: var(--halo-soft-green); color: var(--halo-soft-green-ink); border-color: transparent; }
.halo-navbar__menu-toggle { display: none; }

.halo-navbar__sheet-scrim {
    position: fixed; inset: 0; z-index: var(--halo-z-modal);
    background: var(--halo-scrim);
    animation: halo-fade var(--halo-duration-3) var(--halo-ease-out);
}
.halo-navbar__sheet {
    position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: calc(var(--halo-z-modal) + 1);
    width: min(340px, calc(100vw - 24px));
    display: flex; flex-direction: column; gap: var(--halo-2);
    padding: var(--halo-4);
    border-radius: var(--halo-radius-2xl);
    background: var(--halo-surface-raised);
    box-shadow: var(--halo-shadow-4);
    overflow-y: auto;
    animation: halo-sheet-in var(--halo-duration-4) var(--halo-ease-spring);
}
@keyframes halo-sheet-in { from { transform: translateX(calc(100% + 24px)); } }
.halo-navbar__sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--halo-1) var(--halo-2); }
.halo-navbar__wordmark { font-family: var(--halo-font-display); font-weight: 800; font-size: 1.1875rem; letter-spacing: -0.03em; }
.halo-navbar__sheet-list { display: grid; gap: 2px; }

@media (max-width: 1100px) {
    .halo-navbar { grid-template-columns: 1fr auto; padding-inline: var(--halo-4); }
    .halo-navbar__capsule { display: none; }
    .halo-navbar__menu-toggle { display: inline-grid; }
}

/* View Transitions for navigation (halo-navbar.js). The page content cross-fades
   on the spring; the navbar stays put. */
.halo-navbar { view-transition-name: halo-navbar; }
.halo-main-inner { view-transition-name: halo-page; }
/* Drawers stay in Blazor's render tree, while their overlays and body-portaled
   pickers share the page stacking context with the persistent phone. Both a
   positioned z-index and a view-transition name would otherwise trap them. */
.halo-main-inner:has(.halo-drawer[open]) {
    z-index: auto;
    view-transition-name: none;
}
::view-transition-old(halo-page) { animation: halo-vt-out 260ms cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(halo-page) { animation: halo-vt-in var(--halo-duration-4) var(--halo-ease-spring) both; }
::view-transition-group(*) { animation-duration: var(--halo-duration-4); animation-timing-function: var(--halo-ease-spring); }
@keyframes halo-vt-out { to { opacity: 0; transform: scale(.99); filter: blur(4px); } }
@keyframes halo-vt-in { from { opacity: 0; transform: translateY(12px); filter: blur(6px); } }

/* ==========================================================================
   2. MENUS
   ========================================================================== */
.halo-menu {
    display: grid; gap: 2px; padding: 6px;
    border-radius: var(--halo-radius-lg);
    background: var(--halo-surface-raised);
    border: 1px solid var(--halo-hairline);
    box-shadow: var(--halo-shadow-3);
    transform-origin: top right;
    animation: halo-menu-in var(--halo-duration-3) var(--halo-ease-spring);
}
@keyframes halo-menu-in { from { opacity: 0; transform: scale(.94) translateY(-4px); } }
.halo-menu__item {
    display: flex; align-items: center; gap: 10px;
    min-height: 40px; padding: 0 12px;
    border: 0; border-radius: 12px;
    background: transparent; color: var(--halo-text);
    font: 500 var(--halo-text-sm)/1.2 var(--halo-font); text-align: left; text-decoration: none;
    cursor: pointer;
    transition: background-color var(--halo-duration-1) var(--halo-ease-out);
}
.halo-menu__item:hover { background: var(--halo-surface-hover); }
.halo-menu__item:focus-visible { outline: none; box-shadow: var(--halo-focus-ring); }
.halo-menu__item.is-active, .halo-menu__item[aria-current="page"] { background: var(--halo-soft-navy); color: var(--halo-soft-navy-ink); font-weight: 600; }
.halo-menu__item--danger { color: var(--halo-ink-critical); }
.halo-menu__item .halo-navbar__badge { margin-left: auto; }
.halo-menu__divider { border: 0; border-top: 1px solid var(--halo-hairline); margin: 4px 6px; }

/* ==========================================================================
   3. WORKSPACE TABS (open records) and page header
   ========================================================================== */
.halo-worktabs { display: flex; align-items: center; gap: var(--halo-2); background: transparent; }
.halo-worktab {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    min-height: 36px; padding: 0 var(--halo-3);
    border: 0; border-radius: var(--halo-radius-pill);
    background: transparent; color: var(--halo-text-secondary);
    font: 600 var(--halo-text-sm)/1 var(--halo-font); white-space: nowrap;
    transition: background-color var(--halo-duration-2) var(--halo-ease-out), color var(--halo-duration-2) var(--halo-ease-out);
}
.halo-worktab:hover { background: var(--halo-surface-hover); color: var(--halo-text); }
.halo-worktab[aria-selected="true"], .halo-worktab--active { background: var(--halo-surface); color: var(--halo-text); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 4px 12px rgb(0 0 0 / .06); }
.halo-worktab__age, .halo-worktabs__count { font: 500 var(--halo-text-caption)/1 var(--halo-font); color: var(--halo-text-tertiary); font-variant-numeric: tabular-nums; }
.halo-worktab__close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--halo-text-tertiary); cursor: pointer; }
.halo-worktab__close:hover { background: var(--halo-soft-red); color: var(--halo-soft-red-ink); }
.halo-worktabs--chrome { background: var(--halo-surface-sunken); border-radius: var(--halo-radius-pill); padding: 4px; gap: 2px; }
.halo-worktabs--chrome .workspace-tabs__track { flex: 1; gap: 2px; }

.halo-channel-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; margin-bottom: var(--halo-5); padding: 4px; background: var(--halo-surface-sunken); border-radius: var(--halo-radius-pill); }
.halo-channel-tabs a { display: inline-flex; align-items: center; min-height: 34px; padding: 0 var(--halo-4); color: var(--halo-text-tertiary); border-radius: var(--halo-radius-pill); font-weight: 600; text-decoration: none; transition: color var(--halo-duration-2) var(--halo-ease-out), background-color var(--halo-duration-2) var(--halo-ease-out); }
.halo-channel-tabs a:hover { color: var(--halo-text); }
.halo-channel-tabs a.is-active { background: var(--halo-surface); color: var(--halo-text); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 4px 12px rgb(0 0 0 / .06); }
.halo-channel-tabs a:focus-visible { outline: none; box-shadow: var(--halo-focus-ring); }

.halo-page-header { display: block; padding-bottom: var(--halo-5); }
.halo-page-header__back {
    display: inline-flex; align-items: center; gap: var(--halo-2);
    margin-bottom: var(--halo-2); color: var(--halo-text-tertiary);
    font: 600 var(--halo-text-sm)/1 var(--halo-font); text-decoration: none;
    border-radius: var(--halo-radius-pill);
}
.halo-page-header__back:hover { color: var(--halo-text); }
.halo-page-header__back:focus-visible { outline: none; box-shadow: var(--halo-focus-ring); }
.halo-page-header__content { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--halo-4); }
.halo-page-header__heading { min-width: 0; }
.halo-page-header__title { margin: 0; font-family: var(--halo-font-display); font-size: var(--halo-text-page); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; text-wrap: balance; }
.halo-page-header__subtitle { margin: var(--halo-1) 0 0; font-size: var(--halo-text-body); color: var(--halo-text-tertiary); }
.halo-page-header__crumbs { font-size: var(--halo-text-sm); color: var(--halo-text-tertiary); margin-bottom: var(--halo-1); }
.halo-page-header__actions { margin-left: auto; display: flex; gap: var(--halo-2); flex: none; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 720px) {
    .halo-page-header__content { flex-direction: column; align-items: stretch; }
    .halo-page-header__actions { margin-left: 0; justify-content: flex-start; }
}

/* ==========================================================================
   4. MODALS & DRAWERS — solid surfaces over a scrim, spring entrance.
   ========================================================================== */
.halo-scrim {
    position: fixed; inset: 0; z-index: var(--halo-z-modal);
    background: var(--halo-scrim);
    display: grid; place-items: center;
    padding: var(--halo-6);
    animation: halo-fade var(--halo-duration-3) var(--halo-ease-out);
}
@keyframes halo-fade { from { opacity: 0; } }

.halo-modal {
    width: min(var(--halo-dialog-width, var(--halo-dialog-standard)), 100%);
    max-height: min(88dvh, 920px);
    display: flex; flex-direction: column;
    background: var(--halo-surface-raised);
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-xl);
    box-shadow: var(--halo-shadow-4);
    overflow: hidden;
    animation: halo-modal-in var(--halo-duration-4) var(--halo-ease-spring), halo-fade var(--halo-duration-2) var(--halo-ease-out);
}
@keyframes halo-modal-in { from { transform: translateY(12px) scale(.96); } }
.halo-modal--lg { --halo-dialog-width: var(--halo-dialog-large); }
.halo-modal--workspace { --halo-dialog-width: var(--halo-dialog-workspace); }
.halo-modal--sm { --halo-dialog-width: var(--halo-dialog-compact); }
.halo-modal__header { display: flex; align-items: flex-start; gap: var(--halo-3); padding: 22px 24px var(--halo-2); }
.halo-modal__title { margin: 0; font-family: var(--halo-font-display); font-size: 1.375rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1.2; }
.halo-modal__subtitle { margin: 4px 0 0; font-size: var(--halo-text-sm); color: var(--halo-text-tertiary); }
.halo-modal__close { margin-left: auto; }
.halo-modal__body { padding: var(--halo-3) 24px var(--halo-5); overflow-y: auto; flex: 1; }
.halo-modal__footer { display: flex; align-items: center; gap: var(--halo-2); padding: var(--halo-4) 24px 22px; }
.halo-modal__footer > .halo-btn:first-child { margin-right: auto; }
.halo-modal__footer--end { justify-content: flex-end; }
.halo-modal--danger .halo-modal__header { background: var(--halo-soft-red); }

/* MudBlazor dialog adapter: feature dialogs opt in with .halo-modal. */
.mud-dialog.halo-modal {
    padding: 0; color: var(--halo-text);
    background: var(--halo-surface-raised);
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-xl);
    box-shadow: var(--halo-shadow-4);
}
.mud-dialog.halo-modal > .mud-dialog-title { padding: 22px 24px var(--halo-3); color: var(--halo-text); font-family: var(--halo-font-display); letter-spacing: -0.03em; }
.mud-dialog.halo-modal > .mud-dialog-content { padding: 0 24px var(--halo-5); color: var(--halo-text); }
.mud-dialog.halo-modal > .mud-dialog-actions { gap: var(--halo-2); padding: var(--halo-4) 24px 22px; border-top: 1px solid var(--halo-hairline); background: var(--halo-surface-raised); }

.mud-dialog.halo-modal.halo-user-editor { width: min(1120px, calc(100vw - 48px)); max-width: 1120px; max-height: min(92dvh, 1080px); }
.mud-dialog.halo-user-editor .mud-focus-trap,
.mud-dialog.halo-user-editor .mud-focus-trap-child-container { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.mud-dialog.halo-user-editor .mud-dialog-title,
.mud-dialog.halo-user-editor .mud-dialog-actions { flex: 0 0 auto; }
.mud-dialog.halo-user-editor .mud-dialog-actions { padding: var(--halo-4) var(--halo-6); border-top: 1px solid var(--halo-hairline); background: var(--halo-surface); }
.mud-dialog.halo-user-editor .mud-dialog-content { padding: 0 var(--halo-6) var(--halo-6); flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; }
@media (max-width: 700px) {
    .mud-dialog.halo-modal.halo-user-editor { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 8px; }
    .mud-dialog.halo-user-editor .mud-dialog-title,
    .mud-dialog.halo-user-editor .mud-dialog-content,
    .mud-dialog.halo-user-editor .mud-dialog-actions { padding: var(--halo-4); }
}

.mud-dialog.halo-modal .mud-input-control .mud-input,
.mud-dialog.halo-modal input,
.mud-dialog.halo-modal select,
.mud-dialog.halo-modal textarea { color: var(--halo-text); background: var(--halo-surface); }
.mud-dialog.halo-modal .mud-input-control:focus-within .mud-input,
.mud-dialog.halo-modal input:focus-visible,
.mud-dialog.halo-modal select:focus-visible,
.mud-dialog.halo-modal textarea:focus-visible { outline: none; border-color: var(--halo-focus-color); box-shadow: var(--halo-focus-ring-field); }

.halo-confirm__header { display: flex; align-items: center; gap: var(--halo-3); }
.halo-confirm__icon {
    --t1: var(--halo-tone-info); display: grid; place-items: center;
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px;
    color: rgb(var(--t1)); background: rgb(var(--t1) / .12);
    transform: rotate(-6deg);
}
.halo-confirm__icon--warning { color: var(--halo-soft-yellow-ink); background: var(--halo-soft-yellow); }
.halo-confirm__icon--critical { color: var(--halo-soft-red-ink); background: var(--halo-soft-red); }
.halo-confirm__body { display: grid; gap: var(--halo-4); }
.halo-confirm__entity { padding: var(--halo-2) var(--halo-3); border-radius: var(--halo-radius-md); background: var(--halo-surface-sunken); color: var(--halo-text-secondary); font-size: var(--halo-text-sm); font-weight: 600; }
.halo-confirm__actions { display: flex; justify-content: flex-end; gap: var(--halo-2); width: 100%; }

.halo-drawer {
    position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: var(--halo-z-drawer);
    width: min(480px, calc(100% - 24px));
    display: flex; flex-direction: column;
    background: var(--halo-surface-raised);
    border: 1px solid var(--halo-hairline);
    border-radius: var(--halo-radius-2xl);
    box-shadow: var(--halo-shadow-4);
    overflow: hidden;
    animation: halo-drawer-in var(--halo-duration-4) var(--halo-ease-spring);
}
@keyframes halo-drawer-in { from { transform: translateX(calc(100% + 24px)); } }
.halo-drawer--left { right: auto; left: 12px; animation-name: halo-drawer-in-left; }
@keyframes halo-drawer-in-left { from { transform: translateX(calc(-100% - 24px)); } }

/* ==========================================================================
   5. ALERTS, BANNERS, EMPTY STATES
   ========================================================================== */
.halo-alert {
    --t1: var(--halo-tone-info);
    --alert-bg: var(--halo-soft-blue); --alert-ink: var(--halo-soft-blue-ink);
    display: flex; gap: var(--halo-3);
    padding: var(--halo-3) var(--halo-4);
    border-radius: var(--halo-radius-md);
    background: var(--alert-bg);
    color: var(--halo-text);
}
.halo-alert__icon { flex: none; color: var(--alert-ink); margin-top: 1px; }
.halo-alert__title { font-weight: 700; font-size: var(--halo-text-body); color: var(--alert-ink); }
.halo-alert__body { font-size: var(--halo-text-sm); color: var(--halo-text-secondary); margin-top: 2px; }
.halo-alert__actions { margin-left: auto; display: flex; gap: var(--halo-2); align-items: center; flex: none; }
.halo-alert--info     { --t1: var(--halo-tone-info);     --alert-bg: var(--halo-soft-blue);   --alert-ink: var(--halo-soft-blue-ink); }
.halo-alert--success  { --t1: var(--halo-tone-success);  --alert-bg: var(--halo-soft-green);  --alert-ink: var(--halo-soft-green-ink); }
.halo-alert--warning  { --t1: var(--halo-tone-warning);  --alert-bg: var(--halo-soft-yellow); --alert-ink: var(--halo-soft-yellow-ink); }
.halo-alert--critical { --t1: var(--halo-tone-critical); --alert-bg: var(--halo-soft-red);    --alert-ink: var(--halo-soft-red-ink); }
.mud-dialog.halo-modal .halo-alert { color: var(--halo-text); }

.halo-banner {
    --banner-bg: var(--halo-soft-yellow); --banner-ink: var(--halo-soft-yellow-ink);
    display: flex; align-items: center; gap: var(--halo-3);
    margin: 0 28px var(--halo-3);
    padding: var(--halo-2) var(--halo-4);
    border-radius: var(--halo-radius-pill);
    font-size: var(--halo-text-sm); font-weight: 500;
    background: var(--banner-bg); color: var(--halo-text);
}
.halo-banner strong { color: var(--banner-ink); }
.halo-banner--critical { --banner-bg: var(--halo-soft-red); --banner-ink: var(--halo-soft-red-ink); }

.halo-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--halo-2); text-align: center;
    padding: var(--halo-12) var(--halo-6);
    border-radius: var(--halo-radius-xl);
    color: var(--halo-text-secondary);
}
.halo-empty__icon {
    display: grid; place-items: center; width: 60px; height: 60px;
    border-radius: 20px;
    background: var(--halo-soft-navy); color: var(--halo-soft-navy-ink);
    transform: rotate(-6deg);
    margin-bottom: var(--halo-2);
}
.halo-empty__title { font-family: var(--halo-font-display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.03em; color: var(--halo-text); }
.halo-empty__body { font-size: var(--halo-text-sm); max-width: 42ch; color: var(--halo-text-tertiary); }
.halo-empty--inline { padding: var(--halo-8) var(--halo-4); }

/* Submission detail keeps navigation visible while long forms scroll. */
.mud-dialog.cp-submission-dialog { max-height: calc(100dvh - 32px); }
.mud-dialog.cp-submission-dialog > .mud-dialog-content { min-height: 0; overflow-y: auto; }
.mud-dialog.cp-submission-dialog > .mud-dialog-actions { flex-wrap: wrap; flex-shrink: 0; }

/* ==========================================================================
   6. ACCOUNT
   ========================================================================== */
.halo-account { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; min-height: 48px; padding: 6px; border: 0; border-radius: var(--halo-radius-pill); background: transparent; color: var(--halo-text); text-align: left; cursor: pointer; font: inherit; transition: background-color var(--halo-duration-1) var(--halo-ease-out); }
.halo-account:hover { background: var(--halo-surface-hover); }
.halo-account:focus-visible { outline: none; box-shadow: var(--halo-focus-ring); }
.halo-account--compact { width: auto; min-height: 0; padding: 3px; }
.halo-account__avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; overflow: hidden; background: var(--halo-soft-red); color: var(--halo-soft-red-ink); font-size: 13px; font-weight: 700; }
.halo-account__avatar img { width: 100%; height: 100%; object-fit: cover; }
.halo-account__copy { display: grid; gap: 3px; min-width: 0; flex: 1; }
.halo-account__copy strong, .halo-account__copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.halo-account__copy strong { font-size: var(--halo-text-body); font-weight: 600; line-height: 1.3; }
.halo-account__copy > span { font-size: var(--halo-text-caption); color: var(--halo-text-tertiary); line-height: 1.3; }
.halo-account__more { font-weight: 700; font-size: 20px; }

.account-profile { display: grid; gap: var(--halo-4); padding-block: var(--halo-2); }
.account-profile__identity { display: flex; align-items: center; gap: var(--halo-4); min-width: 0; }
.account-profile__identity > div { min-width: 0; overflow-wrap: anywhere; }
.account-profile__identity h3 { margin: 0 0 4px; font-family: var(--halo-font-display); font-size: 1.375rem; letter-spacing: -0.03em; }
.account-profile__identity p { margin: 0 0 6px; color: var(--halo-text-secondary); }
.account-profile__avatar { width: 72px; height: 72px; flex-basis: 72px; font-size: 24px; }
.account-profile__role, .account-profile__hint { font-size: var(--halo-text-caption); color: var(--halo-text-tertiary); }
.account-profile__hint { margin: 0; line-height: 1.6; }
.account-profile__photo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--halo-2); }
.account-profile__upload { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: var(--halo-control-md); padding: 0 16px; border: 1px solid var(--halo-input-border); border-radius: var(--halo-radius-pill); color: var(--halo-text); background: var(--halo-surface); font-weight: 600; cursor: pointer; }
.account-profile__upload input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.account-profile__upload:focus-within { outline: none; box-shadow: var(--halo-focus-ring); }
.account-profile__upload.is-busy { opacity: .6; }
.account-profile__error { color: var(--halo-ink-critical); }
.account-profile__message { color: var(--halo-ink-success); }

/* Appearance picker (account dialog). */
.halo-theme-picker { display: grid; grid-template-columns: 24px 1fr; align-items: center; column-gap: var(--halo-2); row-gap: var(--halo-1); padding: var(--halo-3) 0; border-top: 1px solid var(--halo-hairline); color: var(--halo-text); }
.halo-theme-picker__icon { grid-row: 1 / 3; font-size: 24px; color: var(--halo-text-secondary); }
.halo-theme-picker__label { font-size: var(--halo-text-sm); font-weight: 600; }
.halo-theme-picker__select { min-width: 0; width: 100%; min-height: var(--halo-control-lg); padding: 0 var(--halo-4); border: 1px solid var(--halo-input-border); border-radius: var(--halo-radius-pill); background: var(--halo-surface); color: var(--halo-text); font: inherit; }
.halo-theme-picker__select:focus-visible { outline: none; border-color: var(--halo-focus-color); box-shadow: var(--halo-focus-ring-field); }

/* ==========================================================================
   7. FEATURE DIALOG SIZING (kept here because they wrap MudDialog chrome)
   ========================================================================== */
.mud-dialog.halo-modal.sales-review-dialog { width: min(1040px, calc(100vw - 40px)); max-width: calc(100vw - 40px); max-height: calc(100dvh - 40px); }
.mud-dialog.sales-review-dialog > .mud-dialog-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.mud-dialog.sales-review-dialog > .mud-dialog-title,
.mud-dialog.sales-review-dialog > .mud-dialog-actions { flex: 0 0 auto; }
@media (max-width: 700px) {
    .mud-dialog.halo-modal.sales-review-dialog { width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 8px; }
}

.mud-dialog.halo-modal.uam-person-modal {
    width: min(1040px, calc(100vw - 48px)); margin: 24px;
    max-width: calc(100vw - 48px); max-height: calc(100dvh - 48px); border-radius: var(--halo-radius-2xl);
    display: flex; flex-direction: column;
}
.uam-person-modal .mud-dialog-content { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.uam-person-modal .mud-dialog-title { border-bottom: 1px solid var(--halo-hairline); }
.uam-person-modal .mud-dialog-actions { border-top: 1px solid var(--halo-hairline); padding: 16px 24px; }
.uam-person-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.uam-person-heading h2 { margin: 0; font-family: var(--halo-font-display); font-size: 1.375rem; letter-spacing: -0.03em; }
.uam-person-heading p { margin: .25rem 0 0; font-size: .85rem; color: var(--halo-text-secondary); }
.uam-person-heading button { border: 0; background: transparent; font-size: 1.75rem; color: var(--halo-text-secondary); cursor: pointer; padding: .3rem .75rem; border-radius: var(--halo-radius-pill); }
@media (max-width: 700px) { .mud-dialog.halo-modal.uam-person-modal { margin: 8px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: var(--halo-radius-xl); } }

@media (prefers-reduced-motion: reduce) {
    .halo-navbar__indicator, .halo-navbar__mark, .halo-menu, .halo-modal, .halo-drawer, .halo-navbar__sheet { animation: none; transition-duration: 1ms; }
    ::view-transition-old(halo-page), ::view-transition-new(halo-page) { animation: none; }
}
