/* ==========================================================================
   SETRA app shell (2026-10-09 redesign)
   The sidebar (narrow: icons; wide: icons and names), the phone bar, the
   workspace tabs and the page area. Drawn by templates/base.html from
   users.navigation. All colours come from tokens.css.
   ========================================================================== */

:root {
    --shell-sidebar-narrow: 4.5rem;     /* 72px */
    --shell-sidebar-wide: 15rem;        /* 240px */
    --shell-sidebar-width: var(--shell-sidebar-narrow);
    --shell-phone-bar-height: 3.75rem;  /* 60px */
}
html.sidebar-expanded {
    --shell-sidebar-width: var(--shell-sidebar-wide);
}

body {
    min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--shell-sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--s-sidebar-bg);
    color: var(--s-sidebar-text);
    z-index: var(--s-z-sidebar);
    transition: width var(--s-transition-normal);
}

/* ---- Brand ---- */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 4rem;
    padding: var(--s-space-3) var(--s-space-4);
}
.logo-link {
    display: flex;
    align-items: center;
    gap: var(--s-space-3);
    color: #fff;
    text-decoration: none;
    min-width: 0;
}
.logo-link:hover {
    color: #fff;
}
/* Placeholder mark: rounded square + "S". Swap for a real logo asset later. */
.logo-mark {
    flex: none;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--s-radius-lg);
    background: var(--s-color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--s-font-weight-bold);
    font-size: var(--s-font-size-lg);
}
/* The name shows only when the sidebar is wide (and in the phone's slid-in menu); on the narrow
   rail it would run out over the page's heading. */
.sidebar-wordmark {
    display: none;
    font-size: var(--s-font-size-lg);
    font-weight: var(--s-font-weight-bold);
    letter-spacing: 0.14em;
    white-space: nowrap;
}
.sidebar-close {
    display: none;
}

/* ---- The arrow on the sidebar's edge that widens and narrows it ---- */
.sidebar-edge {
    position: absolute;
    top: 1.375rem;
    right: -0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--s-color-border-strong);
    border-radius: 50%;
    background: var(--s-color-surface);
    color: var(--s-color-text-secondary);
    box-shadow: var(--s-shadow-md);
    cursor: pointer;
    z-index: 1;
}
.sidebar-edge:hover,
.sidebar-edge:focus-visible {
    color: var(--s-color-accent-text);
    border-color: var(--s-color-accent);
}
.sidebar-edge .material-icons-outlined {
    font-size: 18px;
    line-height: 0;
    transition: transform var(--s-transition-normal);
}
html.sidebar-expanded .sidebar-edge .material-icons-outlined {
    transform: rotate(180deg);
}

/* ---- Entries ---- */
.sidebar-nav {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: var(--s-space-3);
    padding: var(--s-space-2) var(--s-space-3);
    min-height: 0;
    /* Scrolls when there are more links than fit, in the narrow rail too. The narrow rail's names
       are drawn outside it (see .sidebar-link::after), so scrolling does not cut them off. */
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--s-sidebar-scrollbar) transparent;
}
/* Resources, kept at the bottom above the person's menu while the links above it scroll. */
.sidebar-pinned {
    flex: none;
    padding: var(--s-space-2) var(--s-space-3);
}
.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-group-label {
    display: none;
    padding: 0 var(--s-space-3) var(--s-space-1);
    font-size: var(--s-font-size-xs);
    font-weight: var(--s-font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--s-sidebar-text);
    opacity: 0.7;
}
.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--s-space-3);
    min-height: 2.5rem;
    padding: var(--s-space-2) var(--s-space-3);
    border-radius: var(--s-radius-lg);
    color: var(--s-sidebar-text);
    text-decoration: none;
    font-size: var(--s-font-size-md);
    font-weight: var(--s-font-weight-medium);
    white-space: nowrap;
}
.sidebar-link .material-icons-outlined {
    flex: none;
    font-size: 22px;
    line-height: 1;
}
/* The count of mails that need a record, on the icon (loaded after the page). */
.sidebar-badge {
    position: absolute;
    top: 0.1rem;
    left: 1.6rem;
    min-width: 1.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background-color: var(--s-color-danger);
    color: #fff;
    font-size: var(--s-font-size-xs);
    font-weight: var(--s-font-weight-semibold);
    line-height: 1.1rem;
    text-align: center;
}
.sidebar-badge:empty {
    display: none;
}
.sidebar-link:hover,
.sidebar-link:focus-visible {
    background: var(--s-sidebar-active-bg);
    color: var(--s-sidebar-text-hover);
}
.sidebar-link.is-active {
    background: var(--s-sidebar-active-bg);
    color: var(--s-sidebar-text-hover);
    font-weight: var(--s-font-weight-semibold);
}
.sidebar-link.is-active::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--s-space-3));
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.375rem;
    border-radius: 0 2px 2px 0;
    background: var(--s-color-accent);
}
.sidebar-link-label {
    display: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Narrow: the name shows beside the icon on hover and on keyboard focus. */
html:not(.sidebar-expanded) .sidebar-link {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}
/* The name is placed against the screen, not the list, so a scrolling list cannot cut it off;
   static/js/common/sidebar_tips.js sets --tip-top to the middle of the link being pointed at. */
html:not(.sidebar-expanded) .sidebar-link::after {
    content: attr(data-label);
    position: fixed;
    left: var(--shell-sidebar-width);
    top: var(--tip-top, 50%);
    transform: translateY(-50%);
    padding: var(--s-space-1) var(--s-space-2);
    border-radius: var(--s-radius-md);
    background: var(--s-color-text);
    color: var(--s-color-surface);
    font-size: var(--s-font-size-sm);
    font-weight: var(--s-font-weight-medium);
    white-space: nowrap;
    box-shadow: var(--s-shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--s-transition-fast);
    z-index: var(--s-z-popover);
}
html:not(.sidebar-expanded) .sidebar-link:hover::after,
html:not(.sidebar-expanded) .sidebar-link:focus-visible::after {
    opacity: 1;
}

/* ---- Resources: a section that opens (wide sidebar, phone menu) or a panel beside the rail (narrow) ---- */
button.sidebar-link {
    width: 100%;
    border: 0;
    background: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}
/* The chevron only shows in the wide sidebar and the phone menu. The selector is as specific as
   `.sidebar-link .material-icons-outlined`, so the icon font's own display cannot win. */
.sidebar-link .sidebar-resources__chevron {
    display: none;
    margin-left: auto;
    transition: transform var(--s-transition-fast);
}
html.sidebar-expanded .sidebar-link .sidebar-resources__chevron {
    display: block;
}
.sidebar-resources__panel {
    display: flex;
    flex-direction: column;
    gap: var(--s-space-2);
    padding: var(--s-space-1) 0 var(--s-space-2) var(--s-space-3);
}
.sidebar-resources__list {
    display: flex;
    flex-direction: column;
    gap: var(--s-space-3);
    min-height: 0;
    /* Pinned at the bottom, the opened list scrolls inside itself rather than pushing the sidebar off screen. */
    max-height: min(55vh, 28rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--s-sidebar-scrollbar) transparent;
}
.sidebar-resources__search {
    position: relative;
    display: block;
    margin: 0;
}
.sidebar-resources__search .material-icons-outlined {
    position: absolute;
    left: var(--s-space-2);
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 0;
    opacity: 0.7;
    pointer-events: none;
}
.sidebar-resources__search input {
    width: 100%;
    padding: 0.4rem var(--s-space-2) 0.4rem 2rem;
    border: 1px solid var(--s-sidebar-border);
    border-radius: var(--s-radius-md);
    background: rgba(255, 255, 255, 0.06);
    color: var(--s-sidebar-text-hover);
    font: inherit;
    font-size: var(--s-font-size-sm);
}
.sidebar-resources__search input::placeholder {
    color: var(--s-sidebar-text);
    opacity: 0.7;
}
.sidebar-resources__search input:focus {
    outline: 2px solid var(--s-color-accent);
    outline-offset: 0;
}
.sidebar-resources__none {
    margin: 0;
    padding: 0 var(--s-space-3);
    font-size: var(--s-font-size-sm);
    opacity: 0.7;
}
.sidebar-resources__title {
    padding: 0 var(--s-space-3);
    font-size: var(--s-font-size-xs);
    font-weight: var(--s-font-weight-semibold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.7;
}
.sidebar-resources__section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-resources__link {
    display: flex;
    align-items: center;
    gap: var(--s-space-2);
    padding: 0.35rem var(--s-space-3);
    border-radius: var(--s-radius-md);
    color: var(--s-sidebar-text);
    text-decoration: none;
    font-size: var(--s-font-size-sm);
    font-weight: var(--s-font-weight-medium);
}
.sidebar-resources__link .material-icons-outlined {
    flex: none;
    font-size: 18px;
    line-height: 0;
}
.sidebar-resources__link:hover,
.sidebar-resources__link:focus-visible,
.sidebar-resources__link.is-active {
    background: var(--s-sidebar-active-bg);
    color: var(--s-sidebar-text-hover);
}
.sidebar-resources__link.is-active {
    font-weight: var(--s-font-weight-semibold);
}
@media (min-width: 769px) {
    /* Narrow rail: the same links in a panel beside it, from the top of the screen to the bottom,
       the search box fixed on top and the links scrolling under it. */
    html:not(.sidebar-expanded) .sidebar-resources__toggle[aria-expanded="true"]::after {
        display: none;
    }
    html:not(.sidebar-expanded) .sidebar-resources__panel {
        position: fixed;
        top: 0;
        bottom: 0;
        left: var(--shell-sidebar-width);
        width: 17rem;
        height: 100vh;
        height: 100dvh;
        gap: var(--s-space-3);
        padding: var(--s-space-4) var(--s-space-3) var(--s-space-3);
        background: var(--s-color-surface);
        color: var(--s-color-text);
        border-right: 1px solid var(--s-color-border);
        box-shadow: var(--s-shadow-xl);
        z-index: var(--s-z-popover);
    }
    html:not(.sidebar-expanded) .sidebar-resources__list {
        flex: 1 1 auto;
        max-height: none;
        overflow-y: auto;
        overscroll-behavior: contain;
        /* This panel is light, unlike the dark sidebar. */
        scrollbar-color: var(--s-color-border-strong) transparent;
    }
    html:not(.sidebar-expanded) .sidebar-resources__search input {
        border-color: var(--s-color-border);
        background: var(--s-color-surface);
        color: var(--s-color-text);
    }
    html:not(.sidebar-expanded) .sidebar-resources__search input::placeholder {
        color: var(--s-color-text-secondary);
    }
    html:not(.sidebar-expanded) .sidebar-resources__link {
        color: var(--s-color-text);
    }
    html:not(.sidebar-expanded) .sidebar-resources__link:hover,
    html:not(.sidebar-expanded) .sidebar-resources__link:focus-visible {
        background: var(--s-color-surface-hover);
        color: var(--s-color-text);
    }
    html:not(.sidebar-expanded) .sidebar-resources__link.is-active {
        background: var(--s-color-accent-light);
        color: var(--s-color-accent-text);
    }
}

/* Wide: names and group labels show. */
html.sidebar-expanded .sidebar-wordmark,
html.sidebar-expanded .sidebar-group-label,
html.sidebar-expanded .sidebar-link-label {
    display: block;
}

/* ---- Bottom: the person's menu ---- */
.sidebar-bottom {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: var(--s-space-1);
    padding: var(--s-space-2) var(--s-space-3) var(--s-space-3);
    border-top: 1px solid var(--s-sidebar-border);
}
.sidebar-user {
    position: relative;
}
.sidebar-user-button {
    display: flex;
    align-items: center;
    gap: var(--s-space-3);
    width: 100%;
    min-height: 2.75rem;
    padding: var(--s-space-1) var(--s-space-2);
    border: 0;
    border-radius: var(--s-radius-lg);
    background: none;
    color: var(--s-sidebar-text-hover);
    text-align: left;
    cursor: pointer;
}
html:not(.sidebar-expanded) .sidebar-user-button {
    justify-content: center;
    padding: var(--s-space-1) 0;
}
.sidebar-user-button:hover,
.sidebar-user-button[aria-expanded="true"] {
    background: var(--s-sidebar-active-bg);
}
.sidebar-avatar {
    flex: none;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--s-color-accent-light);
    border: 1px solid var(--s-sidebar-border);
    color: #fff;
    font-size: var(--s-font-size-xs);
    font-weight: var(--s-font-weight-semibold);
}
.sidebar-user-text {
    display: none;
    min-width: 0;
}
html.sidebar-expanded .sidebar-user-text {
    display: flex;
    flex-direction: column;
}
.sidebar-user-text strong,
.sidebar-user-text span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-text strong {
    font-size: var(--s-font-size-sm);
    font-weight: var(--s-font-weight-semibold);
}
.sidebar-user-text span {
    font-size: var(--s-font-size-xs);
    color: var(--s-sidebar-text);
}
.sidebar-user-menu {
    position: absolute;
    left: calc(100% + var(--s-space-3));
    bottom: 0;
    width: 15rem;
    padding: var(--s-space-1);
    background: var(--s-color-surface);
    color: var(--s-color-text);
    border: 1px solid var(--s-color-border);
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-xl);
    z-index: var(--s-z-popover);
}
.sidebar-user-meta {
    display: flex;
    flex-direction: column;
    padding: var(--s-space-2) var(--s-space-3);
    margin-bottom: var(--s-space-1);
    border-bottom: 1px solid var(--s-color-border);
    font-size: var(--s-font-size-sm);
    color: var(--s-color-text-secondary);
}
.sidebar-user-meta strong {
    color: var(--s-color-text);
    font-size: var(--s-font-size-md);
}
.sidebar-user-menu form {
    margin: 0;
}
.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: var(--s-space-2);
    width: 100%;
    padding: var(--s-space-2) var(--s-space-3);
    border: 0;
    border-radius: var(--s-radius-md);
    background: none;
    color: var(--s-color-text);
    font: inherit;
    font-size: var(--s-font-size-md);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.sidebar-menu-item .material-icons-outlined {
    font-size: 18px;
    line-height: 0;
    color: var(--s-color-text-secondary);
}
.sidebar-menu-item:hover,
.sidebar-menu-item.is-active {
    background: var(--s-color-surface-hover);
    color: var(--s-color-text);
}
.sidebar-menu-item--danger,
.sidebar-menu-item--danger .material-icons-outlined {
    color: var(--s-color-danger-text);
}

/* ---- The notification bell (D-45): top right of every page, level with the heading ----
   static/js/common/shell-bell.js sets `top` from the page's heading and marks the heading's row
   `.bell-gutter`, which leaves room for the bell beside the row's buttons. */
.page-inner {
    position: relative;
}
.page-bell {
    position: absolute;
    top: 0;
    right: 0;
    /* Above the page's own dropdowns and sticky parts (up to 200), always below the slide-in
       drawers, dialogs and the sidebar (1000 and up). Its panel is inside this layer, so it
       stays behind them too. */
    z-index: 900;
}
.bell-gutter {
    padding-right: 3.25rem;
}
.notification-bell {
    position: relative;
}
.notification-bell__button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 1px solid var(--s-color-border);
    border-radius: var(--s-radius-lg);
    background: var(--s-color-surface);
    color: var(--s-color-text-secondary);
    cursor: pointer;
    font: inherit;
}
.notification-bell__button:hover,
.notification-bell__button[aria-expanded="true"] {
    background: var(--s-color-surface-hover);
    color: var(--s-color-text);
}
.notification-bell__button .material-icons-outlined {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}
.notification-bell__label {
    display: none;
}
.notification-bell__count {
    position: absolute;
    top: -0.4rem;
    right: -0.4rem;
    min-width: 1.25rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background-color: var(--s-color-danger);
    color: #fff;
    font-size: var(--s-font-size-xs);
    font-weight: var(--s-font-weight-semibold);
    line-height: 1.25rem;
    text-align: center;
}
/* Fixed to the window, under the bell (shell-bell.js / the bell partial put it there and cut its
   height to the room left), so it always fits the screen. A long list scrolls inside the panel. */
.notification-bell__panel {
    position: fixed;
    top: 4rem;
    right: var(--s-space-4);
    width: min(26rem, calc(100vw - var(--s-space-8)));
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: var(--s-color-surface);
    color: var(--s-color-text);
    border: 1px solid var(--s-color-border);
    border-radius: var(--s-radius-lg);
    box-shadow: var(--s-shadow-xl);
    padding: var(--s-space-3);
    z-index: var(--s-z-popover);
}
.notification-bell__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-space-2);
    margin-bottom: var(--s-space-2);
}
.notification-bell__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.notification-bell__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-space-2);
    padding: var(--s-space-2) 0;
    border-top: 1px solid var(--s-color-border);
}
.notification-bell__text {
    min-width: 0;
}
.notification-bell__text .muted {
    font-size: var(--s-font-size-xs);
}
.notification-bell__item .btn-icon {
    flex-shrink: 0;
}
.notification-bell__item form {
    margin: 0;
}
.notification-bell__open {
    border: none;
    background: none;
    padding: 0;
    text-align: left;
    color: var(--s-color-text);
    font: inherit;
    cursor: pointer;
}
.notification-bell__item.is-unread .notification-bell__open {
    font-weight: var(--s-font-weight-semibold);
}

/* ==========================================================================
   PAGE AREA
   The wide sidebar pushes the page aside rather than covering it.
   ========================================================================== */
.main-content {
    min-width: 0;
    padding: var(--s-space-5) var(--s-space-6) var(--s-space-8);
    transition: margin-left var(--s-transition-normal);
}
body.has-shell .main-content {
    margin-left: var(--shell-sidebar-width);
}
.main-content > .page-inner {
    max-width: var(--s-content-max-width);
    margin: 0 auto;
}
/* Every page of the signed-in app uses the full width of the screen (Nikhil,
   2026-10-17). Only the sign-in and registration pages, which have no shell,
   keep the centred column unless they ask for page-inner--full. */
body.has-shell .main-content > .page-inner,
.main-content > .page-inner.page-inner--full {
    max-width: none;
}

/* Page header pattern: h1 + muted subtitle */
.page-header {
    margin-bottom: var(--s-space-3);
}
.page-header h1 {
    margin-bottom: var(--s-space-1);
}

/* ---- The workspace's tabs, above the page ---- */
.workspace-bar {
    display: flex;
    flex-direction: column;
    gap: var(--s-space-2);
    margin-bottom: var(--s-space-5);
}
.workspace-tabs {
    margin-bottom: 0;
}
.workspace-views {
    align-self: flex-start;
}

/* ---- Breadcrumb: where the page is, above its heading ---- */
.crumbs {
    margin-bottom: var(--s-space-2);
    font-size: var(--s-font-size-sm);
    color: var(--s-color-text-secondary);
}
.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}
.crumbs li + li::before {
    content: "/";
    margin: 0 var(--s-space-2);
    color: var(--s-color-text-tertiary);
}
.crumbs a {
    color: var(--s-color-text-secondary);
    text-decoration: none;
}
.crumbs a:hover {
    color: var(--s-color-text);
    text-decoration: underline;
}
.crumbs li[aria-current] {
    color: var(--s-color-text);
    font-weight: var(--s-font-weight-medium);
}

/* ==========================================================================
   PHONE (≤ 768px): bottom bar; the sidebar slides in from Menu
   ========================================================================== */
.phone-bar,
.sidebar-scrim {
    display: none;
}

@media (max-width: 768px) {
    .sidebar {
        width: min(18rem, 85vw);
        left: calc(-1 * min(18rem, 85vw) - 1rem);
        transition: left var(--s-transition-normal);
        box-shadow: var(--s-shadow-xl);
    }
    .sidebar.is-open {
        left: 0;
    }
    .sidebar-edge {
        display: none;
    }
    .sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        border: 0;
        border-radius: 50%;
        background: none;
        color: var(--s-sidebar-text-hover);
        cursor: pointer;
    }
    /* In the slid-in menu everything shows its name. */
    .sidebar .sidebar-link .sidebar-resources__chevron,
    .sidebar .sidebar-wordmark,
    .sidebar .sidebar-group-label,
    .sidebar .sidebar-link-label {
        display: block;
    }
    .sidebar .sidebar-user-text {
        display: flex;
        flex-direction: column;
    }
    .sidebar .sidebar-link,
    .sidebar .sidebar-user-button {
        justify-content: flex-start;
        padding-left: var(--s-space-3);
        padding-right: var(--s-space-3);
    }
    .sidebar .sidebar-link::after {
        display: none;
    }
    .sidebar .sidebar-nav {
        overflow-y: auto;
    }
    .sidebar-user-menu {
        left: 0;
        right: 0;
        bottom: calc(100% + var(--s-space-2));
        width: auto;
    }
    .sidebar-scrim {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--s-transition-normal);
        z-index: calc(var(--s-z-sidebar) - 1);
    }
    .sidebar-scrim.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .phone-bar {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--shell-phone-bar-height) + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
        background: var(--s-color-surface);
        border-top: 1px solid var(--s-color-border);
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
        z-index: calc(var(--s-z-sidebar) - 2);
    }
    .phone-bar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: var(--s-space-1) 2px;
        border: 0;
        background: none;
        color: var(--s-color-text-secondary);
        text-decoration: none;
        font: inherit;
        cursor: pointer;
    }
    .phone-bar-item .material-icons-outlined {
        font-size: 24px;
        line-height: 1;
    }
    .phone-bar-label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: var(--s-font-size-xs);
        font-weight: var(--s-font-weight-medium);
    }
    .phone-bar-item.is-active {
        color: var(--s-color-accent-text);
    }
    .phone-bar-item--home .material-icons-outlined {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.25rem;
        height: 2.25rem;
        border-radius: 50%;
        background: var(--s-color-accent);
        color: #fff;
        font-size: 20px;
    }

    /* The one bell, pinned over the bar's fourth place. */
    .page-bell {
        position: fixed;
        top: auto !important;
        left: 60%;
        right: auto;
        width: 20%;
        bottom: env(safe-area-inset-bottom, 0px);
        height: var(--shell-phone-bar-height);
        z-index: calc(var(--s-z-sidebar) - 2);
    }
    .bell-gutter {
        padding-right: 0;
    }
    .page-bell .notification-bell__button {
        flex-direction: column;
        gap: 2px;
        width: 100%;
        height: var(--shell-phone-bar-height);
        border: 0;
        border-radius: 0;
        color: var(--s-color-text-secondary);
        background: none;
    }
    .page-bell .notification-bell__label {
        display: inline;
        font-size: var(--s-font-size-xs);
        font-weight: var(--s-font-weight-medium);
    }
    .page-bell .notification-bell__count {
        top: 0.3rem;
        right: auto;
        left: calc(50% + 4px);
    }
    .notification-bell__panel {
        left: var(--s-space-2);
        right: var(--s-space-2);
        top: auto;
        width: auto;
        bottom: calc(var(--shell-phone-bar-height) + env(safe-area-inset-bottom, 0px) + var(--s-space-2));
        max-height: calc(100vh - var(--shell-phone-bar-height) - var(--s-space-8));
    }

    body.has-shell .main-content {
        margin-left: 0;
        padding: var(--s-space-4) var(--s-space-3) calc(var(--shell-phone-bar-height) + env(safe-area-inset-bottom, 0px) + var(--s-space-6));
    }
}

@media print {
    .sidebar,
    .sidebar-scrim,
    .phone-bar,
    .workspace-bar,
    .page-bell,
    .toast-region {
        display: none !important;
    }
    body.has-shell .main-content {
        margin-left: 0;
        padding: 0;
    }
}

/* The bell's name: only on the phone bar, where it is short. */
.notification-bell__label-short {
    display: none;
}
@media (max-width: 768px) {
    .page-bell .notification-bell__label-long {
        display: none;
    }
    .page-bell .notification-bell__label-short {
        display: inline;
    }
}
