/* The workspace extends TerraBot's existing amber dossier / pixel typography. */
.aiw-layout { display:grid; grid-template-columns:210px minmax(0,1fr); gap:18px; align-items:start; }
.aiw-layout *, .aiw-layout *::before, .aiw-layout *::after { box-sizing:border-box; }
.aiw-main { min-width:0; display:grid; gap:16px; }
.aiw-rail { position:sticky; top:18px; display:grid; gap:14px; padding:18px 14px; min-width:0; border:1px solid var(--border-subtle); background:var(--bg-base); }
.aiw-eyebrow { color:var(--amber); font:600 10px/1.6 var(--font-mono); letter-spacing:.08em; }
.aiw-field { display:grid; gap:7px; min-width:0; color:var(--text-secondary); font:12px/1.5 var(--font-ui); }
.aiw-field input, .aiw-field textarea, .aiw-task-row select { width:100%; min-width:0; padding:10px; border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-input); color:var(--text-primary); font:13px/1.6 var(--font-ui); }
.aiw-field textarea { min-height:80px; resize:vertical; }
.aiw-field input:focus-visible, .aiw-field textarea:focus-visible, .aiw-task-row select:focus-visible { outline:2px solid var(--amber); outline-offset:2px; }
.aiw-layout button:focus-visible, .aiw-layout a:focus-visible, .aiw-layout summary:focus-visible { outline:2px solid var(--amber); outline-offset:3px; }
.aiw-layout button { min-height:38px; }
.aiw-layout button:disabled { cursor:not-allowed; opacity:.48; }
.aiw-layout [hidden] { display:none !important; }
.aiw-history { max-height:60vh; overflow:auto; scrollbar-width:thin; }
.aiw-history-row { display:grid; grid-template-columns:minmax(0,1fr) 32px; border-bottom:1px solid var(--border-dim); }
.aiw-history-open { appearance:none; border:0; padding:11px 8px; text-align:left; background:transparent; color:var(--text-secondary); font:13px/1.55 var(--font-ui); cursor:pointer; overflow-wrap:anywhere; }
.aiw-history-open:hover, .aiw-history-open[aria-current] { color:var(--amber); background:var(--accent-soft); }
.aiw-history-delete { border:0; background:transparent; color:var(--text-muted); font-size:19px; cursor:pointer; }
.aiw-history-delete:hover { color:var(--red); }
.aiw-context { display:flex; align-items:center; flex-wrap:wrap; gap:8px 12px; padding:12px 24px 0; color:var(--text-secondary); font-size:12px; overflow-wrap:anywhere; }
.aiw-link { color:var(--amber); text-underline-offset:3px; font-size:12px; overflow-wrap:anywhere; }
.aiw-layout .ai-quota-grid { padding-bottom:16px; }
.aiw-transcript { display:grid; gap:18px; min-width:0; }
.aiw-empty { padding:40px 28px; border:1px dashed var(--border-subtle); }
.aiw-empty h3 { margin:9px 0 12px; font-size:23px; font-weight:500; color:var(--text-primary); }
.aiw-empty p, .aiw-muted { color:var(--text-muted); font-size:12px; line-height:1.8; }
.aiw-muted { padding:8px; }
.aiw-turn { min-width:0; padding:20px 24px; border:1px solid var(--border-subtle); background:var(--bg-base); overflow-wrap:anywhere; }
.aiw-turn-label { margin:0 0 12px; font:600 10px/1.5 var(--font-mono); color:var(--amber); letter-spacing:.15em; }
.aiw-user { margin-left:32px; border-left:2px solid var(--border-active); background:var(--accent-soft); }
.aiw-user .aiw-turn-label { color:var(--text-muted); }
.aiw-turn-text, .aiw-live-answer { white-space:pre-wrap; font-size:14px; line-height:1.8; }
.aiw-progress { margin:0 0 12px; color:var(--text-muted); font:11px/1.7 var(--font-mono); }
.aiw-reasoning { margin:0 0 15px; border-left:2px solid var(--border-subtle); padding-left:12px; }
.aiw-reasoning summary { cursor:pointer; color:var(--text-muted); font-size:11px; }
.aiw-reasoning pre { max-height:220px; overflow:auto; margin-top:10px; white-space:pre-wrap; word-break:break-word; color:var(--text-secondary); font:12px/1.8 var(--font-mono); }
.aiw-compose { background:var(--bg-elevated); border:1px solid var(--border-active); }
.aiw-compose .aiw-field { font-size:12px; }
.aiw-compose .ai-question { min-height:104px; }
.aiw-compose-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:12px; }
.aiw-compose-actions > :first-child { margin-right:auto; }
.aiw-compose > .ai-mode-note { margin-top:12px; }
.aiw-suggestions { display:grid; gap:10px; }
.aiw-suggestions:empty, .aiw-plan:empty, .aiw-job-detail:empty, .aiw-job-live:empty, .aiw-notice:empty { display:none; }
.aiw-job-live { min-width:0; padding:18px 24px; border-left:2px solid var(--amber); background:var(--bg-base); overflow-wrap:anywhere; }
.aiw-suggestion { padding:16px 20px; border:1px dashed var(--border-active); background:var(--accent-soft); color:var(--text-secondary); font-size:12px; line-height:1.8; }
.aiw-suggestion h4 { margin:0 0 5px; color:var(--amber); font-size:13px; }
.aiw-suggestion button { margin-top:12px; }
.aiw-plan, .aiw-job-detail { padding:22px 24px; border:1px solid var(--border-active); background:var(--bg-base); display:grid; gap:14px; }
.aiw-plan h3, .aiw-job-detail > h3 { margin:0; color:var(--amber); font:600 14px/1.7 var(--font-ui); }
.aiw-plan-questions { display:grid; gap:12px; }
.aiw-plan-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:8px; }
.aiw-check { display:flex; align-items:flex-start; gap:9px; color:var(--text-secondary); font-size:12px; line-height:1.8; cursor:pointer; }
.aiw-check input { margin-top:5px; accent-color:var(--amber); flex-shrink:0; }
.aiw-panel { border:1px solid var(--border-subtle); padding:16px 20px; min-width:0; }
.aiw-panel > summary { color:var(--text-secondary); font:600 12px/1.7 var(--font-ui); cursor:pointer; padding:2px 0; }
.aiw-panel[open] > summary { color:var(--amber); margin-bottom:14px; }
.aiw-job-row { display:flex; flex-wrap:wrap; align-items:center; gap:10px; padding:7px 0; border-bottom:1px solid var(--border-dim); }
.aiw-job-row > :first-child { flex:1 1 180px; min-width:0; }
.aiw-task-row { display:grid; grid-template-columns:minmax(70px,1fr) 90px auto; gap:8px; align-items:center; padding:12px 0; border-top:1px solid var(--border-dim); margin-top:12px; }
.aiw-task-row strong { color:var(--text-primary); font-size:13px; overflow-wrap:anywhere; }
.aiw-task-row time { grid-row:2; grid-column:1 / -1; overflow-wrap:anywhere; }
.aiw-task-row button { grid-column:3; grid-row:1; }
.aiw-notice { padding:12px 16px; border-left:2px solid var(--red); color:var(--text-secondary); background:var(--bg-elevated); font-size:12px; line-height:1.8; }
.aiw-cards { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); gap:10px; margin:18px 0; }
.aiw-card { padding:14px; border:1px solid var(--border-subtle); min-width:0; }
.aiw-card h4 { margin-bottom:10px; color:var(--text-primary); font-size:13px; }
.aiw-entity-fields { display:grid; grid-template-columns:auto minmax(0,1fr); gap:7px 12px; margin-top:12px; font-size:12px; line-height:1.7; }
.aiw-entity-fields dt { color:var(--text-muted); }
.aiw-entity-fields dd { margin:0; color:var(--text-primary); overflow-wrap:anywhere; }
.aiw-sparkline { display:block; width:100%; height:auto; max-height:150px; margin:10px 0; color:var(--amber); }
.aiw-sparkline path { stroke:currentColor; }
.aiw-sparkline circle { fill:currentColor; }
.aiw-trend-data summary { color:var(--text-secondary); font-size:11px; cursor:pointer; }
.aiw-trend { width:100%; border-collapse:collapse; color:var(--text-secondary); font:11px/1.7 var(--font-mono); }
.aiw-trend th { text-align:left; padding:4px; color:var(--text-muted); }
.aiw-trend td { border-bottom:1px solid var(--border-dim); padding:4px; overflow-wrap:anywhere; }
.aiw-trend td:last-child { text-align:right; color:var(--amber); }
.aiw-followups { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
.aiw-followups button { text-align:left; white-space:normal; line-height:1.6; max-width:100%; overflow-wrap:anywhere; }
.aiw-share { display:grid; gap:12px; padding-top:18px; margin-top:10px; border-top:1px solid var(--border-subtle); }
.aiw-share h4 { color:var(--amber); font-size:12px; }
.aiw-share-preview { display:grid; gap:12px; }
.aiw-share-preview img { display:block; width:100%; height:auto; max-width:640px; border:1px solid var(--border-subtle); }
.aiw-map-preview img { display:block; width:100%; height:auto; margin-top:10px; border:1px solid var(--border-subtle); }
.aiw-card > button { margin-top:12px; }
.aiw-research-plan { color:var(--text-secondary); font-size:12px; line-height:1.8; }
.aiw-research-plan summary { cursor:pointer; }
.aiw-research-plan ol { padding-left:20px; }
@media (max-width:1100px) {
  .aiw-layout { grid-template-columns:176px minmax(0,1fr); gap:12px; }
  .aiw-rail { padding:14px 10px; }
  .aiw-turn, .aiw-plan, .aiw-job-detail { padding:18px; }
}
@media (max-width:760px) {
  .aiw-layout { grid-template-columns:minmax(0,1fr); }
  .aiw-rail { position:static; grid-template-columns:minmax(0,1fr) auto; gap:10px; }
  .aiw-rail > h3 { align-self:center; }
  .aiw-rail > .aiw-field, .aiw-rail > .aiw-history { grid-column:1 / -1; }
  .aiw-history { max-height:150px; }
  .aiw-rail > :last-child { grid-column:1 / -1; }
  .aiw-user { margin-left:14px; }
  .aiw-context { padding-left:16px; padding-right:16px; }
  .aiw-main { gap:12px; }
  .aiw-empty { padding:28px 18px; }
  .aiw-compose-actions > :first-child { margin-right:0; }
}
@media (prefers-reduced-motion:reduce) { .aiw-layout * { animation:none !important; scroll-behavior:auto !important; } }
