/* Screen architecture: navigation / intake / source history / workbook artifact.
   The composer is the first screen. Records activate the document workbench. */
body.workspace-app { height: 100dvh; min-height: 0; padding: 0; overflow: hidden; }
.workspace-root { display: grid; grid-template-columns: 220px minmax(0,1fr); height: 100%; }
.workspace-sidebar { display: flex; flex-direction: column; width: 220px; min-width: 0; min-height: 0; padding: 20px 12px 16px; background: #eeece5; }
.sidebar-brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 28px; color: var(--ink); font-size: 18px; }
.sidebar-brand .brand-mark { width: 23px; height: 23px; }
.sidebar-brand .brand-word { font-family: var(--font); font-size: 16px; font-weight: 600; }
#closeNavigation { display: none; margin-left: auto; }
.primary-navigation { display: grid; gap: 4px; }
.primary-navigation > button, .sidebar-settings, .sidebar-bottom .header-status { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 10px 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); text-align: left; font-size: 14px; }
.primary-navigation > button:hover, .sidebar-settings:hover, .sidebar-bottom .header-status:hover { background: #e5e2d9; color: var(--ink); }
.primary-navigation > button[aria-current=page] { color: var(--ink); background: #e1ddd2; }
.primary-navigation svg { width: 20px; height: 20px; }
.sidebar-bottom svg { width: 20px; height: 20px; }
.nav-count { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sidebar-batch { margin: 28px 12px 20px; min-width: 0; }
.sidebar-batch p, .sidebar-recent h2 { color: var(--muted); font-size: 12px; font-weight: 400; }
.sidebar-batch > span { display: block; margin-top: 8px; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sidebar-recent { min-height: 0; overflow: auto; padding: 0 4px; }
.sidebar-recent h2 { padding: 0 8px 8px; }
.recent-message { display: block; width: 100%; padding: 9px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); text-align: left; }
.recent-message:hover { background: #e5e2d9; }
.recent-message > span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.recent-message time { color: var(--muted); font-size: 11px; }
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
.sidebar-bottom > span { display: block; padding: 12px; color: var(--muted); font-size: 11px; }
.workspace-content { display: flex; flex-direction: column; height: 100%; min-width: 0; min-height: 0; }
.workspace-topbar { display: flex; align-items: center; gap: 12px; min-height: 66px; padding: 10px 24px; flex-shrink: 0; }
.workspace-topbar h1 { font: 500 15px/1.5 var(--font); color: var(--muted); letter-spacing: 0; }
.workspace-title { min-width: 0; }
.workspace-title .workspace-save { margin: 3px 0 0; font-size: 11px; max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.workspace-topbar .icon-button { width: 36px; height: 36px; }
.workspace-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.workspace-actions button { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.workspace-actions svg { width: 18px; height: 18px; }
.workspace-actions .secondary { background: transparent; }
.workspace-main { flex: 1; min-height: 0; max-width: none; padding: 0 24px 24px; overflow: hidden; }
.workspace-layout { display: grid; grid-template-columns: minmax(0,1fr); height: 100%; min-height: 0; gap: 20px; }
.intake-pane, .result-pane { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; }
.intake-pane { display: flex; flex-direction: column; }
.intake-stage { width: min(100%,720px); margin: auto; padding: 36px 12px 72px; }
.intake-intro { margin-bottom: 28px; }
.intake-intro h2 { font-family: var(--font); font-weight: 500; font-size: 30px; line-height: 1.5; letter-spacing: 0; }
.intake-intro p { color: var(--muted); font-size: 14px; margin-top: 10px; }
.message-composer { overflow: hidden; border: 1px solid var(--control); border-radius: 14px; background: var(--surface); }
.message-composer:focus-within { border-color: #aa9c88; }
.message-composer .sheet-body { overflow: visible; padding: 0; }
.message-composer #raw { display: block; padding: 20px 20px 8px; min-height: 190px; border: 0; border-radius: 0; outline: none; resize: vertical; background: transparent; font-size: 15px; line-height: 1.9; }
.message-composer #raw:focus { outline: none; }
.message-composer .intake-tools { padding: 0 12px; margin: 0; }
.message-composer .intake-tools .text-button { min-height: 40px; padding: 8px; font-size: 12px; }
.message-composer .intake-tools svg { width: 17px; height: 17px; }
.message-composer .sheet-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; border-top: 0; }
.message-composer #parse { min-height: 40px; padding: 9px 14px; font-size: 13px; }
.message-composer #parse svg { width: 16px; height: 16px; }
.composer-shortcut { color: var(--muted); font-size: 11px; padding-left: 8px; }
.intake-footnote { margin: 14px 4px 0; color: var(--muted); font-size: 12px; }
.intake-stage > #batchReceipt { padding: 0; margin: 12px 4px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.intake-pane.drag-over .message-composer { outline: 2px solid var(--accent); outline-offset: 4px; }
.result-pane { display: none; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.result-heading h2 { font-size: 22px; font-weight: 550; }
.result-heading p { color: var(--muted); font-size: 12px; margin-top: 6px; }
#resultIssueText::before { content: ' · '; }
.document-label { color: var(--muted); font-size: 11px; padding-top: 6px; white-space: nowrap; }
.workspace-save { color: var(--muted); font-size: 11px; margin: 10px 0 18px; }
.result-pane .filter-group { gap: 24px; margin-bottom: 0; }
.result-pane .filter-group button { font-size: 12px; min-height: 42px; }
.result-pane .batch-sheet-section { border: 0; border-radius: 0; }
.result-pane .batch-sheet-heading { padding: 12px 0; }
.result-pane .batch-sheet-heading > p { color: var(--muted); font-size: 11px; }
.result-pane .batch-sheet-host { border: 1px solid var(--line); border-radius: 7px; min-height: 340px; }
.result-pane .sheet-source { padding: 12px 0; border-top: 0; }
.result-pane .vehicle-details { margin-top: 4px; }
body[data-record-filter=issues] .result-pane .batch-sheet-section { display: none; }
body[data-record-filter=issues] .result-pane .vehicle-details > summary { display: none; }
.message-feed { margin-top: 32px; }
.message-feed > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.message-feed h2 { font: 500 13px/1.5 var(--font); color: var(--muted); }
.message-feed h2 span { margin-left: 6px; font-variant-numeric: tabular-nums; }
.message-feed > header .text-button { font-size: 12px; padding: 6px; min-height: 36px; }
.message-entry { padding: 14px 0; border-top: 1px solid var(--line); }
.message-source { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 0; min-height: 28px; border: 0; background: transparent; color: var(--ink); font-size: 12px; text-align: left; }
.message-source time { color: var(--muted); font-size: 11px; }
.message-entry pre { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.8; max-height: 100px; overflow: hidden; }
.navigation-drawer { height: 100dvh; max-height: none; width: min(300px,88vw); max-width: none; padding: 0; margin: 0 auto 0 0; border: 0; background: #eeece5; }
.navigation-drawer::backdrop { background: #302c254d; }
.navigation-drawer .workspace-sidebar { width: 100%; height: 100%; }
.mobile-workspace-nav { display: none; }
.workspace-content > #toast { position: static; transform: none; flex-shrink: 0; width: auto; max-width: none; margin: 0 24px 12px; padding: 9px 14px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink); font-size: 12px; }
#history { max-height: none; }
#historySummary { margin-bottom: 12px; }
body[data-workspace-screen=vehicles] .result-pane { display: block; }
body[data-workspace-screen=vehicles] .intake-pane { display: none; }
body[data-wide=true][data-has-records=true] .workspace-layout { grid-template-columns: 320px minmax(0,1fr); }
body[data-wide=true][data-has-records=true] .result-pane, body[data-wide=true][data-has-records=true] .intake-pane { display: block; }
body[data-wide=true][data-has-records=true] .intake-stage { padding: 22px 0; margin: 0; }
body[data-wide=true][data-has-records=true] .intake-intro { margin-bottom: 18px; }
body[data-wide=true][data-has-records=true] .intake-intro h2 { font-family: var(--font); font-size: 18px; line-height: 1.5; font-weight: 500; }
body[data-wide=true][data-has-records=true] .intake-intro p { font-size: 12px; line-height: 1.8; }
body[data-wide=true][data-has-records=true] .message-composer #raw { min-height: 190px; padding: 16px; font-size: 14px; }
body[data-wide=true][data-has-records=true] .message-composer .composer-shortcut { display: none; }
body[data-wide=true][data-has-records=true] .message-composer .sheet-footer { justify-content: flex-end; }
body[data-sidebar-collapsed=true][data-wide=true] .workspace-root { grid-template-columns: minmax(0,1fr); }
body[data-sidebar-collapsed=true][data-wide=true] > .workspace-root > .workspace-sidebar { display: none; }
@media (min-width:1600px) { body[data-wide=true][data-has-records=true] .workspace-layout { grid-template-columns: 380px minmax(0,1fr); gap: 28px; } }
@media (max-width:1179px) {
 .workspace-root { grid-template-columns: minmax(0,1fr); }
 .workspace-topbar { padding: 10px 20px; }
 .workspace-topbar .icon-button { width: 44px; height: 44px; }
 #closeNavigation { display: inline-flex; }
 .workspace-main { padding: 0 20px 20px; }
 .intake-stage { padding-left: 0; padding-right: 0; }
 .mobile-workspace-nav { display: flex; justify-content: space-around; min-height: 68px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom,0px)); background: var(--canvas); border-top: 1px solid var(--line); flex-shrink: 0; }
 .mobile-workspace-nav button { display: flex; align-items: center; justify-content: center; gap: 7px; flex: 1; min-height: 44px; padding: 10px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 13px; }
 .mobile-workspace-nav svg { width: 20px; height: 20px; }
 .mobile-workspace-nav button[aria-current=page] { background: var(--surface-soft); color: var(--ink); }
 .result-pane { padding: 20px; }
}
@media (max-width:600px) {
 .workspace-topbar { min-height: 64px; padding: calc(6px + env(safe-area-inset-top,0px)) 12px 6px; gap: 6px; }
 .workspace-topbar h1 { font-size: 14px; }
 .workspace-actions { gap: 2px; }
 .workspace-actions button { min-height: 44px; padding: 8px 10px; }
 .workspace-actions [data-view-target=inbox] span { display: none; }
 .workspace-actions [data-view-target=inbox] { width: 40px; }
 .workspace-actions .secondary { font-size: 12px; border-color: var(--line); }
 .workspace-main { padding: 0 16px 16px; }
 .workspace-content > #toast { margin-left: 16px; margin-right: 16px; }
 .intake-stage { margin: auto 0; padding: 28px 0 42px; }
 .intake-intro h2 { font-size: 24px; max-width: 320px; }
 .intake-intro p { font-size: 13px; line-height: 1.8; }
 .message-composer #raw { min-height: 200px; padding: 16px; font-size: 16px; }
 .composer-shortcut { display: none; }
 .message-composer .sheet-footer { justify-content: flex-end; padding-top: 8px; }
 .message-composer #parse { min-height: 44px; }
 .intake-footnote { font-size: 11px; line-height: 1.8; }
 .result-pane { padding: 16px 12px; }
 .result-heading h2 { font-size: 20px; }
 .result-pane .batch-sheet-host { min-height: 360px; }
 .result-pane .batch-sheet-heading { padding: 8px 0; }
 .result-pane .filter-group { gap: 22px; }
 .document-label { padding-top: 4px; font-size: 11px; }
 .mobile-workspace-nav button { font-size: 12px; }
 #toast { bottom: calc(88px + env(safe-area-inset-bottom,0px)); }
}
