.shell-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100vh;
    padding: 12px;
    border-right: 1px solid var(--shell-line);
    background: var(--shell-chrome);
    transition: width 180ms ease;
}

.shell-nav {
    display: grid;
    gap: 4px;
}

.shell-nav-button,
.shell-chip-button,
.shell-action-button,
.shell-row-button,
.shell-inline-button {
    appearance: none;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
}

.shell-nav-button {
    display: grid;
    gap: 4px;
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--shell-radius-sm);
    text-align: left;
    background: transparent;
    color: var(--shell-text);
}

.shell-nav-button:hover,
.shell-nav-button.is-active {
    border-color: var(--shell-line);
    background: var(--shell-accent-soft);
}

.ui-app-sidebar__item:disabled {
    cursor: not-allowed;
    opacity: 0.52;
}

.ui-app-sidebar__item:disabled:hover {
    border-color: transparent;
    background: transparent;
}

.shell-nav-label {
    font-weight: 700;
}

.shell-nav-hint {
    font-size: 0.86rem;
    color: var(--shell-text-soft);
}

.shell-sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--shell-line);
    border-radius: var(--shell-radius);
    background: var(--shell-chrome);
}

.ui-app-sidebar__collapse-button {
    width: 100%;
    gap: 6px;
    justify-content: center;
}

.ui-app-sidebar__collapse-button svg {
    width: 18px;
    height: 18px;
}

.app-shell-user-menu {
    position: relative;
    min-width: 0;
}

.app-shell-user-menu__button {
    appearance: none;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 16px;
    gap: 9px;
    align-items: center;
    width: 100%;
    min-height: 46px;
    padding: 5px 8px 5px 5px;
    border: 1px solid transparent;
    border-radius: var(--shell-radius-sm);
    background: transparent;
    color: var(--shell-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.app-shell-user-menu__button:hover,
.app-shell-user-menu__button:focus-visible,
.app-shell-user-menu.is-open .app-shell-user-menu__button {
    border-color: var(--shell-line-strong);
    background: var(--shell-control);
    outline: none;
}

.app-shell-user-menu__avatar {
    width: 36px;
    height: 36px;
    font-size: 0.8rem;
}

.app-shell-user-menu__identity {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.app-shell-user-menu__name,
.app-shell-user-menu__email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell-user-menu__name {
    color: var(--shell-text);
    font-size: 0.86rem;
    font-weight: 700;
}

.app-shell-user-menu__email {
    color: var(--shell-text-soft);
    font-size: 0.74rem;
}

.app-shell-user-menu__button svg {
    width: 15px;
    height: 15px;
    color: var(--shell-text-soft);
}

.app-shell-user-menu__dropdown {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    z-index: 60;
    display: grid;
    gap: 4px;
    width: 100%;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--shell-line-strong);
    border-radius: var(--shell-radius);
    background: var(--shell-panel-strong);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.app-shell-user-menu__dropdown button {
    appearance: none;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 36px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: var(--shell-radius-sm);
    background: transparent;
    color: var(--shell-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.app-shell-user-menu__dropdown button:hover,
.app-shell-user-menu__dropdown button:focus-visible {
    border-color: var(--shell-line);
    background: var(--shell-control);
    outline: none;
}

.app-shell-user-menu__dropdown svg {
    width: 16px;
    height: 16px;
    color: var(--shell-text-soft);
}

.shell-main {
    min-width: 0;
}

.shell-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: var(--shell-header-height);
    padding: 10px 14px;
    border-bottom: 1px solid var(--shell-line);
    background: color-mix(in srgb, var(--shell-chrome) 94%, transparent);
    backdrop-filter: blur(10px);
}

.shell-header-main {
    min-width: 0;
}

.ui-top-navigation-bar__title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

.shell-header-title {
    margin: 0;
    font-size: 1.18rem;
}

.shell-header-subtitle {
    margin: 3px 0 0;
    font-size: 0.86rem;
    color: var(--shell-text-soft);
}

.shell-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.shell-select {
    min-width: 220px;
    padding: 8px 10px;
    border: 1px solid var(--shell-line-strong);
    border-radius: var(--shell-radius-sm);
    background: var(--shell-control);
    color: var(--shell-text);
    font: inherit;
}

.app_shell_project_selector {
    position: relative;
    width: min(280px, 38vw);
}

.app_shell_project_selector__button,
.app_shell_project_selector__option {
    appearance: none;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-height: 44px;
    border: 1px solid color-mix(in srgb, var(--shell-line-strong) 72%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--shell-control) 82%, #05070a 18%);
    color: var(--shell-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.app_shell_project_selector__button {
    grid-template-columns: 34px minmax(0, 1fr) 28px auto;
}

.app_shell_project_selector__button {
    padding: 5px 9px 5px 5px;
}

.app_shell_project_selector__button:hover,
.app_shell_project_selector__button:focus-visible,
.app_shell_project_selector__option:hover,
.app_shell_project_selector__option:focus-visible {
    border-color: var(--shell-accent);
    background: color-mix(in srgb, var(--shell-control) 88%, var(--shell-accent) 12%);
    outline: none;
}

.app_shell_project_selector__thumb,
.app_shell_project_selector__option_thumb {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    overflow: hidden;
    border: 1px solid var(--shell-line);
    border-radius: 6px;
    background:
        radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--shell-accent) 20%, transparent), transparent 34%),
        linear-gradient(135deg, color-mix(in srgb, var(--shell-panel-strong) 72%, #111827 28%), color-mix(in srgb, var(--shell-accent) 8%, #0f172a 92%));
}

.app_shell_project_selector__option_thumb {
    width: 34px;
    height: 34px;
}

.app_shell_project_selector__thumb img,
.app_shell_project_selector__option_thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.app_shell_project_selector__thumb.is-placeholder::after,
.app_shell_project_selector__option_thumb.is-placeholder::after {
    content: none;
}

.app_shell_project_selector__thumb.is-placeholder svg,
.app_shell_project_selector__option_thumb.is-placeholder svg {
    width: 17px;
    height: 17px;
    color: color-mix(in srgb, var(--shell-text-soft) 78%, white 22%);
}

.app_shell_project_selector__name,
.app_shell_project_selector__option_name,
.app_shell_project_selector__option_status {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app_shell_project_selector__name,
.app_shell_project_selector__option_name {
    font-weight: 700;
}

.app_shell_project_selector__chevron {
    display: inline-flex;
    color: var(--shell-text-soft);
}

.app_shell_project_selector__chevron svg {
    width: 16px;
    height: 16px;
}

.app_shell_project_selector.is-open .app_shell_project_selector__chevron {
    transform: rotate(180deg);
}

.app_shell_project_selector.is-static .app_shell_project_selector__button {
    cursor: default;
}

.app_shell_project_selector.is-static .app_shell_project_selector__button:hover,
.app_shell_project_selector.is-static .app_shell_project_selector__button:focus-visible {
    border-color: color-mix(in srgb, var(--shell-line-strong) 72%, transparent);
    background: color-mix(in srgb, var(--shell-control) 82%, #05070a 18%);
}

.app_shell_project_selector.is-static .app_shell_project_selector__chevron {
    display: none;
}

.app_shell_project_selector__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    display: grid;
    gap: 4px;
    width: max(100%, 300px);
    max-height: min(360px, 70vh);
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--shell-line-strong);
    border-radius: 8px;
    background: var(--shell-panel-strong);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.app_shell_project_selector__option {
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    min-height: 46px;
    padding: 5px 8px 5px 5px;
    border-color: transparent;
    background: transparent;
}

.app_shell_project_selector__option.is-selected {
    border-color: var(--shell-accent);
    background: color-mix(in srgb, var(--shell-control) 88%, var(--shell-accent) 12%);
}

.app_shell_project_selector__option_text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.app_shell_project_selector__option_status {
    color: var(--shell-text-soft);
    font-size: 0.76rem;
    text-transform: uppercase;
}

.app_shell_project_selector__option_access {
    display: inline-grid;
    place-items: center;
    justify-self: end;
    width: 26px;
    height: 26px;
    border: 1px solid color-mix(in srgb, var(--shell-line) 76%, transparent);
    border-radius: 7px;
    background: color-mix(in srgb, var(--shell-control) 72%, transparent);
    color: var(--shell-text-soft);
}

.app_shell_project_selector__option_access svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
}

.app_shell_project_selector__option_access.is-viewer {
    color: #91a7bf;
}

.app_shell_project_selector__option_access.is-editor {
    border-color: color-mix(in srgb, var(--shell-accent) 34%, transparent);
    background: color-mix(in srgb, var(--shell-accent-soft) 76%, transparent);
    color: color-mix(in srgb, var(--shell-accent) 72%, white 28%);
}

.app_shell_project_selector__option_access.is-owner {
    border-color: color-mix(in srgb, var(--shell-success) 38%, transparent);
    background: color-mix(in srgb, var(--shell-success) 13%, transparent);
    color: color-mix(in srgb, var(--shell-success) 72%, white 28%);
}

.app_shell_project_selector__option_access.is-public {
    border-color: color-mix(in srgb, var(--shell-accent) 36%, transparent);
    background: color-mix(in srgb, var(--shell-accent-soft) 70%, transparent);
    color: color-mix(in srgb, var(--shell-accent) 70%, white 30%);
}

.app_shell_project_selector__button_access {
    justify-self: center;
}

.app_shell_project_selector__empty {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--shell-line);
    border-radius: 7px;
    color: var(--shell-text-soft);
    background: var(--shell-control);
}

:root[data-theme="light"] .app_shell_project_selector__button,
:root[data-theme="light"] .app_shell_project_selector__option {
    border-color: var(--m2p-border-subtle);
    background: var(--m2p-bg-surface);
}

:root[data-theme="light"] .app_shell_project_selector__button:hover,
:root[data-theme="light"] .app_shell_project_selector__button:focus-visible,
:root[data-theme="light"] .app_shell_project_selector__option:hover,
:root[data-theme="light"] .app_shell_project_selector__option:focus-visible,
:root[data-theme="light"] .app_shell_project_selector__option.is-selected {
    border-color: var(--m2p-accent);
    background: var(--m2p-accent-soft);
}

:root[data-theme="light"] .app_shell_project_selector__thumb,
:root[data-theme="light"] .app_shell_project_selector__option_thumb {
    background:
        radial-gradient(circle at 25% 20%, color-mix(in srgb, var(--m2p-accent) 14%, transparent), transparent 34%),
        linear-gradient(135deg, var(--m2p-bg-surface-muted), var(--m2p-bg-surface));
}

:root[data-theme="light"] .app_shell_project_selector__menu {
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

:root[data-theme="light"] .app_shell_project_selector__option_access.is-viewer {
    color: var(--m2p-text-muted);
}

:root[data-theme="light"] .app_shell_project_selector.is-static .app_shell_project_selector__button:hover,
:root[data-theme="light"] .app_shell_project_selector.is-static .app_shell_project_selector__button:focus-visible {
    border-color: var(--m2p-border-subtle);
    background: var(--m2p-bg-surface);
}

