/* Atlas shell owns only the authenticated layout, topbar, context header and canvas. */
.wrapper.app-shell {
    display: flex;
    min-height: 100dvh;
    background: var(--ig-page);
}

.app-main {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
}

.atlas-topbar {
    position: sticky;
    z-index: var(--ig-z-sticky);
    top: 0;
    display: flex;
    height: var(--ig-topbar-height);
    min-height: var(--ig-topbar-height);
    align-items: center;
    gap: var(--ig-space-3);
    padding: 0 var(--ig-space-6);
    border-bottom: 1px solid var(--ig-border);
    background: var(--ig-surface);
}

.atlas-topbar__actions {
    display: flex;
    min-width: 0;
    flex: 1;
    align-items: center;
    justify-content: flex-end;
    gap: var(--ig-space-2);
}

.atlas-workspace-identity {
    display: flex;
    min-width: 176px;
    align-items: center;
    gap: var(--ig-space-2);
    color: var(--ig-text);
}

.atlas-workspace-identity__icon,
.atlas-context-header__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    color: var(--ig-primary-700);
}

.atlas-workspace-identity > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.atlas-workspace-identity strong,
.atlas-workspace-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.atlas-workspace-identity small {
    color: var(--ig-text-muted);
    font-size: .72rem;
}

.atlas-icon-button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius-button);
    background: var(--ig-surface);
    color: var(--ig-text-secondary);
    place-items: center;
    text-decoration: none;
}

.atlas-icon-button:hover {
    border-color: var(--ig-border-strong);
    background: var(--ig-surface-soft);
    color: var(--ig-primary-700);
}

.atlas-context-header {
    display: flex;
    min-height: var(--ig-context-header-height);
    align-items: center;
    justify-content: space-between;
    gap: var(--ig-space-6);
    padding: var(--ig-space-4) var(--ig-space-6);
    border-bottom: 1px solid var(--ig-border);
    background: var(--ig-surface);
}

.atlas-context-header__main {
    min-width: 0;
}

.atlas-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ig-space-2);
    margin: 0 0 var(--ig-space-2);
    padding: 0;
    color: var(--ig-text-muted);
    font-size: .75rem;
    list-style: none;
}

.atlas-breadcrumb li + li::before {
    margin-right: var(--ig-space-2);
    color: var(--ig-border-strong);
    content: "/";
}

.atlas-context-header__identity {
    display: flex;
    align-items: center;
    gap: var(--ig-space-3);
}

.atlas-context-header__icon {
    width: 40px;
    height: 40px;
    border-radius: var(--ig-radius-button);
    background: var(--ig-primary-50);
}

.atlas-context-header h1 {
    margin: 0;
    color: var(--ig-text);
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 750;
    letter-spacing: -.02em;
}

.atlas-context-header p {
    margin: var(--ig-space-1) 0 0;
    color: var(--ig-text-muted);
    font-size: .875rem;
}

.atlas-context-header__statuses,
.atlas-context-header__actions {
    display: flex;
    align-items: center;
    gap: var(--ig-space-2);
}

.atlas-status-chip {
    display: inline-flex;
    margin-top: var(--ig-space-2);
    padding: var(--ig-space-1) var(--ig-space-2);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius-sm);
    background: var(--ig-surface-soft);
    color: var(--ig-text-secondary);
    font-size: .75rem;
}

.app-content {
    width: 100%;
    flex: 1 1 auto;
    padding: 0;
    background: var(--ig-page);
}

.atlas-workspace-canvas {
    width: 100%;
    margin-inline: auto;
    padding: var(--ig-space-6);
}

.atlas-workspace-canvas--standard { max-width: 1120px; }
.atlas-workspace-canvas--wide { max-width: 1480px; }
.atlas-workspace-canvas--full { max-width: none; }
.atlas-workspace-canvas--workbench { max-width: none; min-height: calc(100dvh - var(--ig-topbar-height) - var(--ig-context-header-compact-height)); padding: 0; }
.atlas-workspace-canvas--focus { max-width: none; padding: var(--ig-space-3); }

.app-shell.is-focus-mode .app-sidebar { width: 0; flex-basis: 0; overflow: hidden; border: 0; }
.app-shell.is-focus-mode .atlas-context-header { display: none; }
.app-shell.is-focus-mode .atlas-workspace-identity { display: none; }

.topbar-user-button {
    display: inline-flex;
    height: 40px;
    align-items: center;
    gap: var(--ig-space-2);
    padding: var(--ig-space-1) var(--ig-space-2);
    border: 1px solid var(--ig-border);
    border-radius: var(--ig-radius-button);
    background: var(--ig-surface);
    color: var(--ig-text);
}

.topbar-user-avatar {
    display: inline-grid;
    width: 28px;
    height: 28px;
    border-radius: var(--ig-radius-input);
    background: var(--ig-primary-800);
    color: var(--ig-surface);
    font-size: .75rem;
    font-weight: 800;
    place-items: center;
}

.topbar-user-summary {
    display: flex;
    max-width: 176px;
    flex-direction: column;
    text-align: left;
    line-height: 1.1;
}

.topbar-user-summary small { color: var(--ig-text-muted); font-size: .68rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
