:root {
    --ws-header: #131722;
    --ws-sidebar: #11151f;
    --ws-surface: #0f121a;
    --ws-panel: #1e222d;
    --ws-panel-soft: #181c27;
    --ws-border: #2a2e39;
    --ws-border-strong: #454b59;
    --ws-text: #f2f2f3;
    --ws-muted: #a1a3aa;
    --ws-subtle: #787b86;
    --ws-blue: #2962ff;
    --ws-cyan: #00bce5;
    --ws-green: #089981;
}

html[data-theme="light"] {
    color-scheme: light;
    --ws-header: #ffffff;
    --ws-sidebar: #f8f9fd;
    --ws-surface: #f2f2f3;
    --ws-panel: #ffffff;
    --ws-panel-soft: #f8f9fd;
    --ws-border: #d7d7db;
    --ws-border-strong: #adb3bf;
    --ws-text: #131722;
    --ws-muted: #60626b;
    --ws-subtle: #787b86;
}

.workspace-body { min-height: 100vh; overflow: hidden; color: var(--ws-text); background: var(--ws-surface); }
.workspace-header { position: relative; z-index: 40; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 22px; border-bottom: 1px solid var(--ws-border); background: var(--ws-header); }
.workspace-brand-area, .workspace-header-actions, .workspace-brand { display: flex; align-items: center; }
.workspace-brand-area { gap: 12px; min-width: 0; }
.workspace-brand { gap: 9px; text-decoration: none; }
.workspace-brand .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
.brand-product { font-size: 15px; font-weight: 800; }
.brand-platform { color: var(--ws-muted); font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.preview-pill, .planned-label { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border: 1px solid rgba(41, 98, 255, .4); border-radius: 999px; color: #8aa8ff; background: rgba(41, 98, 255, .1); font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.planned-label.muted { color: var(--ws-subtle); border-color: var(--ws-border); background: transparent; }
.workspace-header-actions { gap: 8px; }
.workspace-action, .workspace-header-actions .button { min-height: 36px; padding: 0 13px; color: var(--ws-muted); background: transparent; }
.balance-pill { min-height: 36px; display: inline-flex; align-items: center; padding: 0 13px; border: 1px solid var(--ws-border); border-radius: 9px; color: var(--ws-subtle); font-size: 11px; }
.icon-button { border: 0; color: var(--ws-text); background: transparent; }
.mobile-task-toggle { display: none; width: 34px; height: 34px; padding: 7px; }
.mobile-task-toggle span { display: block; width: 19px; height: 2px; margin: 3px 0; background: currentColor; }

.workspace-shell { height: calc(100vh - 68px); display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.task-panel { min-height: 0; display: flex; flex-direction: column; overflow-y: auto; border-right: 1px solid var(--ws-border); background: var(--ws-sidebar); }
.panel-heading { padding: 24px 20px 14px; }
.workspace-eyebrow { margin: 0 0 7px; color: #6991ff; font-size: 9px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.panel-heading h2 { margin: 0; font-size: 17px; }
.task-buttons { padding: 4px 10px 18px; }
.task-group-label { padding: 14px 10px 6px; color: var(--ws-subtle); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.task-button { width: 100%; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; margin: 3px 0; padding: 11px 10px; border: 1px solid transparent; border-radius: 9px; color: var(--ws-muted); text-align: left; background: transparent; cursor: pointer; }
.task-button:hover { color: var(--ws-text); background: rgba(120, 123, 134, .08); }
.task-button.active { color: var(--ws-text); border-color: rgba(41, 98, 255, .35); background: rgba(41, 98, 255, .13); box-shadow: inset 2px 0 var(--ws-blue); }
.task-button strong, .task-button small { display: block; }
.task-button strong { margin-bottom: 3px; font-size: 12px; }
.task-button small { color: var(--ws-subtle); font-size: 9px; line-height: 1.35; }
.task-icon { position: relative; width: 28px; height: 28px; border: 1px solid var(--ws-border); border-radius: 8px; background: var(--ws-panel-soft); }
.task-icon::before, .task-icon::after { content: ""; position: absolute; }
.strategy-icon::before { left: 6px; right: 6px; bottom: 7px; height: 1px; background: var(--ws-green); box-shadow: 4px -5px var(--ws-green), 9px -2px var(--ws-green); transform: rotate(-15deg); }
.indicator-icon::before { left: 6px; right: 6px; top: 13px; height: 2px; background: var(--ws-cyan); transform: skewY(-25deg); }
.source-icon::before { inset: 6px 8px; border: 1px solid #8aa8ff; border-radius: 2px; }
.source-icon::after { width: 5px; height: 5px; right: 6px; bottom: 5px; border-radius: 50%; background: var(--ws-blue); }
.convert-icon::before { content: "↔"; inset: 0; display: grid; place-items: center; color: #8aa8ff; font-size: 15px; }
.report-icon::before { left: 7px; right: 7px; bottom: 7px; height: 5px; border-left: 3px solid var(--ws-green); border-right: 3px solid var(--ws-blue); box-shadow: 5px -4px 0 -1px var(--ws-cyan); }
.repair-icon::before { content: "!"; inset: 0; display: grid; place-items: center; color: #f4b84a; font-size: 15px; font-weight: 800; }
.task-button.repair-task strong { color: var(--ws-text); }
.task-button.repair-task:hover strong, .task-button.repair-task.active strong { color: #f4c66f; }
.task-button.repair-task:hover { background: rgba(244, 184, 74, .075); }
.task-button.repair-task.active { border-color: rgba(244, 184, 74, .28); background: linear-gradient(90deg, rgba(244, 184, 74, .18), rgba(244, 184, 74, .055)); box-shadow: inset 5px 0 #e5a936; }
.workspace-support { margin-top: auto; padding: 18px 14px 10px; border-top: 1px solid var(--ws-border); }
.workspace-support .workspace-eyebrow { padding: 0 7px; }
.workspace-support-link { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 7px; border: 0; border-radius: 7px; color: var(--ws-subtle); text-decoration: none; text-align: left; background: transparent; cursor: pointer; }
.workspace-support-link:hover { color: var(--ws-text); background: rgba(120, 123, 134, .08); }
.support-symbol { width: 24px; text-align: center; color: #8aa8ff; font-weight: 800; }
.workspace-build-version { padding: 5px 21px 16px; color: var(--ws-subtle); font-size: 9px; }

.chat-panel { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; background: var(--ws-surface); }
.chat-toolbar { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 18px 28px; border-bottom: 1px solid var(--ws-border); background: var(--ws-panel-soft); }
.task-title-line { display: flex; align-items: center; gap: 10px; }
.chat-toolbar h1 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.project-title { display: block; margin-top: 5px; color: var(--ws-subtle); font-size: 11px; }
.model-field { width: 220px; display: grid; gap: 6px; }
.model-field-label { display: flex; align-items: center; justify-content: space-between; color: var(--ws-muted); font-size: 10px; }
.model-cost-badge { padding: 2px 5px; border: 1px solid rgba(62, 207, 142, .32); border-radius: 3px; color: #73d9aa; background: rgba(62, 207, 142, .08); font-size: 9px; font-weight: 700; letter-spacing: .04em; line-height: 1.1; }
.model-field select { width: 100%; height: 36px; padding: 0 32px 0 10px; border: 1px solid var(--ws-border); border-radius: 8px; color: var(--ws-text); background: var(--ws-panel); font: inherit; font-size: 11px; }
.model-field small { color: var(--ws-subtle); font-size: 9px; }
.messages { min-height: 0; overflow-y: auto; display: grid; place-items: center; padding: 36px; background-image: radial-gradient(circle at 50% 15%, rgba(41, 98, 255, .07), transparent 30rem), linear-gradient(rgba(120, 123, 134, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 123, 134, .035) 1px, transparent 1px); background-size: auto, 42px 42px, 42px 42px; }
.workspace-empty-state { width: min(650px, 100%); text-align: center; }
.empty-state-mark { width: 58px; height: 58px; display: flex; align-items: end; justify-content: center; gap: 5px; margin: 0 auto 24px; padding: 13px; border: 1px solid rgba(41, 98, 255, .35); border-radius: 17px; background: rgba(41, 98, 255, .08); box-shadow: 0 18px 45px rgba(41, 98, 255, .12); }
.empty-state-mark span { width: 7px; border-radius: 3px 3px 0 0; background: linear-gradient(var(--ws-cyan), var(--ws-blue)); }
.empty-state-mark span:nth-child(1) { height: 13px; }.empty-state-mark span:nth-child(2) { height: 28px; }.empty-state-mark span:nth-child(3) { height: 20px; }
.workspace-empty-state h2 { margin: 0; font-size: clamp(28px, 3.2vw, 42px); letter-spacing: -.035em; }
.workspace-empty-state > p:not(.workspace-eyebrow) { max-width: 580px; margin: 16px auto 0; color: var(--ws-muted); font-size: 14px; line-height: 1.7; }
.suggestion-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 27px; }
.suggestion-chips button { padding: 9px 12px; border: 1px solid var(--ws-border); border-radius: 999px; color: var(--ws-muted); background: var(--ws-panel); font: inherit; font-size: 10px; cursor: pointer; }
.suggestion-chips button:hover { color: var(--ws-text); border-color: rgba(41, 98, 255, .5); }
.source-shelf { margin: 0 24px 10px; min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 10px 12px; border: 1px solid rgba(41, 98, 255, .3); border-radius: 10px; background: rgba(41, 98, 255, .07); }
.image-import { margin: 0 24px 10px; min-height: 54px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--ws-border); border-radius: 10px; background: var(--ws-panel-soft); }
.image-import[hidden] { display: none; }
.image-import > span { flex: 1; color: var(--ws-muted); font-size: 11px; }
.image-import.has-image > span { color: #cbd7ff; font-size: 12px; font-weight: 650; }
.image-import.has-image > span::before { content: "✓"; display: inline-grid; place-items: center; width: 17px; height: 17px; margin-right: 7px; border-radius: 50%; color: #071812; background: #56d6b5; font-size: 11px; font-weight: 900; }
.image-preview { position: relative; width: 58px; height: 42px; overflow: visible; border: 1px solid var(--ws-border); border-radius: 6px; background: var(--ws-surface); }
.image-preview img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.image-preview button { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; padding: 0; border: 1px solid #666b78; border-radius: 50%; color: #fff; background: #272b35; cursor: pointer; }
.submitted-image { width: min(420px, 100%); margin: 0 0 10px auto; overflow: hidden; border: 1px solid var(--ws-border); border-radius: 10px; background: var(--ws-panel); }
.submitted-image img { width: 100%; max-height: 260px; display: block; object-fit: contain; }
.source-shelf[hidden] { display: none; }
.composer[hidden] { display: none; }
.messages:has(.repair-model-notice:not([hidden])) { align-content: start; place-items: stretch; }
.workspace-empty-state.repair-guide-active { display: none; }
.repair-model-notice { box-sizing: border-box; width: 100%; max-width: 1140px; margin: 0 auto 24px; padding: 18px 20px; border: 1px solid rgba(82, 125, 255, .48); border-radius: 9px; color: var(--ws-text); background: rgba(41, 98, 255, .075); font-size: 13px; line-height: 1.55; }
.repair-model-notice[hidden] { display: none; }
.repair-model-message { margin: 0 0 18px; padding: 9px 11px; border-left: 3px solid #7192ff; color: #c8d5ff; background: rgba(41, 98, 255, .1); }
.repair-task-guide h2 { margin: 18px 0 7px; color: var(--ws-text); font-size: 14px; }
.repair-task-guide h2:first-child { margin-top: 0; font-size: 18px; }
.repair-task-guide p { margin: 0 0 10px; color: var(--ws-muted); }
.repair-task-guide ul { margin: 5px 0 12px; padding-left: 20px; color: var(--ws-muted); }
.repair-task-guide li + li { margin-top: 4px; }
html[data-theme="light"] .repair-model-notice { border-color: #9eb2ec; background: #f7f9ff; }
html[data-theme="light"] .repair-model-message { color: #334d98; background: #eef3ff; }
.source-shelf > div { display: flex; align-items: center; gap: 10px; }
.source-shelf-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--ws-blue); font: 700 12px var(--font-code); }
.source-shelf strong, .source-shelf small { display: block; }
.source-shelf strong { font-size: 11px; }.source-shelf small { margin-top: 3px; color: var(--ws-subtle); font-size: 12px; }

.composer { margin: 0 24px 20px; overflow: hidden; border: 1px solid var(--ws-border); border-radius: 12px; background: var(--ws-panel); box-shadow: 0 16px 44px rgba(0, 0, 0, .2); }
.composer:focus-within { border-color: rgba(41, 98, 255, .75); box-shadow: 0 0 0 3px rgba(41, 98, 255, .1), 0 16px 44px rgba(0, 0, 0, .2); }
.composer-topline { display: flex; justify-content: space-between; gap: 12px; padding: 1px 4px 5px; color: var(--ws-subtle); font-size: 9px; }
.composer textarea { width: 100%; min-height: 88px; resize: none; padding: 13px 14px; border: 0; outline: 0; color: var(--ws-text); background: transparent; font: 13px/1.55 var(--font-ui); }
.composer textarea::placeholder { color: var(--ws-subtle); }
.composer-footer { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border-top: 1px solid var(--ws-border); }
.composer-context-actions, .composer-actions { display: flex; align-items: center; gap: 8px; }
.composer-tool { width: 32px; height: 32px; border: 1px solid var(--ws-border); border-radius: 8px; color: var(--ws-muted); background: transparent; font-size: 18px; cursor: pointer; }
.chat-status { color: var(--ws-subtle); font-size: 9px; }
.chat-status[hidden] { display: none; }
.composer-actions .button { min-height: 34px; padding: 0 13px; font-size: 11px; }
.send-button { min-width: 68px; }

.preview-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(3, 5, 9, .72); backdrop-filter: blur(6px); }
.preview-modal[hidden] { display: none; }
.preview-dialog { width: min(500px, 100%); border: 1px solid var(--ws-border); border-radius: 14px; background: var(--ws-panel); box-shadow: 0 30px 90px rgba(0, 0, 0, .5); }
.preview-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--ws-border); }
.preview-dialog h2 { margin: 0; font-size: 21px; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--ws-border); border-radius: 8px; color: var(--ws-muted); background: transparent; font-size: 22px; cursor: pointer; }
.preview-dialog-content { padding: 24px 22px; color: var(--ws-muted); font-size: 13px; line-height: 1.7; }
.preview-dialog-content strong { color: var(--ws-text); }
.preview-dialog-content .dialog-preview-card { margin-top: 16px; padding: 14px; border: 1px dashed var(--ws-border); border-radius: 9px; background: var(--ws-panel-soft); }
.preview-dialog footer { display: flex; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--ws-border); }
.modal-open { overflow: hidden; }
.feedback-dialog { width: min(590px, 100%); }
.feedback-form { padding: 22px; }
.feedback-form > p:first-child { margin: 0 0 20px; color: var(--ws-muted); font-size: 13px; line-height: 1.65; }
.feedback-field { display: grid; gap: 8px; margin-top: 16px; }
.feedback-field[hidden] { display: none; }
.feedback-field > span { color: var(--ws-text); font-size: 13px; font-weight: 600; }
.feedback-field select, .feedback-field textarea { width: 100%; border: 1px solid var(--ws-border); border-radius: 7px; outline: 0; color: var(--ws-text); background: var(--ws-surface); font: 13px/1.55 var(--font-ui); }
.feedback-field select { min-height: 42px; padding: 0 12px; }
.feedback-field textarea { min-height: 130px; padding: 11px 12px; resize: vertical; }
.feedback-field select:focus, .feedback-field textarea:focus { border-color: var(--ws-blue); box-shadow: 0 0 0 3px rgba(41, 98, 255, .12); }
.feedback-diagnostics { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 10px; margin-top: 18px; color: var(--ws-muted); font-size: 12px; line-height: 1.55; cursor: pointer; }
.feedback-diagnostics input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--ws-blue); }
.feedback-status { min-height: 20px; margin: 14px 0 0; color: var(--ws-muted); font-size: 12px; }
.feedback-status.error { color: #ff7b85; }
.feedback-status.success { color: #65c8b6; }
.feedback-actions { gap: 9px; margin: 18px -22px -22px; }
.feedback-actions .button { min-height: 38px; font-size: 13px; }
.requirements-validation-dialog { width: min(760px, 100%); max-height: min(820px, calc(100vh - 32px)); overflow: auto; }
.requirements-validation-form { padding: 22px; }
.requirements-validation-form > p:first-child { margin: 0 0 18px; color: var(--ws-muted); font-size: 14px; line-height: 1.6; }
.requirements-validation-model { margin: 14px 0 0; color: var(--ws-muted); font-size: 12px; }
.requirements-audit-working { min-height: 32px; display: flex; align-items: center; gap: 7px; color: var(--ws-muted); }
.requirements-audit-working strong { margin-left: 6px; color: var(--ws-text); font-size: 13px; font-weight: 600; }
.requirements-audit-working .working-dot { width: 7px; height: 7px; }
.requirements-validation-message { border-left: 2px solid var(--ws-blue); padding-left: 16px; }
.pine-error-repair-dialog { width: min(760px, 100%); max-height: min(760px, calc(100vh - 32px)); overflow: auto; }
.pine-error-repair-form { padding: 22px; }
.pine-error-repair-form > p:first-child { margin: 0 0 18px; color: var(--ws-muted); font-size: 14px; line-height: 1.6; }
.pine-error-repair-help { margin: 10px 0 0; color: var(--ws-muted); font-size: 12px; }
.pine-error-repair-help code { color: var(--ws-text); font-family: var(--font-code); }
.source-dialog { display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(820px, 100%); max-height: min(860px, calc(100vh - 32px)); overflow: hidden; border-color: var(--ws-border-strong); }
.source-form { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; overflow: hidden; }
.source-form-fields { display: grid; gap: 14px; min-height: 0; overflow-y: auto; padding: 22px; scrollbar-gutter: stable; }
.source-form-fields > p:first-child { margin: 0; color: var(--ws-muted); font-size: 13px; line-height: 1.6; }
.source-form .feedback-actions { z-index: 2; margin: 0; padding: 14px 22px; background: var(--ws-panel); }
.source-form .feedback-field input { min-height: 42px; padding: 0 12px; border: 1px solid var(--ws-border); border-radius: 7px; color: var(--ws-text); background: var(--ws-surface); font: inherit; }
.source-form textarea { font-family: var(--font-code); }
.source-upload-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 42px; }
.source-upload-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.source-help-link { width: fit-content; color: var(--ws-blue); font-size: 12px; font-weight: 600; text-decoration: none; }
.source-help-link:hover { text-decoration: underline; }
.source-help-link[hidden] { display: none; }
.source-form-fields.existing-source-mode .source-file-name-field { order: 1; }
.source-form-fields.existing-source-mode #sourceRoleField { order: 2; }
.source-form-fields.existing-source-mode .source-code-field { order: 3; }
.source-form-fields.existing-source-mode .source-upload-button { order: 4; }
.source-form-fields.existing-source-mode .source-help-link { order: 5; }
.source-form-fields.existing-source-mode .feedback-status { order: 6; }
.requirements-validation-note { margin-bottom: 14px; color: #9bb4ff; font-size: 12px; font-weight: 600; }
.requirements-validation-report > h2:first-child { margin: 0 0 24px; font-size: 21px; }
.requirements-validation-report h2 { margin: 26px 0 10px; color: var(--ws-text); font-size: 17px; }
.requirements-validation-report h3 { margin: 22px 0 9px; color: var(--ws-text); font-size: 15px; }
.requirements-validation-report p, .requirements-validation-report li { font-size: 14px; line-height: 1.65; }
.requirements-validation-report ul { margin: 8px 0 18px; padding-left: 24px; }
.requirements-match-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 26px 0 10px; }
.requirements-match-row h2, .requirements-match-row h3 { margin: 0; }
.requirements-match-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
.requirements-match-badge.low { color: #ff8d98; border-color: #b84756; background: rgba(184, 71, 86, .14); }
.requirements-match-badge.medium { color: #ffc66d; border-color: #a97228; background: rgba(169, 114, 40, .14); }
.requirements-match-badge.high { color: #72d6b9; border-color: #32886f; background: rgba(50, 136, 111, .14); }
.requirements-validation-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--ws-border); }
.project-dialog { width: min(760px, 100%); max-height: min(760px, calc(100vh - 40px)); overflow: hidden; }
.project-dialog header h2 { font-size: 23px; }
.project-dialog header .workspace-eyebrow { font-size: 11px; }
.project-dialog-message { min-height: 22px; margin: 18px 22px 8px; color: var(--ws-muted); font-size: 13px; }
.project-dialog-message:empty { display: none; }
.projects-list { max-height: 560px; padding: 8px 22px 24px; overflow-y: auto; }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 0; border: 1px solid #353b49; border-radius: 9px; background: #171b25; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.project-row:hover { border-color: #454c5c; background: #191e29; }
.project-row.selected { border-color: rgba(82, 125, 255, .82); background: rgba(41, 98, 255, .065); box-shadow: inset 2px 0 rgba(82, 125, 255, .82); }
.project-row + .project-row { margin-top: 10px; }
.project-open { min-width: 0; padding: 17px 16px; border: 0; color: var(--ws-text); text-align: left; background: transparent; font-family: var(--font-ui); cursor: pointer; }
.project-open strong, .project-open span { display: block; }
.project-open strong { overflow: hidden; font-size: 15px; font-weight: 700; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.project-open span { margin-top: 5px; color: var(--ws-muted); font-size: 12px; line-height: 1.45; }
.project-actions { display: flex; gap: 7px; padding-right: 12px; }
.project-actions button { min-height: 36px; padding: 0 11px; border: 1px solid var(--ws-border); border-radius: 5px; color: var(--ws-text); background: var(--ws-surface); font: 600 12px var(--font-ui); cursor: pointer; }
.project-actions button.open { border-color: var(--ws-blue); color: #fff; background: var(--ws-blue); }
.project-actions button.danger { color: #ff8d98; }
.projects-footer { display: flex; justify-content: flex-end; padding: 14px 22px; border-top: 1px solid var(--ws-border); }
.projects-footer[hidden] { display: none; }
.projects-footer button { padding: 8px 9px; border: 0; color: #ff7b85; background: transparent; font: 500 12px var(--font-ui); text-decoration: underline; cursor: pointer; }
.history-dialog { width: min(1320px, 100%); height: min(860px, calc(100vh - 28px)); max-height: calc(100vh - 28px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.history-workspace-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; min-height: 0; }
.history-editor { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-width: 0; min-height: 0; border-right: 1px solid var(--ws-border); }
.history-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; padding: 10px 14px; border-bottom: 1px solid var(--ws-border); background: var(--ws-panel-soft); }
.history-toolbar > div:first-child { display: grid; gap: 2px; min-width: 0; }
.history-toolbar strong { overflow: hidden; color: var(--ws-text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.history-toolbar span { color: var(--ws-muted); font-size: 10px; }
.history-toolbar-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.history-toolbar-actions .button { min-height: 36px; padding: 0 14px; font-size: 12px; }
.history-prompt-panel { max-height: 150px; padding: 12px 16px; overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid rgba(82, 125, 255, .35); background: rgba(42, 87, 220, .09); scrollbar-color: var(--ws-blue) transparent; }
.history-prompt-panel strong { display: block; margin-bottom: 7px; color: #7fa1ff; font-size: 10px; letter-spacing: .08em; }
.history-prompt-panel p { margin: 0; color: var(--ws-text); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-wrap; }
.history-code { min-width: 0; min-height: 0; margin: 0; padding: 20px; overflow: auto; overscroll-behavior: contain; color: #d8dce7; background: #080b12; font: 12px/1.65 var(--font-code); tab-size: 4; white-space: pre; scrollbar-color: var(--ws-blue) #080b12; }
.history-revision-panel { min-width: 0; overflow-y: auto; background: var(--ws-panel-soft); scrollbar-color: var(--ws-blue) transparent; }
.history-revision-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 16px 15px 12px; border-bottom: 1px solid var(--ws-border); }
.history-revision-heading .workspace-eyebrow { margin: 0 0 4px; font-size: 9px; }
.history-revision-heading h3 { margin: 0; font-size: 14px; }
.history-revision-heading > span { color: var(--ws-muted); font-size: 12px; }
.history-revision-help { margin: 0; padding: 14px 15px; border-bottom: 1px solid var(--ws-border); color: var(--ws-muted); font-size: 12px; line-height: 1.6; }
.history-message { min-height: 18px; margin: 0; padding: 9px 15px 0; color: var(--ws-muted); font-size: 11px; line-height: 1.5; }
.revision-list { display: grid; gap: 7px; padding: 12px; }
.revision-item { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; padding-bottom: 8px; border: 1px solid var(--ws-border); border-left: 3px solid var(--ws-border); border-radius: 7px; background: var(--ws-panel); transition: border-color .15s ease; }
.revision-item.selected { border-color: rgba(82, 125, 255, .65); }
.revision-item.pinned .revision-details { padding-right: 126px; }
.revision-pinned-marker { position: absolute; top: 9px; right: 9px; padding: 4px 7px; border-radius: 999px; color: #fff; background: #3868f2; font-size: 9px; font-weight: 800; line-height: 1; letter-spacing: .05em; }
.revision-details { display: grid; gap: 5px; min-width: 0; padding: 10px 11px; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.revision-details:focus-visible { outline: 1px solid rgba(138, 168, 255, .65); outline-offset: -2px; border-radius: 6px; }
.revision-details strong { display: flex; align-items: center; gap: 7px; color: var(--ws-text); font-size: 14px; }
.revision-details strong span { overflow: hidden; padding: 2px 6px; border-radius: 999px; color: var(--ws-muted); background: var(--ws-surface); font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.revision-details small { color: var(--ws-muted); font-size: 11px; }
.revision-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 0 8px; }
.revision-action { min-height: 32px; padding: 6px 9px; border: 1px solid #454958; border-radius: 5px; color: var(--ws-text); background: var(--ws-surface); font: 600 11px var(--font-ui); cursor: pointer; }
.revision-action:hover:not(:disabled) { border-color: var(--ws-blue); }
.revision-action.danger { color: #ff8d98; }
.revision-action:disabled { color: var(--ws-muted); opacity: .55; cursor: default; }
.revision-controls { display: grid; gap: 10px; padding: 12px; border-top: 1px solid var(--ws-border); }
.revision-controls[hidden] { display: none; }
.revision-controls > button { justify-self: start; padding: 0; border: 0; color: #ff8d98; background: transparent; font: 500 11px var(--font-ui); text-decoration: underline; cursor: pointer; }
.revision-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.revision-pagination .button { min-height: 32px; padding: 0 10px; font-size: 11px; }
.revision-pagination span { color: var(--ws-muted); font-size: 11px; }
.workspace-header-actions #historyButton:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 820px) { .history-workspace-layout { grid-template-columns: 1fr; grid-template-rows: minmax(420px, 1fr) 280px; } .history-editor { border-right: 0; border-bottom: 1px solid var(--ws-border); } .history-toolbar { align-items: stretch; flex-direction: column; } .project-row { grid-template-columns: 1fr; } .project-actions { padding: 0 14px 14px; flex-wrap: wrap; } }
.mobile-scrim { position: fixed; z-index: 45; inset: 68px 0 0; background: rgba(3, 5, 9, .6); }
.mobile-scrim[hidden] { display: none; }

html[data-theme="light"] .workspace-body { background: var(--ws-surface); }
html[data-theme="light"] .messages { background-color: #f2f2f3; }
html[data-theme="light"] .preview-pill, html[data-theme="light"] .planned-label { color: #214ecc; }

@media (max-width: 920px) {
    .workspace-shell { grid-template-columns: 238px minmax(0, 1fr); }
    .task-panel { width: 238px; }
    .model-field { width: 190px; }
}
.chat-message { width: min(1140px, 100%); margin: 0 auto 24px; padding-bottom: 24px; border-bottom: 1px solid var(--ws-border); }
.chat-message > strong { display: block; margin-bottom: 9px; color: #6991ff; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.chat-message.user > strong { text-align: right; }
.chat-message-body { color: var(--ws-text); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.chat-message.user .chat-message-body { width: fit-content; max-width: min(82%, 860px); margin-left: auto; padding: 14px 18px; border: 1px solid #454958; border-radius: 18px; background: var(--ws-panel); white-space: pre-line; }
.chat-message.user .chat-message-body.pine-error-repair-request { width: min(82%, 860px); max-height: 520px; overflow: auto; overscroll-behavior: contain; white-space: pre-wrap; scrollbar-color: var(--ws-blue) transparent; }
.chat-message-body p { margin: 0 0 10px; }
.chat-message-body h2, .chat-message-body h3 { margin: 24px 0 10px; color: var(--ws-text); }
.chat-message-body h2 { font-size: 18px; }
.chat-message-body h3 { font-size: 15px; }
.chat-message-body ul { margin: 8px 0 18px; padding-left: 24px; }
.chat-message-body li + li { margin-top: 7px; }
.chat-message-body .inline-code { padding: 2px 5px; border: 1px solid var(--ws-border); border-radius: 4px; color: var(--ws-text); background: var(--ws-panel); font: .9em/1.4 var(--font-code); }
.chat-message.error .chat-message-body { color: #ff7b85; }
.existing-source-review-report { line-height: 1.65; }
.existing-source-review-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid rgba(82, 125, 255, .45); border-radius: 10px; background: linear-gradient(135deg, rgba(41, 98, 255, .17), rgba(41, 98, 255, .035)); }
.existing-source-review-header > div { display: grid; gap: 3px; }
.existing-source-review-eyebrow { color: #7ea0ff; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.existing-source-review-header strong { color: var(--ws-text); font-size: 20px; }
.existing-source-review-header small { color: var(--ws-muted); font-size: 12px; }
.existing-source-review-pdf { min-height: 38px; white-space: nowrap; }
.existing-source-review-content > h2, .existing-source-review-content > h3 { margin: 18px 0 10px; padding: 10px 13px; border-left: 3px solid var(--ws-blue); border-radius: 0 7px 7px 0; background: rgba(41, 98, 255, .08); font-size: 16px; }
.existing-source-review-content > h2:first-child, .existing-source-review-content > h3:first-child { margin-top: 0; }
.existing-source-review-content ul, .existing-source-review-content ol { margin-bottom: 14px; }
html[data-theme="light"] .existing-source-review-header { border-color: #9eb2ec; background: linear-gradient(135deg, #eaf0ff, #f8f9fd); }
html[data-theme="light"] .existing-source-review-content > h2, html[data-theme="light"] .existing-source-review-content > h3 { background: #edf2ff; }
.strategy-analysis-report { line-height: 1.65; }
.strategy-analysis-report-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 18px 20px; border: 1px solid rgba(82, 125, 255, .45); border-radius: 10px; background: linear-gradient(135deg, rgba(41, 98, 255, .17), rgba(41, 98, 255, .035)); }
.strategy-analysis-report-header > div { display: grid; gap: 3px; }
.strategy-analysis-eyebrow { color: #7ea0ff; font-size: 10px; font-weight: 750; letter-spacing: .12em; }
.strategy-analysis-report-header strong { color: var(--ws-text); font-size: 20px; }
.strategy-analysis-report-header small { color: var(--ws-muted); font-size: 12px; }
.strategy-analysis-pdf { min-height: 38px; white-space: nowrap; }
.strategy-analysis-sections { display: grid; gap: 13px; }
.strategy-analysis-section { padding: 18px 20px; border: 1px solid #353a48; border-radius: 10px; background: linear-gradient(145deg, rgba(30, 34, 45, .88), rgba(22, 25, 34, .74)); }
.strategy-analysis-section:first-child { border-color: rgba(41, 98, 255, .55); box-shadow: inset 3px 0 #2962ff; }
.strategy-analysis-section h2, .strategy-analysis-section h3 { margin-top: 0; padding-bottom: 9px; border-bottom: 1px solid #363b49; color: #f1f4fb; font-size: 16px; }
.strategy-analysis-section p:last-child, .strategy-analysis-section ul:last-child { margin-bottom: 0; }
.strategy-analysis-section li::marker { color: #7295ff; }
html[data-theme="light"] .strategy-analysis-report-header { border-color: #9eb2ec; background: linear-gradient(135deg, #eaf0ff, #f8f9fd); }
html[data-theme="light"] .strategy-analysis-section { border-color: #cfd3dc; background: #fff; }
html[data-theme="light"] .strategy-analysis-section h2, html[data-theme="light"] .strategy-analysis-section h3 { border-color: #d9dce3; color: #20242d; }
.working-indicator { min-height: 64px; display: flex; align-items: center; gap: 7px; color: var(--ws-muted); }
.working-indicator strong { margin-left: 6px; color: var(--ws-text); }
.working-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ws-blue); animation: working-pulse 1.2s infinite ease-in-out; }
.working-dot:nth-child(2) { animation-delay: .15s; }
.working-dot:nth-child(3) { animation-delay: .3s; }
@keyframes working-pulse { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-4px); } }
.pine-source-card { margin: 20px 0; overflow: hidden; border: 1px solid #303850; border-radius: 12px; background: #080b12; }
.pine-source-actions { min-height: 44px; display: flex; align-items: center; padding: 8px 14px; border-bottom: 1px solid #303850; color: var(--ws-muted); background: #121725; font-size: 12px; font-weight: 700; }
.pine-source-copy { min-height: 28px; margin-left: auto; padding: 0 10px; border: 1px solid #454d61; border-radius: 5px; color: #c8cfdf; background: #1a2030; font: 600 11px var(--font-ui); cursor: pointer; transition: border-color .16s ease, color .16s ease, background-color .16s ease; }
.pine-source-copy:hover, .pine-source-copy:focus-visible { border-color: var(--ws-blue); color: #fff; background: rgba(41, 98, 255, .16); outline: 0; }
.pine-source-card pre { max-height: 520px; margin: 0; padding: 18px; overflow: auto; color: #d8dce7; font: 13px/1.65 var(--font-code); white-space: pre; }
.response-code-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--ws-border); }
.rag-debug { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--ws-border); color: #9db7d5; font-size: 10px; line-height: 1.5; }
.rag-debug-row + .rag-debug-row { margin-top: 3px; }
.rag-debug-row.rejected { color: #b08d66; }
.response-code-actions .button { min-height: 36px; padding: 0 13px; border-color: #454958; font-size: 12px; }
.response-code-actions .button:hover, .response-code-actions .button:focus-visible { border-color: var(--ws-blue); }
.response-code-actions .test-help { color: #a9bcff; border-color: rgba(82, 125, 255, .62); }
.response-code-actions .verify-requirements { color: #9ed8c8; border-color: rgba(63, 176, 145, .62); }
.response-code-actions .fix-pine-errors { color: #ffc66d; border-color: rgba(210, 139, 46, .7); }
.model-feedback-controls { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; }
.model-feedback-button { min-width: 32px; min-height: 30px; padding: 0 7px; border: 1px solid transparent; border-radius: 6px; color: var(--ws-muted); background: transparent; cursor: pointer; filter: grayscale(1); opacity: .7; }
.model-feedback-button:hover, .model-feedback-button:focus-visible { filter: none; opacity: 1; outline: 0; }
.model-feedback-button[data-vote="up"]:hover, .model-feedback-button[data-vote="up"]:focus-visible { border-color: #399364; background: rgba(57, 147, 100, .12); }
.model-feedback-button[data-vote="down"]:hover, .model-feedback-button[data-vote="down"]:focus-visible { border-color: #d06a4e; background: rgba(208, 106, 78, .12); }
.model-feedback-controls.saved { color: var(--ws-muted); font-size: 11px; }
.pine-repair-verification { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 13px; margin: 20px 0 4px; padding: 16px; border: 1px solid rgba(225, 170, 69, .48); border-radius: 8px; background: rgba(225, 170, 69, .075); }
.pine-repair-verification > span { align-self: start; padding: 4px 7px; border-radius: 4px; color: #f4c66f; background: rgba(225, 170, 69, .14); font-size: 9px; font-weight: 800; letter-spacing: .08em; }
.pine-repair-verification strong, .pine-repair-verification p, .pine-repair-verification small { display: block; }
.pine-repair-verification strong { margin-bottom: 5px; color: var(--ws-text); font-size: 14px; }
.pine-repair-verification p { margin: 0 0 6px; color: #d5d7de; font-size: 13px; line-height: 1.55; }
.pine-repair-verification small { color: #aeb3c0; font-size: 12px; line-height: 1.5; }
html[data-theme="light"] .pine-repair-verification { border-color: #c9912d; background: #fff7e7; }
html[data-theme="light"] .pine-repair-verification > span { color: #744b00; background: #ffe8b5; }
html[data-theme="light"] .pine-repair-verification p { color: #3f424b; }
html[data-theme="light"] .pine-repair-verification small { color: #666a75; }
.syntax-keyword { color: #c084fc; }
.syntax-api { color: #67e8f9; }
.syntax-string { color: #86efac; }
.syntax-number { color: #fbbf24; }
.syntax-comment { color: #7f8aa8; font-style: italic; }
.mismatch-switch { margin-top: 15px; }
.messages:has(.chat-message) { align-content: start; padding-top: 30px; overflow-y: auto; }
html[data-theme="light"] .pine-source-card { border-color: #c7ccd8; }
html[data-theme="light"] .pine-source-actions { border-color: #c7ccd8; background: #e9edf6; }
html[data-theme="light"] .pine-source-copy { border-color: #aeb8cb; color: #294681; background: #f7f9fd; }
html[data-theme="light"] .pine-source-copy:hover, html[data-theme="light"] .pine-source-copy:focus-visible { border-color: var(--ws-blue); color: #17336f; background: #e5edff; }

@media (prefers-reduced-motion: reduce) { .working-dot { animation: none; opacity: .7; } }

@media print {
    body.requirements-print-mode * { visibility: hidden !important; }
    body.requirements-print-mode .chat-message.print-target,
    body.requirements-print-mode .chat-message.print-target * { visibility: visible !important; }
    body.requirements-print-mode .chat-message.print-target { position: absolute; inset: 0 auto auto 0; width: 100%; max-width: none; padding: 24px; border: 0; color: #111; background: #fff; }
    body.requirements-print-mode .chat-message.print-target * { color: #111 !important; }
    body.requirements-print-mode .requirements-validation-actions,
    body.requirements-print-mode .existing-source-review-pdf { display: none !important; }
    body.requirements-print-mode .requirements-validation-note { color: #345; }
}

@media (max-width: 740px) {
    .chat-message { width: calc(100% - 24px); padding: 15px; }
    .strategy-analysis-report-header { align-items: stretch; flex-direction: column; }
    .strategy-analysis-pdf { width: 100%; }
    .response-code-actions .button { flex: 1 1 calc(50% - 4px); }
    .workspace-body { overflow: hidden; }
    .mobile-task-toggle { display: block; }
    .brand-platform, .preview-pill, .desktop-action { display: none; }
    .workspace-header { padding: 0 12px; }
    .workspace-header-actions { gap: 5px; }
    .workspace-header-actions .button { padding: 0 9px; }
    .balance-pill { padding: 0 9px; }
    .workspace-shell { display: block; height: calc(100vh - 68px); }
    .task-panel { position: fixed; z-index: 50; top: 68px; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0, 0, 0, .35); }
    .task-panel.open { transform: translateX(0); }
    .chat-panel { height: 100%; }
    .chat-toolbar { min-height: 84px; padding: 14px 16px; }
    .chat-toolbar h1 { font-size: 20px; }
    .model-field { width: 150px; }
    .model-field small, .model-field-label .planned-label { display: none; }
    .messages { padding: 24px 16px; }
    .source-shelf, .composer { margin-left: 12px; margin-right: 12px; }
    .chat-status { display: none; }
}
@media (max-width: 500px) {
    .balance-pill { display: none; }
    .chat-toolbar { align-items: flex-start; gap: 12px; }
    .model-field { width: 128px; }
    .workspace-empty-state h2 { font-size: 29px; }
    .suggestion-chips { display: grid; }
    .composer { margin-bottom: 10px; }
    .composer-footer { align-items: flex-end; }
    .composer-context-actions { max-width: 42px; }
}
@media (prefers-reduced-motion: reduce) { .task-panel { transition: none; } }

/* Match the established Xen workspace layout while retaining TradingView blue. */
.workspace-header { height: 58px; padding: 0 18px; gap: 16px; }
.workspace-brand-area { gap: 0; }
.workspace-brand { gap: 9px; }
.workspace-brand .brand-mark { width: 28px; height: 28px; border-radius: 5px; font-size: 13px; }
.brand-product { font-size: 15px; }
.brand-platform { color: #8aa8ff; font-size: 11px; letter-spacing: .08em; }
.workspace-header-actions { gap: 12px; }
.workspace-action, .workspace-header-actions .button { min-height: 36px; padding: 0 14px; border-radius: 4px; }
html:not([data-theme="light"]) .workspace-body .button:not(.primary):not(.topup-button):not(:disabled) { border-color: #5c5e65; }
html:not([data-theme="light"]) .workspace-body .button:not(.primary):not(.topup-button):not(:disabled):hover,
html:not([data-theme="light"]) .workspace-body .button:not(.primary):not(.topup-button):not(:disabled):focus-visible { border-color: #6889f5; background-color: rgba(41, 98, 255, .09); }
.workspace-header-actions .button:not(.topup-button) { border-color: #454958; }
.workspace-header-actions .button:not(.topup-button):hover,
.workspace-header-actions .button:not(.topup-button):focus-visible { border-color: var(--ws-blue); }
.balance-pill { min-height: 36px; padding: 0 12px; border-color: var(--ws-border); border-radius: 6px; color: var(--ws-text); background: var(--ws-panel); font-size: 12px; }
.balance-pill.healthy-credit { border-color: var(--ws-green); color: #6fd6c4; background: rgba(8, 153, 129, .09); }
.balance-pill.low-credit { border-color: #d99b28; color: #ffd479; background: rgba(217, 155, 40, .12); }
.balance-pill.credit-warning { border-color: #e05260; color: #ff9ca5; background: rgba(224, 82, 96, .14); }
html[data-theme="light"] .balance-pill.healthy-credit { border-color: #0b7f6c; color: #086957; background: #e6f6f2; }
html[data-theme="light"] .balance-pill.low-credit { color: #7a4b00; background: #fff1cf; }
html[data-theme="light"] .balance-pill.credit-warning { color: #9d1c2a; background: #ffe4e7; }
html[data-theme="light"] .brand-platform,
html[data-theme="light"] .workspace-eyebrow { color: #3157bd; }
html[data-theme="light"] .model-cost-badge { border-color: #168365; color: #08664f; background: #e1f4ed; }
.topup-button { color: #fff !important; border-color: var(--ws-blue) !important; background: var(--ws-blue) !important; }

.workspace-shell { height: calc(100vh - 58px); grid-template-columns: 248px minmax(0, 1fr); }
.panel-heading { padding: 20px 18px 17px; }
.workspace-eyebrow { margin-bottom: 6px; font-size: 11px; letter-spacing: .11em; }
.panel-heading h2 { font-size: 15px; }
.task-buttons { padding: 0; }
.task-group-label { padding: 17px 20px 8px; border-bottom: 1px solid var(--ws-border); font-size: 10px; }
.task-button { display: block; margin: 0; padding: 16px 20px; border-width: 0 0 1px; border-color: var(--ws-border); border-radius: 0; color: var(--ws-text); }
.task-button:hover { color: var(--ws-text); background: rgba(41, 98, 255, .075); }
.task-button:focus-visible { position: relative; z-index: 1; outline: 1px solid rgba(82, 125, 255, .72); outline-offset: -1px; }
.task-button.active { border-color: var(--ws-border); background: linear-gradient(90deg, rgba(41, 98, 255, .22), rgba(41, 98, 255, .08)); box-shadow: inset 5px 0 var(--ws-blue); }
.task-button.repair-task.active { border-color: var(--ws-border); background: linear-gradient(90deg, rgba(244, 184, 74, .18), rgba(244, 184, 74, .045)); box-shadow: inset 5px 0 #e5a936; }
.task-icon { display: none; }
.task-button strong { margin-bottom: 3px; color: var(--ws-text); font-size: 14px; font-weight: 700; }
.task-button small { color: var(--ws-muted); font-size: 13px; line-height: 1.5; }

.workspace-support { padding: 16px 18px 14px; }
.workspace-support .workspace-eyebrow { padding: 0; margin-bottom: 10px; font-size: 10px; }
.workspace-support-link { min-height: auto; gap: 9px; padding: 8px 0; border-radius: 0; color: var(--ws-muted); font-size: 13px; }
.workspace-support-link:hover { background: transparent; }
.support-symbol { display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; color: #8aa8ff; font-size: 11px; }
.guide-symbol { border: 0; font-size: 17px; line-height: 1; }
.video-symbol { font-size: 9px; }
.workspace-build-version { padding: 6px 18px 16px; font-size: 10px; }

.chat-panel { height: calc(100vh - 58px); }
.chat-toolbar { min-height: 92px; padding: 14px 22px; }
.chat-toolbar h1 { font-size: 19px; letter-spacing: 0; }
.project-title { font-size: 12px; }
.task-title-line { gap: 0; }
.model-field { width: 230px; gap: 7px; }
.model-field-label { font-size: 12px; }
.model-field select { height: 40px; padding: 0 11px; border-color: #454958; border-radius: 7px; font-family: var(--font-ui); font-size: 13px; transition: border-color .16s ease, box-shadow .16s ease; }
.model-field select:hover { border-color: var(--ws-blue); }
.model-field select:focus { border-color: var(--ws-blue); outline: 0; box-shadow: 0 0 0 2px rgba(41, 98, 255, .13); }

.messages { display: block; padding: 28px clamp(24px, 5vw, 76px); background: var(--ws-surface); }
.workspace-empty-state { width: 100%; max-width: 1140px; margin: 0 auto; text-align: left; }
.workspace-empty-state .workspace-eyebrow { margin: 0 0 32px; }
.workspace-empty-state h2 { display: none; }
.workspace-empty-state > p:not(.workspace-eyebrow) { max-width: 920px; margin: 0 0 28px 68px; color: var(--ws-text); font-size: 14px; line-height: 1.7; }
.suggestion-chips { display: none !important; }

.source-shelf { width: calc(100% - 44px); max-width: 1140px; margin: 0 auto 10px; }
.strategy-trades-status { box-sizing: border-box; width: calc(100% - 44px); max-width: 1140px; margin: 0 auto 12px; }
.image-import { width: calc(100% - 44px); max-width: 1140px; margin: 0 auto 10px; }
.composer { width: calc(100% - 44px); max-width: 1140px; margin: 0 auto 18px; padding: 12px; overflow: visible; border: 1px solid var(--ws-border); border-radius: 10px; background: var(--ws-panel); }
.composer textarea { min-height: 92px; padding: 12px 13px; border: 1px solid #454958; border-radius: 7px; background: var(--ws-surface); font: 14px/1.55 var(--font-ui); }
.composer textarea:focus { border-color: var(--ws-blue); box-shadow: 0 0 0 2px rgba(41, 98, 255, .13); }
.composer-footer { min-height: auto; padding: 10px 2px 0; border-top: 0; }
.composer-topline { font-size: 11px; }
.composer-topline .repair-context { color: #f4c66f; font-weight: 800; letter-spacing: .01em; }
html[data-theme="light"] .composer-topline .repair-context { color: #8a5900; }
.chat-status { font-size: 11px; }
.composer-context-actions { gap: 14px; }
.composer-actions { gap: 9px; }
.composer-actions .button, .clear-task-button {
    min-height: 36px;
    padding: 0 15px;
    border-radius: 4px;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
}
.composer-actions .button:not(.primary), .clear-task-button { border-color: #454958; }
.composer-actions .button:not(.primary):hover:not(:disabled),
.composer-actions .button:not(.primary):focus-visible:not(:disabled),
.clear-task-button:hover,
.clear-task-button:focus-visible { border-color: var(--ws-blue); }
.clear-task-button { color: var(--ws-muted); background: transparent; }
.cancel-button:disabled { border-color: #3b404d; color: #777b87; opacity: 1; cursor: not-allowed; }
.send-button { min-width: 82px; }

/* Streamlined Pine task composer. The dedicated repair and report tools keep their own layouts. */
.task-composer-stack { display: contents; }
.task-source-tools { display: contents; }
.task-composer-stack.streamlined { box-sizing: border-box; display: block; width: calc(100% - 44px); max-width: 1140px; margin: 0 auto 18px; padding: 12px; border: 1px solid #3d424f; border-radius: 10px; background: var(--ws-panel); transition: border-color .18s ease, box-shadow .18s ease; }
.task-composer-stack.streamlined.task-entry-highlight { animation: streamlined-composer-highlight 1.5s ease-out; }
.task-composer-stack.streamlined .source-shelf,
.task-composer-stack.streamlined .image-import { box-sizing: border-box; width: 100%; max-width: none; min-height: 42px; margin: 0 0 10px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.task-composer-stack.streamlined .source-shelf .button,
.task-composer-stack.streamlined .image-import .button { min-height: 34px; height: 34px; padding: 0 12px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.task-composer-stack.streamlined .image-import .image-upload-button { display: inline-grid; place-items: center; flex: 0 0 34px; width: 34px; margin-left: auto; padding: 0; }
.image-upload-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.task-composer-stack.streamlined .task-source-tools { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin: 0; }
.task-composer-stack.streamlined .task-source-tools:has(.source-shelf:not([hidden]), .image-import:not([hidden])) { margin-bottom: 10px; }
.task-composer-stack.streamlined .task-source-tools .source-shelf { display: contents; }
.task-composer-stack.streamlined .task-source-tools .source-shelf[hidden] { display: none; }
.task-composer-stack.streamlined .task-source-tools .source-shelf > .button { order: 1; }
.task-composer-stack.streamlined .task-source-tools .image-import { order: 2; flex: 0 0 auto; width: auto; min-height: 34px; margin: 0; }
.task-composer-stack.streamlined .task-source-tools .source-shelf > div { order: 3; flex: 1 1 260px; align-self: center; }
.task-composer-stack.streamlined .task-source-tools .image-import > #imageFileStatus { display: none; }
.task-composer-stack.streamlined .task-source-tools .image-import .image-upload-button { order: 1; }
.task-composer-stack.streamlined .task-source-tools .image-import .image-preview { order: 2; }
.task-composer-stack.streamlined .task-source-tools .image-import.unsupported-model > #imageFileStatus { order: 3; display: flex; }
.task-composer-stack.streamlined .image-import.unsupported-model .image-upload-button { color: #e8bd69; border-color: rgba(232, 189, 105, .65); }
.task-composer-stack.streamlined .source-shelf { flex-direction: row-reverse; justify-content: flex-end; gap: 12px; }
.task-composer-stack.streamlined .source-shelf-icon,
.task-composer-stack.streamlined #sourceShelfTitle { display: none; }
.task-composer-stack.streamlined .source-shelf > div { min-width: 0; }
.task-composer-stack.streamlined #sourceShelfCopy { overflow: hidden; color: var(--ws-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.task-composer-stack.streamlined #sourceShelfCopy:empty { display: none; }
.task-composer-stack.streamlined .source-shelf.conversion-source-attached #sourceShelfCopy { display: inline-flex; align-items: center; gap: 7px; width: fit-content; max-width: 100%; padding: 6px 10px; overflow: hidden; border: 1px solid rgba(82, 125, 255, .62); border-radius: 999px; color: #cbd5f5; background: #171a22; text-overflow: ellipsis; white-space: nowrap; }
.task-composer-stack.streamlined .source-shelf.conversion-source-attached #sourceShelfCopy::before { content: "\1F4CE"; flex: 0 0 auto; color: #8da9ff; font-size: 11px; }
html[data-theme="light"] .task-composer-stack.streamlined .source-shelf.conversion-source-attached #sourceShelfCopy { color: #294681; background: #edf2ff; }
.existing-source-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.task-composer-stack.streamlined .existing-source-attachments { align-items: center; margin-top: 0; }
.existing-source-attachments[hidden] { display: none; }
.existing-source-attachment { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; padding: 4px 5px 4px 8px; border: 1px solid #485064; border-radius: 999px; color: #cbd5f5; background: #171a22; font-size: 11px; }
.existing-source-attachment.current-source { border-color: rgba(82, 125, 255, .62); }
.existing-source-attachment.additional-source { border-color: rgba(74, 187, 151, .48); }
.existing-source-attachment.reference-source { border-color: rgba(196, 151, 71, .52); }
.existing-source-review-button { min-height: 34px; padding: 0 13px; border-color: var(--ws-blue); color: #fff; background: var(--ws-blue); font-size: 11px; box-shadow: 0 3px 10px rgba(41, 98, 255, .24); }
.existing-source-review-button:hover:not(:disabled) { border-color: #5f83ff; background: #5f83ff; }
.existing-source-attachment > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.existing-source-remove { display: inline-grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; color: #aeb5c7; background: #292e3a; cursor: pointer; }
.existing-source-remove:hover:not(:disabled) { color: #fff; background: #3a4252; }
.existing-source-remove:disabled { opacity: .5; cursor: not-allowed; }
.task-composer-stack.streamlined .image-import > span { min-width: 0; color: var(--ws-muted); font-size: 11px; }
.task-composer-stack.streamlined .image-import.unsupported-model > span { display: flex; align-items: center; gap: 7px; color: #e8bd69; font-weight: 650; }
.task-composer-stack.streamlined .image-import.unsupported-model > span::before { content: "!"; display: inline-grid; place-items: center; flex: 0 0 auto; width: 16px; height: 16px; border: 1px solid rgba(232, 189, 105, .7); border-radius: 50%; color: #f1ca7e; font-size: 10px; font-weight: 900; }
.task-composer-stack.streamlined .composer { position: relative; width: 100%; max-width: none; margin: 0; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.task-composer-stack.streamlined .composer:focus-within { border: 0; box-shadow: none; }
.task-composer-stack.streamlined .composer-topline { position: absolute; z-index: 2; top: 9px; right: 11px; display: block; min-height: 0; padding: 0; pointer-events: none; }
.task-composer-stack.streamlined #composerContext { display: none; }
.task-composer-stack.streamlined #characterCount { color: var(--ws-subtle); font-size: 11px; }
.task-composer-stack.streamlined .composer textarea { min-height: 92px; padding-right: 90px; border-color: #484d59; background: #12141a; transition: border-color .18s ease, box-shadow .18s ease; }
.task-composer-stack.streamlined .composer textarea:focus { border-color: var(--ws-blue); box-shadow: 0 0 0 2px rgba(41, 98, 255, .15); }
.task-composer-stack.streamlined .composer-footer { padding: 10px 0 0; }
@keyframes streamlined-composer-highlight {
    0% { border-color: #6385ff; box-shadow: 0 0 0 3px rgba(41, 98, 255, .2); }
    100% { border-color: #3d424f; box-shadow: none; }
}
html[data-theme="light"] .task-composer-stack.streamlined { border-color: #c9cdd6; background: #f5f5f6; }
html[data-theme="light"] .task-composer-stack.streamlined .composer textarea { border-color: #b7bbc5; background: #fff; }
html[data-theme="light"] .task-composer-stack.streamlined .composer textarea:focus { border-color: var(--ws-blue); }
html[data-theme="light"] .existing-source-attachment { color: #343a49; border-color: #b7becf; background: #fff; }
html[data-theme="light"] .existing-source-remove { color: #626a7c; background: #e5e8ef; }
html[data-theme="light"] .task-composer-stack.streamlined .image-import.unsupported-model > span { color: #805300; }
html[data-theme="light"] .task-composer-stack.streamlined .image-import.unsupported-model .image-upload-button { color: #805300; border-color: #a87517; }

html[data-theme="light"] .messages { background: var(--ws-surface); }
html[data-theme="light"] .model-field select { border-color: #aeb2bd; }
html[data-theme="light"] .model-field select:hover,
html[data-theme="light"] .model-field select:focus { border-color: var(--ws-blue); }
html[data-theme="light"] .project-row { border-color: #c6c9d1; background: #f4f5f8; }
html[data-theme="light"] .project-row:hover { border-color: #aeb3bf; background: #eef0f5; }
html[data-theme="light"] .project-row.selected { border-color: rgba(41, 98, 255, .72); background: rgba(41, 98, 255, .055); }
html[data-theme="light"] .project-actions button.danger { border-color: #d58b93; color: #b42332; background: #fff; }
html[data-theme="light"] .project-actions button.danger:hover,
html[data-theme="light"] .project-actions button.danger:focus-visible { border-color: #b42332; color: #8f1724; background: #fff0f1; outline: 0; }
html[data-theme="light"] .projects-footer button { color: #b42332; font-weight: 600; }
html[data-theme="light"] .projects-footer button:hover,
html[data-theme="light"] .projects-footer button:focus-visible { color: #8f1724; background: #fff0f1; outline: 0; }
html[data-theme="light"] .composer-actions .button:not(.primary),
html[data-theme="light"] .clear-task-button { border-color: #aeb2bd; }
html[data-theme="light"] .workspace-header-actions .button:not(.topup-button) { border-color: #aeb2bd; }
html[data-theme="light"] .workspace-header-actions .button:not(.topup-button):hover,
html[data-theme="light"] .workspace-header-actions .button:not(.topup-button):focus-visible,
html[data-theme="light"] .composer-actions .button:not(.primary):hover:not(:disabled),
html[data-theme="light"] .composer-actions .button:not(.primary):focus-visible:not(:disabled),
html[data-theme="light"] .clear-task-button:hover,
html[data-theme="light"] .clear-task-button:focus-visible { border-color: var(--ws-blue); }
html[data-theme="light"] .cancel-button:disabled { border-color: #c2c5cd; color: #858892; }

/* Prompt Builder and staged Pine Build Plans */
.prompt-builder-dialog { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto auto; width: min(720px, calc(100% - 28px)); max-height: min(820px, calc(100vh - 32px)); overflow: hidden; border-color: #3b404d; border-radius: 12px; }
.prompt-builder-dialog > header { padding: 22px 24px; }
.prompt-builder-dialog > header .workspace-eyebrow { margin-bottom: 7px; color: #6991ff; font-size: 11px; }
.prompt-builder-dialog > header h2 { font-size: 22px; line-height: 1.25; }
.prompt-builder-reason { margin: 0; padding: 20px 24px 0; color: #c8cad1; font-size: 16px; line-height: 1.55; }
.prompt-builder-body { display: grid; grid-auto-rows: max-content; align-content: start; gap: 14px; min-height: 0; overflow-y: auto; padding: 18px 24px 20px; scrollbar-gutter: stable; }
.prompt-builder-body.waiting { min-height: 150px; place-items: center; }
.prompt-review-summary, .prompt-builder-field, .build-plan-assumptions, .build-plan-step { border: 1px solid #3b404d; border-radius: 8px; background: var(--ws-panel-soft); }
.prompt-review-summary { padding: 18px; border-color: #3b404d; background: rgba(24, 28, 39, .72); }
.prompt-review-summary strong { display: block; color: var(--ws-text); font-size: 16px; line-height: 1.4; }
.prompt-review-summary p { margin: 8px 0 0; color: #b5b8c1; font-size: 15px; line-height: 1.6; }
.prompt-builder-field { display: grid; gap: 7px; padding: 14px; }
.prompt-builder-field > span { color: var(--ws-text); font-size: 15px; font-weight: 700; }
.prompt-builder-field small { color: var(--ws-muted); font-size: 14px; line-height: 1.55; }
.prompt-builder-field textarea { width: 100%; min-height: 68px; resize: vertical; padding: 11px 12px; border: 1px solid #454958; border-radius: 6px; outline: 0; color: var(--ws-text); background: var(--ws-surface); font: 14px/1.5 var(--font-ui); }
.prompt-builder-field textarea:focus { border-color: var(--ws-blue); box-shadow: 0 0 0 2px rgba(41, 98, 255, .13); }
.prompt-builder-field.invalid { border-color: #ff6978; box-shadow: 0 0 0 2px rgba(255, 105, 120, .1); }
.prompt-builder-field.invalid textarea { border-color: #ff6978; }
.prompt-builder-suggestion { justify-self: end; margin: -1px 0 2px; padding: 0; border: 0; color: #8aa8ff; background: transparent; font: 600 13px var(--font-ui); cursor: pointer; }
.prompt-builder-suggestion:hover { color: #b8c9ff; text-decoration: underline; }
.prompt-builder-status { min-height: 18px; margin: 0; padding: 18px 24px 14px; border-top: 1px solid #343947; color: var(--ws-muted); background: var(--ws-panel); font-size: 14px; line-height: 1.45; }
.prompt-builder-status:empty { display: none; }
.prompt-builder-status.error { color: #ff8d98; }
.prompt-builder-status.working { color: #b8c9ff; font-weight: 600; }
.prompt-builder-status.working::after { display: inline-block; width: 0; overflow: hidden; vertical-align: bottom; content: "..."; animation: prompt-builder-ellipsis 1.2s steps(4, end) infinite; }
.prompt-builder-status.success { color: #9bb4ff; }
.prompt-builder-actions { position: relative; z-index: 1; flex-wrap: wrap; gap: 10px; padding: 16px 24px 22px !important; border-top: 1px solid #343947; background: var(--ws-panel); }
.prompt-builder-actions .button { min-height: 36px; padding: 0 14px; border-color: #454958; border-radius: 5px; font-size: 14px; }
.prompt-builder-actions .button:hover:not(.primary), .prompt-builder-actions .button:focus-visible:not(.primary) { border-color: var(--ws-blue); }
.prompt-builder-loading { display: flex; align-items: center; gap: 11px; color: #c8cad1; font-size: 16px; font-weight: 600; line-height: 1.45; }
.prompt-builder-loading::before { content: ""; width: 16px; height: 16px; border: 2px solid rgba(41, 98, 255, .25); border-top-color: var(--ws-blue); border-radius: 50%; animation: prompt-builder-spin .8s linear infinite; }
.prompt-builder-dialog[aria-busy="true"] .dialog-close { opacity: .35; cursor: not-allowed; }
@keyframes prompt-builder-spin { to { transform: rotate(360deg); } }
@keyframes prompt-builder-ellipsis { to { width: 1.2em; } }
.build-plan-assumptions { padding: 14px 16px; }
.build-plan-assumptions h3 { margin: 0 0 8px; font-size: 13px; }
.build-plan-assumptions ul { margin: 0; padding-left: 19px; color: var(--ws-muted); font-size: 12px; line-height: 1.55; }
.build-plan-step { overflow: hidden; }
.build-plan-step.current { border-color: rgba(82, 125, 255, .72); }
.build-plan-step header { padding: 11px 13px; border-bottom: 1px solid var(--ws-border); }
.build-plan-step h3 { margin: 0; font-size: 13px; }
.build-plan-step pre { max-height: 220px; overflow: auto; margin: 0; padding: 13px; color: var(--ws-muted); background: var(--ws-surface); font: 12px/1.55 var(--font-ui); white-space: pre-wrap; }
.active-build-plan { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: calc(100% - 44px); max-width: 1140px; margin: 0 auto 10px; padding: 11px 13px; border: 1px solid rgba(82, 125, 255, .55); border-radius: 9px; background: linear-gradient(90deg, rgba(41, 98, 255, .11), var(--ws-panel) 52%); }
.active-build-plan[hidden] { display: none; }
.active-build-plan-copy { display: grid; gap: 3px; min-width: 0; }
.active-build-plan-copy .workspace-eyebrow { margin: 0; font-size: 9px; }
.active-build-plan-copy strong { overflow: hidden; color: var(--ws-text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.active-build-plan-copy small { color: var(--ws-muted); font-size: 11px; }
.active-build-plan-image { width: fit-content; margin-top: 3px; padding: 3px 7px; border: 1px solid rgba(86, 214, 181, .48); border-radius: 999px; color: #9aead5; background: rgba(8, 153, 129, .12); font-size: 10px; font-weight: 700; }
.active-build-plan-controls { display: flex; align-items: center; flex: 0 0 auto; gap: 8px; }
.active-build-plan-controls .button { min-height: 32px; padding: 0 10px; border-radius: 4px; font-size: 11px; }
.active-build-plan-controls button:disabled { opacity: .55; cursor: not-allowed; }
.build-plan-exit { padding: 5px 2px; border: 0; color: var(--ws-muted); background: transparent; font: 600 11px var(--font-ui); cursor: pointer; }
.build-plan-exit:hover { color: var(--ws-text); text-decoration: underline; }
html[data-theme="light"] .prompt-review-summary,
html[data-theme="light"] .prompt-builder-field,
html[data-theme="light"] .build-plan-assumptions,
html[data-theme="light"] .build-plan-step { border-color: #c6c9d1; }
html[data-theme="light"] .prompt-builder-reason { color: #454854; }
html[data-theme="light"] .prompt-review-summary { background: #f4f5f8; }
html[data-theme="light"] .prompt-review-summary p { color: #60636e; }
@media (max-width: 620px) { .active-build-plan { align-items: stretch; flex-direction: column; } .active-build-plan-controls { flex-wrap: wrap; } .prompt-builder-actions .button { flex: 1 1 100%; } }

.chat-status.busy { display: inline-flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 9px; border: 1px solid rgba(82, 125, 255, .68); border-radius: 999px; color: #b8c9ff; background: rgba(41, 98, 255, .12); font-weight: 700; white-space: nowrap; }
.chat-status.busy::before { content: ""; flex: 0 0 auto; width: 12px; height: 12px; border: 2px solid rgba(138, 168, 255, .3); border-top-color: #8aa8ff; border-radius: 50%; animation: chat-status-spin .75s linear infinite; }
@keyframes chat-status-spin { to { transform: rotate(360deg); } }
html[data-theme="light"] .chat-status.busy { border-color: rgba(41, 98, 255, .62); color: #214ecc; background: rgba(41, 98, 255, .08); }
@media (prefers-reduced-motion: reduce) { .chat-status.busy::before { animation: none; border-color: #8aa8ff; } }

@media (max-width: 740px) {
    .workspace-shell { height: calc(100vh - 58px); }
    .task-panel { top: 58px; }
    .chat-panel { height: 100%; }
    .workspace-empty-state > p:not(.workspace-eyebrow) { margin-left: 0; }
    .composer { width: calc(100% - 24px); }
    .task-composer-stack.streamlined { width: calc(100% - 24px); }
    .strategy-trades-status { width: calc(100% - 24px); }
}
