/* Workspace: a chat with the brain beside the live preview.
   Owned by the workspace lane; built on web/claude-platform.css (cds tokens and components).
   Tokens only: var(--cds-*) and var(--font-*). */

/* The workspace fills the window below the 48px top bar. The thread scrolls inside the chat column and the composer stays at its foot. */
body[data-view=workspace] main{max-width:none;padding:var(--cds-pad-md) var(--cds-pad-lg)}
body[data-view=workspace] footer{display:none}
.workspace{display:grid;grid-template-columns:minmax(340px,440px) minmax(0,1fr);gap:var(--cds-gap-lg);height:calc(100dvh - 48px - 2*var(--cds-pad-md));min-height:480px}
@media(min-width:1600px){.workspace{grid-template-columns:500px minmax(0,1fr)}}

/* Chat column */
.chat{display:flex;flex-direction:column;min-width:0;min-height:0}
.chat-header{display:flex;align-items:center;justify-content:space-between;gap:var(--cds-gap-sm);padding:0 0 var(--cds-pad-sm);border-bottom:1px solid var(--cds-border)}
.chat-version{display:flex;align-items:baseline;gap:var(--cds-gap-xs);min-width:0;font:var(--cds-w-regular) 12px/17px var(--font-sans);color:var(--cds-text-secondary)}
.chat-version code{flex:none;font-size:12px;line-height:17px;color:var(--cds-text-primary)}
.runtime-label{flex:none;font-weight:var(--cds-w-medium)}
.chat-actions{display:flex;flex:none;align-items:center;gap:var(--cds-gap-sm)}
.activity-shortcut{font:var(--cds-w-regular) 13px/17px var(--font-sans);color:var(--cds-text-accent)}
.chat-thread{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:var(--cds-gap-lg);padding:var(--cds-pad-md) 2px var(--cds-pad-md) 0}
.chat-turns{display:flex;flex-direction:column;gap:var(--cds-gap-lg);margin:0;padding:0;list-style:none}
.chat-turns:empty{display:none}
.chat-turn{display:flex;flex-direction:column;gap:var(--cds-gap-sm);min-width:0}
.chat .cds-bubble{white-space:pre-wrap;max-height:320px;overflow:auto}
.chat-empty{margin:auto 0;padding:var(--cds-pad-lg) 0;text-align:center;color:var(--cds-text-secondary)}
.chat-empty h2{margin-bottom:4px;font:var(--cds-w-semibold) 18px/24px var(--font-sans);color:var(--cds-text-primary)}
.chat-reply-head{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cds-gap-xs);font:var(--cds-w-regular) 13px/17px var(--font-sans);color:var(--cds-text-secondary)}
.chat-reply-text{white-space:pre-wrap;overflow-wrap:anywhere;color:var(--cds-text-primary);font:var(--cds-w-regular) 14px/21px var(--font-sans)}
.chat-reply-note{color:var(--cds-text-secondary);overflow-wrap:anywhere}
.chat-reply-link{align-self:flex-start;min-height:0;padding:0;border:0;border-radius:var(--cds-radius-link);background:none;box-shadow:none;color:var(--cds-text-accent);font:var(--cds-w-regular) 12px/17px var(--font-sans);cursor:pointer}
.chat-reply-link:hover{text-decoration:underline}
.chat-notice{flex:none;margin-top:var(--cds-gap-sm);white-space:pre-wrap;overflow-wrap:anywhere}

/* Composer at the foot of the chat */
.chat-composer{flex:none;padding-top:var(--cds-pad-sm)}
.chat-composer .cds-composer-editor{max-height:240px;padding:5px 6px;border-radius:0;background:transparent;box-shadow:none;font-size:15px;line-height:22px}
.chat-composer .cds-composer-chin{flex-wrap:wrap}
.chat-composer .cds-composer-chin>div:last-child{margin-left:auto;display:flex;align-items:center;gap:var(--cds-gap-sm)}
.starters{flex-wrap:wrap}
.send-hint{display:inline-flex;align-items:center;gap:4px;font:var(--cds-w-regular) 12px/17px var(--font-sans);color:var(--cds-text-secondary)}
@media(max-width:480px){.send-hint{display:none}}
.composer-meta{display:flex;flex-wrap:wrap;justify-content:space-between;gap:2px var(--cds-gap-sm);margin-top:6px;font:var(--cds-w-regular) 12px/17px var(--font-sans);color:var(--cds-text-secondary)}
.prompt-allowance{font-variant-numeric:tabular-nums}
.prompt-allowance[data-exhausted="true"]{color:var(--cds-text-danger)}
.fineprint{font:var(--cds-w-regular) 12px/17px var(--font-sans);color:var(--cds-text-secondary);overflow-wrap:anywhere}

/* Live work: the brain's message for the current turn, with TurnStatusStep rows */
.live-work{min-width:0}
.operation-heading{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cds-gap-xs);font:var(--cds-w-medium) 14px/20px var(--font-sans)}
.operation-heading strong{font-weight:var(--cds-w-semibold)}
.operation-badge{margin-left:auto}
.operation-heading>#operation-icon{display:grid;place-items:center;flex:none;width:20px;height:20px;border-radius:50%;background:var(--cds-bg-neutral);color:var(--cds-text-secondary);font-size:12px;line-height:1}
.live-work[data-active=true] #operation-icon{animation:work-breathe 1.8s ease-in-out infinite}
@keyframes work-breathe{50%{opacity:.4}}
.live-elapsed,.live-measurement{margin:8px 0 0;font:var(--cds-w-regular) 12px/17px var(--font-sans);color:var(--cds-text-secondary);font-variant-numeric:tabular-nums}
.live-steps{display:flex;flex-direction:column;margin:8px 0 0;padding:0;list-style:none}
.live-steps li{min-width:0}
.live-steps [data-cds="TurnStatusStep"] .cds-step-row{padding-block:6px}
.live-steps li[data-step=waiting] .cds-step-label,.live-steps li[data-step=skipped] .cds-step-label{color:var(--cds-text-disabled)}
.live-steps li[data-step=waiting] .cds-step-meta,.live-steps li[data-step=skipped] .cds-step-meta{color:var(--cds-text-secondary)}
.live-steps li[data-step=done] .cds-step-meta{color:var(--cds-text-secondary)}
.live-steps li[data-step=stopped] .cds-step-meta{color:var(--cds-text-secondary)}
.live-steps li[data-step=unknown] .cds-step-meta{color:var(--cds-text-warning)}
.live-detail{margin:8px 0 0;color:var(--cds-text-secondary);overflow-wrap:anywhere}
.live-work .live-contract,#live-checks-summary{font-weight:var(--cds-w-regular);padding:var(--cds-pad-xs) var(--cds-pad-sm);border-radius:var(--cds-radius);background:var(--cds-bg-neutral);color:var(--cds-text-primary)}
.live-work .cds-step-label{color:var(--cds-text-primary)}
.live-files{margin:8px 0 0;padding-left:var(--cds-pad-md);font:var(--cds-w-regular) 12px/18px var(--font-mono);color:var(--cds-text-secondary);overflow-wrap:anywhere}
.live-receipts{list-style:none;margin:8px 0 0;padding:0;font:var(--cds-w-regular) 12px/17px var(--font-sans);color:var(--cds-text-secondary)}
.live-receipts li{margin-top:4px;padding-left:var(--cds-pad-xs);border-left:2px solid var(--cds-border)}
.live-actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cds-gap-xs);margin-top:var(--cds-gap-xs)}
#live-checks-review{margin:0 var(--cds-gap-sm) var(--cds-gap-xs) 0}
@media(prefers-reduced-motion:reduce){.live-work[data-active=true] #operation-icon{animation:none}}

/* Live preview card: fills the right column */
.preview{display:flex;flex-direction:column;min-width:0;min-height:0;height:100%;overflow:hidden}
.preview-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--cds-gap-sm);padding:var(--cds-pad-xs) var(--cds-pad-md)}
.preview-title{display:flex;align-items:center;gap:var(--cds-gap-xs)}
.actions{display:flex;align-items:center;gap:var(--cds-gap-xs)}
.address-bar{display:flex;align-items:center;gap:var(--cds-gap-sm);min-width:0;height:36px;padding:0 var(--cds-pad-md);background:var(--cds-surface-0);border-block:1px solid var(--cds-border);font:var(--cds-w-regular) 12px/17px var(--font-mono);color:var(--cds-text-secondary)}
.window-dots{display:flex;gap:4px}
.window-dots i{width:8px;height:8px;border-radius:50%;background:var(--cds-border-strong)}
#preview-url{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.address-bar code{margin-left:auto;max-width:120px;overflow:hidden;text-overflow:ellipsis;font-size:12px;line-height:17px;color:var(--cds-text-secondary)}
.preview-update{display:flex;align-items:center;justify-content:space-between;gap:var(--cds-gap-sm);padding:var(--cds-pad-xs) var(--cds-pad-md);background:var(--cds-bg-tint-blue);color:var(--cds-text-tint-blue);border-bottom:1px solid var(--cds-border)}
iframe{display:block;width:100%;flex:1;min-height:0;border:0;border-bottom:1px solid var(--cds-border);background:var(--cds-surface-3)}
.preview-footer{display:flex;align-items:center;justify-content:space-between;gap:var(--cds-gap-sm);padding:var(--cds-pad-xs) var(--cds-pad-md);border-top:1px solid var(--cds-border);font:var(--cds-w-regular) 12px/17px var(--font-sans);color:var(--cds-text-secondary)}
.preview-footer .muted{color:var(--cds-text-secondary)}

/* Below 1024px the sidebar folds into a top bar; the chat and the preview stack, each with its own height. */
@media(max-width:1023.98px){
  body[data-view=workspace] main{padding:var(--cds-pad-sm) var(--cds-pad-lg) var(--cds-gap-lg)}
  .workspace{grid-template-columns:minmax(0,1fr);height:auto;min-height:0;gap:var(--cds-gap-md)}
  .chat{height:min(78dvh,720px)}
  .preview{height:auto}
  iframe{flex:none;height:min(60vh,480px);min-height:280px}
}
.live-steps .cds-step-row{display:grid;grid-template-columns:minmax(72px,auto) minmax(0,1fr);gap:var(--cds-gap-sm)}
.live-steps .cds-step-meta{text-align:left}
