@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;
    --status-danger-bg: rgba(217, 45, 32, 0.12);
    --status-danger-text: #d92d20;
    --input-bg: color-mix(in srgb, var(--shell-surface-muted) 86%, var(--shell-surface));
    --popover-bg: var(--shell-surface);
    --popover-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

* {
    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;
    --status-danger-bg: rgba(217, 45, 32, 0.12);
    --status-danger-text: #d92d20;
}

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

.status-pill--danger {
    background: var(--status-danger-bg);
    color: var(--status-danger-text);
    border-color: color-mix(in srgb, var(--status-danger-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;
    }
}

/* --- Figma-aligned shell + workspace refinements --- */

.app-icon {
    display: block;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
}

.shell {
    grid-template-columns: minmax(20rem, 23rem) minmax(0, 1fr);
}

.shell__sidebar {
    gap: 1.45rem;
    padding: 1.2rem 1rem 1rem;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--shell-sidebar) 98%, white), color-mix(in srgb, var(--shell-sidebar) 94%, transparent));
}

.shell__brand {
    gap: 0.72rem;
    padding: 0.2rem 0.4rem 0.35rem;
}

.shell__eyebrow {
    padding: 0.38rem 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
}

.shell__title {
    font-size: clamp(2.35rem, 4vw, 3.1rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.shell__subtitle {
    max-width: 15ch;
    font-size: 1rem;
    line-height: 1.42;
}

.shell__workspace {
    min-height: 100vh;
    background: color-mix(in srgb, var(--shell-background) 96%, white);
}

.shell__main {
    padding: clamp(1.1rem, 1.7vw, 1.6rem);
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.2rem;
    padding: 1rem clamp(1.15rem, 1.9vw, 1.9rem);
    background: color-mix(in srgb, var(--shell-surface) 97%, transparent);
}

.topbar__search {
    display: grid;
    align-items: center;
    max-width: 34rem;
}

.topbar__search-icon {
    left: 1.1rem;
}

.topbar__search-icon-svg {
    width: 1.05rem;
    height: 1.05rem;
}

.topbar__search-input {
    padding: 1rem 3.9rem 1rem 3rem;
    border-radius: 1.15rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 82%, var(--shell-surface));
    font-size: 1rem;
}

.topbar__search-shortcut {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    min-width: 2rem;
    min-height: 2rem;
    padding: 0 0.6rem;
    border: 1px solid color-mix(in srgb, var(--shell-primary) 16%, var(--shell-border));
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-primary-soft) 55%, var(--shell-surface));
    color: var(--shell-primary-strong);
    font-size: 0.88rem;
    font-weight: 700;
}

.topbar__actions {
    gap: 0.8rem;
}

.topbar__button,
.command-palette__close {
    min-width: 2.75rem;
    min-height: 2.75rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-surface) 92%, transparent);
}

.topbar__button-icon,
.theme-picker__option-icon {
    width: 1.05rem;
    height: 1.05rem;
}

.theme-picker__menu {
    min-width: 11.25rem;
    padding: 0.55rem;
    border-radius: 1.2rem;
}

.theme-picker__option {
    gap: 0.8rem;
    padding: 0.8rem 0.9rem;
}

.topbar__identity {
    gap: 0.35rem;
    padding-right: 0.35rem;
    border-radius: 999px;
}

.topbar__identity-text {
    gap: 0.12rem;
    padding-right: 0.35rem;
}

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

.topbar__avatar,
.dev-login__avatar {
    width: 2.85rem;
    font-size: 0.92rem;
}

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

.workspace-hero--aligned h1 {
    margin-top: 0.55rem;
    font-size: clamp(2rem, 2.9vw, 2.9rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.workspace-hero__action {
    align-self: center;
    gap: 0.65rem;
}

.workspace-hero__action-icon {
    width: 1rem;
    height: 1rem;
}

.workspace-stage {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: calc(100vh - 12.25rem);
    overflow: hidden;
    border: 1px solid var(--shell-border);
    border-radius: 1.4rem;
    background: var(--shell-surface);
    box-shadow: var(--shell-card-shadow);
}

.workspace-stage__tabs,
.workspace-stage__chapters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: 1.25rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-stage__tabs {
    padding-top: 0.55rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 72%, var(--shell-surface));
}

.workspace-stage__chapter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-block: 0.5rem;
}

.workspace-room-tab,
.workspace-chapter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem 1rem 0 0;
    background: transparent;
    color: var(--shell-muted-text);
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

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

.workspace-room-tab--active {
    position: relative;
    color: var(--shell-text);
    background: var(--shell-surface);
    box-shadow: inset 0 1px 0 color-mix(in srgb, white 84%, transparent), 0 0 0 1px var(--shell-border);
}

.workspace-room-tab--ghost {
    border-radius: 1rem;
}

.workspace-room-tab__icon,
.workspace-queue__arrow,
.workspace-stream-section__icon,
.workspace-chapter-summary__icon,
.workspace-timer__icon,
.workspace-composer__attach-icon,
.workspace-composer__send-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.workspace-chapter-tab {
    padding: 0.65rem 0.9rem;
    border-radius: 0.9rem;
}

.workspace-chapter-tab--active {
    background: linear-gradient(135deg, var(--shell-primary), var(--shell-primary-strong));
    color: white;
}

.workspace-chapter-tab__prefix {
    opacity: 0.72;
}

.workspace-timer {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-primary-soft) 60%, var(--shell-surface));
    color: var(--shell-text);
    font-weight: 700;
}

.workspace-stage__body {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 22rem);
    min-height: 0;
    overflow: hidden;
}

.workspace-focus {
    display: grid;
    gap: 1rem;
    min-height: 0;
    padding: 1.3rem;
    overflow: auto;
}

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

.workspace-focus__header--stacked {
    flex-direction: column;
}

.workspace-chapter-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-chapter-summary__title {
    display: grid;
    gap: 0.7rem;
}

.workspace-chapter-summary__title h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1.65rem;
    line-height: 1.1;
}

.workspace-chapter-summary__title p {
    max-width: 62rem;
}

.workspace-chapter-summary__filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.workspace-filter-chip,
.workspace-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid color-mix(in srgb, var(--shell-border) 88%, transparent);
    border-radius: 999px;
    background: var(--shell-surface);
    color: var(--shell-muted-text);
    font-size: 0.82rem;
    font-weight: 700;
}

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

.workspace-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--shell-muted-text);
    font-size: 0.88rem;
}

.workspace-stream-section {
    display: grid;
    gap: 0.9rem;
}

.workspace-stream-section__heading {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--shell-muted-text);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.workspace-card-stack,
.workspace-team-chat,
.workspace-chat-list,
.workspace-queue,
.workspace-participant-list {
    display: grid;
    gap: 0.85rem;
}

.workspace-evidence-grid,
.workspace-board-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.workspace-stream-card,
.workspace-board-card,
.workspace-team-chat__message,
.workspace-queue__item,
.workspace-chat-list__item {
    border: 1px solid color-mix(in srgb, var(--shell-border) 96%, transparent);
    border-radius: 1.25rem;
    background: var(--shell-surface);
}

.workspace-stream-card,
.workspace-board-card {
    padding: 1.15rem 1.2rem;
}

.workspace-stream-card--finding {
    border-left: 3px solid color-mix(in srgb, var(--shell-warning) 84%, var(--shell-primary));
}

.workspace-stream-card--evidence {
    border-left: 3px solid var(--shell-secondary);
}

.workspace-stream-card__eyebrow {
    color: var(--shell-primary-strong);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-stream-card h3,
.workspace-board-card h3 {
    margin-top: 0.55rem;
    font-size: 1rem;
}

.workspace-stream-card p,
.workspace-board-card p,
.workspace-team-chat__body p,
.workspace-chat-list__body p {
    margin-top: 0.4rem;
    color: var(--shell-muted-text);
}

.workspace-stream-card__detail,
.workspace-board-card__meta {
    margin-top: 0.85rem;
    padding-top: 0.8rem;
    border-top: 1px solid color-mix(in srgb, var(--shell-border) 92%, transparent);
    color: var(--shell-muted-text);
    font-size: 0.88rem;
}

.workspace-board-card--active {
    background: color-mix(in srgb, var(--shell-primary-soft) 48%, var(--shell-surface));
    border-color: color-mix(in srgb, var(--shell-primary) 24%, var(--shell-border));
}

.workspace-board-card__header,
.workspace-note-card__header,
.workspace-team-chat__meta,
.workspace-chat-list__meta,
.workspace-rail__heading-row,
.workspace-queue__item,
.workspace-participant-list__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.workspace-note-card__author,
.workspace-team-chat__message,
.workspace-chat-list__item,
.workspace-queue__item,
.workspace-participant-list__item {
    display: flex;
    gap: 0.85rem;
}

.workspace-note-card__author div:last-child,
.workspace-queue__content,
.workspace-chat-list__body {
    display: grid;
    gap: 0.12rem;
}

.workspace-note-card__header span,
.workspace-team-chat__meta span,
.workspace-chat-list__meta span,
.workspace-rail__heading-row span,
.workspace-queue__content span,
.workspace-participant-list__item span,
.workspace-chat-list__badge {
    color: var(--shell-muted-text);
    font-size: 0.82rem;
}

.participant-avatar {
    display: inline-grid;
    place-items: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    color: white;
    font-size: 0.82rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.participant-avatar--lead {
    background: linear-gradient(135deg, #22408f, #3157bc);
}

.participant-avatar--auditor {
    background: linear-gradient(135deg, #5b67ff, #818cf8);
}

.participant-avatar--trainee {
    background: linear-gradient(135deg, #f59e0b, #fb923c);
}

.participant-avatar--customer {
    background: linear-gradient(135deg, #0991a2, #18b7c9);
}

.workspace-composer {
    display: grid;
    gap: 0.95rem;
    margin-top: 0.3rem;
    padding: 1rem 1.05rem;
    border: 1px dashed color-mix(in srgb, var(--shell-primary) 26%, var(--shell-border));
    border-radius: 1.2rem;
    background: color-mix(in srgb, var(--shell-primary-soft) 42%, var(--shell-surface));
}

.workspace-composer--chat {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.workspace-composer__quick-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.workspace-composer__label {
    color: var(--shell-muted-text);
    font-size: 0.82rem;
    font-weight: 700;
}

.workspace-chip--warning {
    color: var(--shell-warning);
}

.workspace-chip--danger {
    color: var(--shell-danger);
}

.workspace-chip--secondary {
    color: var(--shell-secondary);
}

.workspace-composer__surface {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.7rem;
    border: 1px solid color-mix(in srgb, var(--shell-border) 96%, transparent);
    border-radius: 1.15rem;
    background: var(--shell-surface);
}

.workspace-composer__attach,
.workspace-composer__send {
    display: inline-grid;
    place-items: center;
    width: 2.7rem;
    height: 2.7rem;
    border-radius: 1rem;
    background: color-mix(in srgb, var(--shell-primary-soft) 62%, var(--shell-surface));
    color: var(--shell-primary-strong);
}

.workspace-composer__send {
    background: linear-gradient(135deg, var(--shell-primary), var(--shell-primary-strong));
    color: white;
}

.workspace-composer__input p {
    margin-top: 0.15rem;
    color: var(--shell-muted-text);
}

.workspace-rail {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 0;
    min-height: 0;
    border-left: 1px solid var(--shell-border);
    background: color-mix(in srgb, var(--shell-surface-muted) 44%, var(--shell-surface));
}

.workspace-rail__section {
    display: grid;
    gap: 0.9rem;
    padding: 1.1rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-rail__section--chat {
    min-height: 0;
    overflow: hidden;
}

.workspace-rail__heading-row h3 {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--shell-muted-text);
}

.workspace-rail__session-name {
    font-size: 1rem;
}

.workspace-participant-list__item {
    align-items: center;
}

.workspace-participant-list__status {
    width: 0.55rem;
    height: 0.55rem;
    margin-left: auto;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-muted-text) 32%, transparent);
}

.workspace-participant-list__status--online {
    background: var(--shell-success);
}

.workspace-queue__item {
    align-items: center;
    width: 100%;
    padding: 0.8rem 0.85rem;
    text-align: left;
}

.workspace-queue__item--active {
    background: color-mix(in srgb, var(--shell-primary-soft) 68%, var(--shell-surface));
    border-color: color-mix(in srgb, var(--shell-primary) 22%, var(--shell-border));
}

.workspace-queue__badge {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-primary-soft) 85%, var(--shell-surface));
    color: var(--shell-primary-strong);
    font-size: 0.78rem;
    font-weight: 800;
    flex: 0 0 auto;
}

.workspace-queue__arrow {
    margin-left: auto;
}

.workspace-chat-list {
    min-height: 0;
    overflow: auto;
    padding-right: 0.25rem;
}

.workspace-chat-list__badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 0.45rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-primary-soft) 72%, var(--shell-surface));
    color: var(--shell-primary-strong);
    font-weight: 700;
}

.workspace-team-chat__message,
.workspace-chat-list__item {
    padding: 0.9rem 1rem;
}

@media (max-width: 1320px) {
    .workspace-stage__body {
        grid-template-columns: minmax(0, 1fr) minmax(17rem, 19rem);
    }
}

@media (max-width: 1100px) {
    .shell {
        grid-template-columns: minmax(18rem, 20rem) minmax(0, 1fr);
    }

    .workspace-stage__body,
    .workspace-evidence-grid,
    .workspace-board-grid {
        grid-template-columns: 1fr;
    }

    .workspace-rail {
        border-left: 0;
        border-top: 1px solid var(--shell-border);
    }
}

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

    .shell__sidebar {
        height: auto;
    }

    .shell__subtitle {
        max-width: 36ch;
    }

    .topbar,
    .workspace-hero,
    .workspace-stage__tabs,
    .workspace-stage__chapters,
    .workspace-chapter-summary,
    .workspace-composer--chat {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar__search {
        max-width: none;
    }

    .topbar__actions {
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .shell__sidebar,
    .shell__main,
    .workspace-focus,
    .workspace-rail__section {
        padding: 1rem;
    }

    .shell__title {
        font-size: 2rem;
    }

    .topbar {
        padding: 1rem;
    }

    .topbar__identity-text {
        display: none;
    }

    .workspace-stage {
        min-height: auto;
    }

    .workspace-stage__tabs,
    .workspace-stage__chapters {
        padding-inline: 0.85rem;
    }

    .workspace-room-tab,
    .workspace-chapter-tab {
        width: 100%;
        justify-content: center;
    }

    .workspace-stage__tabs,
    .workspace-stage__chapter-tabs,
    .workspace-composer__surface,
    .workspace-note-card__header,
    .workspace-team-chat__message,
    .workspace-chat-list__item,
    .workspace-queue__item,
    .workspace-participant-list__item {
        flex-direction: column;
        align-items: stretch;
    }

    .workspace-composer__surface {
        grid-template-columns: 1fr;
    }
}

/* --- Source-template alignment (published HTML adaptation) --- */

.shell {
    grid-template-columns: 15rem minmax(0, 1fr);
    background: var(--shell-surface);
}

.shell__sidebar {
    gap: 0;
    padding: 0;
    border-right: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.shell__brand {
    display: flex;
    align-items: center;
    min-height: 4.4rem;
    padding: 0 1.45rem;
    border-bottom: 1px solid var(--shell-border);
}

.shell__title {
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.03em;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4.4rem;
    padding: 0 1.4rem;
    background: var(--shell-surface);
    backdrop-filter: none;
}

.topbar__search {
    max-width: 34rem;
}

.topbar__search-input {
    padding: 0.9rem 1rem 0.9rem 3rem;
    border-radius: 1rem;
    background: var(--shell-surface);
    font-size: 0.98rem;
}

.topbar__actions {
    gap: 0.7rem;
}

.topbar__button,
.command-palette__close {
    min-width: 2.25rem;
    min-height: 2.25rem;
    border-radius: 999px;
    border-color: transparent;
    background: transparent;
}

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

.topbar__button--alert::after {
    top: 0.45rem;
    right: 0.45rem;
}

.topbar__identity {
    display: inline-grid;
    place-items: center;
    gap: 0;
    padding: 0;
    border: 0;
}

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

.topbar__avatar,
.dev-login__avatar {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.85rem;
}

.shell__main {
    padding: 1.45rem;
    background: var(--shell-background);
}

.template-dashboard {
    display: grid;
    gap: 1.45rem;
}

.template-dashboard__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.template-dashboard__header h1 {
    font-size: 2rem;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.template-dashboard__header p {
    margin-top: 0.55rem;
    color: var(--shell-muted-text);
    font-size: 0.92rem;
}

.template-dashboard__create {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 4.3rem;
    padding: 0 1.6rem;
    border-radius: 1rem;
    background: var(--shell-primary);
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
}

.template-dashboard__create-icon,
.template-metric-card__icon-svg,
.template-inline-meta__icon,
.workspace-template__group-icon,
.workspace-template__timer-icon,
.workspace-template__chapter-summary-icon,
.workspace-template__input-icon,
.workspace-template__room-icon,
.workspace-template__queue-arrow {
    width: 1rem;
    height: 1rem;
}

.template-dashboard__metrics,
.template-dashboard__grid,
.template-dashboard__grid--bottom {
    display: grid;
    gap: 1.4rem;
}

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

.template-dashboard__grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(20rem, 1fr);
    align-items: start;
}

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

.template-dashboard__stack {
    display: grid;
    gap: 1.4rem;
}

.template-metric-card,
.template-panel,
.workspace-template,
.workspace-template__finding-card,
.workspace-template__evidence-card,
.workspace-template__note-card,
.workspace-template__board-card,
.workspace-template__team-message,
.workspace-template__queue-item,
.workspace-template__chat-item {
    border: 1px solid var(--shell-border);
    border-radius: 1rem;
    background: var(--shell-surface);
}

.template-metric-card {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-height: 8rem;
    padding: 1.5rem;
}

.template-metric-card__icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
}

.template-metric-card__icon--primary {
    background: color-mix(in srgb, var(--shell-primary) 12%, white);
    color: var(--shell-primary);
}

.template-metric-card__icon--secondary {
    background: color-mix(in srgb, var(--shell-secondary) 16%, white);
    color: color-mix(in srgb, var(--shell-secondary) 85%, var(--shell-text));
}

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

.template-metric-card strong {
    display: block;
    font-size: 2.1rem;
    line-height: 1;
}

.template-metric-card span {
    display: block;
    margin-top: 0.35rem;
    color: var(--shell-muted-text);
    font-size: 0.94rem;
}

.template-panel {
    overflow: hidden;
}

.template-panel__header {
    padding: 1.45rem;
    border-bottom: 1px solid var(--shell-border);
}

.template-panel__header h2 {
    font-size: 1.05rem;
    font-weight: 600;
}

.template-panel__list {
    display: grid;
}

.template-panel__list > * + * {
    border-top: 1px solid var(--shell-border);
}

.template-audit-item,
.template-simple-item,
.template-recent-item,
.template-task-item {
    display: block;
    padding: 1.45rem;
}

.template-audit-item:hover,
.template-recent-item:hover,
.template-task-item:hover,
.template-simple-item:hover {
    background: color-mix(in srgb, var(--shell-surface-muted) 80%, var(--shell-surface));
}

.template-audit-item__header,
.template-task-item__header,
.template-recent-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.8rem;
}

.template-audit-item h3,
.template-simple-item h3 {
    font-size: 0.98rem;
    font-weight: 500;
}

.template-inline-meta,
.template-audit-item__footer > div {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.template-inline-meta {
    margin-top: 0.6rem;
    color: var(--shell-muted-text);
    font-size: 0.9rem;
}

.template-inline-meta span,
.template-simple-item p {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.template-progress-block {
    margin-top: 1rem;
}

.template-progress-block__row,
.template-audit-item__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.template-progress-block__row {
    margin-bottom: 0.45rem;
    color: var(--shell-muted-text);
    font-size: 0.9rem;
}

.template-progress-block__row strong {
    color: var(--shell-text);
}

.template-progress-block__track {
    height: 0.45rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-border) 55%, white);
    overflow: hidden;
}

.template-progress-block__track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--shell-primary);
}

.template-audit-item__footer {
    margin-top: 0.95rem;
    color: var(--shell-muted-text);
    font-size: 0.88rem;
}

.template-simple-item {
    display: grid;
    gap: 0.55rem;
}

.template-simple-item p,
.template-recent-item span,
.template-task-item p,
.template-task-item__header span,
.template-recent-item div span {
    color: var(--shell-muted-text);
    font-size: 0.9rem;
}

.template-recent-item div {
    display: grid;
    gap: 0.25rem;
}

.template-recent-item strong,
.template-task-item strong {
    font-weight: 500;
}

.template-task-item {
    display: grid;
    gap: 0.65rem;
}

.workspace-template {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
}

.workspace-template__room-tabs,
.workspace-template__chapter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.1rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-template__room-tabs {
    padding-top: 0.45rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 60%, var(--shell-surface));
}

.workspace-template__room-tab,
.workspace-template__chapter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.8rem 1rem;
    border-radius: 0.9rem 0.9rem 0 0;
    background: transparent;
    color: var(--shell-muted-text);
    font-size: 0.88rem;
    font-weight: 500;
}

.workspace-template__room-tab:hover,
.workspace-template__chapter-tab:hover {
    color: var(--shell-text);
}

.workspace-template__room-tab--active {
    background: var(--shell-surface);
    color: var(--shell-text);
    box-shadow: 0 0 0 1px var(--shell-border);
}

.workspace-template__room-tab--ghost {
    border-radius: 0.85rem;
}

.workspace-template__chapter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0;
}

.workspace-template__chapter-tab {
    border-radius: 0.7rem;
    padding: 0.65rem 0.85rem;
}

.workspace-template__chapter-tab--active {
    background: var(--shell-primary);
    color: white;
}

.workspace-template__timer {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 84%, white);
    font-size: 0.9rem;
    font-weight: 500;
}

.workspace-template__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 23rem;
    min-height: 0;
}

.workspace-template__main {
    display: grid;
    gap: 1rem;
    min-height: 0;
    padding: 1.25rem;
    overflow: auto;
}

.workspace-template__main--team,
.workspace-template__main--board {
    align-content: start;
}

.workspace-template__section-heading h2,
.workspace-template__chapter-summary h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.workspace-template__section-heading p,
.workspace-template__chapter-summary p,
.workspace-template__finding-card p,
.workspace-template__evidence-card p,
.workspace-template__note-card p,
.workspace-template__board-card p,
.workspace-template__chat-item p,
.workspace-template__team-message p,
.workspace-template__input-copy p,
.workspace-template__participant-row span,
.workspace-template__queue-item span {
    color: var(--shell-muted-text);
}

.workspace-template__chapter-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-template__chapter-summary h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.workspace-template__filters,
.workspace-template__quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.workspace-template__filter,
.workspace-template__chip {
    padding: 0.38rem 0.7rem;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    background: var(--shell-surface);
    color: var(--shell-muted-text);
    font-size: 0.78rem;
    font-weight: 500;
}

.workspace-template__filter--active {
    background: var(--shell-primary);
    border-color: var(--shell-primary);
    color: white;
}

.workspace-template__stats,
.workspace-template__eyebrow,
.workspace-template__group-heading,
.workspace-template__rail-heading h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.workspace-template__stats {
    display: flex;
    gap: 1.2rem;
    color: var(--shell-muted-text);
}

.workspace-template__stack {
    display: grid;
    gap: 0.85rem;
}

.workspace-template__group-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--shell-muted-text);
}

.workspace-template__finding-card,
.workspace-template__evidence-card,
.workspace-template__note-card,
.workspace-template__board-card {
    padding: 1rem;
}

.workspace-template__finding-card {
    border-color: color-mix(in srgb, var(--shell-warning) 25%, var(--shell-border));
}

.workspace-template__evidence-grid,
.workspace-template__board-grid {
    display: grid;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.workspace-template__board-card--active {
    background: color-mix(in srgb, var(--shell-surface-muted) 80%, white);
}

.workspace-template__detail,
.workspace-template__board-meta {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid var(--shell-border);
    color: var(--shell-muted-text);
    font-size: 0.84rem;
}

.workspace-template__board-meta,
.workspace-template__note-header,
.workspace-template__message-meta,
.workspace-template__rail-heading,
.workspace-template__participant-row,
.workspace-template__queue-item,
.workspace-template__chat-item,
.workspace-template__team-message,
.workspace-template__task-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.workspace-template__note-author,
.workspace-template__team-message,
.workspace-template__chat-item,
.workspace-template__participant-row,
.workspace-template__queue-item {
    display: flex;
    gap: 0.7rem;
}

.workspace-template__note-author > div:last-child,
.workspace-template__queue-item > div:last-child,
.workspace-template__queue-item > div:nth-child(2),
.workspace-template__chat-item > div:last-child,
.workspace-template__team-message > div:last-child,
.workspace-template__participant-row > div:last-child {
    display: grid;
    gap: 0.12rem;
}

.workspace-template__composer {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border: 1px solid var(--shell-border);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 72%, white);
}

.workspace-template__composer--team {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.workspace-template__input-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.65rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.9rem;
    background: var(--shell-surface);
}

.workspace-template__icon-button,
.workspace-template__send-button {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 84%, white);
    color: var(--shell-primary);
}

.workspace-template__send-button {
    background: var(--shell-primary);
    color: white;
}

.workspace-template__rail {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    border-left: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__rail-section {
    display: grid;
    gap: 0.8rem;
    padding: 1rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-template__rail-section--chat {
    min-height: 0;
}

.workspace-template__rail-heading {
    align-items: center;
}

.workspace-template__rail-heading h3,
.workspace-template__rail-heading span,
.workspace-template__rail-title {
    color: var(--shell-muted-text);
}

.workspace-template__rail-title {
    color: var(--shell-text);
    font-size: 0.94rem;
    font-weight: 600;
}

.workspace-template__participant-list,
.workspace-template__queue,
.workspace-template__chat-list,
.workspace-template__team-feed {
    display: grid;
    gap: 0.65rem;
}

.workspace-template__participant-row,
.workspace-template__queue-item,
.workspace-template__chat-item,
.workspace-template__team-message {
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.9rem;
    background: var(--shell-surface);
}

.workspace-template__participant-row {
    align-items: center;
}

.workspace-template__participant-status {
    width: 0.55rem;
    height: 0.55rem;
    margin-left: auto;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-muted-text) 25%, transparent);
}

.workspace-template__participant-status--online {
    background: var(--shell-success);
}

.workspace-template__queue-item {
    width: 100%;
    text-align: left;
}

.workspace-template__queue-item--active {
    background: color-mix(in srgb, var(--shell-primary) 8%, white);
    border-color: color-mix(in srgb, var(--shell-primary) 20%, var(--shell-border));
}

.workspace-template__queue-badge {
    display: inline-grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: var(--shell-surface);
    color: var(--shell-muted-text);
    font-size: 0.74rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.workspace-template__chat-list {
    min-height: 0;
    overflow: auto;
}

.workspace-template__chat-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 0.45rem;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-primary) 10%, white);
    color: var(--shell-primary);
    font-size: 0.72rem;
    font-weight: 600;
}

.participant-avatar {
    display: inline-grid;
    place-items: center;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.participant-avatar--lead {
    background: #22408f;
}

.participant-avatar--auditor {
    background: #6366f1;
}

.participant-avatar--trainee {
    background: #f59e0b;
}

.participant-avatar--customer {
    background: #0f8ea0;
}

/* Workspace redesign closer to the published prototype */
.workspace-template {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    background: var(--shell-surface);
}

.workspace-template__room-tabs,
.workspace-template__chapter-bar {
    justify-content: space-between;
    padding-inline: 1.15rem;
    border-bottom: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__room-tabs {
    padding-top: 0.6rem;
}

.workspace-template__room-tab-row,
.workspace-template__chapter-tabs {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.workspace-template__room-tab,
.workspace-template__chapter-tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.82rem 1rem;
    border-radius: 0.9rem 0.9rem 0 0;
    color: var(--shell-muted-text);
    font-size: 0.92rem;
    font-weight: 600;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.workspace-template__room-tab:hover,
.workspace-template__chapter-tab:hover {
    background: color-mix(in srgb, var(--shell-surface-muted) 90%, var(--shell-surface));
    color: var(--shell-text);
}

.workspace-template__room-tab--active {
    background: var(--shell-surface);
    color: var(--shell-text);
    box-shadow: 0 0 0 1px var(--shell-border);
}

.workspace-template__room-tab--ghost {
    border-radius: 0.8rem;
    padding-inline: 0.85rem;
}

.workspace-template__chapter-bar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.workspace-template__chapter-tab {
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    font-size: 0.88rem;
}

.workspace-template__chapter-tab--active {
    background: var(--shell-primary);
    color: #ffffff;
}

.workspace-template__timer {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.85rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 84%, var(--shell-surface));
    color: var(--shell-text);
    font-size: 0.9rem;
    font-weight: 600;
}

.workspace-template__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 25rem;
    min-height: 0;
    background: var(--shell-surface);
}

.workspace-template__main {
    min-height: 0;
    padding: 0;
    overflow: hidden;
    background: var(--shell-surface);
}

.workspace-template__main--timeline {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.workspace-template__main--board,
.workspace-template__main--team {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.workspace-template__section-heading,
.workspace-template__chapter-summary {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__section-heading h2,
.workspace-template__chapter-summary h2 {
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 700;
}

.workspace-template__section-heading p,
.workspace-template__chapter-summary p,
.workspace-template__requirement,
.workspace-template__finding-card p,
.workspace-template__evidence-card p,
.workspace-template__note-card p,
.workspace-template__board-card p,
.workspace-template__chat-item p,
.workspace-template__team-message p,
.workspace-template__input-copy p,
.workspace-template__queue-copy span {
    color: var(--shell-muted-text);
}

.workspace-template__chapter-copy {
    display: grid;
    gap: 0.55rem;
    min-width: 0;
}

.workspace-template__chapter-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.workspace-template__chapter-title-row h2 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-right: auto;
}

.workspace-template__requirement-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    background: var(--shell-surface);
    color: var(--shell-muted-text);
    font-size: 0.74rem;
    font-weight: 600;
}

.workspace-template__toggle-icon {
    display: inline-grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    transition: transform 140ms ease;
}

.workspace-template__toggle-icon--open {
    transform: rotate(90deg);
}

.workspace-template__toggle-icon-svg {
    width: 0.9rem;
    height: 0.9rem;
}

.workspace-template__requirement {
    max-width: 68rem;
    font-size: 0.94rem;
    line-height: 1.5;
}

.workspace-template__filters,
.workspace-template__quick-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.workspace-template__filter,
.workspace-template__chip,
.workspace-template__recipient-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.36rem 0.74rem;
    border: 1px solid var(--shell-border);
    border-radius: 999px;
    background: var(--shell-surface);
    color: var(--shell-muted-text);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.workspace-template__filter--active {
    background: var(--shell-primary);
    border-color: var(--shell-primary);
    color: #ffffff;
}

.workspace-template__chip--warning {
    border-color: color-mix(in srgb, var(--shell-warning) 30%, var(--shell-border));
    color: var(--shell-warning);
}

.workspace-template__chip--danger {
    border-color: color-mix(in srgb, var(--shell-danger) 28%, var(--shell-border));
    color: var(--shell-danger);
}

.workspace-template__chip--secondary,
.workspace-template__recipient-pill--team {
    border-color: color-mix(in srgb, var(--shell-secondary) 28%, var(--shell-border));
    color: var(--shell-secondary);
}

.workspace-template__stats,
.workspace-template__eyebrow,
.workspace-template__group-heading,
.workspace-template__rail-heading h3 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.workspace-template__stats {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 0.7rem 1.25rem 0.85rem;
    color: var(--shell-muted-text);
}

.workspace-template__timeline-scroll,
.workspace-template__team-feed,
.workspace-template__chat-list {
    min-height: 0;
    overflow: auto;
}

.workspace-template__timeline-scroll {
    padding: 0 1.25rem 1.1rem;
    display: grid;
    align-content: start;
    gap: 1rem;
}

.workspace-template__stack {
    display: grid;
    gap: 0.85rem;
}

.workspace-template__group-heading {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--shell-muted-text);
}

.workspace-template__card-topline,
.workspace-template__card-meta-inline,
.workspace-template__note-header,
.workspace-template__message-meta,
.workspace-template__rail-heading,
.workspace-template__queue-item,
.workspace-template__chat-item,
.workspace-template__team-message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
}

.workspace-template__message-body,
.workspace-template__queue-copy {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
    flex: 1 1 auto;
}

.workspace-template__card-meta-inline {
    align-items: center;
    color: var(--shell-muted-text);
    font-size: 0.8rem;
    white-space: nowrap;
}

.workspace-template__finding-card,
.workspace-template__evidence-card,
.workspace-template__note-card,
.workspace-template__board-card,
.workspace-template__queue-item,
.workspace-template__chat-item,
.workspace-template__team-message {
    border-radius: 1rem;
    border: 1px solid var(--shell-border);
    background: var(--shell-surface);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.workspace-template__finding-card,
.workspace-template__evidence-card,
.workspace-template__note-card,
.workspace-template__board-card {
    padding: 1rem 1.05rem;
}

.workspace-template__finding-card--ofi {
    border-color: color-mix(in srgb, var(--shell-warning) 38%, var(--shell-border));
}

.workspace-template__finding-card--nc {
    border-color: color-mix(in srgb, var(--shell-danger) 26%, var(--shell-border));
}

.workspace-template__evidence-grid,
.workspace-template__board-grid {
    display: grid;
    gap: 0.9rem;
    grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
    padding: 1rem 1.25rem 1.25rem;
}

.workspace-template__board-grid {
    align-content: start;
}

.workspace-template__board-card--active {
    background: color-mix(in srgb, var(--shell-primary) 5%, var(--shell-surface));
    border-color: color-mix(in srgb, var(--shell-primary) 18%, var(--shell-border));
}

.workspace-template__detail,
.workspace-template__board-meta {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--shell-border);
    color: var(--shell-muted-text);
    font-size: 0.84rem;
    line-height: 1.5;
}

.workspace-template__board-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.workspace-template__note-author {
    display: flex;
    gap: 0.7rem;
    min-width: 0;
}

.workspace-template__note-author > div:last-child {
    display: grid;
    gap: 0.12rem;
}

.workspace-template__composer {
    display: grid;
    gap: 0.85rem;
    padding: 0.9rem 1.25rem 1.15rem;
    border-top: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__composer--team {
    grid-template-columns: minmax(0, 1fr);
}

.workspace-template__quick-actions {
    color: var(--shell-muted-text);
}

.workspace-template__quick-actions--team {
    justify-content: flex-start;
}

.workspace-template__input-shell,
.workspace-template__chat-compose-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.65rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.9rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 70%, var(--shell-surface));
}

.workspace-template__chat-compose-shell {
    grid-template-columns: minmax(0, 1fr) auto;
}

.workspace-template__icon-button,
.workspace-template__send-button {
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.8rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 84%, var(--shell-surface));
    color: var(--shell-primary);
}

.workspace-template__send-button {
    background: var(--shell-primary);
    color: #ffffff;
}

.workspace-template__input-copy {
    min-width: 0;
    display: grid;
    gap: 0.16rem;
}

.workspace-template__input-copy strong {
    font-size: 0.96rem;
    line-height: 1.2;
}

.workspace-template__rail {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
    border-left: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__rail-section {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-template__rail-section--chat {
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
}

.workspace-template__rail-heading {
    align-items: center;
}

.workspace-template__rail-heading span {
    color: var(--shell-muted-text);
    font-size: 0.82rem;
}

.workspace-template__rail-title {
    font-size: 0.98rem;
    font-weight: 700;
}

.workspace-template__participant-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.workspace-template__participant-pill {
    position: relative;
    display: inline-flex;
}

.workspace-template__participant-status {
    position: absolute;
    right: -0.1rem;
    bottom: -0.1rem;
    width: 0.68rem;
    height: 0.68rem;
    border-radius: 999px;
    border: 2px solid var(--shell-surface);
    background: color-mix(in srgb, var(--shell-muted-text) 25%, transparent);
}

.workspace-template__participant-status--online {
    background: var(--shell-success);
}

.workspace-template__participant-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    color: var(--shell-muted-text);
    font-size: 0.68rem;
}

.workspace-template__participant-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.workspace-template__legend-dot {
    width: 0.48rem;
    height: 0.48rem;
    border-radius: 999px;
    display: inline-block;
}

.workspace-template__legend-dot--lead { background: #22408f; }
.workspace-template__legend-dot--auditor { background: #6366f1; }
.workspace-template__legend-dot--trainee { background: #f59e0b; }
.workspace-template__legend-dot--customer { background: #0f8ea0; }

.workspace-template__queue {
    display: grid;
    gap: 0.6rem;
}

.workspace-template__queue-item {
    width: 100%;
    padding: 0.72rem 0.8rem;
    text-align: left;
}

.workspace-template__queue-item--active {
    background: color-mix(in srgb, var(--shell-primary) 8%, var(--shell-surface));
    border-color: color-mix(in srgb, var(--shell-primary) 20%, var(--shell-border));
}

.workspace-template__queue-badge {
    display: inline-grid;
    place-items: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-surface-muted) 92%, var(--shell-surface));
    color: var(--shell-muted-text);
    font-size: 0.72rem;
    font-weight: 700;
    flex: 0 0 auto;
}

.workspace-template__queue-copy strong {
    font-size: 0.9rem;
    line-height: 1.25;
}

.workspace-template__queue-meta {
    display: grid;
    justify-items: end;
    gap: 0.15rem;
    color: var(--shell-muted-text);
    font-size: 0.76rem;
}

.workspace-template__queue-arrow {
    width: 0.9rem;
    height: 0.9rem;
}

.workspace-template__chat-list,
.workspace-template__team-feed {
    display: grid;
    gap: 0.7rem;
    align-content: start;
}

.workspace-template__chat-item,
.workspace-template__team-message {
    padding: 0.82rem 0.88rem;
}

.workspace-template__chat-badge {
    display: inline-flex;
    width: fit-content;
    margin-top: 0.45rem;
    padding: 0.18rem 0.48rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: color-mix(in srgb, var(--shell-surface-muted) 92%, var(--shell-surface));
    color: var(--shell-muted-text);
}

.workspace-template__chat-badge--team {
    background: color-mix(in srgb, var(--shell-warning) 12%, var(--shell-surface));
    color: var(--shell-warning);
}

.workspace-template__chat-badge--direct {
    background: color-mix(in srgb, var(--shell-primary) 12%, var(--shell-surface));
    color: var(--shell-primary);
}

.workspace-template__chat-composer {
    display: grid;
    gap: 0.5rem;
}

@media (max-width: 1200px) {
    .template-dashboard__metrics,
    .template-dashboard__grid,
    .template-dashboard__grid--bottom,
    .workspace-template__body {
        grid-template-columns: 1fr;
    }

    .workspace-template__rail {
        border-left: 0;
        border-top: 1px solid var(--shell-border);
    }
}

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

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

    .template-dashboard__header,
    .workspace-template__chapter-summary,
    .workspace-template__composer--team,
    .topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar__actions {
        justify-content: space-between;
    }
}

@media (max-width: 640px) {
    .shell__main,
    .workspace-template__main,
    .workspace-template__rail-section {
        padding: 1rem;
    }

    .workspace-template__room-tabs,
    .workspace-template__chapter-bar {
        padding-inline: 0.75rem;
    }

    .workspace-template__room-tabs,
    .workspace-template__chapter-tabs,
    .workspace-template__quick-actions,
    .template-inline-meta,
    .template-audit-item__footer {
        flex-direction: column;
        align-items: stretch;
    }
}

/* --- Global nav-menu override so NavLink/AppIcon output matches the published template exactly. --- */
.sidebar-nav {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    height: 100%;
    padding: 0.75rem;
}

.sidebar-nav__group {
    display: grid;
    gap: 0.25rem;
    align-content: start;
}

.sidebar-nav__group--audit {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--shell-border);
}

.sidebar-nav__group--footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--shell-border);
}

.sidebar-audit-context {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.2rem 0.55rem;
    margin: 0.75rem 0 0;
    padding: 0.8rem 1rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 45%, var(--shell-surface));
}

.sidebar-audit-context__icon {
    display: inline-grid;
    place-items: start center;
    grid-row: 1 / span 2;
    padding-top: 0.12rem;
    color: var(--shell-muted-text);
}

.sidebar-audit-context__icon-svg {
    width: 1rem;
    height: 1rem;
}

.sidebar-audit-context__title {
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--shell-text);
    word-break: break-word;
}

.sidebar-audit-context__meta {
    color: var(--shell-muted-text);
    font-size: 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.72rem 0.9rem;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 0.85rem;
    background: transparent;
    color: var(--shell-text);
    text-align: left;
    text-decoration: none;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

a.sidebar-link:hover,
button.sidebar-link:hover {
    background: color-mix(in srgb, var(--shell-surface-muted) 85%, var(--shell-surface));
}

a.sidebar-link.active,
button.sidebar-link.active {
    background: var(--shell-sidebar-primary);
    border-color: var(--shell-sidebar-primary);
    color: var(--shell-sidebar-primary-foreground);
}

.sidebar-link--disabled {
    opacity: 0.72;
    cursor: default;
}

.sidebar-link__icon-shell {
    display: grid;
    place-items: center;
    width: 1rem;
    height: 1rem;
    color: currentColor;
    flex: 0 0 auto;
}

.sidebar-link__icon {
    width: 1rem;
    height: 1rem;
}

.sidebar-link__content {
    min-width: 0;
    display: block;
    flex: 1 1 auto;
}

.sidebar-link__label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
}

.sidebar-link__description {
    display: none;
}

.app-update-banner {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    display: grid;
    gap: 0.55rem;
    width: min(25rem, calc(100vw - 2rem));
    padding: 1rem 1.05rem;
    border: 1px solid color-mix(in srgb, var(--shell-border) 92%, white 8%);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--shell-surface) 92%, white 8%);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
}

.app-update-banner__eyebrow {
    font-size: 0.73rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--shell-primary);
}

.app-update-banner__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--shell-text);
}

.app-update-banner__text {
    font-size: 0.86rem;
    color: var(--shell-muted-text);
}

.app-update-banner__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
}

.app-update-banner__button {
    min-width: 6.75rem;
    padding: 0.65rem 0.95rem;
    border-radius: 0.82rem;
    border: 1px solid transparent;
    transition: transform 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

.app-update-banner__button:hover {
    transform: translateY(-1px);
}

.app-update-banner__button--secondary {
    border-color: color-mix(in srgb, var(--shell-border) 100%, transparent);
    background: transparent;
    color: var(--shell-text);
}

.app-update-banner__button--primary {
    background: var(--shell-primary);
    color: #ffffff;
}

@media (max-width: 640px) {
    .app-update-banner {
        left: 1rem;
        width: auto;
    }

    .app-update-banner__actions {
        flex-direction: column-reverse;
    }

    .app-update-banner__button {
        width: 100%;
    }
}

/* Final workspace fidelity pass based on the original src.zip layout */
.topbar--workspace-view {
    padding: 0.875rem 1.5rem;
    background: var(--shell-surface);
    backdrop-filter: none;
}

.topbar--workspace-view .topbar__search {
    max-width: 28rem;
}

.topbar--workspace-view .topbar__search-input {
    padding: 0.75rem 0.95rem 0.75rem 2.45rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
}

.topbar--workspace-view .topbar__search-icon {
    left: 0.85rem;
}

.topbar--workspace-view .topbar__button {
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: 0.45rem;
    border-color: transparent;
    border-radius: 0.65rem;
    background: transparent;
}

.topbar--workspace-view .topbar__button:hover {
    background: color-mix(in srgb, var(--shell-surface-muted) 84%, var(--shell-surface));
    transform: none;
}

.topbar--workspace-view .topbar__avatar {
    width: 2.15rem;
    height: 2.15rem;
    font-size: 0.86rem;
}

.shell__main--workspace-view {
    padding: 0;
    overflow: hidden;
    background: var(--shell-surface);
}

.shell__main--workspace-view > .workspace-template {
    height: 100%;
    min-height: 0;
}

.workspace-template {
    height: 100%;
    min-height: 0;
    background: var(--shell-surface);
}

.workspace-template__room-tabs,
.workspace-template__chapter-bar {
    padding-inline: 1rem;
}

.workspace-template__room-tabs {
    padding-top: 0.375rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 45%, var(--shell-surface));
}

.workspace-template__room-tab-row {
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.workspace-template__room-tab {
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem 0.5rem 0 0;
    font-size: 0.875rem;
    font-weight: 500;
}

.workspace-template__room-tab--active {
    box-shadow: inset 0 1px 0 var(--shell-border), inset 1px 0 0 var(--shell-border), inset -1px 0 0 var(--shell-border);
}

.workspace-template__room-tab--ghost {
    border-radius: 0.5rem 0.5rem 0 0;
}

.workspace-template__room-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.workspace-template__chapter-bar {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    background: var(--shell-surface);
}

.workspace-template__chapter-tabs {
    gap: 0.25rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0;
}

.workspace-template__chapter-tab {
    gap: 0.35rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.workspace-template__timer {
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 74%, var(--shell-surface));
    font-family: "SFMono-Regular", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.875rem;
    font-weight: 500;
}

.workspace-template__timer-icon {
    width: 0.85rem;
    height: 0.85rem;
}

.workspace-template__body {
    grid-template-columns: minmax(0, 1fr) 21.25rem;
}

.workspace-template__main {
    gap: 0;
    padding: 0;
    overflow: hidden;
    background: var(--shell-surface);
}

.workspace-template__main--timeline {
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.workspace-template__main--board {
    gap: 0.75rem;
    padding: 1rem;
}

.workspace-template__chapter-header-panel {
    display: grid;
    grid-template-rows: auto auto;
    border-bottom: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__section-heading {
    padding: 0.25rem 0.1rem 0.5rem;
}

.workspace-template__section-heading h2,
.workspace-template__chapter-summary h2 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.workspace-template__section-heading p,
.workspace-template__chapter-summary p,
.workspace-template__finding-card p,
.workspace-template__evidence-card p,
.workspace-template__note-card p,
.workspace-template__board-card p {
    font-size: 0.75rem;
    line-height: 1.45;
}

.workspace-template__chapter-summary {
    gap: 0.85rem;
    padding: 0.75rem 1rem 0.55rem;
    border-bottom: 0;
}

.workspace-template__chapter-copy {
    min-width: 0;
}

.workspace-template__chapter-title-row {
    margin-bottom: 0.35rem;
}

.workspace-template__chapter-summary-icon,
.workspace-template__group-icon {
    width: 0.9rem;
    height: 0.9rem;
}

.workspace-template__requirement-toggle {
    gap: 0.35rem;
    font-size: 0.75rem;
}

.workspace-template__requirement {
    font-size: 0.75rem;
    line-height: 1.45;
}

.workspace-template__filters,
.workspace-template__quick-actions {
    gap: 0.25rem;
}

.workspace-template__filter,
.workspace-template__chip {
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    border-color: transparent;
    font-size: 0.75rem;
    font-weight: 500;
}

.workspace-template__stats {
    gap: 1rem;
    padding: 0 1rem 0.75rem;
    font-size: 0.75rem;
}

.workspace-template__timeline-scroll {
    padding: 1rem;
}

.workspace-template__stack {
    gap: 1.25rem;
}

.workspace-template__group-heading {
    margin-bottom: 0.5rem;
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
}

.workspace-template__finding-card,
.workspace-template__evidence-card,
.workspace-template__note-card,
.workspace-template__board-card {
    padding: 0.75rem;
    border-radius: 0.5rem;
    box-shadow: none;
}

.workspace-template__finding-card--ofi,
.workspace-template__finding-card--nc {
    border-left-width: 2px;
}

.workspace-template__finding-card--ofi {
    border-left-color: var(--shell-warning);
    background: color-mix(in srgb, var(--shell-warning) 10%, var(--shell-surface));
}

.workspace-template__finding-card--nc {
    border-left-color: var(--shell-danger);
    background: color-mix(in srgb, var(--shell-danger) 8%, var(--shell-surface));
}

.workspace-template__evidence-card {
    border-left: 2px solid var(--shell-secondary);
}

.workspace-template__evidence-grid,
.workspace-template__board-grid {
    gap: 0.5rem;
}

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

.workspace-template__card-topline,
.workspace-template__note-header {
    gap: 0.45rem;
    margin-bottom: 0.45rem;
}

.workspace-template__card-meta-inline,
.workspace-template__note-author {
    gap: 0.4rem;
}

.workspace-template__detail,
.workspace-template__board-meta {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    font-size: 0.6875rem;
    line-height: 1.4;
}

.workspace-template__note-card {
    overflow: hidden;
}

.workspace-template__note-header {
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-template__note-card > p {
    padding-top: 0.1rem;
}

.workspace-template__composer {
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 0;
    border-top: 1px solid var(--shell-border);
    border-radius: 0;
    background: var(--shell-surface);
}

.workspace-template__quick-capture-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: flex-start;
}

.workspace-template__quick-capture-input {
    width: 100%;
    min-height: 3rem;
    max-height: 7rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.625rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 72%, var(--shell-surface));
    color: var(--shell-text);
    font-size: 0.875rem;
    line-height: 1.4;
    resize: none;
    overflow: auto;
}

.workspace-template__quick-capture-input::placeholder {
    color: var(--shell-muted-text);
}

.workspace-template__quick-capture-input:focus {
    outline: 2px solid color-mix(in srgb, var(--shell-primary) 18%, transparent);
    border-color: color-mix(in srgb, var(--shell-primary) 38%, var(--shell-border));
}

.workspace-template__icon-button,
.workspace-template__send-button {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.625rem;
}

.workspace-template__input-icon {
    width: 0.95rem;
    height: 0.95rem;
}

.workspace-template__rail {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    background: var(--shell-surface);
}

.workspace-template__rail-section {
    gap: 0.6rem;
    padding: 0.75rem;
}

.workspace-template__rail-heading h3,
.workspace-template__rail-heading span {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
}

.workspace-template__rail-title {
    margin-top: -0.1rem;
    font-size: 0.9375rem;
    font-weight: 500;
}

.workspace-template__participant-stack {
    gap: 0.25rem;
}

.workspace-template__participant-pill .participant-avatar {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.64rem;
}

.workspace-template__participant-legend {
    gap: 0.5rem;
    font-size: 0.5625rem;
}

.workspace-template__legend-dot {
    width: 0.4rem;
    height: 0.4rem;
}

.workspace-template__queue {
    gap: 0.25rem;
}

.workspace-template__queue-item {
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.5rem;
    border-color: transparent;
}

.workspace-template__queue-item--active {
    background: color-mix(in srgb, var(--shell-primary) 10%, var(--shell-surface));
    border-color: transparent;
}

.workspace-template__queue-badge {
    width: 1rem;
    height: 1rem;
    font-size: 0.5rem;
}

.workspace-template__queue-copy strong {
    font-size: 0.75rem;
    font-weight: 500;
}

.workspace-template__queue-copy span,
.workspace-template__queue-meta span {
    font-size: 0.625rem;
}

.workspace-template__queue-arrow {
    width: 0.7rem;
    height: 0.7rem;
}

.workspace-template__rail-section--chat {
    gap: 0;
    padding: 0;
}

.workspace-template__rail-heading--chat {
    padding: 0.75rem 0.75rem 0.35rem;
    border-bottom: 0;
}

.workspace-template__chat-thread {
    gap: 0.625rem;
    padding: 0 0.75rem 0.75rem;
}

.workspace-template__chat-message .participant-avatar,
.workspace-template__team-message .participant-avatar {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.58rem;
}

.workspace-template__chat-message-copy,
.workspace-template__team-message-copy {
    gap: 0.15rem;
}

.workspace-template__chat-message-topline,
.workspace-template__team-message-meta {
    gap: 0.3rem;
}

.workspace-template__chat-message-topline strong,
.workspace-template__team-message-meta strong {
    font-size: 0.75rem;
    font-weight: 600;
}

.workspace-template__chat-message-topline > span,
.workspace-template__team-message-meta span {
    font-size: 0.625rem;
}

.workspace-template__chat-message p,
.workspace-template__team-bubble {
    font-size: 0.75rem;
    line-height: 1.45;
}

.workspace-template__team-chat-scroll {
    padding: 1rem;
    gap: 0.75rem;
}

.workspace-template__team-bubble {
    padding: 0.55rem 0.75rem;
    border-radius: 0.625rem;
}

.workspace-template__team-chat-footer {
    padding: 0.75rem;
}

.workspace-template__team-compose-row,
.workspace-template__chat-input-row {
    gap: 0.375rem;
}

.workspace-template__team-input,
.workspace-template__chat-input {
    padding: 0.55rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
}

.workspace-template__chat-compose {
    gap: 0.4rem;
    padding: 0.5rem 0.75rem 0.75rem;
}

.workspace-template__recipient-toggle {
    gap: 0.25rem;
    padding: 0.125rem 0.45rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
}

.workspace-template__recipient-icon,
.workspace-template__recipient-chevron,
.workspace-template__recipient-option-icon,
.workspace-template__chat-badge-icon {
    width: 0.72rem;
    height: 0.72rem;
}

.workspace-template__recipient-menu {
    width: 12rem;
    padding: 0.25rem;
    border-radius: 0.75rem;
}

.workspace-template__recipient-option {
    gap: 0.45rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.55rem;
    font-size: 0.7rem;
}

.workspace-template__recipient-option-avatar {
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.45rem;
}

.workspace-template__chat-badge {
    padding: 0.08rem 0.3rem;
    font-size: 0.54rem;
}

@media (max-width: 920px) {
    .topbar--workspace-view {
        padding-inline: 1rem;
    }

    .topbar--workspace-view .topbar__search {
        max-width: none;
    }

    .shell__main--workspace-view {
        overflow: auto;
    }

    .workspace-template__body {
        grid-template-columns: 1fr;
    }

    .workspace-template__rail {
        border-top: 1px solid var(--shell-border);
        border-left: 0;
    }
}

@media (max-width: 640px) {
    .workspace-template__room-tabs,
    .workspace-template__chapter-bar,
    .workspace-template__chapter-summary,
    .workspace-template__timeline-scroll,
    .workspace-template__composer,
    .workspace-template__team-chat-scroll,
    .workspace-template__team-chat-footer {
        padding-inline: 0.75rem;
    }

    .workspace-template__room-tab-row,
    .workspace-template__chapter-tabs {
        flex-wrap: wrap;
    }

    .workspace-template__quick-capture-row,
    .workspace-template__team-compose-row,
    .workspace-template__chat-input-row {
        grid-template-columns: 1fr;
    }
}

/* Workspace chat refinement aligned closer to the original prototype */
.workspace-template__main--team {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
}

.workspace-template__team-chat-scroll {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1rem 0;
    display: grid;
    gap: 0.85rem;
}

.workspace-template__chat-empty-state {
    display: grid;
    place-items: center;
    gap: 0.5rem;
    min-height: 15rem;
    color: var(--shell-muted-text);
    text-align: center;
}

.workspace-template__chat-empty-icon {
    width: 2rem;
    height: 2rem;
    opacity: 0.45;
}

.workspace-template__team-message,
.workspace-template__chat-message {
    display: flex;
    gap: 0.7rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.workspace-template__team-message .participant-avatar,
.workspace-template__chat-message .participant-avatar {
    width: 1.6rem;
    height: 1.6rem;
    font-size: 0.64rem;
}

.workspace-template__team-message-copy,
.workspace-template__chat-message-copy {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.workspace-template__team-message-meta,
.workspace-template__chat-message-topline {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.workspace-template__team-message-meta strong,
.workspace-template__chat-message-topline strong {
    font-size: 0.82rem;
    line-height: 1.2;
}

.workspace-template__team-message-meta span,
.workspace-template__chat-message-topline > span {
    color: var(--shell-muted-text);
    font-size: 0.68rem;
    line-height: 1.2;
}

.workspace-template__team-bubble {
    display: inline-block;
    width: fit-content;
    max-width: min(34rem, 100%);
    padding: 0.7rem 0.85rem;
    border-radius: 0.85rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 88%, var(--shell-surface));
    color: var(--shell-text);
    font-size: 0.83rem;
    line-height: 1.45;
}

.workspace-template__team-chat-footer {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__team-compose-row,
.workspace-template__chat-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem;
    align-items: center;
}

.workspace-template__team-input,
.workspace-template__chat-input {
    width: 100%;
    min-width: 0;
    padding: 0.72rem 0.85rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 68%, var(--shell-surface));
    color: var(--shell-text);
    font-size: 0.78rem;
    line-height: 1.2;
}

.workspace-template__team-input::placeholder,
.workspace-template__chat-input::placeholder {
    color: var(--shell-muted-text);
}

.workspace-template__team-input:focus,
.workspace-template__chat-input:focus {
    outline: 2px solid color-mix(in srgb, var(--shell-primary) 25%, transparent);
    border-color: color-mix(in srgb, var(--shell-primary) 35%, var(--shell-border));
}

.workspace-template__send-button--compact {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.72rem;
}

.workspace-template__send-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.workspace-template__rail-section--chat {
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    gap: 0;
    padding: 0;
}

.workspace-template__rail-heading--chat {
    padding: 0.9rem 1rem 0.6rem;
    border-bottom: 1px solid var(--shell-border);
}

.workspace-template__chat-thread {
    min-height: 0;
    overflow: auto;
    display: grid;
    gap: 0.95rem;
    padding: 0.9rem 1rem;
}

.workspace-template__chat-message-topline {
    gap: 0.35rem;
}

.workspace-template__chat-message p {
    margin: 0;
    color: var(--shell-text);
    font-size: 0.76rem;
    line-height: 1.45;
}

.workspace-template__chat-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    width: fit-content;
    margin-top: 0;
    padding: 0.12rem 0.38rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.workspace-template__chat-badge-icon {
    width: 0.68rem;
    height: 0.68rem;
    stroke-width: 2.2;
}

.workspace-template__chat-badge--all {
    background: color-mix(in srgb, var(--shell-surface-muted) 72%, var(--shell-surface));
    color: var(--shell-muted-text);
    border-color: color-mix(in srgb, var(--shell-border) 90%, transparent);
}

.workspace-template__chat-badge--team {
    background: color-mix(in srgb, #f59e0b 12%, var(--shell-surface));
    color: #b45309;
    border-color: color-mix(in srgb, #f59e0b 22%, transparent);
}

.workspace-template__chat-badge--direct {
    background: color-mix(in srgb, #6366f1 12%, var(--shell-surface));
    color: #4338ca;
    border-color: color-mix(in srgb, #6366f1 22%, transparent);
}

.workspace-template__chat-compose {
    position: relative;
    display: grid;
    gap: 0.55rem;
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--shell-border);
    background: var(--shell-surface);
}

.workspace-template__recipient-menu-shell {
    position: relative;
}

.workspace-template__recipient-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid transparent;
    border-radius: 0.45rem;
    font-size: 0.64rem;
    font-weight: 600;
    transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.workspace-template__recipient-toggle--all {
    background: color-mix(in srgb, var(--shell-surface-muted) 72%, var(--shell-surface));
    color: var(--shell-muted-text);
    border-color: transparent;
}

.workspace-template__recipient-toggle--team {
    background: color-mix(in srgb, #f59e0b 10%, var(--shell-surface));
    color: #b45309;
    border-color: color-mix(in srgb, #f59e0b 18%, transparent);
}

.workspace-template__recipient-toggle--direct {
    background: color-mix(in srgb, #6366f1 10%, var(--shell-surface));
    color: #4338ca;
    border-color: color-mix(in srgb, #6366f1 18%, transparent);
}

.workspace-template__recipient-icon,
.workspace-template__recipient-chevron,
.workspace-template__recipient-option-icon {
    width: 0.78rem;
    height: 0.78rem;
    stroke-width: 2.2;
}

.workspace-template__recipient-chevron {
    opacity: 0.72;
}

.workspace-template__recipient-menu {
    position: absolute;
    bottom: calc(100% + 0.45rem);
    left: 0;
    z-index: 20;
    display: grid;
    gap: 0.1rem;
    width: 13rem;
    padding: 0.3rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.9rem;
    background: var(--shell-surface);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.workspace-template__recipient-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.48rem 0.58rem;
    border-radius: 0.7rem;
    color: var(--shell-text);
    font-size: 0.73rem;
    text-align: left;
}

.workspace-template__recipient-option:hover,
.workspace-template__recipient-option--active {
    background: color-mix(in srgb, var(--shell-surface-muted) 80%, var(--shell-surface));
}

.workspace-template__recipient-option-avatar {
    width: 1rem;
    height: 1rem;
    font-size: 0.5rem;
}

.workspace-template__chat-send-button {
    flex: 0 0 auto;
}

@media (max-width: 920px) {
    .workspace-template__team-bubble {
        max-width: 100%;
    }

    .workspace-template__recipient-menu {
        width: min(14rem, 100%);
    }
}

@media (max-width: 640px) {
    .workspace-template__team-compose-row,
    .workspace-template__chat-input-row {
        grid-template-columns: 1fr;
    }

    .workspace-template__recipient-toggle {
        width: 100%;
        justify-content: space-between;
    }
}

/* Follow-up fidelity corrections after visual review across workspace and standard pages. */
.sidebar-audit-context {
    grid-row: 2;
}

.sidebar-nav__group--audit {
    grid-row: 3;
}

.sidebar-nav__group--footer {
    grid-row: 4;
}

.sidebar-audit-context {
    display: grid;
    gap: 0.55rem;
}

.sidebar-audit-context__eyebrow {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-primary-soft) 88%, var(--shell-surface));
    color: var(--shell-primary-strong);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-audit-context__body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.2rem 0.55rem;
}

.sidebar-audit-context__copy {
    min-width: 0;
    display: grid;
    gap: 0.15rem;
}

.split-panel {
    align-items: start;
}

.customers-page {
    display: grid;
    gap: 1.15rem;
}

.customers-page__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.customers-page__header h1 {
    margin-top: 0.35rem;
    font-size: 1.95rem;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.customers-page__portal-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0 0.95rem;
    border: 1px solid var(--shell-border);
    border-radius: 0.75rem;
    background: color-mix(in srgb, var(--shell-surface-muted) 86%, var(--shell-surface));
    color: var(--shell-text);
    font-size: 0.86rem;
    font-weight: 600;
    transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.customers-page__portal-link:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--shell-primary) 26%, var(--shell-border));
    background: color-mix(in srgb, var(--shell-primary-soft) 40%, var(--shell-surface));
}

.customers-page__grid {
    gap: 1rem;
}

.customers-page__card {
    gap: 0.75rem;
}

.customers-page__card--requests .task-list {
    gap: 0.7rem;
}

.customers-page__request-item {
    align-items: center;
}

.template-dashboard {
    gap: 1.1rem;
}

.template-dashboard__metrics,
.template-dashboard__grid,
.template-dashboard__grid--bottom,
.template-dashboard__stack {
    gap: 1rem;
}

.template-dashboard__grid--bottom {
    align-items: start;
}

.template-metric-card,
.template-panel {
    border-radius: 0.82rem;
}

.template-metric-card {
    min-height: 6.8rem;
    padding: 1.1rem 1.2rem;
}

.template-panel__header,
.template-audit-item,
.template-simple-item,
.template-recent-item,
.template-task-item {
    padding: 1.15rem 1.2rem;
}

.template-progress-block {
    margin-top: 0.85rem;
}

.template-audit-item__footer {
    margin-top: 0.8rem;
}

.shell--workspace-view .workspace-template {
    grid-template-rows: auto minmax(0, 1fr);
}

.shell--workspace-view .workspace-template__room-tabs {
    border-bottom: 1px solid var(--shell-border);
}

.shell--workspace-view .workspace-template__room-tab {
    margin-bottom: -1px;
    border: 1px solid transparent;
    border-bottom-color: transparent;
    border-radius: 0.42rem 0.42rem 0 0;
}

.shell--workspace-view .workspace-template__room-tab--active {
    border-color: var(--shell-border);
    border-bottom-color: var(--shell-surface);
    background: var(--shell-surface);
    box-shadow: none;
}

.shell--workspace-view .workspace-template__chapter-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.7rem;
    padding-bottom: 0.4rem;
}

.shell--workspace-view .workspace-template__stats {
    padding-top: 0.45rem;
    border-top: 1px solid color-mix(in srgb, var(--shell-border) 88%, transparent);
}

.shell--workspace-view .workspace-template__evidence-grid {
    padding: 0;
}

.workspace-template__evidence-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.workspace-template__evidence-icon-shell {
    display: inline-grid;
    place-items: center;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 0.42rem;
    background: color-mix(in srgb, var(--shell-secondary) 12%, var(--shell-surface));
    color: var(--shell-secondary);
    flex: 0 0 auto;
}

.workspace-template__evidence-icon {
    width: 0.86rem;
    height: 0.86rem;
}

.shell--workspace-view .workspace-template__evidence-card h3 {
    font-size: 0.86rem;
    line-height: 1.2;
}

.shell--workspace-view .workspace-template__quick-actions {
    align-items: baseline;
    gap: 0.15rem;
}

.shell--workspace-view .workspace-template__quick-actions > span {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--shell-muted-text);
}

.shell--workspace-view .workspace-template__chip {
    padding: 0.04rem 0.2rem;
    border: 0;
    background: transparent;
    border-radius: 0.25rem;
    font-size: 0.7rem;
}

.shell--workspace-view .workspace-template__chip:hover {
    background: color-mix(in srgb, var(--shell-surface-muted) 78%, var(--shell-surface));
}

.shell--workspace-view .workspace-template__quick-capture-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.shell--workspace-view .workspace-template__quick-capture-row .workspace-template__icon-button {
    width: 1.9rem;
    height: 1.9rem;
    border: 1px solid transparent;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--shell-muted-text);
}

.shell--workspace-view .workspace-template__quick-capture-row .workspace-template__icon-button:hover {
    background: color-mix(in srgb, var(--shell-surface-muted) 78%, var(--shell-surface));
}

.shell--workspace-view .workspace-template__quick-capture-row .workspace-template__send-button {
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 0.45rem;
}

.shell--workspace-view .workspace-template__queue-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
}

.shell--workspace-view .workspace-template__queue-item--active {
    background: color-mix(in srgb, var(--shell-primary) 9%, var(--shell-surface));
}

.shell--workspace-view .workspace-template__queue-copy strong {
    font-size: 0.7rem;
}

.shell--workspace-view .workspace-template__queue-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    white-space: nowrap;
}

.shell--workspace-view .workspace-template__rail-heading--chat {
    border-bottom: 0;
    padding-bottom: 0.15rem;
}

.shell--workspace-view .workspace-template__chat-thread {
    padding-top: 0.25rem;
}

/* Final workspace fidelity corrections based on the published demo shell and latest review feedback. */
.shell {
    min-height: 100dvh;
}

.shell__main {
    min-height: 0;
}

.shell--workspace-view {
    grid-template-columns: 15.75rem minmax(0, 1fr);
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.shell--workspace-view .shell__sidebar {
    gap: 0;
    height: 100%;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.shell--workspace-view .shell__brand {
    display: flex;
    align-items: center;
    min-height: 3.5rem;
    padding: 0 1.1rem;
    border-bottom: 1px solid var(--shell-border);
}

.shell--workspace-view .shell__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
}

.shell--workspace-view .sidebar-nav {
    padding: 0.75rem 0.5rem;
}

.shell--workspace-view .sidebar-nav__group {
    gap: 0.2rem;
}

.shell--workspace-view .sidebar-nav__group--audit {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
}

.shell--workspace-view .sidebar-nav__group--footer {
    padding-top: 0.65rem;
}

.shell--workspace-view .sidebar-audit-context {
    margin: 0.65rem 0 0;
    padding: 0.72rem 0.88rem;
    border-radius: 0.75rem;
}

.shell--workspace-view .sidebar-audit-context__title {
    font-size: 0.77rem;
    line-height: 1.3;
}

.shell--workspace-view .sidebar-audit-context__meta {
    font-size: 0.72rem;
}

.shell--workspace-view .sidebar-link {
    gap: 0.68rem;
    padding: 0.66rem 0.82rem;
    border-radius: 0.72rem;
}

.shell--workspace-view .sidebar-link__label {
    font-size: 0.8125rem;
    font-weight: 500;
}

.shell--workspace-view .shell__workspace {
    min-height: 0;
    overflow: hidden;
    grid-template-rows: auto minmax(0, 1fr);
}

.shell--workspace-view .topbar--workspace-view {
    min-height: 3.5rem;
    padding: 0 1.15rem;
}

.shell--workspace-view .topbar--workspace-view .topbar__search {
    max-width: 32rem;
}

.shell--workspace-view .shell__main--workspace-view {
    min-height: 0;
}

.shell--workspace-view .workspace-template {
    min-height: 0;
    height: 100%;
}

.shell--workspace-view .workspace-template__room-tabs,
.shell--workspace-view .workspace-template__chapter-bar {
    padding-inline: 0.75rem;
}

.shell--workspace-view .workspace-template__room-tabs {
    padding-top: 0.3rem;
}

.shell--workspace-view .workspace-template__room-tab-row {
    gap: 0.2rem;
}

.shell--workspace-view .workspace-template__room-tab {
    gap: 0.4rem;
    padding: 0.5rem 0.95rem;
    border-radius: 0.48rem 0.48rem 0 0;
    font-size: 0.82rem;
    font-weight: 600;
}

.shell--workspace-view .workspace-template__room-tab--ghost {
    padding-inline: 0.7rem;
}

.shell--workspace-view .workspace-template__chapter-bar {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.shell--workspace-view .workspace-template__chapter-tabs {
    gap: 0.2rem;
}

.shell--workspace-view .workspace-template__chapter-tab {
    gap: 0.28rem;
    padding: 0.34rem 0.68rem;
    border-radius: 0.45rem;
    font-size: 0.81rem;
}

.shell--workspace-view .workspace-template__timer {
    gap: 0.4rem;
    padding: 0.22rem 0.6rem;
    border-radius: 0.45rem;
    font-size: 0.8rem;
}

.shell--workspace-view .workspace-template__body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) 21.25rem;
}

.shell--workspace-view .workspace-template__main {
    min-height: 0;
}

.shell--workspace-view .workspace-template__main--timeline {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
}

.shell--workspace-view .workspace-template__chapter-header-panel {
    min-height: 0;
}

.shell--workspace-view .workspace-template__chapter-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.75rem;
    padding: 0.7rem 1rem 0.5rem;
}

.shell--workspace-view .workspace-template__chapter-copy {
    gap: 0.28rem;
}

.shell--workspace-view .workspace-template__chapter-title-row {
    gap: 0.6rem;
    margin-bottom: 0.2rem;
}

.shell--workspace-view .workspace-template__chapter-summary h2 {
    gap: 0.45rem;
    font-size: 0.9rem;
}

.shell--workspace-view .workspace-template__requirement-toggle {
    gap: 0.32rem;
    padding: 0.28rem 0.62rem;
    font-size: 0.72rem;
}

.shell--workspace-view .workspace-template__requirement {
    max-width: 56rem;
    font-size: 0.76rem;
    line-height: 1.4;
}

.shell--workspace-view .workspace-template__filters {
    flex-wrap: nowrap;
    gap: 0.22rem;
    align-items: center;
}

.shell--workspace-view .workspace-template__filter {
    padding: 0.14rem 0.46rem;
    border-radius: 0.38rem;
    font-size: 0.72rem;
}

.shell--workspace-view .workspace-template__stats {
    gap: 0.95rem;
    padding: 0 1rem 0.65rem;
    font-size: 0.72rem;
}

.shell--workspace-view .workspace-template__timeline-scroll {
    min-height: 0;
    overflow: auto;
    padding: 0.8rem 1rem;
}

.shell--workspace-view .workspace-template__stack {
    gap: 1rem;
}

.shell--workspace-view .workspace-template__group-heading {
    margin-bottom: 0.4rem;
    font-size: 0.67rem;
}

.shell--workspace-view .workspace-template__finding-card,
.shell--workspace-view .workspace-template__evidence-card,
.shell--workspace-view .workspace-template__note-card,
.shell--workspace-view .workspace-template__board-card {
    padding: 0.72rem 0.8rem;
    border-radius: 0.45rem;
}

.shell--workspace-view .workspace-template__card-topline,
.shell--workspace-view .workspace-template__note-header {
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.shell--workspace-view .workspace-template__note-header {
    padding-bottom: 0.4rem;
}

.shell--workspace-view .workspace-template__detail,
.shell--workspace-view .workspace-template__board-meta {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-size: 0.68rem;
}

.shell--workspace-view .workspace-template__evidence-grid {
    gap: 0.5rem;
}

.shell--workspace-view .workspace-template__composer {
    gap: 0.42rem;
    padding: 0.6rem 1rem 0.75rem;
}

.shell--workspace-view .workspace-template__quick-actions {
    gap: 0.2rem;
}

.shell--workspace-view .workspace-template__chip {
    padding: 0.08rem 0.38rem;
    border-radius: 0.34rem;
    font-size: 0.68rem;
}

.shell--workspace-view .workspace-template__quick-capture-row {
    gap: 0.4rem;
    align-items: center;
}

.shell--workspace-view .workspace-template__quick-capture-input {
    min-height: 2.6rem;
    max-height: 6rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.55rem;
    font-size: 0.78rem;
    line-height: 1.32;
}

.shell--workspace-view .workspace-template__icon-button,
.shell--workspace-view .workspace-template__send-button,
.shell--workspace-view .workspace-template__send-button--compact {
    width: 2rem;
    height: 2rem;
    border-radius: 0.55rem;
}

.shell--workspace-view .workspace-template__rail {
    min-height: 0;
    overflow: hidden;
}

.shell--workspace-view .workspace-template__rail-section {
    gap: 0.55rem;
    padding: 0.72rem 0.75rem;
}

.shell--workspace-view .workspace-template__rail-title {
    font-size: 0.88rem;
    font-weight: 600;
}

.shell--workspace-view .workspace-template__participant-stack {
    gap: 0.2rem;
}

.shell--workspace-view .workspace-template__participant-pill .participant-avatar {
    width: 1.62rem;
    height: 1.62rem;
    font-size: 0.6rem;
}

.shell--workspace-view .workspace-template__participant-legend {
    gap: 0.4rem;
    font-size: 0.55rem;
}

.shell--workspace-view .workspace-template__queue {
    gap: 0.18rem;
}

.shell--workspace-view .workspace-template__queue-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.5rem;
    padding: 0.32rem 0.45rem;
    border-radius: 0.45rem;
}

.shell--workspace-view .workspace-template__queue-badge {
    width: 0.95rem;
    height: 0.95rem;
    font-size: 0.48rem;
}

.shell--workspace-view .workspace-template__queue-copy {
    min-width: 0;
    display: block;
}

.shell--workspace-view .workspace-template__queue-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.2;
}

.shell--workspace-view .workspace-template__queue-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    color: var(--shell-muted-text);
    font-size: 0.62rem;
    line-height: 1;
    white-space: nowrap;
}

.shell--workspace-view .workspace-template__queue-meta span {
    font-size: 0.62rem;
    line-height: 1;
}

.shell--workspace-view .workspace-template__queue-arrow {
    width: 0.65rem;
    height: 0.65rem;
}

.shell--workspace-view .workspace-template__rail-section--chat {
    min-height: 0;
}

.shell--workspace-view .workspace-template__rail-heading--chat {
    padding: 0.7rem 0.75rem 0.4rem;
}

.shell--workspace-view .workspace-template__chat-thread {
    gap: 0.55rem;
    padding: 0.6rem 0.75rem 0.75rem;
}

.shell--workspace-view .workspace-template__chat-message {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.45rem;
}

.shell--workspace-view .workspace-template__chat-message .participant-avatar {
    width: 1.45rem;
    height: 1.45rem;
    font-size: 0.56rem;
}

.shell--workspace-view .workspace-template__chat-message-copy {
    display: grid;
    gap: 0.12rem;
}

.shell--workspace-view .workspace-template__chat-message-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.3rem;
}

.shell--workspace-view .workspace-template__chat-message-topline {
    min-width: 0;
    gap: 0.25rem;
    align-items: baseline;
}

.shell--workspace-view .workspace-template__chat-message-topline strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.74rem;
    line-height: 1.1;
}

.shell--workspace-view .workspace-template__chat-message-topline > span {
    font-size: 0.62rem;
    line-height: 1;
}

.shell--workspace-view .workspace-template__chat-badge {
    align-self: start;
    padding: 0.08rem 0.32rem;
    font-size: 0.54rem;
    line-height: 1;
}

.shell--workspace-view .workspace-template__chat-message p {
    font-size: 0.74rem;
    line-height: 1.35;
}

.shell--workspace-view .workspace-template__chat-compose {
    gap: 0.3rem;
    padding: 0.5rem 0.75rem 0.75rem;
}

.shell--workspace-view .workspace-template__recipient-toggle {
    padding: 0.1rem 0.42rem;
    font-size: 0.62rem;
}

.shell--workspace-view .workspace-template__chat-input-row {
    gap: 0.35rem;
}

.shell--workspace-view .workspace-template__chat-input {
    padding: 0.55rem 0.72rem;
    font-size: 0.74rem;
}

@media (max-width: 920px) {
    .shell--workspace-view {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100dvh;
        overflow: visible;
    }

    .shell--workspace-view .shell__sidebar {
        overflow: auto;
    }

    .shell--workspace-view .shell__workspace {
        overflow: visible;
    }

    .shell--workspace-view .shell__main--workspace-view {
        overflow: auto;
    }

    .shell--workspace-view .workspace-template__body {
        grid-template-columns: 1fr;
    }
}

/* Final visual pass after screenshot review: sidebar separation, dashboard balance and workspace/chat fidelity. */
.workspace-template {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.shell {
    min-height: 100dvh;
}

.shell__sidebar {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

.sidebar-nav {
    min-height: 0;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
}

.sidebar-nav__group--audit,
.sidebar-nav__group--footer {
    position: relative;
    border-top: 0;
}

.sidebar-nav__group--audit::before,
.sidebar-nav__group--footer::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: var(--shell-border);
}

.sidebar-nav__group--footer {
    position: sticky;
    bottom: 0;
    z-index: 1;
    padding-bottom: 0.15rem;
    background: linear-gradient(180deg, transparent 0%, var(--shell-surface) 16%, var(--shell-surface) 100%);
}

.sidebar-audit-context {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.42rem;
    padding: 0.68rem 0.78rem;
    overflow: hidden;
}

.sidebar-audit-context__title {
    width: 100%;
    min-width: 0;
    font-size: 0.72rem;
    line-height: 1.18;
    word-break: normal;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-audit-context__meta {
    width: 100%;
    font-size: 0.72rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.shell--workspace-view .sidebar-audit-context {
    gap: 0.42rem;
    padding: 0.66rem 0.72rem;
}

.shell--workspace-view .workspace-template__room-tabs {
    padding-top: 0;
    background: var(--shell-surface);
    border-bottom: 1px solid var(--shell-border);
}

.shell--workspace-view .workspace-template__room-tab-row {
    gap: 0;
}

.shell--workspace-view .workspace-template__room-tab {
    position: relative;
    gap: 0.4rem;
    margin-bottom: 0;
    padding: 0.72rem 0.95rem 0.68rem;
    border: 0;
    border-left: 1px solid transparent;
    border-right: 1px solid transparent;
    border-top: 1px solid transparent;
    border-radius: 0.82rem 0.82rem 0 0;
    background: transparent;
}

.shell--workspace-view .workspace-template__room-tab--active {
    border-top-color: var(--shell-border);
    border-left-color: var(--shell-border);
    border-right-color: var(--shell-border);
    background: var(--shell-surface);
}

.shell--workspace-view .workspace-template__room-tab--active::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px;
    height: 1px;
    background: var(--shell-surface);
}

.shell--workspace-view .workspace-template__room-tab--ghost {
    padding-inline: 0.7rem;
}

.shell--workspace-view .workspace-template__stats {
    gap: 1.1rem;
    margin-top: 0.15rem;
    padding-top: 0.55rem;
}

.shell--workspace-view .workspace-template__timeline-scroll {
    padding-top: 0.85rem;
}

.shell--workspace-view .workspace-template__composer {
    gap: 0.32rem;
    padding: 0.45rem 0.9rem 0.68rem;
}

.shell--workspace-view .workspace-template__quick-actions {
    gap: 0.28rem;
}

.shell--workspace-view .workspace-template__quick-actions > span {
    margin-right: 0.18rem;
}

.shell--workspace-view .workspace-template__quick-capture-row {
    gap: 0.35rem;
}

.shell--workspace-view .workspace-template__quick-capture-row .workspace-template__icon-button {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.42rem;
}

.shell--workspace-view .workspace-template__quick-capture-row .workspace-template__send-button {
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.42rem;
}

.shell--workspace-view .workspace-template__quick-capture-input {
    min-height: 2.25rem;
    padding: 0.62rem 0.78rem;
    border-radius: 0.52rem;
}

.workspace-template__evidence-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 0.45rem;
}

.workspace-template__evidence-copy {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.shell--workspace-view .workspace-template__evidence-icon {
    width: 0.92rem;
    height: 0.92rem;
    margin-top: 0.08rem;
    color: var(--shell-secondary);
}

.shell--workspace-view .workspace-template__evidence-card {
    gap: 0.52rem;
}

.shell--workspace-view .workspace-template__evidence-card h3 {
    font-size: 0.82rem;
    line-height: 1.24;
}

.shell--workspace-view .workspace-template__evidence-card p {
    margin: 0;
    color: var(--shell-muted-text);
    font-size: 0.76rem;
    line-height: 1.38;
}

.shell--workspace-view .workspace-template__evidence-card .workspace-template__detail {
    margin-top: 0.08rem;
    padding-top: 0.52rem;
}

.shell--workspace-view .workspace-template__queue {
    gap: 0.15rem;
}

.shell--workspace-view .workspace-template__queue-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.55rem;
    padding: 0.46rem 0.58rem;
}

.shell--workspace-view .workspace-template__queue-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.22;
}

.shell--workspace-view .workspace-template__rail-section--chat {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 0;
    overflow: hidden;
    border-top: 1px solid var(--shell-border);
}

.shell--workspace-view .workspace-template__rail-heading--chat {
    padding: 0.75rem;
    border-bottom: 0 !important;
}

.shell--workspace-view .workspace-template__chat-thread {
    gap: 0.9rem;
    padding: 0.15rem 0 0.8rem 0.75rem;
    margin-right: -0.3rem;
    scrollbar-gutter: stable;
}

.shell--workspace-view .workspace-template__chat-thread::-webkit-scrollbar {
    width: 0.55rem;
}

.shell--workspace-view .workspace-template__chat-thread::-webkit-scrollbar-track {
    background: transparent;
}

.shell--workspace-view .workspace-template__chat-thread::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-border) 88%, transparent);
}

.shell--workspace-view .workspace-template__chat-message {
    padding-right: 0.45rem;
}

.shell--workspace-view .workspace-template__chat-message-copy {
    gap: 0.24rem;
}

.shell--workspace-view .workspace-template__chat-message-head {
    align-items: center;
    gap: 0.4rem;
}

.shell--workspace-view .workspace-template__chat-message-topline {
    gap: 0.32rem;
}

.shell--workspace-view .workspace-template__chat-message-lines,
.workspace-template__team-message-lines {
    display: grid;
    gap: 0.28rem;
}

.shell--workspace-view .workspace-template__chat-message--grouped .workspace-template__chat-message-lines {
    gap: 0.22rem;
}

.shell--workspace-view .workspace-template__chat-message p {
    margin: 0;
}

.shell--workspace-view .workspace-template__chat-badge {
    align-self: center;
}

.shell--workspace-view .workspace-template__rail-heading h3,
.shell--workspace-view .workspace-template__rail-heading span {
    font-size: 0.6875rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shell--workspace-view .workspace-template__rail-heading--chat span {
    color: var(--shell-muted-text);
}

.template-dashboard__header {
    align-items: center;
}

.template-dashboard__create {
    gap: 0.48rem;
    min-height: 2.9rem;
    padding: 0 1.05rem;
    border-radius: 0.85rem;
    font-size: 0.84rem;
}

.template-dashboard__grid {
    grid-template-columns: minmax(0, 1.18fr) minmax(19rem, 0.82fr);
}

.template-dashboard__grid--bottom {
    grid-template-columns: minmax(0, 1.18fr) minmax(19rem, 0.82fr);
}

.template-dashboard__stack {
    grid-template-rows: repeat(2, minmax(0, auto));
}

.template-panel__list {
    align-content: start;
}

@media (max-width: 920px) {
    .shell__sidebar {
        position: static;
        height: auto;
        min-height: 0;
    }

    .sidebar-nav {
        overflow: visible;
    }

    .sidebar-nav__group--footer {
        position: static;
        background: transparent;
    }

    .template-dashboard__grid,
    .template-dashboard__grid--bottom {
        grid-template-columns: 1fr;
    }
}

/* Final workspace shell alignment pass after live preview review. */
.shell--workspace-view {
    grid-template-columns: 15rem minmax(0, 1fr);
}

.shell--workspace-view .shell__brand {
    display: grid;
    align-content: center;
    min-height: 4.4rem;
    padding: 0 1rem;
    border-bottom: 1px solid var(--shell-border);
}

.shell--workspace-view .shell__title {
    font-size: 1.18rem;
    line-height: 1;
    letter-spacing: -0.03em;
}

.shell--workspace-view .topbar--workspace-view {
    min-height: 4.4rem;
    padding: 0 1.4rem;
}

.shell--workspace-view .topbar--workspace-view .topbar__search {
    max-width: 34rem;
}

.shell--workspace-view .workspace-template__room-tabs {
    padding-top: 0;
}

.shell--workspace-view .workspace-template__room-tab-row {
    position: relative;
    align-items: end;
    gap: 0.15rem;
}

.shell--workspace-view .workspace-template__room-tab {
    padding: 0.7rem 0.95rem 0.62rem;
    border: 1px solid transparent;
    border-bottom: 0;
    border-radius: 0.82rem 0.82rem 0 0;
}

.shell--workspace-view .workspace-template__room-tab--active {
    margin-bottom: -1px;
    border-color: var(--shell-border);
    border-bottom-color: var(--shell-surface);
}

.shell--workspace-view .workspace-template__room-tab--active::after {
    content: none;
}

.sidebar-audit-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.35rem;
}

.sidebar-audit-context__title {
    line-height: 1.22;
}

.shell--workspace-view .sidebar-audit-context {
    display: flex !important;
    flex-direction: column;
    align-items: flex-start;
    grid-template-columns: none !important;
    gap: 0.34rem;
    padding: 0.72rem 0.8rem;
}

.shell--workspace-view .sidebar-audit-context__eyebrow {
    font-size: 0.58rem;
    padding: 0.14rem 0.48rem;
}

.shell--workspace-view .sidebar-audit-context__title {
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.22;
    -webkit-line-clamp: 2;
}

.shell--workspace-view .sidebar-audit-context__meta {
    font-size: 0.69rem;
}

.shell--workspace-view .workspace-template__composer,
.shell--workspace-view .workspace-template__chat-compose {
    --workspace-footer-meta-height: 1.5rem;
    --workspace-footer-input-height: 2.25rem;
    --workspace-footer-gap: 0.375rem;
    --workspace-footer-padding-inline: 0.75rem;
    --workspace-footer-padding-top: 0.5rem;
    --workspace-footer-padding-bottom: 0.5rem;
    grid-template-rows: var(--workspace-footer-meta-height) var(--workspace-footer-input-height);
    align-content: end;
    min-height: calc(
        var(--workspace-footer-padding-top) +
        var(--workspace-footer-meta-height) +
        var(--workspace-footer-gap) +
        var(--workspace-footer-input-height) +
        var(--workspace-footer-padding-bottom)
    );
}

.shell--workspace-view .workspace-template__composer {
    gap: var(--workspace-footer-gap);
    padding:
        var(--workspace-footer-padding-top)
        var(--workspace-footer-padding-inline)
        var(--workspace-footer-padding-bottom);
}

.shell--workspace-view .workspace-template__quick-actions {
    display: flex;
    align-items: center;
    min-height: var(--workspace-footer-meta-height);
    line-height: 1;
}

.shell--workspace-view .workspace-template__quick-actions > span {
    margin-right: 0.28rem;
}

.shell--workspace-view .workspace-template__quick-capture-row {
    grid-template-columns: 2rem minmax(0, 1fr) 2rem;
    gap: 0.32rem;
    min-height: var(--workspace-footer-input-height);
    align-items: center;
}

.shell--workspace-view .workspace-template__quick-capture-input {
    min-height: 100%;
    height: 100%;
    padding: 0.54rem 0.72rem;
    box-sizing: border-box;
    resize: none;
}

.shell--workspace-view .workspace-template__rail-section--chat {
    padding: 0;
    gap: 0;
    border-top: 0;
    border-bottom: 0;
}

.shell--workspace-view .workspace-template__rail-heading--chat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.72rem 0.75rem 0.56rem;
}

.shell--workspace-view .workspace-template__chat-thread {
    gap: 0.84rem;
    padding: 0.06rem 0 0.56rem 0.75rem;
    margin-right: 0;
}

.shell--workspace-view .workspace-template__chat-thread::-webkit-scrollbar {
    width: 0.5rem;
}

.shell--workspace-view .workspace-template__chat-thread::-webkit-scrollbar-track {
    background: transparent;
}

.shell--workspace-view .workspace-template__chat-thread::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--shell-border) 88%, transparent);
}

.shell--workspace-view .workspace-template__chat-message {
    gap: 0.5rem;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    padding-right: 0.75rem;
}

.shell--workspace-view .workspace-template__chat-message-copy {
    gap: 0.18rem;
}

.shell--workspace-view .workspace-template__chat-message-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.4rem;
}

.shell--workspace-view .workspace-template__chat-message-lines,
.shell--workspace-view .workspace-template__team-message-lines {
    gap: 0.32rem;
}

.shell--workspace-view .workspace-template__chat-message--grouped .workspace-template__chat-message-lines {
    gap: 0.2rem;
}

.shell--workspace-view .workspace-template__chat-compose {
    gap: var(--workspace-footer-gap);
    padding:
        var(--workspace-footer-padding-top)
        var(--workspace-footer-padding-inline)
        var(--workspace-footer-padding-bottom);
    border-top: 1px solid var(--shell-border);
}

.shell--workspace-view .workspace-template__recipient-menu-shell {
    display: flex;
    align-items: center;
    min-height: var(--workspace-footer-meta-height);
}

.shell--workspace-view .workspace-template__chat-input-row {
    grid-template-columns: minmax(0, 1fr) 2rem;
    gap: 0.32rem;
    align-items: center;
    min-height: var(--workspace-footer-input-height);
}

.shell--workspace-view .workspace-template__chat-input {
    min-height: 100%;
    height: 100%;
    padding: 0.54rem 0.72rem;
    box-sizing: border-box;
}

.shell--workspace-view .workspace-template__recipient-toggle {
    min-height: var(--workspace-footer-meta-height);
    padding-block: 0;
}

.shell--workspace-view .workspace-template__chip {
    min-height: var(--workspace-footer-meta-height);
    display: inline-flex;
    align-items: center;
}

/* Generisches Desktop-Shell-Grid: feste Navigation + Kopfzeile, Scroll nur im Inhaltsbereich. */
@media (min-width: 921px) {
    .shell {
        --shell-sidebar-width: 15rem;
        --shell-header-height: 4.4rem;
        grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
        height: 100dvh;
        overflow: hidden;
    }

    .shell--workspace-view {
        --shell-sidebar-width: 15rem;
        --shell-header-height: 4.4rem;
    }

    .shell__sidebar,
    .shell__workspace {
        height: 100%;
        min-height: 0;
    }

    .shell__sidebar {
        grid-template-rows: var(--shell-header-height) minmax(0, 1fr);
    }

    .shell__workspace {
        display: grid;
        grid-template-rows: var(--shell-header-height) minmax(0, 1fr);
        overflow: hidden;
    }

    .shell__brand,
    .topbar,
    .shell--workspace-view .shell__brand,
    .shell--workspace-view .topbar--workspace-view {
        min-height: var(--shell-header-height);
    }

    .shell__main {
        height: 100%;
        min-height: 0;
        overflow: auto;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .shell__main--workspace-view {
        overflow: hidden;
        scrollbar-gutter: auto;
    }
}
