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__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__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__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 svg,
.workspace-bar__help 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__icon-btn,
.sidebar-mobile-toggle,
.sidebar-toggle {
    min-width: 40px;
    padding-inline: 8px;
}

.workspace-bar__menu-toggle {
    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: 12px;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.topbar-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
    width: auto;
}

.topbar-copy__title-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    width: auto;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    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.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.topbar-copy h2 {
    margin: 0;
    font-size: clamp(1.25rem, 1.8vw, 1.55rem);
    line-height: 1.14;
    letter-spacing: -0.02em;
    font-weight: 500;
}

.topbar-copy p {
    margin: 0;
    max-width: 64ch;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 0.92rem;
    line-height: 1.35;
}

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

.topbar-actions .btn {
    min-height: 36px;
    padding: 0 16px;
    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: wrap;
    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);
}

.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: 24px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    vertical-align: middle;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.field-tip:hover,
.field-tip:focus-visible {
    border-color: var(--md-sys-color-primary);
    background: rgba(43, 99, 181, 0.16);
    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: 13px;
    font-weight: 700;
    line-height: 1;
    transform: translateY(-0.25px);
}

.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.15fr) minmax(420px, 520px);
    background:
        radial-gradient(circle at left top, rgba(43, 99, 181, 0.15), transparent 28%),
        linear-gradient(180deg, var(--md-sys-color-surface-container-lowest), var(--md-sys-color-background));
}

.auth-hero {
    display: flex;
    align-items: stretch;
    padding: clamp(40px, 6vw, 72px);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(242, 244, 251, 0.9));
}

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

.brand-lockup--logo {
    align-items: flex-start;
}

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

.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(40px, 6vw, 84px) 0 0;
}

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

.auth-copy h2 {
    margin: 0 0 18px;
    max-width: 720px;
    font-size: clamp(2.8rem, 5vw, 4.75rem);
    line-height: 1.02;
    letter-spacing: -0.045em;
    font-weight: 500;
}

.auth-copy p {
    margin: 0;
    max-width: 720px;
    color: var(--md-sys-color-on-surface-variant);
    font-size: 1rem;
    line-height: 1.8;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 40px;
}

.feature-card {
    padding: 20px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: var(--md-sys-elevation-level1);
}

.feature-card strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 600;
}

.feature-card p {
    margin: 0;
    color: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-small-size);
    line-height: 1.65;
}

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
    background: linear-gradient(180deg, rgba(242, 244, 251, 0.48), rgba(248, 249, 255, 0.82));
}

.auth-card {
    width: min(560px, 100%);
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 32px;
    box-shadow: var(--md-sys-elevation-level4);
    overflow: hidden;
}

.auth-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    background: var(--md-sys-color-surface-container-low);
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}

.auth-tab {
    min-height: 48px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--md-sys-shape-corner-full);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 500;
}

.auth-tab.active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    box-shadow: var(--md-sys-elevation-level1);
}

.auth-body {
    padding: 28px;
}

.auth-body h3 {
    margin: 0 0 10px;
    font-size: clamp(1.75rem, 3vw, 2.1rem);
    line-height: 1.12;
}

.auth-body p {
    color: var(--md-sys-color-on-surface-variant);
}

.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: 32px;
    padding: 0 12px;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: 500;
}

.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: var(--md-sys-color-on-surface-variant);
    font-size: var(--md-sys-typescale-body-small-size);
    line-height: 1.6;
}

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

.auth-passkey-copy__meta strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
}

.auth-passkey-copy__meta p {
    margin: 6px 0 0;
}

.auth-passkey-visual,
.auth-passkey-visual--modal {
    border-radius: 28px;
    border: 1px solid rgba(43, 99, 181, 0.14);
    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);
}

.shell-menu {
    position: absolute;
    top: calc(100% + 12px);
    min-width: 248px;
    padding: 12px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--md-sys-color-on-surface);
    box-shadow: var(--md-sys-elevation-level4);
    z-index: 340;
}

.shell-menu--workspace {
    left: 0;
    width: 320px;
}

.shell-menu--account {
    right: 0;
    width: 280px;
}

.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__divider {
    margin: 10px 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__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: 10px;
}

.shell-menu__workspace-card {
    width: 100%;
    margin: 0;
    padding: 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: 20px;
    background: var(--md-sys-color-surface-container-low);
    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) {
    border-color: var(--md-sys-color-outline);
    box-shadow: var(--md-sys-elevation-level1);
    transform: translateY(-1px);
}

.shell-menu__workspace-card--current {
    background: var(--md-sys-color-primary-container);
    border-color: rgba(43, 99, 181, 0.24);
}

.shell-menu__workspace-name {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

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

.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 {
    justify-content: center;
    border: 1px solid var(--md-sys-color-outline-variant);
    border-radius: var(--md-sys-shape-corner-full);
}

.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;
    }

    .auth-hero {
        border-right: 0;
        border-bottom: 1px solid var(--md-sys-color-outline-variant);
    }

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

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

    .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-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-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);
    }
}
