.workbench-body { display: grid; grid-template-columns: minmax(0, 1fr) 326px; max-width: 1600px; margin: 0 auto; }
.workbench-body .content { width: 100%; margin: 0; padding-right: clamp(16px, 2vw, 28px); }
.workbench-body .grid { grid-template-columns: minmax(0, 1fr); }
.workbench-body #materials .side-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.agent-panel { position: sticky; top: 12px; align-self: start; margin: 28px 18px 22px 0; height: calc(100dvh - 110px); min-height: 390px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); color: var(--ink); overflow: hidden; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; padding: 16px 15px 10px; }
.workspace-heading h2 { font-size: 16px; }
.workspace-tabs { display: flex; gap: 6px; padding: 0 15px 12px; border-bottom: 1px solid var(--line); }
.workspace-tabs > button { min-height: 32px; background: none; color: var(--muted); padding: 4px 11px; }
.workspace-tabs > button[aria-pressed=true] { background: var(--soft); color: var(--button); border-color: #d8e2d1; }
.workspace-conversation { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.workspace-memory { max-height: 180px; overflow: auto; padding: 6px 14px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.workspace-memory summary { cursor: pointer; padding: 4px 0; }
.workspace-memory textarea { margin-top: 5px; font-size: 12px; }
#agent-secure { display: block; color: var(--button); }
.agent-turns { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 14px; }
.agent-turns article { max-width: 100%; padding: 9px 11px; border-radius: 10px; overflow-wrap: anywhere; }
.agent-turns article p { white-space: pre-wrap; font-size: 13px; line-height: 1.55; }
.agent-user { background: var(--soft); align-self: flex-end; }
.agent-answer { background: #f2f3ea; }
.agent-answer .button { padding: 2px 6px; margin-top: 5px; min-height: 27px; font-size: 11px; }
.turn-references { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.agent-form { position: relative; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.agent-form textarea { min-height: 70px; font-size: 13px; }
.agent-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.agent-tools > button { min-height: 32px; padding: 3px 8px; }
#agent-send { margin-left: auto; }
.agent-refs { display: flex; flex-wrap: wrap; gap: 4px; max-height: 80px; overflow: auto; margin-bottom: 5px; }
.ref-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 4px 3px 7px; border-radius: 6px; background: var(--soft); color: var(--button); font-size: 11px; overflow-wrap: anywhere; }
.ref-chip button { padding: 0 4px; min-height: 18px; border: 0; background: transparent; }
.agent-all { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.agent-all input { width: 14px; height: 14px; }
.agent-mentions { position: absolute; z-index: 2; left: 10px; right: 10px; bottom: calc(100% + 2px); max-height: 210px; overflow: auto; padding: 6px; display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 10px 24px #24332b24; }
.agent-mentions button { justify-content: flex-start; text-align: left; min-height: 30px; overflow-wrap: anywhere; }
.workspace-assets, .workspace-deliveries { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.assets-tools { margin-bottom: 9px; }
.agent-assets, .workspace-deliveries { display: grid; align-content: start; gap: 8px; }
.shelf-item { min-width: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; }
.shelf-item .shelf-preview { width: 56px; height: 62px; padding: 0; overflow: hidden; background: var(--soft); cursor: zoom-in; }
.shelf-preview img { width: 100%; height: 100%; object-fit: contain; }
.shelf-info { min-width: 0; }
.shelf-info strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shelf-info small { color: var(--muted); font-size: 11px; }
.shelf-actions { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; }
.shelf-actions .button { min-height: 23px; padding: 1px 5px; font-size: 10px; }
.asset-zoom { display: block; max-width: 100%; max-height: 64vh; margin: auto; }
#asset-preview-body audio { width: 100%; }
.drag-target { outline: 2px dashed var(--button); outline-offset: -2px; background: #edf2d8; }
.workspace-toggle { display: none; }
@media (min-width: 1550px) {
  .workbench-body { grid-template-columns: minmax(0, 1fr) 356px; }
  .workbench-body #materials .grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 258px); }
  .workbench-body #materials .side-stack { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1179px) {
  .workbench-body { display: block; }
  .workspace-toggle { display: inline-flex; }
  .agent-panel { display: none; position: fixed; z-index: 5; top: auto; bottom: 12px; right: 12px; width: min(430px, calc(100vw - 24px)); height: min(680px, calc(100dvh - 100px)); min-height: 0; margin: 0; box-shadow: 0 12px 36px #202e2640; }
  .agent-panel.open { display: flex; }
}
@media (max-width: 680px) {
  .workbench-body #materials .side-stack { grid-template-columns: minmax(0, 1fr); }
  .agent-panel { bottom: 8px; inset-inline: 8px; width: auto; height: min(730px, calc(100dvh - 114px)); }
  .workspace-heading { padding: 9px 12px 6px; }
  #close-workspace { min-height: 30px; }
}
