@layer reset, base, shell, components, auth;

:root {
    color-scheme: light dark;
    --shell-font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --shell-background: #f5f7fb;
    --shell-surface: #ffffff;
    --shell-surface-muted: #f8f9fc;
    --shell-surface-raised: #eef2ff;
    --shell-sidebar: #ffffff;
    --shell-border: #dde3ee;
    --shell-text: #162033;
    --shell-muted-text: #667085;
    --shell-primary: #22408f;
    --shell-primary-strong: #1b3273;
    --shell-primary-soft: rgba(34, 64, 143, 0.08);
    --shell-secondary: #16a3b5;
    --shell-success: #15803d;
    --shell-warning: #c26a18;
    --shell-danger: #d92d20;
    --shell-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
    --shell-radius: 0.95rem;
    --shell-radius-sm: 0.72rem;
    --shell-sidebar-primary: #22408f;
    --shell-sidebar-primary-foreground: #ffffff;
    --status-neutral-bg: rgba(102, 112, 133, 0.12);
    --status-neutral-text: #475467;
    --status-success-bg: rgba(21, 128, 61, 0.12);
    --status-success-text: #15803d;
    --status-warning-bg: rgba(194, 106, 24, 0.14);
    --status-warning-text: #b45309;
    --status-progress-bg: rgba(34, 64, 143, 0.12);
    --status-progress-text: #22408f;
    --status-waiting-bg: rgba(22, 163, 181, 0.14);
    --status-waiting-text: #0f7c8c;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: #f1f4fa;
    color: var(--shell-text);
    font-family: var(--shell-font-family);
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

:where(h1, h2, h3, p) {
    margin: 0;
}

:where(h1, h2, h3, h4):focus {
    outline: none;
}

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--shell-primary) 35%, transparent);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.theme-surface {
    color: var(--shell-text);
    --shell-card-border: color-mix(in srgb, var(--shell-border) 100%, transparent);
    --shell-card-shadow: var(--shell-shadow);
}

.theme-surface[data-theme-preference="light"],
.theme-surface[data-theme-preference="system"] {
    color-scheme: light;
    --shell-background: #f5f7fb;
    --shell-surface: #ffffff;
    --shell-surface-muted: #f8f9fc;
    --shell-surface-raised: #eef2ff;
    --shell-sidebar: #ffffff;
    --shell-border: #dde3ee;
    --shell-text: #162033;
    --shell-muted-text: #667085;
    --shell-primary: #22408f;
    --shell-primary-strong: #1b3273;
    --shell-primary-soft: rgba(34, 64, 143, 0.08);
    --shell-secondary: #16a3b5;
    --shell-success: #15803d;
    --shell-warning: #c26a18;
    --shell-danger: #d92d20;
    --shell-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
    --shell-sidebar-primary: #22408f;
    --shell-sidebar-primary-foreground: #ffffff;
    --status-neutral-bg: rgba(102, 112, 133, 0.12);
    --status-neutral-text: #475467;
    --status-success-bg: rgba(21, 128, 61, 0.12);
    --status-success-text: #15803d;
    --status-warning-bg: rgba(194, 106, 24, 0.14);
    --status-warning-text: #b45309;
    --status-progress-bg: rgba(34, 64, 143, 0.12);
    --status-progress-text: #22408f;
    --status-waiting-bg: rgba(22, 163, 181, 0.14);
    --status-waiting-text: #0f7c8c;
}

.theme-surface[data-theme-preference="dark"] {
    color-scheme: dark;
    --shell-background: #0f1726;
    --shell-surface: #111b2d;
    --shell-surface-muted: #172235;
    --shell-surface-raised: #1a2942;
    --shell-sidebar: #111a2a;
    --shell-border: #263348;
    --shell-text: #eef2ff;
    --shell-muted-text: #aab4c7;
    --shell-primary: #8aa6ff;
    --shell-primary-strong: #b6c7ff;
    --shell-primary-soft: rgba(138, 166, 255, 0.14);
    --shell-secondary: #54d4e4;
    --shell-success: #4ade80;
    --shell-warning: #fbbf24;
    --shell-danger: #f87171;
    --shell-shadow: 0 24px 56px rgba(2, 6, 23, 0.34);
    --shell-sidebar-primary: #8aa6ff;
    --shell-sidebar-primary-foreground: #0f1726;
    --status-neutral-bg: rgba(170, 180, 199, 0.16);
    --status-neutral-text: #d4dceb;
    --status-success-bg: rgba(74, 222, 128, 0.16);
    --status-success-text: #9ae6b4;
    --status-warning-bg: rgba(251, 191, 36, 0.16);
    --status-warning-text: #fde68a;
    --status-progress-bg: rgba(138, 166, 255, 0.18);
    --status-progress-text: #d7e0ff;
    --status-waiting-bg: rgba(84, 212, 228, 0.18);
    --status-waiting-text: #b7f2f7;
}

@media (prefers-color-scheme: dark) {
    .theme-surface[data-theme-preference="system"] {
        color-scheme: dark;
        --shell-background: #0f1726;
        --shell-surface: #111b2d;
        --shell-surface-muted: #172235;
        --shell-surface-raised: #1a2942;
        --shell-sidebar: #111a2a;
        --shell-border: #263348;
        --shell-text: #eef2ff;
        --shell-muted-text: #aab4c7;
        --shell-primary: #8aa6ff;
        --shell-primary-strong: #b6c7ff;
        --shell-primary-soft: rgba(138, 166, 255, 0.14);
        --shell-secondary: #54d4e4;
        --shell-success: #4ade80;
        --shell-warning: #fbbf24;
        --shell-danger: #f87171;
        --shell-shadow: 0 24px 56px rgba(2, 6, 23, 0.34);
        --shell-sidebar-primary: #8aa6ff;
        --shell-sidebar-primary-foreground: #0f1726;
        --status-neutral-bg: rgba(170, 180, 199, 0.16);
        --status-neutral-text: #d4dceb;
        --status-success-bg: rgba(74, 222, 128, 0.16);
        --status-success-text: #9ae6b4;
        --status-warning-bg: rgba(251, 191, 36, 0.16);
        --status-warning-text: #fde68a;
        --status-progress-bg: rgba(138, 166, 255, 0.18);
        --status-progress-text: #d7e0ff;
        --status-waiting-bg: rgba(84, 212, 228, 0.18);
        --status-waiting-text: #b7f2f7;
    }
}

.shell {
    display: grid;
    grid-template-columns: minmax(11.5rem, 13.75rem) minmax(0, 1fr);
    min-height: 100vh;
    background: var(--shell-background);
}

.standalone-surface {
    min-height: 100vh;
    background: var(--shell-background);
}

.shell__sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    padding: 0.85rem 0.8rem;
    overflow-y: auto;
    border-right: 1px solid var(--shell-border);
    background: color-mix(in srgb, var(--shell-sidebar) 98%, transparent);
}

.shell__brand {
    display: grid;
    gap: 0.45rem;
    padding: 0.2rem 0.3rem 0.35rem;
}

.shell__eyebrow,
.page-kicker,
.presentation-view__eyebrow,
.sidebar-audit-context__eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.45rem;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    background: var(--shell-primary-soft);
    color: var(--shell-primary-strong);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shell__title {
    font-size: clamp(1.2rem, 1.5vw, 1.35rem);
    line-height: 1.1;
}

.shell__subtitle,
.page-intro,
.card-intro,
.timeline-entry p,
.task-list__item p,
.mobile-capture p,
.mobile-card p,
.chat-message p,
.chapter-card p,
.field span,
.compact-list__item span,
.audit-list__meta-row,
.presentation-tile span,
.topbar__identity-text span {
    color: var(--shell-muted-text);
}

.shell__workspace {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
}

.shell__main {
    min-width: 0;
    padding: clamp(1rem, 1.8vw, 1.75rem);
    overflow: auto;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.8rem clamp(1rem, 1.6vw, 1.6rem);
    border-bottom: 1px solid var(--shell-border);
    background: color-mix(in srgb, var(--shell-surface) 96%, transparent);
    backdrop-filter: blur(10px);
}

.topbar__search {
    position: relative;
    flex: 1;
    max-width: 38rem;
}

.topbar__search-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--shell-muted-text);
    font-size: 0.95rem;
    pointer-events: none;
}

.topbar__search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.topbar__search-input,
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.65rem;
    border: 1px solid var(--shell-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 86%, var(--shell-surface));
    color: var(--shell-text);
    outline: 0;
    transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.field input,
.field select,
.field textarea {
    padding-left: 1rem;
}

.topbar__search-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.command-palette__input:focus {
    border-color: color-mix(in srgb, var(--shell-primary) 72%, var(--shell-border));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--shell-primary) 12%, transparent);
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.topbar__button,
.command-palette__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0 0.7rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.8rem;
    background: var(--shell-surface);
    color: var(--shell-text);
    transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.topbar__button:hover,
.command-palette__close:hover,
.primary-action:hover,
.primary-action--secondary:hover,
.topbar__identity:hover {
    transform: translateY(-1px);
}

.topbar__button:hover,
.command-palette__close:hover,
.topbar__identity:hover {
    background: var(--shell-surface-muted);
    border-color: color-mix(in srgb, var(--shell-primary) 40%, var(--shell-border));
}

.topbar__button--icon {
    width: 2.35rem;
    padding: 0;
}

.topbar__button--alert {
    position: relative;
}

.topbar__button--alert::after {
    content: "";
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    background: var(--shell-danger);
}

.theme-picker {
    position: relative;
}

.theme-picker__menu {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 0;
    z-index: 20;
    display: grid;
    gap: 0.3rem;
    min-width: 10rem;
    padding: 0.45rem;
    border: 1px solid var(--shell-border);
    border-radius: 1rem;
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
}

.theme-picker__option {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border-radius: 0.8rem;
    background: transparent;
    color: var(--shell-text);
    text-align: left;
}

.theme-picker__option:hover,
.theme-picker__option--active {
    background: color-mix(in srgb, var(--shell-primary-soft) 75%, var(--shell-surface));
}

.topbar__identity {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.15rem 0.2rem 0.15rem 0.15rem;
    border: 1px solid color-mix(in srgb, var(--shell-border) 75%, transparent);
    border-radius: 999px;
    transition: transform 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.topbar__identity--anonymous {
    pointer-events: none;
}

.topbar__identity-text {
    display: grid;
    gap: 0.05rem;
}

.topbar__identity-text strong {
    font-size: 0.9rem;
}

.topbar__identity-text span {
    font-size: 0.75rem;
}

.topbar__avatar,
.dev-login__avatar {
    display: grid;
    place-items: center;
    width: 2.6rem;
    aspect-ratio: 1;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--shell-primary), var(--shell-secondary));
    color: white;
    font-size: 0.86rem;
    font-weight: 700;
}

.dev-login {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 1.5rem;
    background: radial-gradient(circle at top right, color-mix(in srgb, var(--shell-primary) 14%, transparent), transparent 32%), var(--shell-background);
}

.dev-login__card {
    width: min(36rem, 100%);
    display: grid;
    gap: 1rem;
    padding: clamp(1.3rem, 3vw, 2rem);
    border: 1px solid var(--shell-border);
    border-radius: calc(var(--shell-radius) + 0.25rem);
    background: var(--shell-surface);
    box-shadow: var(--shell-shadow);
}

.dev-login__header {
    display: grid;
    gap: 0.75rem;
}

.dev-login__environment {
    display: inline-flex;
    width: fit-content;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-warning) 12%, transparent);
    color: var(--shell-warning);
    font-size: 0.82rem;
    font-weight: 700;
}

.dev-login__error {
    padding: 0.8rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--shell-danger) 25%, transparent);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--shell-danger) 10%, transparent);
    color: var(--shell-danger);
}

.dev-login__list {
    display: grid;
    gap: 0.75rem;
}

.dev-login__option-form {
    margin: 0;
}

.dev-login__option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.9rem;
    align-items: center;
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1px solid var(--shell-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 76%, var(--shell-surface));
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.dev-login__option:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--shell-primary) 30%, var(--shell-border));
    background: color-mix(in srgb, var(--shell-primary-soft) 40%, var(--shell-surface));
}

.dev-login__option:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--shell-primary) 70%, transparent);
    outline-offset: 2px;
}

.dev-login__identity {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.dev-login__identity span {
    color: var(--shell-muted-text);
    font-size: 0.88rem;
}

.page-header,
.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1,
.workspace-header h1,
.presentation-view h1,
.mobile-capture h1 {
    margin-top: 0.55rem;
    font-size: clamp(1.55rem, 2vw, 2rem);
    line-height: 1.15;
}

.page-header--stack-on-mobile {
    align-items: end;
}

.primary-action,
.primary-action--secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.9rem;
    text-decoration: none;
    transition: transform 150ms ease, opacity 150ms ease, background-color 150ms ease;
}

.primary-action {
    background: linear-gradient(135deg, var(--shell-primary), var(--shell-primary-strong));
    color: white;
    box-shadow: 0 10px 20px color-mix(in srgb, var(--shell-primary) 20%, transparent);
}

.primary-action--secondary {
    background: var(--shell-surface);
    color: var(--shell-text);
    border: 1px solid var(--shell-border);
}

.metric-grid,
.standards-grid,
.form-layout,
.split-panel,
.workspace-grid,
.presentation-view__grid,
.dashboard-grid {
    display: grid;
    gap: 1rem;
}

.metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    margin-bottom: 1rem;
}

.metric-card,
.app-card,
.mobile-card,
.presentation-tile,
.chapter-card,
.chat-message,
.timeline-entry {
    border: 1px solid var(--shell-border);
    border-radius: var(--shell-radius);
    background: var(--shell-surface);
    box-shadow: var(--shell-card-shadow);
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
}

.metric-card__icon {
    display: grid;
    place-items: center;
    width: 2.55rem;
    aspect-ratio: 1;
    border-radius: 0.9rem;
    background: var(--shell-primary-soft);
    color: var(--shell-primary-strong);
    font-size: 0.98rem;
}

.metric-card__icon--secondary {
    background: color-mix(in srgb, var(--shell-secondary) 14%, transparent);
    color: color-mix(in srgb, var(--shell-secondary) 80%, var(--shell-text));
}

.metric-card__icon--warning {
    background: color-mix(in srgb, var(--shell-warning) 14%, transparent);
    color: color-mix(in srgb, var(--shell-warning) 85%, var(--shell-text));
}

.metric-card__value {
    font-size: 1.55rem;
    font-weight: 700;
}

.metric-card__label {
    font-size: 0.94rem;
    color: var(--shell-muted-text);
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(19rem, 1fr);
    align-items: start;
    margin-top: 1rem;
}

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

.dashboard-column,
.stack-panel {
    display: grid;
    gap: 1rem;
}

.app-card {
    display: grid;
    gap: 0.9rem;
    padding: 1rem;
}

.app-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 0.15rem;
}

.audit-list,
.compact-list,
.task-list,
.timeline-stack,
.bullet-list,
.chat-transcript,
.chapter-board {
    display: grid;
    gap: 0.85rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.audit-list__item,
.compact-list__item,
.task-list__item,
.timeline-entry,
.chapter-card,
.chat-message {
    display: grid;
    gap: 0.45rem;
}

.audit-list__item,
.compact-list__item,
.timeline-entry,
.chapter-card,
.chat-message {
    padding: 1rem 1.05rem;
    text-decoration: none;
}

.audit-list__item,
.compact-list__item--linked {
    transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.audit-list__item:hover,
.compact-list__item--linked:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--shell-primary) 38%, var(--shell-border));
    background: color-mix(in srgb, var(--shell-primary-soft) 55%, var(--shell-surface));
}

.audit-list__item,
.compact-list__item,
.task-list__item {
    border: 1px solid var(--shell-border);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--shell-surface) 92%, var(--shell-background));
}

.audit-list__heading-row,
.task-list__item,
.chapter-card__header {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    align-items: start;
}

.audit-list__heading-row h3,
.compact-list__item strong,
.task-list__item strong,
.chapter-card h3,
.workspace-panel h2 {
    font-size: 1rem;
}

.audit-list__heading-row p,
.compact-list__item span,
.task-list__item p {
    font-size: 0.92rem;
}

.audit-list__meta-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.84rem;
}

.progress-meter {
    display: grid;
    gap: 0.45rem;
}

.progress-meter__row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: center;
    font-size: 0.84rem;
    color: var(--shell-muted-text);
}

.progress-meter__row strong {
    color: var(--shell-text);
    font-size: 0.88rem;
}

.progress-meter__track {
    position: relative;
    height: 0.38rem;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-border) 72%, transparent);
}

.progress-meter__track > span {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--shell-primary), var(--shell-primary-strong));
}

.compact-list--actions .compact-list__item {
    gap: 0.25rem;
}

.task-list__item {
    padding: 0.95rem 1rem;
}

.task-list__status-stack {
    display: grid;
    justify-items: end;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--shell-muted-text);
    text-align: right;
}

.bullet-list li {
    display: grid;
    gap: 0.4rem;
}

.bullet-list--spacious li + li {
    padding-top: 0.85rem;
    border-top: 1px solid var(--shell-border);
}

.form-layout,
.split-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.45rem;
}

.field span {
    font-size: 0.85rem;
    font-weight: 600;
}

.field--wide {
    grid-column: 1 / -1;
}

.selection-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selection-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-surface-muted) 80%, var(--shell-surface));
    color: var(--shell-muted-text);
    font-size: 0.8rem;
    font-weight: 600;
}

.selection-chip--active {
    border-color: color-mix(in srgb, var(--shell-primary) 20%, var(--shell-border));
    background: color-mix(in srgb, var(--shell-primary-soft) 72%, var(--shell-surface));
    color: var(--shell-primary-strong);
}

.participant-grid,
.workspace-preview-grid {
    display: grid;
    gap: 1rem;
}

.participant-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.participant-card,
.workspace-preview {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--shell-surface) 92%, var(--shell-background));
}

.participant-card h3,
.workspace-preview__header strong {
    font-size: 1rem;
}

.participant-list {
    display: grid;
    gap: 0.65rem;
}

.participant-list__item,
.workspace-preview__header {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    align-items: start;
}

.participant-list__item strong,
.workspace-preview strong {
    display: block;
}

.participant-list__item span,
.workspace-preview p {
    color: var(--shell-muted-text);
    font-size: 0.84rem;
}

.workspace-preview-grid {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.form-actions {
    display: flex;
    justify-content: end;
    gap: 0.75rem;
}

.workspace-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.3rem;
    border: 1px solid var(--shell-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 72%, var(--shell-surface));
}

.workspace-tab {
    padding: 0.7rem 0.95rem;
    border-radius: 0.8rem;
    background: transparent;
    color: var(--shell-muted-text);
    transition: background-color 150ms ease, color 150ms ease;
}

.workspace-tab:hover {
    background: color-mix(in srgb, var(--shell-primary-soft) 42%, transparent);
    color: var(--shell-text);
}

.workspace-tab--active {
    background: var(--shell-surface);
    color: var(--shell-primary-strong);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--shell-primary) 20%, var(--shell-border));
}

.workspace-grid {
    grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 1fr);
    align-items: start;
}

.workspace-panel,
.mobile-capture,
.presentation-view {
    border: 1px solid var(--shell-border);
    border-radius: calc(var(--shell-radius) + 0.15rem);
    background: var(--shell-surface);
    box-shadow: var(--shell-card-shadow);
}

.workspace-panel {
    padding: 1.2rem;
}

.workspace-panel--timeline {
    display: grid;
    gap: 1rem;
}

.workspace-panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.workspace-section + .workspace-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--shell-border);
}

.timeline-entry {
    padding: 0.95rem 1rem;
}

.timeline-entry__eyebrow,
.chat-message__author {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--shell-primary-strong);
}

.composer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px dashed color-mix(in srgb, var(--shell-primary) 22%, var(--shell-border));
    border-radius: 1rem;
    background: color-mix(in srgb, var(--shell-primary-soft) 45%, var(--shell-surface));
}

.chapter-board {
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.chat-transcript {
    grid-template-columns: 1fr;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    white-space: nowrap;
}

.status-pill--sm {
    padding: 0.28rem 0.65rem;
    font-size: 0.75rem;
}

.status-pill--md {
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
}

.status-pill--neutral {
    background: var(--status-neutral-bg);
    color: var(--status-neutral-text);
    border-color: color-mix(in srgb, var(--status-neutral-text) 12%, transparent);
}

.status-pill--success {
    background: var(--status-success-bg);
    color: var(--status-success-text);
    border-color: color-mix(in srgb, var(--status-success-text) 12%, transparent);
}

.status-pill--warning {
    background: var(--status-warning-bg);
    color: var(--status-warning-text);
    border-color: color-mix(in srgb, var(--status-warning-text) 12%, transparent);
}

.status-pill--progress {
    background: var(--status-progress-bg);
    color: var(--status-progress-text);
    border-color: color-mix(in srgb, var(--status-progress-text) 12%, transparent);
}

.status-pill--waiting {
    background: var(--status-waiting-bg);
    color: var(--status-waiting-text);
    border-color: color-mix(in srgb, var(--status-waiting-text) 12%, transparent);
}

.command-palette-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: start center;
    padding: 8vh 1rem 1rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
}

.command-palette {
    width: min(44rem, 100%);
    border: 1px solid var(--shell-border);
    border-radius: 1.4rem;
    background: var(--shell-surface);
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.command-palette__header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.8rem;
    align-items: center;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid var(--shell-border);
}

.command-palette__symbol {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    aspect-ratio: 1;
    border-radius: 0.8rem;
    background: var(--shell-primary-soft);
    color: var(--shell-primary-strong);
    font-weight: 700;
}

.command-palette__input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.95rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 74%, var(--shell-surface));
    color: var(--shell-text);
}

.command-palette__list {
    display: grid;
    gap: 0.3rem;
    max-height: 22rem;
    padding: 0.8rem;
    overflow: auto;
}

.command-palette__item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 0.95rem;
    background: transparent;
    color: var(--shell-text);
    text-align: left;
}

.command-palette__item:hover {
    background: color-mix(in srgb, var(--shell-primary-soft) 52%, transparent);
}

.command-palette__item-category,
.command-palette__empty {
    color: var(--shell-muted-text);
    font-size: 0.84rem;
}

.command-palette__empty {
    padding: 1.5rem 1rem;
    text-align: center;
}

.mobile-capture,
.presentation-view {
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2rem);
}

.mobile-capture {
    display: grid;
    gap: 1rem;
}

.mobile-capture__stack {
    display: grid;
    gap: 0.9rem;
}

.mobile-card,
.presentation-tile {
    padding: 1rem 1.05rem;
}

.presentation-view {
    display: grid;
    align-content: center;
    gap: 1rem;
    background:
        radial-gradient(circle at top right, rgba(79, 70, 229, 0.16), transparent 28%),
        linear-gradient(135deg, color-mix(in srgb, var(--shell-primary-soft) 52%, var(--shell-surface)), var(--shell-surface));
}

.presentation-view__grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.presentation-tile strong {
    font-size: 1.35rem;
}

@media (max-width: 1100px) {
    .dashboard-grid,
    .dashboard-grid--bottom,
    .workspace-grid,
    .split-panel,
    .form-layout,
    .participant-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 920px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .shell__sidebar {
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--shell-border);
    }

    .topbar,
    .page-header,
    .workspace-header,
    .composer-bar,
    .workspace-panel__header {
        flex-direction: column;
        align-items: stretch;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field--wide {
        grid-column: auto;
    }
}

@media (max-width: 640px) {
    .shell__main {
        padding: 1rem;
    }

    .topbar {
        padding: 1rem;
    }

    .topbar__actions {
        width: 100%;
        justify-content: space-between;
    }

    .page-header--stack-on-mobile {
        align-items: start;
    }

    .metric-grid,
    .presentation-view__grid,
    .chapter-board,
    .workspace-preview-grid {
        grid-template-columns: 1fr;
    }

    .audit-list__heading-row,
    .task-list__item,
    .chapter-card__header {
        flex-direction: column;
        align-items: start;
    }

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .task-list__status-stack {
        justify-items: start;
        text-align: left;
    }
}
