html body .app-shell .gallery-group-body.has-workspace-chat-agent {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  align-content: flex-start !important;
  gap: 10px !important;
}

html body .app-shell .gallery-group-body.has-workspace-chat-agent > .gallery-card {
  flex: 0 0 210px !important;
  width: 210px !important;
  max-width: 210px !important;
}

.workspace-chat-agent {
  position: relative;
  flex: 1 1 520px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 48px minmax(0, 1fr) auto auto;
  min-width: 520px;
  height: clamp(440px, calc(100vh - 330px), 640px);
  min-height: 440px;
  overflow: hidden;
  border: 1px solid #d7dce2;
  border-radius: 8px;
  background: #ffffff;
  color: #16181d;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.07);
  letter-spacing: 0;
}

.workspace-chat-agent.has-archive-sidebar {
  grid-template-columns: 208px minmax(0, 1fr);
  min-width: 620px;
}

.workspace-chat-agent[hidden],
.workspace-chat-agent-launcher[hidden] {
  display: none !important;
}

html body .app-shell .gallery-group-body.has-workspace-chat-agent > .gallery-group-empty {
  display: none !important;
}

.workspace-chat-agent.is-floating {
  position: fixed;
  right: auto;
  bottom: auto;
  z-index: 10020;
  width: min(920px, calc(100vw - 24px));
  max-width: none;
  height: min(760px, calc(100vh - 24px));
  min-width: min(560px, calc(100vw - 24px));
  min-height: min(480px, calc(100vh - 24px));
  flex: none;
  border-color: #c9ced6;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.2);
}

.workspace-chat-agent.is-maximized {
  position: fixed;
  inset: 0;
  z-index: 30000;
  width: auto;
  max-width: none;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  border-color: #c9ced6;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.2);
}

body.workspace-chat-agent-maximized {
  overflow: hidden !important;
}

.workspace-chat-agent-head {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid #e3e6ea;
  background: #ffffff;
  cursor: move;
  touch-action: none;
  user-select: none;
}

.workspace-chat-agent-archive {
  grid-column: 1;
  grid-row: 2 / 5;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid #e3e6ea;
  background: #f7f8f9;
}

.workspace-chat-agent-archive[hidden] {
  display: none !important;
}

.workspace-chat-agent-archive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  padding: 0 8px 0 11px;
  border-bottom: 1px solid #e4e7eb;
}

.workspace-chat-agent-archive-head strong {
  color: #25282e;
  font-size: 11px;
  font-weight: 800;
}

.workspace-chat-agent-archive-head button,
.workspace-chat-agent-archive-delete {
  display: grid;
  place-items: center;
  width: auto;
  height: 26px;
  padding: 0 6px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #6e747d;
  font: inherit;
  cursor: pointer;
}

.workspace-chat-agent-archive-head button:hover,
.workspace-chat-agent-archive-delete:hover {
  background: #e8eaed;
  color: #1e2126;
}

.workspace-chat-agent-archive-delete {
  width: 26px;
  padding: 0;
}

.workspace-chat-agent-current {
  width: calc(100% - 16px);
  height: 34px;
  margin: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #444950;
  font-family: inherit;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.workspace-chat-agent-current:hover,
.workspace-chat-agent-current.is-active {
  background: #e7e9ec;
  color: #15171b;
}

.workspace-chat-agent-archive-list {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 0;
  max-height: calc(100% - 92px);
  padding: 0 7px 9px;
  overflow-y: auto;
}

.workspace-chat-agent-archive-empty {
  padding: 14px 6px;
  color: #858b94;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

.workspace-chat-agent-archive-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
  gap: 2px;
  min-width: 0;
  border-radius: 6px;
}

.workspace-chat-agent-archive-item.is-active {
  background: #e7e9ec;
}

.workspace-chat-agent-archive-open {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 7px 5px 7px 8px;
  border: 0;
  background: transparent;
  color: #30343a;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-chat-agent-archive-open strong,
.workspace-chat-agent-archive-open span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-chat-agent-archive-open strong {
  font-size: 11px;
  font-weight: 750;
}

.workspace-chat-agent-archive-open span {
  color: #858b94;
  font-size: 9px;
}

.workspace-chat-agent-archive-item:hover {
  background: #eceef0;
}

.workspace-chat-agent.has-archive-sidebar .workspace-chat-agent-messages,
.workspace-chat-agent.has-archive-sidebar .workspace-chat-agent-attachments,
.workspace-chat-agent.has-archive-sidebar .workspace-chat-agent-compose {
  grid-column: 2;
}

.workspace-chat-agent.is-maximized .workspace-chat-agent-head {
  cursor: default;
}

body.workspace-chat-agent-dragging {
  user-select: none !important;
}

.workspace-chat-agent-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.workspace-chat-agent-title > div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.workspace-chat-agent-title strong {
  overflow: hidden;
  color: #111318;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0;
}

.workspace-chat-agent-title span:not(.workspace-chat-agent-mark) {
  color: #717780;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
}

.workspace-chat-agent-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid #16181d;
  border-radius: 6px;
  background: #16181d;
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.workspace-chat-agent-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.workspace-chat-agent-icon,
.workspace-chat-agent-header-command,
.workspace-chat-agent-send,
.workspace-chat-agent-launcher {
  display: inline-grid;
  place-items: center;
  margin: 0;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  background: #ffffff;
  color: #17191e;
  font-family: inherit;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  letter-spacing: 0;
}

.workspace-chat-agent-header-command {
  width: auto;
  height: 30px;
  padding: 0 8px;
  font-size: 10px;
}

.workspace-chat-agent-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 17px;
}

.workspace-chat-agent-icon:hover,
.workspace-chat-agent-tool:hover {
  border-color: #aeb4bd;
  background: #f5f6f7;
}

.workspace-chat-agent-icon.is-active {
  border-color: #aeb4bd;
  background: #eceef1;
}

.workspace-chat-agent-header-command.is-active {
  border-color: #aeb4bd;
  background: #eceef1;
}

.workspace-chat-agent-icon:disabled,
.workspace-chat-agent-header-command:disabled,
.workspace-chat-agent-tool:disabled,
.workspace-chat-agent-send:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.workspace-chat-agent-messages {
  grid-column: 1;
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  background: #ffffff;
  scrollbar-gutter: stable;
}

.workspace-chat-agent-message {
  display: grid;
  gap: 5px;
  max-width: min(86%, 820px);
  margin: 0 0 14px;
}

.workspace-chat-agent-message.is-user {
  justify-self: end;
}

.workspace-chat-agent-message.is-assistant {
  justify-self: start;
}

.workspace-chat-agent-message-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #747a83;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.workspace-chat-agent-message.is-user .workspace-chat-agent-message-label {
  justify-content: flex-end;
}

.workspace-chat-agent-message-body {
  padding: 9px 11px;
  border: 1px solid #e0e3e7;
  border-radius: 8px;
  background: #ffffff;
  color: #202329;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.workspace-chat-agent-message.is-user .workspace-chat-agent-message-body {
  border-color: #d8dce1;
  background: #f1f3f5;
}

.workspace-chat-agent-message.is-pending .workspace-chat-agent-message-body {
  color: #6f747d;
}

.workspace-chat-agent-message-copy {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: #666c75;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}

.workspace-chat-agent-message-copy:hover {
  color: #111318;
}

.workspace-chat-agent-message-images {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
}

.workspace-chat-agent-message-images img,
.workspace-chat-agent-attachment img {
  display: block;
  width: 46px;
  height: 46px;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  background: #f2f3f5;
  object-fit: cover;
}

.workspace-chat-agent-attachments {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  gap: 7px;
  min-width: 0;
  padding: 8px 12px 0;
  overflow-x: auto;
  border-top: 1px solid #eceef1;
  background: #ffffff;
}

.workspace-chat-agent-attachment {
  position: relative;
  flex: 0 0 46px;
}

.workspace-chat-agent-attachment-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid #c8cdd4;
  border-radius: 50%;
  background: #ffffff;
  color: #33373e;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.workspace-chat-agent-compose {
  position: relative;
  grid-column: 1;
  grid-row: 4;
  display: grid;
  gap: 7px;
  padding: 9px 10px 10px;
  border-top: 1px solid #e3e6ea;
  background: #ffffff;
}

.workspace-chat-agent-compose.is-dragging {
  outline: 2px solid #202329;
  outline-offset: -3px;
  background: #f5f6f7;
}

.workspace-chat-agent-drop-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 2px dashed #6b7280;
  background: rgba(255, 255, 255, 0.94);
  color: #202329;
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.workspace-chat-agent-drop-hint[hidden] {
  display: none !important;
}

.workspace-chat-agent-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.workspace-chat-agent-tool {
  min-width: 0;
  height: 28px;
  padding: 0 9px;
  border: 1px solid #d8dce2;
  border-radius: 6px;
  background: #ffffff;
  color: #353940;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  letter-spacing: 0;
}

.workspace-chat-agent-status {
  min-width: 0;
  margin-left: auto;
  overflow: hidden;
  color: #737983;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-chat-agent-status.is-error {
  color: #b42318;
}

.workspace-chat-agent-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: end;
  gap: 7px;
}

.workspace-chat-agent-input-row textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 58px;
  max-height: 128px;
  margin: 0;
  padding: 9px 10px;
  resize: none;
  border: 1px solid #cfd4da;
  border-radius: 7px;
  outline: none;
  background: #ffffff;
  color: #17191e;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: 0;
}

.workspace-chat-agent-input-row textarea:focus {
  border-color: #6c737d;
  box-shadow: 0 0 0 2px rgba(31, 35, 41, 0.08);
}

.workspace-chat-agent-send {
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: #17191e;
  background: #17191e;
  color: #ffffff;
  font-size: 18px;
}

.workspace-chat-agent-send:hover {
  background: #33373e;
}

.workspace-chat-agent-send.is-busy {
  border-color: #5c626b;
  background: #5c626b;
  font-size: 12px;
}

.workspace-chat-agent-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10010;
  width: 46px;
  height: 46px;
  padding: 0;
  border-color: #17191e;
  border-radius: 8px;
  background: #17191e;
  color: #ffffff;
  font-size: 12px;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.2);
  touch-action: none;
  user-select: none;
}

.workspace-chat-agent-launcher:hover {
  background: #33373e;
}

@media (max-width: 900px) {
  html body .app-shell .gallery-group-body.has-workspace-chat-agent > .gallery-card {
    flex-basis: min(210px, 100%) !important;
  }

  .workspace-chat-agent {
    flex-basis: 100%;
    min-width: 100%;
    height: 520px;
  }

  .workspace-chat-agent.has-archive-sidebar {
    min-width: 100%;
  }

  .workspace-chat-agent.is-maximized {
    inset: 6px;
    min-width: 0;
    height: auto;
  }

  .workspace-chat-agent.is-floating {
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    min-width: 0;
    min-height: 0;
  }
}

@media (max-width: 560px) {
  html body .app-shell .gallery-group-body.has-workspace-chat-agent > .gallery-card {
    flex-basis: 100% !important;
    width: 100% !important;
    max-width: none !important;
  }

  .workspace-chat-agent-message {
    max-width: 94%;
  }

  .workspace-chat-agent.has-archive-sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-chat-agent.has-archive-sidebar .workspace-chat-agent-messages,
  .workspace-chat-agent.has-archive-sidebar .workspace-chat-agent-attachments,
  .workspace-chat-agent.has-archive-sidebar .workspace-chat-agent-compose {
    grid-column: 1;
  }

  .workspace-chat-agent-archive {
    position: absolute;
    top: 48px;
    bottom: 0;
    left: 0;
    z-index: 4;
    width: min(248px, calc(100% - 46px));
    border-top: 0;
    box-shadow: 12px 0 30px rgba(17, 24, 39, 0.12);
  }

  .workspace-chat-agent-tools {
    flex-wrap: wrap;
  }

  .workspace-chat-agent-status {
    width: 100%;
    margin-left: 0;
  }
}
