body.has-modal-dialog {
    overflow: hidden;
}

.lp-root {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(43, 99, 181, 0.11), transparent 26%),
        linear-gradient(180deg, var(--md-sys-color-surface-container-lowest), var(--md-sys-color-background) 46%);
}

.workspace-bar,
.sidebar,
.topbar,
.shell-menu,
.auth-card,
.feature-card,
.popup-modal__dialog,
.md-dialog,
.toast {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.shell {
    min-height: 100vh;
    width: 100%;
    background: transparent;
}

.workspace-bar {
    position: sticky;
    top: 0;
    z-index: 320;
    height: var(--workspace-bar-height);
    padding: 0 24px;
    background: var(--workspace-bar-bg);
    border-bottom: 1px solid var(--workspace-bar-border);
    color: var(--md-sys-color-on-surface);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.workspace-bar__left,
.workspace-bar__right {
    gap: 16px;
}

.workspace-brand {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: auto;
    height: auto;
    min-width: 0;
    color: var(--md-sys-color-on-surface);
}

.workspace-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-sys-elevation-level1);
}

.workspace-brand__mark svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workspace-brand__label {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    letter-spacing: 0;
}

.workspace-switcher-wrap,
.workspace-menu-wrap {
    position: relative;
}

.workspace-switcher,
.workspace-bar__help,
.workspace-bar__account,
.workspace-bar__icon-btn,
.sidebar-mobile-toggle,
.sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface-variant);
    box-shadow: var(--md-sys-elevation-level0);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.workspace-switcher {
    min-width: 0;
    padding-inline: 18px 14px;
    color: var(--md-sys-color-on-surface);
}

.workspace-switcher:hover,
.workspace-switcher[aria-expanded="true"],
.workspace-bar__help:hover,
.workspace-bar__account:hover,
.workspace-bar__account[aria-expanded="true"],
.workspace-bar__icon-btn:hover,
.workspace-bar__icon-btn[aria-expanded="true"],
.sidebar-mobile-toggle:hover,
.sidebar-toggle:hover {
    background: var(--md-sys-color-surface-container);
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-level1);
}

.workspace-switcher:active,
.workspace-bar__help:active,
.workspace-bar__account:active,
.workspace-bar__icon-btn:active,
.sidebar-mobile-toggle:active,
.sidebar-toggle:active {
    transform: translateY(1px);
}

.workspace-switcher__name {
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--md-sys-typescale-body-medium-size);
    font-weight: 500;
}

.workspace-switcher__icon {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-left: 2px;
    border-radius: var(--md-sys-shape-corner-full);
    color: var(--md-sys-color-on-surface-variant);
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.workspace-switcher[aria-expanded="true"] .workspace-switcher__icon {
    transform: rotate(180deg);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.workspace-bar__account[aria-expanded="true"] .workspace-bar__account-icon {
    transform: rotate(180deg);
}

.workspace-switcher__icon svg,
.workspace-bar__help svg,
.workspace-bar__account-icon svg,
.workspace-bar__icon-btn svg,
.sidebar-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workspace-bar__help {
    padding-inline: 16px;
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 500;
}

.workspace-bar__help span {
    white-space: nowrap;
}

.workspace-bar__account {
    justify-content: flex-start;
    min-width: 0;
    max-width: min(280px, 28vw);
    padding: 4px 12px 4px 6px;
    color: var(--md-sys-color-on-surface);
}

.workspace-bar__account-avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 700;
}

.workspace-bar__account-copy {
    display: grid;
    min-width: 0;
    text-align: left;
    line-height: 1.15;
}

.workspace-bar__account-label {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-bar__account-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 600;
}

.workspace-bar__account-icon {
    display: inline-flex;
    flex: 0 0 auto;
    color: var(--md-sys-color-on-surface-variant);
    transition: transform 0.18s ease;
}

.workspace-bar__icon-btn,
.sidebar-mobile-toggle,
.sidebar-toggle {
    min-width: 40px;
    padding-inline: 8px;
}

.workspace-bar__menu-toggle {
    display: none;
}

.global-search {
    position: relative;
    z-index: 2;
    flex: 1 1 520px;
    max-width: 560px;
    min-width: 240px;
}

.global-search__box {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface-variant);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.global-search__box:focus-within {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-surface-container-lowest);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--md-sys-color-primary) 12%, transparent);
}

.global-search__icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
}

.global-search__icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.global-search input {
    min-width: 0;
    flex: 1 1 auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    font: inherit;
    font-size: var(--md-sys-typescale-body-medium-size);
}

.global-search input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.global-search__shortcut {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    border-radius: var(--md-sys-shape-corner-small);
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.8rem;
    font-weight: 700;
}

.global-search__panel {
    position: absolute;
    inset: calc(100% + 10px) 0 auto;
    overflow: hidden;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
    background: var(--md-sys-color-surface-container-lowest);
    box-shadow: var(--md-sys-elevation-level3);
}

.global-search__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.global-search__header strong {
    color: var(--md-sys-color-on-surface);
    font-size: var(--md-sys-typescale-label-large-size);
}

.global-search__header span {
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-label-small-size);
}

.global-search__results {
    display: grid;
    max-height: min(480px, calc(100vh - 110px));
    overflow-y: auto;
    padding: 8px;
}

.global-search-result {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    text-align: left;
    cursor: pointer;
}

.global-search-result:hover,
.global-search-result:focus-visible {
    outline: 0;
    background: var(--md-sys-color-secondary-container);
}

.global-search-result__icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.global-search-result__body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.global-search-result__body strong,
.global-search-result__body small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.global-search-result__body small {
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-small-size);
}

.global-search-result__meta {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border-radius: var(--md-sys-shape-corner-full);
    padding: 5px 9px;
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-label-small-size);
    font-weight: 700;
}

.global-search__empty {
    padding: 18px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-medium-size);
}

@media (max-width: 1180px) {
    .global-search {
        max-width: 420px;
    }

    .global-search__shortcut,
    .global-search-result__meta {
        display: none;
    }
}

.sidebar-mobile-toggle__icon {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}

.sidebar-mobile-toggle__icon span {
    width: 18px;
    height: 2px;
    border-radius: var(--md-sys-shape-corner-full);
    background: currentColor;
}

.shell-body {
    display: grid;
    grid-template-columns: minmax(216px, var(--sidebar-width)) minmax(0, 1fr);
    min-height: calc(100vh - var(--workspace-bar-height));
    width: 100%;
    background: transparent;
    align-items: start;
}

.shell-scrim {
    position: fixed;
    inset: var(--workspace-bar-height) 0 0;
    z-index: 250;
    border: 0;
    background: var(--md-sys-color-scrim);
}

.shell-scrim[hidden] {
    display: none !important;
}

.sidebar {
    position: sticky;
    top: var(--workspace-bar-height);
    align-self: start;
    height: calc(100vh - var(--workspace-bar-height));
    padding: 8px 6px 12px;
    gap: 8px;
    background: var(--workspace-sidebar-bg);
    border-right: 1px solid var(--workspace-sidebar-line);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.5);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.sidebar-mobile-head {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 10px 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.sidebar-mobile-head__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sidebar-mobile-head__copy strong {
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: 600;
}

.sidebar-mobile-head__copy span {
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-small-size);
}

.nav-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group__label {
    padding: 0 10px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav-group__items {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nav-item,
.nav-branch__summary,
.nav-branch__children a {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 36px;
    padding: 0 10px;
    border-radius: var(--md-sys-shape-corner-full);
    color: var(--md-sys-color-on-surface);
    font-size: var(--md-sys-typescale-body-medium-size);
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-item:hover,
.nav-branch__summary:hover,
.nav-branch__children a:hover {
    background: var(--md-sys-color-surface-container);
}

.nav-item.active,
.nav-branch.is-active > .nav-branch__summary,
.nav-branch__children a.active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.nav-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    color: inherit;
}

.nav-link__icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-link__label {
    min-width: 0;
    flex: 1 1 auto;
}

.main-shell {
    min-width: 0;
    width: 100%;
    padding: 12px 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
    padding: 0 0 8px;
    border: 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.topbar-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: baseline;
    column-gap: 10px;
    row-gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
    width: auto;
}

.topbar-copy__title-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    width: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: baseline;
    width: max-content;
    max-width: 100%;
    min-height: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar-copy h2 {
    margin: 0;
    flex: 0 0 auto;
    font-size: clamp(1.15rem, 1.5vw, 1.38rem);
    line-height: 1.14;
    letter-spacing: -0.02em;
    font-weight: 500;
}

.topbar-title-input {
    width: min(360px, 36vw);
    min-width: 120px;
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.topbar-title-input:focus {
    outline: 0;
    box-shadow: 0 2px 0 var(--md-sys-color-primary);
}

.topbar-copy p {
    margin: 0;
    min-width: 0;
    max-width: min(64ch, 100%);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.86rem;
    line-height: 1.2;
}

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

.topbar-custom-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.topbar-custom-actions[hidden] {
    display: none;
}

.topbar-builder-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-builder-actions .journey-status-select {
    min-height: 34px;
    border-radius: 10px;
}

.topbar-builder-actions .btn {
    min-height: 36px;
}

.topbar-builder-actions .btn--icon-only {
    width: 38px;
    min-width: 38px;
    padding-inline: 0;
}

.topbar-builder-actions .btn--icon-only svg {
    width: 19px;
    height: 19px;
}

.broadcast-topbar-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    max-width: min(48vw, 680px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.broadcast-topbar-title__crumb {
    border: 0;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Consolas, monospace);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
    padding: 0;
    text-transform: uppercase;
    cursor: pointer;
}

.broadcast-topbar-title__crumb:hover,
.broadcast-topbar-title__crumb:focus-visible {
    color: var(--md-sys-color-primary);
}

.broadcast-topbar-title__crumb:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 4px;
    border-radius: 6px;
}

.broadcast-topbar-title__separator {
    color: var(--md-sys-color-outline);
    font-size: 0.9rem;
    font-weight: 500;
}

.broadcast-topbar-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.broadcast-topbar-actions .btn {
    min-height: 38px;
}

.topbar-actions .btn {
    min-height: 34px;
    padding: 0 14px;
    border-radius: var(--md-sys-shape-corner-full);
    box-shadow: var(--md-sys-elevation-level0);
}

.topbar-actions .btn--primary {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.page-content,
.view-mount {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    min-width: 0;
    max-width: none;
    align-items: stretch;
}

.btn,
.shell-menu__footer-link,
.popup-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-primary);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 500;
    letter-spacing: 0.01em;
    box-shadow: var(--md-sys-elevation-level0);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.btn:hover,
.shell-menu__footer-link:hover,
.popup-modal__close:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

.btn:active,
.shell-menu__footer-link:active,
.popup-modal__close:active {
    transform: translateY(1px);
}

.btn:disabled,
.shell-menu__footer-link:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn svg,
.popup-modal__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn--primary {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.btn--primary:hover {
    box-shadow: var(--md-sys-elevation-level2);
}

.btn--ghost,
.btn--outlined {
    background: transparent;
    border-color: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-primary);
}

.btn--ghost:hover,
.btn--outlined:hover {
    background: rgba(43, 99, 181, 0.06);
    border-color: var(--md-sys-color-outline);
}

.btn--soft,
.btn--tonal {
    background: var(--md-sys-color-secondary-container);
    border-color: transparent;
    color: var(--md-sys-color-on-secondary-container);
}

.btn--text {
    background: transparent;
    border-color: transparent;
    padding-inline: 12px;
    color: var(--md-sys-color-primary);
}

.btn--text:hover {
    background: rgba(43, 99, 181, 0.06);
}

.btn--elevated {
    background: var(--md-sys-color-surface-container-lowest);
    border-color: transparent;
    box-shadow: var(--md-sys-elevation-level1);
}

.btn--icon {
    display: inline-flex;
    align-items: center;
}

.btn--icon-only,
.workspace-bar__icon-btn,
.sidebar-mobile-toggle,
.sidebar-toggle {
    min-width: 40px;
    padding-inline: 8px;
}

.btn--danger.btn--primary,
.btn--danger.btn--tonal,
.btn--danger.btn--soft {
    background: var(--md-sys-color-error);
    border-color: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
}

.btn--danger.btn--ghost,
.btn--danger.btn--outlined,
.btn--danger.btn--text,
.shell-menu__action--danger {
    color: var(--md-sys-color-error);
    border-color: rgba(186, 26, 26, 0.2);
}

.button-row,
.object-form-actions,
.auth-passkey-modal__actions,
.auth-password-required-modal__actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.field > span,
.field__legend,
.checkbox-row span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-label-medium-size);
    font-weight: 500;
    letter-spacing: 0.02em;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    min-height: 56px;
    padding: 16px;
    border-radius: var(--md-sys-shape-corner-large);
    border: 1px solid var(--md-sys-color-outline);
    background: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field textarea {
    min-height: 128px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #7a8292;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(43, 99, 181, 0.12);
}

.field select {
    appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--md-sys-color-on-surface-variant) 50%),
        linear-gradient(135deg, var(--md-sys-color-on-surface-variant) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 3px),
        calc(100% - 12px) calc(50% - 3px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.field--code textarea {
    background: #16202d;
    border-color: #374151;
    color: #eff3ff;
    box-shadow: none;
}

.field--code textarea::placeholder {
    color: #8ca0ba;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-large);
    background: var(--md-sys-color-surface-container-lowest);
}

.checkbox-row input,
.radio-card input {
    accent-color: var(--md-sys-color-primary);
}

.checkbox-row input[type="checkbox"],
.radio-card input[type="radio"] {
    box-sizing: border-box;
    inline-size: 18px;
    block-size: 18px;
    min-inline-size: 18px;
    min-block-size: 18px;
    flex: 0 0 18px;
    padding: 0;
    transform: none;
}

.field--radio-group {
    margin: 0;
    padding: 0;
    border: 0;
}

.radio-card-grid {
    display: grid;
    gap: 12px;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
    background: var(--md-sys-color-surface-container-lowest);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.radio-card:has(input:checked),
.radio-card.is-selected {
    background: var(--md-sys-color-secondary-container);
    border-color: var(--md-sys-color-primary);
    box-shadow: inset 0 0 0 1px var(--md-sys-color-primary);
}

.radio-card__body small {
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.5;
}

.field-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid rgba(43, 99, 181, 0.18);
    border-radius: var(--md-sys-shape-corner-full);
    background: rgba(43, 99, 181, 0.08);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    box-shadow: none;
}

.field-tip:hover,
.field-tip:focus-visible {
    border-color: var(--md-sys-color-primary);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    outline: none;
}

.field-tip .icon-inline {
    display: inline-flex;
    width: 12px;
    height: 12px;
    flex: 0 0 12px;
}

.field-tip svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.field-tip__glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: currentColor;
    font-size: 0 !important;
    font-weight: 700;
    line-height: 1;
    overflow: hidden;
}

.field-tip__glyph::before {
    content: "i";
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    transform: translateY(-0.5px);
}

.notice {
    margin-bottom: 20px;
    padding: 14px 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 16px;
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-on-surface-variant);
}

.notice--info {
    background: var(--md-sys-color-surface-container);
}

.notice--success {
    background: #e7f7ec;
    border-color: #b9dec3;
    color: #1f6f43;
}

.notice--error {
    background: var(--md-sys-color-error-container);
    border-color: #efb8b0;
    color: var(--md-sys-color-on-error-container);
}

.app-fatal {
    position: fixed;
    inset: 24px 24px auto;
    z-index: 8000;
    max-width: min(640px, calc(100vw - 48px));
    padding: 20px 22px;
    border: 1px solid #efb8b0;
    border-radius: 24px;
    background: rgba(255, 247, 246, 0.96);
    color: var(--md-sys-color-on-error-container);
    box-shadow: var(--md-sys-elevation-level4);
}

.app-fatal h1 {
    margin: 0 0 8px;
    font-size: 1.35rem;
    line-height: 1.2;
}

.app-fatal p {
    margin: 0;
    line-height: 1.6;
}

.app-tooltip {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 5000;
    max-width: min(360px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    font-size: 12px;
    line-height: 1.5;
    box-shadow: var(--md-sys-elevation-level3);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.app-tooltip::after {
    content: "";
    position: absolute;
    left: var(--tooltip-arrow-left, 24px);
    width: 10px;
    height: 10px;
    background: var(--md-sys-color-inverse-surface);
    transform: translateX(-50%) rotate(45deg);
}

.app-tooltip[data-placement="top"]::after {
    top: calc(100% - 5px);
}

.app-tooltip[data-placement="bottom"]::after {
    bottom: calc(100% - 5px);
}

.app-tooltip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(430px, 0.95fr);
    background:
        linear-gradient(90deg, #071d35 0 52%, #ffffff 52% 100%);
}

.auth-hero {
    display: flex;
    align-items: stretch;
    min-height: 100vh;
    padding: clamp(36px, 4.4vw, 62px);
    border-right: 0;
    background:
        radial-gradient(circle at 70% 14%, rgba(37, 99, 235, 0.28), transparent 34%),
        radial-gradient(circle at 52% 48%, rgba(15, 63, 125, 0.38), transparent 42%),
        linear-gradient(145deg, #071d35 0%, #061a31 52%, #04152a 100%);
    color: #ffffff;
}

.auth-hero__inner {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-lockup--logo {
    align-items: center;
}

.brand-logo {
    display: block;
    width: clamp(180px, 22vw, 224px);
    height: auto;
}

.auth-brand-lockup {
    gap: 16px;
}

.auth-brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
}

.auth-brand-name {
    color: #ffffff;
    font-size: clamp(1.45rem, 2vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.045em;
}

.brand-mark {
    width: 60px;
    height: 60px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    color: var(--md-sys-color-on-primary-container);
    background: linear-gradient(180deg, var(--md-sys-color-primary-container), rgba(255, 255, 255, 0.96));
    box-shadow: var(--md-sys-elevation-level1);
}

.brand-mark svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.brand-lockup h1 {
    margin: 0;
    font-size: var(--md-sys-typescale-title-large-size);
}

.brand-lockup p {
    margin: 4px 0 0;
    color: var(--md-sys-color-on-surface-variant);
}

.auth-copy {
    max-width: 760px;
    margin: clamp(132px, 23vh, 230px) 0 0;
}

.auth-copy .eyebrow {
    margin-bottom: 18px;
}

.auth-copy h2 {
    margin: 0 0 18px;
    max-width: 760px;
    color: #ffffff;
    font-size: clamp(2.25rem, 3.75vw, 3.35rem);
    line-height: 1.16;
    letter-spacing: -0.055em;
    font-weight: 750;
}

.auth-copy p {
    margin: 0;
    max-width: 680px;
    color: rgba(226, 236, 250, 0.68);
    font-size: clamp(1rem, 1.24vw, 1.18rem);
    line-height: 1.58;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: clamp(36px, 5.4vh, 58px);
}

.feature-card {
    display: flex;
    min-height: 118px;
    flex-direction: column;
    gap: 8px;
    padding: 18px;
    border: 1px solid rgba(190, 209, 235, 0.22);
    border-radius: 10px;
    background: rgba(9, 31, 56, 0.74);
    box-shadow: none;
    color: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.auth-feature-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #6ea8ff;
}

.auth-feature-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.85;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-card strong {
    display: block;
    margin: 6px 0 0;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.25;
}

.feature-card p {
    margin: 0;
    color: rgba(226, 236, 250, 0.62);
    font-size: var(--md-sys-typescale-body-small-size);
    line-height: 1.45;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: clamp(24px, 4.2vw, 58px);
    background: #ffffff;
}

.auth-card {
    width: min(510px, 100%);
    background: #ffffff;
    border: 1px solid #c8ccd6;
    border-radius: 10px;
    box-shadow: none;
    overflow: hidden;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 28px 30px 0;
    background: transparent;
    border-bottom: 1px solid #cfd3dc;
}

.auth-tab {
    position: relative;
    min-height: 48px;
    padding: 0 14px 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #1f2937;
    font-size: 1.02rem;
    font-weight: 500;
    box-shadow: none;
}

.auth-tab.active {
    background: transparent;
    color: #0f172a;
    box-shadow: none;
}

.auth-tab.active::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: var(--md-sys-color-primary);
}

.auth-body {
    padding: 28px 30px 30px;
}

.auth-body h3 {
    margin: 0 0 8px;
    color: #111827;
    font-size: clamp(1.45rem, 2.2vw, 1.7rem);
    line-height: 1.16;
    letter-spacing: -0.04em;
}

.auth-body p {
    margin: 0 0 18px;
    color: #4b5563;
    line-height: 1.55;
}

.auth-body .notice.notice--info.auth-notice--idle {
    display: none;
}

.auth-body .notice:not(.notice--info) {
    margin-bottom: 16px;
    border-radius: 8px;
}

.auth-body .form-stack {
    gap: 16px;
}

.auth-body .field {
    gap: 8px;
}

.auth-body .field > span {
    color: #1f2937;
    font-size: 0.98rem;
    font-weight: 500;
}

.auth-body .field input,
.auth-body .field select,
.auth-body .field textarea {
    min-height: 48px;
    border-radius: 7px;
    border-color: #c8ccd6;
    background: #f4f5fb;
    color: #111827;
    font-size: 1rem;
}

.auth-body .field input:focus,
.auth-body .field select:focus,
.auth-body .field textarea:focus {
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(43, 99, 181, 0.13);
}

#signupPane .form-stack {
    gap: 11px;
}

#signupPane .field {
    gap: 5px;
}

#signupPane .field > span {
    font-size: 0.9rem;
}

#signupPane .field input {
    min-height: 42px;
    padding-block: 9px;
}

#signupPane .button-row {
    margin-top: 2px;
}

#signupPane .password-rules {
    margin-top: 0;
    padding: 10px 12px;
    border-radius: 13px;
}

#signupPane .password-rules__title {
    margin-bottom: 7px;
    font-size: 0.64rem;
    letter-spacing: 0.14em;
}

#signupPane .password-rules__list {
    gap: 6px 12px;
}

#signupPane .password-rules__item {
    min-height: 18px;
    gap: 7px;
    font-size: 0.82rem;
}

#signupPane .password-rules__icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
}

.auth-stepbar,
.auth-identity-row,
.auth-passkey-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-step-pill,
.auth-identity-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: #64748b;
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 650;
}

.auth-step-pill {
    display: none;
}

.auth-identity-chip {
    padding: 5px 10px;
    border: 1px solid #d5dae6;
    border-radius: 999px;
    background: #f8fafc;
    color: #334155;
}

.auth-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--md-sys-color-primary);
    font-weight: 500;
}

.auth-inline-note,
.auth-form-note {
    color: #64748b;
    font-size: var(--md-sys-typescale-body-small-size);
    line-height: 1.45;
}

.auth-form-note {
    margin-top: 2px;
}

.auth-passkey-stage,
.auth-password-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-password-reset-link {
    align-self: flex-start;
}

.auth-password-reset-modal {
    width: min(560px, calc(100vw - 32px));
}

.auth-password-reset-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.auth-reset-actions {
    justify-content: flex-start;
}

.auth-reset-actions .btn {
    min-height: 40px;
}

.auth-modal-x {
    min-width: 0;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #b91c1c;
    box-shadow: none;
    font-size: 1.45rem;
    line-height: 1;
}

.auth-modal-x:hover {
    background: rgba(185, 28, 28, 0.08);
}

.auth-passkey-copy__meta strong {
    display: block;
    color: #111827;
    font-size: 0.98rem;
    font-weight: 700;
}

.auth-passkey-copy__meta p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
}

.auth-passkey-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid #d5dae6;
    border-radius: 12px;
    background: #f8fafc;
}

.auth-passkey-card__icon {
    display: inline-grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 14px;
    background: #e8f0ff;
    color: var(--md-sys-color-primary);
}

.auth-passkey-card__icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.auth-passkey-card .auth-passkey-copy {
    display: grid;
    justify-content: stretch;
    gap: 8px;
}

.auth-passkey-card .auth-identity-chip {
    width: fit-content;
}

.auth-passkey-visual,
.auth-passkey-visual--modal {
    border-radius: 10px;
    border: 1px solid #d5dae6;
    background:
        radial-gradient(circle at top, rgba(43, 99, 181, 0.18), transparent 46%),
        linear-gradient(180deg, rgba(232, 238, 255, 0.92), rgba(249, 250, 255, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.auth-login-step__actions .btn,
#signupPane .button-row .btn {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    border-radius: 999px;
    font-size: 1rem;
}

#signupPane .button-row .btn {
    min-height: 48px;
}

.shell-menu {
    position: absolute;
    box-sizing: border-box;
    top: calc(100% + 12px);
    min-width: 248px;
    padding: 12px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 28px;
    background: var(--md-sys-color-surface-container-lowest);
    color: var(--md-sys-color-on-surface);
    box-shadow: var(--md-sys-elevation-level4);
    z-index: 340;
    opacity: 1;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.shell-menu--workspace {
    left: 0;
    top: calc(100% + 6px);
    width: min(320px, calc(100vw - 24px));
    padding: 10px;
    border-radius: 22px;
}

.shell-menu--workspace::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 42px;
    width: 12px;
    height: 12px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    border-left: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-lowest);
    transform: rotate(45deg);
}

.shell-menu--account {
    right: 0;
    top: calc(100% + 6px);
    width: min(300px, calc(100vw - 24px));
    padding: 10px;
    border-radius: 22px;
}

.shell-menu--account::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 46px;
    width: 12px;
    height: 12px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    border-left: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-lowest);
    transform: rotate(45deg);
}

.shell-menu__label {
    padding: 0 12px 8px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-label-small-size);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shell-menu__label--with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px 8px;
}

.shell-menu__label-icon,
.shell-menu__workspace-icon {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--md-sys-color-primary);
}

.shell-menu__label-icon {
    width: 24px;
    height: 24px;
    border-radius: 9px;
    background: var(--md-sys-color-primary-container);
}

.shell-menu__label-icon svg,
.shell-menu__workspace-icon svg,
.shell-menu__footer-link svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.shell-menu__divider {
    margin: 8px 0;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.shell-menu__profile {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 2px 12px 6px;
}

.shell-menu__account-card {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}

.shell-menu__account-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--md-sys-color-primary) 14%, var(--md-sys-color-surface-container-lowest));
    color: var(--md-sys-color-on-primary-container);
    font-size: 0.94rem;
    font-weight: 700;
}

.shell-menu__account-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.shell-menu__account-name {
    overflow: hidden;
    color: var(--md-sys-color-on-primary-container);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-menu__account-meta {
    overflow: hidden;
    color: color-mix(in srgb, var(--md-sys-color-on-primary-container) 76%, transparent);
    font-size: 0.78rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-menu__profile-avatar {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    font-size: 0.95rem;
    font-weight: 700;
}

.shell-menu__profile-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.shell-menu__profile-name {
    color: var(--md-sys-color-on-surface);
    font-size: var(--md-sys-typescale-body-large-size);
    font-weight: 600;
}

.shell-menu__identity,
.shell-menu__headline,
.shell-menu__status {
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-small-size);
}

.shell-menu__status--error {
    color: var(--md-sys-color-error);
}

.shell-menu__workspace-list,
.shell-menu__footer-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shell-menu__footer-actions {
    gap: 4px;
    padding: 0 4px 2px;
}

.shell-menu__account-actions {
    padding-inline: 2px;
}

.shell-menu__workspace-card {
    display: grid;
    box-sizing: border-box;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 16px;
    background: var(--md-sys-color-surface-container-lowest);
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.shell-menu__workspace-card:hover:not(:disabled) {
    background: var(--md-sys-color-surface-container-low);
    box-shadow: none;
    transform: none;
}

.shell-menu__workspace-card--current {
    background: var(--md-sys-color-primary-container);
    border-color: transparent;
}

.shell-menu__workspace-icon {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: var(--md-sys-color-surface-container-high);
}

.shell-menu__workspace-card--current .shell-menu__workspace-icon {
    background: color-mix(in srgb, var(--md-sys-color-primary) 14%, var(--md-sys-color-surface-container-lowest));
}

.shell-menu__workspace-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
}

.shell-menu__workspace-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shell-menu__workspace-meta {
    display: block;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.78rem;
}

.shell-menu__link,
.shell-menu__action,
.shell-menu__footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border-radius: 16px;
    border: 0;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    text-align: left;
    font-size: var(--md-sys-typescale-body-medium-size);
    font-weight: 500;
}

.shell-menu__link:hover,
.shell-menu__action:hover {
    background: var(--md-sys-color-surface-container-low);
}

.shell-menu__footer-link {
    box-sizing: border-box;
    justify-content: flex-start;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.shell-menu__footer-link:hover {
    border-color: transparent;
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-primary);
}

.shell-menu__footer-link--danger {
    color: var(--md-sys-color-error);
}

.shell-menu__footer-link--danger:hover {
    background: color-mix(in srgb, var(--md-sys-color-error) 9%, var(--md-sys-color-surface-container-lowest));
    color: var(--md-sys-color-error);
}

.shell-menu__logout {
    margin-top: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 0;
}

.popup-modal {
    z-index: 6200;
}

.popup-modal.is-open {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: auto;
    padding: 24px 16px;
}

.popup-modal__scrim,
.md-dialog-layer__scrim {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(15, 23, 42, 0.42);
}

.popup-modal__dialog {
    width: min(760px, calc(100vw - 32px));
    margin: 0 auto;
    max-height: calc(100vh - 48px);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--md-sys-elevation-level5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.popup-modal__dialog--wide {
    width: min(1080px, calc(100vw - 32px));
}

.popup-modal__header {
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    background: rgba(255, 255, 255, 0.72);
}

.popup-modal__header h3 {
    margin: 0 0 6px;
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    line-height: 1.2;
    font-weight: 500;
}

.popup-modal__header p {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
}

.popup-modal__body {
    padding: 24px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 0;
    overflow: auto;
}

.popup-modal__close {
    min-width: 0;
    padding-inline: 16px;
    background: var(--md-sys-color-surface-container-low);
    border-color: var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-primary);
}

.dialog-root {
    position: relative;
    z-index: 7000;
}

.md-dialog-layer {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.md-dialog {
    position: relative;
    width: min(560px, calc(100vw - 32px));
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--md-sys-elevation-level5);
    overflow: hidden;
}

.md-dialog__headline {
    padding: 24px 24px 0;
}

.md-dialog__headline h3 {
    margin: 0;
    font-size: clamp(1.5rem, 2vw, 1.9rem);
    line-height: 1.2;
    font-weight: 500;
}

.md-dialog__content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 24px 0;
}

.md-dialog__supporting-text {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    line-height: 1.6;
}

.md-dialog__form {
    display: flex;
    flex-direction: column;
}

.md-dialog__validation {
    color: var(--md-sys-color-error);
    font-size: var(--md-sys-typescale-body-small-size);
}

.md-dialog__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    padding: 24px;
}

.md-dialog--danger .md-dialog__headline h3 {
    color: var(--md-sys-color-error);
}

.toast-stack {
    right: 24px;
    bottom: 24px;
    gap: 12px;
}

.toast {
    min-width: 320px;
    max-width: 400px;
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(44, 49, 59, 0.94);
    color: var(--md-sys-color-inverse-on-surface);
    box-shadow: var(--md-sys-elevation-level3);
}

.toast--error {
    background: rgba(186, 26, 26, 0.96);
    color: var(--md-sys-color-on-error);
}

@media (max-width: 1180px) {
    .auth-shell {
        grid-template-columns: 1fr;
        background: #ffffff;
    }

    .auth-hero {
        min-height: auto;
        border-right: 0;
        border-bottom: 0;
        padding: 34px 28px;
    }

    .auth-copy {
        margin: 72px 0 0;
    }

    .auth-panel {
        min-height: auto;
        padding-top: 34px;
    }

    .auth-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 839px) {
    .workspace-bar {
        padding: 0 16px;
    }

    .global-search {
        display: none;
    }

    .workspace-bar__menu-toggle {
        display: inline-flex;
    }

    .workspace-bar__help span {
        display: none;
    }

    .shell-body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: var(--workspace-bar-height);
        left: 0;
        bottom: 0;
        width: min(86vw, 320px);
        height: auto;
        padding: 14px 10px 20px;
        border-right: 1px solid var(--md-sys-color-outline-variant);
        border-radius: 0 28px 28px 0;
        box-shadow: var(--md-sys-elevation-level5);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 280;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-mobile-head,
    .sidebar-toggle {
        display: flex;
    }

    .main-shell {
        padding: 12px 16px 18px;
        gap: 10px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 0 8px;
    }

    .topbar-copy {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .topbar-copy__title-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .topbar-copy p {
        white-space: normal;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .shell-menu--workspace {
        left: -8px;
        width: min(90vw, 320px);
    }

    .shell-menu--account {
        right: -6px;
        width: min(84vw, 280px);
    }

    .auth-panel {
        padding: 24px 16px 32px;
    }

    .auth-hero {
        padding: 28px 20px;
    }

    .auth-copy {
        margin-top: 54px;
    }

    .auth-copy h2 {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .auth-feature-grid {
        grid-template-columns: 1fr;
        margin-top: 32px;
    }

    .feature-card {
        min-height: auto;
    }

    .auth-body,
    .popup-modal__body,
    .md-dialog__content,
    .md-dialog__headline,
    .md-dialog__actions {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-height: 920px) and (min-width: 840px) {
    .sidebar {
        padding: 6px 4px 8px;
        gap: 6px;
    }

    .nav-stack {
        gap: 6px;
    }

    .nav-group {
        gap: 2px;
    }

    .nav-item,
    .nav-branch__summary,
    .nav-branch__children a {
        min-height: 34px;
        padding-inline: 8px;
    }
}

@media (max-width: 640px) {
    .workspace-brand__label {
        display: none;
    }

    .workspace-switcher__name {
        max-width: 140px;
    }

    .auth-feature-grid {
        grid-template-columns: 1fr;
    }

    .popup-modal__dialog,
    .popup-modal__dialog--wide,
    .md-dialog {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .toast-stack {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    .app-fatal {
        inset: 12px 12px auto;
        max-width: calc(100vw - 24px);
    }
}
