@media (max-width: 1180px) {
  .app-chat-panel {
    height: 100%;
    max-height: none;
    border-radius: 0;
  }

  .app-chat-panel--tablet-app {
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    border-radius: 0;
    overflow: hidden;
  }

  .app-chat-panel.ant-card .ant-card-head {
    padding: 0 14px;
  }

  .app-chat-panel.ant-card .ant-card-body {
    padding: 10px;
  }

  .app-chat-panel__conversation-shell,
  .app-chat-panel__stack--chat,
  .app-chat-panel__conversation-main,
  .app-chat-panel__conversation-view,
  .app-chat-panel__conversation-view-inner,
  .app-chat-panel__messages,
  .app-chat-panel__composer,
  .app-chat-panel__composer-input-shell {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .app-chat-message {
    width: auto;
    max-width: calc(100% - 40px);
    margin-right: 20px;
  }

  .app-chat-message--codex,
  .app-chat-message--system-inline {
    margin-left: 4px;
    margin-right: 20px;
  }

  .app-chat-message--user {
    margin-left: 20px;
    margin-right: 4px;
  }

  .app-chat-message-stack--codex .app-chat-preview-card,
  .app-chat-message-stack--system .app-chat-preview-card,
  .app-chat-message-stack--user .app-chat-preview-card {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .app-chat-message-stack--artifact-only .app-chat-preview-card {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
  }

  .app-chat-panel__composer-queue {
    width: min(220px, calc(100% - 88px));
  }
}

@media (min-width: 1181px) and (max-width: 1366px) {
  .app-chat-panel__conversation-list {
    flex: 0 0 clamp(208px, 19vw, 240px);
    width: clamp(208px, 19vw, 240px);
    min-width: clamp(208px, 19vw, 240px);
    max-width: clamp(208px, 19vw, 240px);
  }

  .app-chat-panel__conversation-main,
  .app-chat-panel__conversation-view,
  .app-chat-panel__conversation-view-inner {
    width: auto;
  }
}

.app-chat-message-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(241, 245, 249, 0.92)),
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 42%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.app-chat-message-group--interactive {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.app-chat-message-group--interactive:hover,
.app-chat-message-group--interactive:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.34);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
  outline: none;
}

.app-chat-message-group__header {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.app-chat-message-group__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.app-chat-message-group__header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.app-chat-message-group__eyebrow {
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-chat-message-group__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.app-chat-message-group__status--completed {
  color: #166534;
  background: rgba(34, 197, 94, 0.14);
}

.app-chat-message-group__status--attention {
  color: #b45309;
  background: rgba(245, 158, 11, 0.14);
}

.app-chat-message-group__status--started {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.14);
}

.app-chat-message-group__status--queued,
.app-chat-message-group__status--neutral {
  color: #334155;
  background: rgba(148, 163, 184, 0.16);
}

.app-chat-message-group__status--failed,
.app-chat-message-group__status--cancelled {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.14);
}

.app-chat-message-group__toggle.ant-btn.ant-btn-text {
  padding-inline: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.app-chat-message-group__header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}

.app-chat-message-group__child-action.ant-btn {
  border-color: rgba(245, 158, 11, 0.32);
  color: #b45309;
  background: rgba(255, 251, 235, 0.92);
  font-size: 12px;
  font-weight: 600;
}

.app-chat-message-group__child-action.ant-btn:hover,
.app-chat-message-group__child-action.ant-btn:focus-visible {
  color: #92400e;
  border-color: rgba(217, 119, 6, 0.42);
  background: rgba(254, 243, 199, 0.98);
}

.app-chat-message-group__toggle.ant-btn.ant-btn-text:hover,
.app-chat-message-group__toggle.ant-btn.ant-btn-text:focus-visible {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.06);
}

.app-chat-message-group__title {
  color: #0f172a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.app-chat-message-group__detail {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

.app-chat-message-group__child-composer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 16px;
  background: rgba(255, 251, 235, 0.82);
}

.app-chat-message-group__child-composer .ant-input {
  background: rgba(255, 255, 255, 0.92);
}

.app-chat-message-group__child-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.app-chat-message-group__child-composer-hint {
  color: #78716c;
  font-size: 11px;
  line-height: 1.4;
}

.app-chat-message-group__child-composer-buttons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.app-chat-message-group__body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-chat-message-group__activity {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.app-chat-message-group__request-tree,
.app-chat-message-group__embedded-request-tree {
  width: 100%;
}

.app-chat-message-group__activity-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.app-chat-message-group__activity-item--child {
  position: relative;
  margin-left: 18px;
  padding-left: 12px;
}

.app-chat-message-group__activity-item--child::before {
  content: '';
  position: absolute;
  top: 10px;
  left: -2px;
  width: 10px;
  height: calc(100% - 18px);
  border-top: 2px solid rgba(96, 165, 250, 0.82);
  border-left: 2px solid rgba(96, 165, 250, 0.82);
  border-top-left-radius: 8px;
  pointer-events: none;
}

.app-chat-message-group__section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(219, 234, 254, 0.88);
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.app-chat-message-group__section-label::before {
  content: '└';
  flex: none;
  color: #60a5fa;
  font-size: 12px;
  line-height: 1;
}

.app-chat-message-group__activity-label {
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.app-chat-message-group__activity-stack {
  width: 100%;
}

.app-chat-message-group__activity-children {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.app-chat-message-group__body .app-chat-panel__preview-rich .previewer-ui__editor-body,
.app-chat-message-group__body .app-chat-panel__preview-rich--markdown,
.app-chat-message-group__body .app-chat-panel__preview-table-scroll,
.app-chat-message-group__body .app-chat-message__preview-text {
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
}

.app-chat-preview-card__body {
  display: flex;
  min-height: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding: 8px 0 1px;
  width: 100%;
  box-sizing: border-box;
}

.app-chat-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: 0;
  margin: 0;
  background: rgba(15, 23, 42, 0.28);
}

.app-chat-preview-card--fullscreen {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100vw;
  min-width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #f8fafc;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.26);
  overflow: hidden;
}

.app-chat-preview-card--fullscreen .app-chat-preview-card__header {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.96));
}

.app-chat-preview-card--fullscreen .app-chat-preview-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding-top: 0;
  border-top: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app-chat-preview-card--fullscreen .app-chat-panel__preview-rich {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: 100%;
}

.app-chat-preview-card--fullscreen .app-chat-panel__preview-rich,
.app-chat-preview-card--fullscreen .codex-diff-previewer,
.app-chat-preview-card--fullscreen .codex-diff-previewer__diff-list,
.app-chat-preview-card--fullscreen .previewer-ui {
  min-height: 0;
  width: 100%;
  max-width: none;
}

.app-chat-preview-card--fullscreen .codex-diff-previewer,
.app-chat-preview-card--fullscreen .codex-diff-previewer__diff-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.app-chat-preview-card--fullscreen .codex-diff-previewer__diff-list {
  gap: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.app-chat-preview-card--fullscreen .codex-diff-previewer__diff-toolbar {
  display: flex;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(241, 245, 249, 0.96);
}

.app-chat-preview-card--fullscreen .codex-diff-previewer__diff-section {
  flex: 0 0 auto;
  border-width: 0 0 1px;
  border-radius: 0;
  height: auto;
  min-height: auto;
}

.app-chat-preview-card--fullscreen .codex-diff-previewer__diff-toggle {
  padding-inline: 16px 88px;
}

.app-chat-preview-card--fullscreen .codex-diff-previewer__diff-body {
  height: auto;
  overflow: visible;
}

.app-chat-preview-card--fullscreen .previewer-ui__editor {
  height: auto;
  min-height: 0;
  border-width: 0;
  border-radius: 0;
}

.app-chat-preview-card--fullscreen .previewer-ui__editor-body {
  height: auto;
  max-height: none;
  padding-inline: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.app-chat-panel__preview-rich {
  width: 100%;
  min-width: 0;
  padding-bottom: 1px;
  box-sizing: border-box;
}

.app-chat-panel__preview-rich .previewer-ui__editor,
.app-chat-panel__preview-rich .codex-diff-previewer__diff-list,
.app-chat-panel__preview-rich .codex-diff-previewer__diff-section {
  width: 100%;
}

.app-chat-panel__preview-rich .codex-diff-previewer,
.app-chat-panel__preview-rich .codex-diff-previewer__diff-body,
.app-chat-panel__preview-rich .previewer-ui,
.app-chat-panel__preview-rich .previewer-ui__body {
  width: 100%;
}

.app-chat-panel__preview-rich .previewer-ui__editor {
  border-color: rgba(15, 23, 42, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-chat-panel__preview-rich .previewer-ui__editor-tab {
  font-weight: 700;
  letter-spacing: 0.1em;
}

.app-chat-panel__preview-rich .previewer-ui__editor-body {
  max-height: 420px;
  overflow: auto;
}

.app-chat-panel__preview-rich .codex-diff-previewer__diff-toolbar {
  display: none;
}

.app-chat-preview-card--fullscreen .app-chat-panel__preview-rich .codex-diff-previewer__diff-toolbar {
  display: flex;
}

.app-chat-panel__preview-rich .codex-diff-previewer__diff-section {
  border-radius: 0;
}

.app-chat-panel__preview-rich .codex-diff-previewer__file-name {
  color: #e2e8f0;
}

.app-chat-panel__preview-rich .codex-diff-previewer__diff-list--expand-all .codex-diff-previewer__diff-section {
  border-radius: 0;
}

.app-chat-panel__preview-rich--markdown {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  max-height: min(420px, 70vh);
  padding: 4px 2px 0;
}

.app-chat-panel__preview-rich--markdown .markdown-preview {
  width: 100%;
  min-width: 0;
}

.app-chat-panel__preview-table {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.app-chat-panel__preview-table-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.app-chat-panel__preview-table-scroll {
  overflow: auto;
  max-height: min(420px, 70vh);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
}

.app-chat-panel__preview-table-grid {
  width: 100%;
  min-width: max-content;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.5;
}

.app-chat-panel__preview-table-grid th,
.app-chat-panel__preview-table-grid td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(226, 232, 240, 0.92);
  white-space: pre-wrap;
  word-break: break-word;
}

.app-chat-panel__preview-table-grid th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 700;
}

.app-chat-panel__preview-table-grid tbody tr:nth-child(even) td {
  background: rgba(248, 250, 252, 0.82);
}

.app-chat-panel__preview-table-grid tbody tr:last-child td {
  border-bottom: 0;
}

.app-chat-message__preview-image,
.app-chat-message__preview-video,
.app-chat-message__preview-frame {
  width: 100%;
  max-height: 200px;
  min-height: 120px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  object-fit: contain;
  background: #f8fafc;
}

.app-chat-message__preview-text {
  width: 100%;
  max-height: 180px;
  margin: 0;
  padding: 8px;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.18);
  font: 11px/1.5 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.app-chat-message__expand.ant-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: auto;
  min-width: 0;
  height: 26px;
  margin-top: 2px;
  padding-inline: 10px;
  font-size: 12px;
  color: #475569;
  border-radius: 999px;
}

.app-chat-message__expand.ant-btn:hover,
.app-chat-message__expand.ant-btn:focus {
  color: #0f172a;
  background: rgba(148, 163, 184, 0.12);
}

.app-chat-panel__scroll-jump {
  position: absolute;
  left: 50%;
  bottom: clamp(132px, 18vh, 176px);
  transform: translateX(-50%);
  z-index: 3;
}

.app-chat-panel__scroll-jump .ant-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.14);
}

.app-chat-panel__composer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  padding-top: 4px;
  padding-right: 10px;
  padding-bottom: max(2px, min(env(safe-area-inset-bottom, 0px), 8px));
  padding-left: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 0;
  background: rgba(248, 250, 252, 0.94);
  box-shadow: none;
}

.app-chat-panel--maximized .app-chat-panel__messages {
  padding-bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 10px));
  scroll-padding-bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 10px));
}

.app-chat-panel--maximized .app-chat-panel__system-status-slot--bottom {
  padding-bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 4px));
}

.app-chat-panel--maximized .app-chat-panel__composer {
  padding-bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 8px));
}

.app-chat-panel__composer-input-shell {
  position: relative;
  display: flex;
  align-items: stretch;
  flex: none;
  width: 100%;
  min-width: 0;
  min-height: var(--app-chat-panel-composer-height, clamp(112px, 18dvh, 160px));
}

.app-chat-panel__composer-input-shell--autosize {
  min-height: auto;
}

.app-chat-panel--maximized .app-chat-panel__composer-input-shell {
  min-height: var(--app-chat-panel-composer-height, clamp(104px, 16dvh, 148px));
}

.app-chat-panel--maximized .app-chat-panel__composer-input-shell--autosize {
  min-height: auto;
}

.app-chat-panel__composer-queue {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: min(320px, calc(100% - 112px));
  pointer-events: auto;
}

.app-chat-panel__composer-queue-count {
  padding: 2px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.app-chat-panel__composer-queue-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  max-height: 188px;
  overflow-y: auto;
}

.app-chat-panel__composer-queue-chip,
.app-chat-panel__composer-queue-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 12px;
  background: rgba(239, 246, 255, 0.96);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.1);
  color: #1e3a8a;
}

.app-chat-panel__composer-queue-chip-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
}

.app-chat-panel__composer-queue-chip-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.app-chat-panel__composer-queue-chip-actions .ant-btn {
  color: #1d4ed8;
}

.app-chat-panel__composer-queue-order {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  font-size: 11px;
  font-weight: 700;
}

.app-chat-panel__composer-queue-text,
.app-chat-panel__composer-queue-more {
  font-size: 12px;
  line-height: 1.3;
}

.app-chat-panel__composer-queue-text {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-chat-panel__composer .ant-input-textarea,
.app-chat-panel__composer textarea.ant-input {
  width: 100%;
  min-width: 0;
  display: block;
  align-self: stretch;
  flex: none;
  min-height: 0;
}

.app-chat-panel__composer textarea.ant-input {
  width: 100%;
  font-size: 13px;
  line-height: 1.4;
  height: var(--app-chat-panel-composer-height, clamp(112px, 18dvh, 160px));
  min-height: var(--app-chat-panel-composer-height, clamp(112px, 18dvh, 160px));
  padding: 10px 52px 8px 14px;
  box-sizing: border-box;
  resize: none;
}

.app-chat-panel__composer-input-shell--autosize .ant-input-textarea,
.app-chat-panel__composer-input-shell--autosize .ant-input-textarea textarea.ant-input,
.app-chat-panel__composer-input-shell--autosize textarea.ant-input {
  height: auto;
}

.app-chat-panel--maximized .app-chat-panel__composer textarea.ant-input {
  height: var(--app-chat-panel-composer-height, clamp(104px, 16dvh, 148px));
  min-height: var(--app-chat-panel-composer-height, clamp(104px, 16dvh, 148px));
  padding-bottom: max(14px, calc(env(safe-area-inset-bottom, 0px) + 10px));
}

:root.app-virtual-keyboard-open .app-chat-panel--maximized {
  --app-chat-panel-maximized-inset-bottom: 0px;
}

:root.app-virtual-keyboard-open .app-chat-panel--maximized .ant-card-body {
  padding-bottom: 0;
}

:root.app-virtual-keyboard-open .app-chat-panel--maximized .app-chat-panel__composer {
  padding-bottom: 2px;
}

:root.app-virtual-keyboard-open .app-chat-panel--maximized .app-chat-panel__composer textarea.ant-input {
  padding-bottom: 8px;
}

.app-chat-panel__composer-input-shell--with-queue textarea.ant-input {
  padding-top: 96px;
}

.app-chat-panel__composer-input-shell--autosize.app-chat-panel__composer-input-shell--with-queue {
  min-height: 120px;
}

.app-chat-panel__composer-input-shell--autosize.app-chat-panel__composer-input-shell--with-queue textarea.ant-input {
  min-height: 120px;
}

.app-chat-panel__composer-input-shell--with-assist textarea.ant-input {
  padding-left: 52px;
}

.app-chat-panel__composer-topline,
.app-chat-panel__composer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-chat-panel__composer-topline {
  width: 100%;
  justify-content: stretch;
  flex-wrap: nowrap;
}

.app-chat-panel__composer-utility-buttons {
  flex: none;
}

.app-chat-panel__composer-type {
  flex: 1;
  min-width: 0;
}

.app-chat-panel__composer-action-buttons {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.app-chat-panel__composer-contextless-toggle.ant-btn {
  color: #475569;
}

.app-chat-panel__composer-immediate-toggle.ant-btn {
  color: #475569;
}

.app-chat-panel__composer-immediate-toggle--active.ant-btn {
  border-color: #2563eb;
  background: linear-gradient(135deg, #2563eb, #2563eb);
  color: #eff6ff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.app-chat-panel__composer-immediate-toggle--active.ant-btn:hover,
.app-chat-panel__composer-immediate-toggle--active.ant-btn:focus-visible {
  border-color: #1d4ed8;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #eff6ff;
}

.app-chat-panel__composer-contextless-toggle--active.ant-btn {
  border-color: #0f766e;
  background: linear-gradient(135deg, #0f766e, #0f766e);
  color: #f8fafc;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.24);
}

.app-chat-panel__composer-contextless-toggle--active.ant-btn:hover,
.app-chat-panel__composer-contextless-toggle--active.ant-btn:focus-visible {
  border-color: #0f766e;
  background: linear-gradient(135deg, #0f766e, #115e59);
  color: #f8fafc;
}

.app-chat-panel__composer-utility-buttons {
  display: inline-flex;
  gap: 6px;
}

.app-chat-panel__composer-file-input {
  display: none;
}

.app-chat-panel__composer-assist-trigger.ant-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding-inline: 0;
  border-radius: 999px;
  color: rgba(71, 85, 105, 0.88);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.app-chat-panel__composer-assist-trigger.ant-btn:hover,
.app-chat-panel__composer-assist-trigger.ant-btn:focus-visible {
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(239, 246, 255, 0.98);
}

.app-chat-panel__composer-clear.ant-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: rgba(71, 85, 105, 0.88);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
  transform: translateY(-4px);
}

.app-chat-panel__composer-clear.app-chat-panel__composer-clear--visible.ant-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.app-chat-panel__composer-clear.ant-btn:disabled {
  opacity: 0;
  pointer-events: none;
}

.app-chat-panel__composer-attachment-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  min-height: 0;
}


.app-chat-panel__composer-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 4px 4px 4px 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #334155;
}

.app-chat-panel__composer-attachment-chip--pending {
  border-style: dashed;
  background: rgba(239, 246, 255, 0.96);
  color: #1d4ed8;
}

.app-chat-panel__composer-attachment-chip--failed {
  border-style: solid;
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(254, 242, 242, 0.98);
  color: #b91c1c;
}

.app-chat-panel__composer-attachment-name {
  max-width: min(240px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.3;
}

.app-chat-panel__composer-attachment-pending-label {
  flex: none;
  font-size: 10px;
  line-height: 1.2;
  color: inherit;
  opacity: 0.78;
}

.app-chat-panel__composer-attachment-remove.ant-btn {
  width: 22px;
  min-width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 999px;
  color: #64748b;
}

.app-chat-panel__composer .ant-btn {
  height: 28px;
  padding-inline: 8px;
  border-radius: 8px;
  font-size: 12px;
}

.app-chat-panel__composer-action-buttons .ant-btn,
.app-chat-panel__composer-type .ant-select-selector {
  min-height: 28px;
}

.app-chat-panel__composer-action-buttons .ant-btn:not(.ant-btn-icon-only) {
  padding-inline: 10px;
}

.app-chat-panel__composer-action-buttons .ant-btn-icon-only {
  width: 28px;
  min-width: 28px;
  padding-inline: 0;
}

.app-chat-panel__composer-assist-modal-alert {
  margin-bottom: 12px;
}

.app-chat-panel__composer-assist-modal-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.app-chat-panel__composer-assist-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.92);
}

.app-chat-panel__composer-assist-option-main .ant-checkbox-wrapper {
  align-items: center;
}

.app-chat-panel__composer-assist-option-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #0f172a;
}

.app-chat-panel__composer-assist-option-description {
  margin: 0;
  padding-left: 24px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
}

.app-chat-panel__composer-type .ant-select-selector {
  padding-block: 2px;
}

.app-chat-panel__composer-actions .ant-typography {
  font-size: 12px;
}

.app-chat-panel__composer-hint {
  display: block;
}

.app-chat-panel__type-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.app-chat-panel__resource-strip {
  position: absolute;
  top: 38px;
  right: 8px;
  left: auto;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100% - 16px));
  max-height: min(58vh, 520px);
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(246, 248, 252, 0.96);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  overflow: hidden;
}

.app-chat-panel__resource-strip-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-top: 2px;
  max-height: min(32vh, 240px);
  overflow-x: hidden;
  overflow-y: auto;
}

.app-chat-panel__resource-strip-filter {
  display: flex;
  align-items: center;
  min-width: 0;
  color: #334155;
  font-size: 11px;
  line-height: 1.4;
}

.app-chat-panel__resource-strip-filter .ant-checkbox-wrapper {
  width: 100%;
  margin-inline-start: 0;
  font-size: inherit;
  color: inherit;
}

.app-chat-panel__resource-strip-empty.ant-typography {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}

.app-chat-panel__preview-stage {
  display: flex;
  min-height: 0;
  padding: 0 18px;
}

.app-chat-panel__preview-stage--modal {
  padding: 0;
}

.app-chat-panel__preview-stage > * {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.app-chat-panel__preview-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 220px;
}

.app-chat-panel__conversation-view {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
}

.app-chat-panel__conversation-view-inner {
  display: flex;
  flex: 1;
  min-height: 0;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.app-chat-panel__conversation-view-inner.is-loading {
  pointer-events: none;
}

.app-chat-panel__conversation-view-inner.is-busy {
  user-select: auto;
}

.app-chat-panel__conversation-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex: 1;
  min-height: 360px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  padding: 32px 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(191, 219, 254, 0.45), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(248, 250, 252, 0.86));
  backdrop-filter: blur(6px);
  text-align: center;
}

.app-chat-panel__busy-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(147, 197, 253, 0.26), transparent 48%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.64), rgba(241, 245, 249, 0.74));
  backdrop-filter: blur(4px);
  text-align: center;
}

.app-chat-panel__busy-overlay strong {
  color: #0f172a;
}

.app-chat-panel__busy-overlay span {
  color: #475569;
  font-size: 12px;
}

.app-chat-panel__preview-image,
.app-chat-panel__preview-video,
.app-chat-panel__preview-frame {
  width: 100%;
  min-height: 320px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  object-fit: contain;
}

.app-chat-panel__preview-image {
  display: block;
  height: auto;
  max-height: min(72vh, 640px);
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)),
    linear-gradient(135deg, rgba(226, 232, 240, 0.16), rgba(255, 255, 255, 0));
  object-position: top center;
}

.app-chat-panel__preview-video {
  height: 100%;
  background: #0f172a;
}

.app-chat-panel__preview-frame {
  height: 100%;
  background: #fff;
}

.app-chat-panel__preview-text {
  min-height: 320px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border-radius: 16px;
  background: #0f172a;
  color: #dbeafe;
  font: 13px/1.6 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.app-chat-panel__preview-file {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.88);
  border: 1px dashed rgba(148, 163, 184, 0.35);
}

.app-chat-panel__preview-modal .fullscreen-preview-modal__meta {
  display: flex;
  align-items: center;
}

.app-chat-panel__preview-modal .ant-modal-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.app-chat-panel__preview-modal {
  z-index: 1600;
}

.app-chat-panel__preview-stage--modal {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.app-chat-panel__delete-confirm-modal {
  z-index: 1700 !important;
}

.app-chat-panel__delete-confirm-modal .ant-modal-content {
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
}

.app-chat-panel__preview-modal-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}

.app-chat-panel__preview-modal-findbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(11, 18, 32, 0.96);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.app-chat-panel__preview-modal-findbar .ant-input-affix-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

.app-chat-panel__preview-modal .app-chat-panel__preview-rich,
.app-chat-panel__preview-modal .previewer-ui,
.app-chat-panel__preview-modal .previewer-ui__editor,
.app-chat-panel__preview-modal .previewer-ui__editor-body,
.app-chat-panel__preview-modal .codex-diff-previewer,
.app-chat-panel__preview-modal .codex-diff-previewer__diff-list,
.app-chat-panel__preview-modal .codex-diff-previewer__diff-section,
.app-chat-panel__preview-modal .codex-diff-previewer__diff-body {
  height: 100%;
  width: 100%;
  max-width: none;
}

.app-chat-panel__preview-modal .app-chat-panel__preview-rich--markdown,
.app-chat-preview-card--fullscreen .app-chat-panel__preview-rich--markdown {
  height: 100%;
  max-height: none;
  padding: 20px 18px 28px;
  background: #f8fafc;
}

.app-chat-panel__preview-modal .previewer-ui__editor,
.app-chat-panel__preview-modal .codex-diff-previewer__diff-section,
.app-chat-panel__preview-modal .app-chat-panel__preview-image,
.app-chat-panel__preview-modal .app-chat-panel__preview-video,
.app-chat-panel__preview-modal .app-chat-panel__preview-frame {
  border-left-width: 0;
  border-right-width: 0;
  border-radius: 0;
}

.app-chat-panel__preview-modal .app-chat-panel__preview-image {
  height: 100%;
  max-height: none;
  background: #0b1220;
  object-position: center;
}

.app-chat-panel__preview-modal .app-chat-panel__preview-rich--markdown .markdown-preview,
.app-chat-preview-card--fullscreen .app-chat-panel__preview-rich--markdown .markdown-preview {
  color: #0f172a;
}

.app-chat-panel__preview-modal .app-chat-panel__preview-rich--markdown code,
.app-chat-preview-card--fullscreen .app-chat-panel__preview-rich--markdown code {
  color: #0f172a;
}

.app-chat-panel__preview-modal .previewer-ui__editor-body {
  max-height: none;
  padding-inline: 0;
}

.app-chat-panel__preview-zoom-stage {
  width: 100%;
  height: 100%;
  background: #0b1220;
}

.app-chat-panel__preview-zoom-content {
  display: flex;
  width: 100%;
  height: 100%;
}

.app-chat-panel__preview-zoom-content .app-chat-panel__preview-image,
.app-chat-panel__preview-zoom-content .app-chat-panel__preview-frame {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
}

.app-chat-panel__preview-zoom-content .app-chat-panel__preview-frame {
  pointer-events: none;
  background: #fff;
}

.app-chat-panel__preview-modal--html-mobile .ant-modal-content {
  background: #fff;
}

.app-chat-panel__preview-modal--html-mobile .ant-modal-body,
.app-chat-panel__preview-modal--html-mobile .app-chat-panel__preview-modal-body,
.app-chat-panel__preview-modal--html-mobile .app-chat-panel__preview-stage--modal {
  padding: 0;
}

.app-chat-panel__preview-stage--html-mobile {
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
}

.app-chat-panel__preview-stage--html-mobile > * {
  display: flex;
  justify-content: stretch;
  width: 100%;
  min-height: 100%;
  padding: 0;
}

.app-chat-panel__preview-modal--html-mobile .app-chat-panel__preview-frame {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

@media (max-width: 720px) {
  .app-chat-panel__preview-stage--html-mobile > * {
    padding: 0;
  }

  .app-chat-panel__preview-modal--html-mobile .app-chat-panel__preview-frame {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-width: 720px) {
  .app-chat-panel__preview-modal-findbar {
    flex-wrap: wrap;
  }

  .app-chat-panel__preview-modal-findbar .ant-btn {
    flex: 1 1 calc(50% - 4px);
  }
}

.app-chat-panel__connection-dot--connecting {
  background: #f59e0b;
}

@keyframes app-chat-message-loading {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

  40% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .app-chat-panel {
    height: 100%;
    min-height: 100%;
    border-radius: 0;
    overflow: hidden;
  }

  .app-chat-panel .ant-card-head {
    flex: 0 0 auto;
    padding-inline: 8px;
  }

  .app-chat-panel .ant-card-head-wrapper {
    min-width: 0;
    gap: 8px;
  }

  .app-chat-panel .ant-card-head-title,
  .app-chat-panel .ant-card-extra {
    padding-block: 8px;
  }

  .app-chat-panel .ant-card-head-title {
    flex: 1 1 auto;
    min-width: 0;
  }

  .app-chat-panel .ant-card-extra {
    flex: 0 0 auto;
    min-width: fit-content;
  }

  .app-chat-panel .ant-card-body {
    padding: 0;
  }

  .app-chat-panel__stack,
  .app-chat-panel__conversation-shell,
  .app-chat-panel__conversation-list,
  .app-chat-panel__conversation-main {
    height: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .app-chat-panel__conversation-shell {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    overscroll-behavior-y: none;
  }

  .app-chat-panel__conversation-list-header {
    padding-inline: 10px;
  }

  .app-chat-panel__conversation-list-search {
    padding-inline: 8px;
  }

  .app-chat-panel__conversation-list-body {
    padding-inline: 8px;
    padding-bottom: 8px;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .app-chat-panel input,
  .app-chat-panel textarea,
  .app-chat-panel .ant-input,
  .app-chat-panel .ant-input-affix-wrapper input,
  .app-chat-panel .ant-select-selection-item,
  .app-chat-panel .ant-select-selection-placeholder,
  .app-chat-panel .ant-select-selector,
  .app-chat-panel .ant-input-textarea textarea.ant-input {
    font-size: 16px !important;
  }

  .app-chat-panel__messages,
  .app-chat-panel__composer,
  .app-chat-panel__resource-strip {
    overscroll-behavior-y: none;
  }

  .app-chat-panel__conversation-header,
  .app-chat-panel__composer-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .app-chat-panel__composer-actions {
    gap: 10px;
  }

  .app-chat-panel__composer-topline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .app-chat-panel__conversation-badges {
    align-items: flex-start;
  }

  .app-chat-message {
    max-width: 100%;
  }

  .app-chat-panel__messages,
  .app-chat-panel__preview-stage,
  .app-chat-panel__resource-strip {
    width: 100%;
    min-width: 0;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }

  .app-chat-panel__composer {
    width: 100%;
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 4px;
    padding-bottom: max(2px, min(env(safe-area-inset-bottom, 0px), 8px));
    box-sizing: border-box;
  }

  .app-chat-panel__composer-action-buttons {
    gap: 8px;
  }

  .app-chat-panel__composer-action-buttons .ant-btn,
  .app-chat-panel__composer-type .ant-select-selector {
    min-height: 34px;
  }

  .app-chat-panel__composer-action-buttons .ant-btn:not(.ant-btn-icon-only) {
    padding-inline: 12px;
  }

  .app-chat-panel__composer-action-buttons .ant-btn-icon-only {
    width: 34px;
    min-width: 34px;
  }

  .app-chat-panel__composer textarea.ant-input {
    height: var(--app-chat-panel-composer-height, clamp(104px, 16dvh, 136px));
    min-height: var(--app-chat-panel-composer-height, clamp(104px, 16dvh, 136px));
    padding-top: 8px;
    padding-bottom: 8px;
    line-height: 1.5;
  }

  .app-chat-panel__composer-input-shell {
    min-height: var(--app-chat-panel-composer-height, clamp(104px, 16dvh, 136px));
  }

  .app-chat-panel__composer-input-shell--autosize {
    min-height: auto;
  }

  .app-chat-panel__composer-input-shell--with-queue textarea.ant-input {
    padding-top: 88px;
  }

  .app-chat-panel__resource-strip-list {
    max-height: min(30vh, 220px);
    overflow-x: hidden;
    overflow-y: auto;
    padding-bottom: 2px;
  }

  .app-chat-panel__preview-image,
  .app-chat-panel__preview-video,
  .app-chat-panel__preview-frame,
  .app-chat-panel__preview-text {
    min-height: 220px;
  }
}

.app-chat-runtime {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.app-chat-runtime__summary-strip {
  display: block;
}

.app-chat-runtime__summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.05);
}

.app-chat-runtime__summary-metric {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.app-chat-runtime__summary-metric .ant-typography {
  margin: 0;
}

.app-chat-runtime__summary-status.ant-typography {
  margin-inline-start: auto;
}

.app-chat-runtime__session-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.app-chat-runtime__session-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(248, 250, 252, 0.88);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}

.app-chat-runtime__session-chip--active {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(239, 246, 255, 0.96);
}

.app-chat-runtime__content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.app-chat-runtime__section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-radius: 22px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.82);
  overflow: hidden;
}

.app-chat-runtime__section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.app-chat-runtime__list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-chat-runtime__empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.app-chat-runtime__job {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.96));
}

.app-chat-runtime__job--active {
  border-color: rgba(37, 99, 235, 0.32);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
}

.app-chat-runtime__job-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.app-chat-runtime__job-actions {
  justify-content: flex-end;
}

.app-chat-runtime__job-actions .ant-btn {
  touch-action: manipulation;
}

.app-chat-runtime__job-headline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-chat-runtime__job-summary.ant-typography {
  margin: 0;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-chat-runtime__job-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.app-chat-runtime__log-modal {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: calc(100dvh - 56px);
  padding: 20px 24px 24px;
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.98), rgba(241, 245, 249, 0.98));
}

.app-chat-runtime__drawer .ant-drawer-content {
  background: transparent;
}

.app-chat-runtime__drawer .ant-drawer-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.app-chat-runtime__drawer .ant-drawer-body {
  display: flex;
  min-height: 0;
}

.app-chat-runtime__log-state {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 24px;
}

.app-chat-runtime__log-viewer {
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.55;
  font-family:
    'JetBrains Mono', 'SFMono-Regular', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
}

@media (max-width: 960px) {
  .app-chat-runtime__content,
  .app-chat-runtime__job-meta {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .app-chat-panel__conversation-list {
    flex: 1 1 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    border-right: 0;
  }

  .app-chat-runtime {
    overflow: hidden;
  }

  .app-chat-runtime__summary-card {
    padding: 14px;
    border-radius: 16px;
    align-items: flex-start;
    gap: 10px 14px;
  }

  .app-chat-runtime__summary-metric {
    flex: 1 1 calc(50% - 8px);
  }

  .app-chat-runtime__summary-status.ant-typography {
    width: 100%;
    margin-inline-start: 0;
  }

  .app-chat-runtime__session-strip {
    margin-inline: -2px;
    padding-inline: 2px;
    padding-bottom: 6px;
  }

  .app-chat-runtime__session-chip {
    min-width: min(240px, 82vw);
    padding: 12px 14px;
    border-radius: 16px;
  }

  .app-chat-runtime__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
  }

  .app-chat-runtime__section {
    flex: 0 0 auto;
    min-height: 320px;
    border-radius: 18px;
  }

  .app-chat-runtime__section--recent {
    min-height: 260px;
  }

  .app-chat-runtime__section-header {
    padding: 14px;
  }

  .app-chat-runtime__list {
    padding: 10px;
    overflow-y: visible;
  }

  .app-chat-runtime__job {
    padding: 14px;
    border-radius: 16px;
  }

  .app-chat-runtime__job-top {
    flex-direction: column;
    align-items: stretch;
  }

  .app-chat-runtime__job-top > .ant-btn {
    width: 100%;
    min-height: 40px;
    border-radius: 12px;
  }

  .app-chat-runtime__job-actions {
    width: 100%;
    justify-content: stretch;
  }

  .app-chat-runtime__job-actions .ant-space-item {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
  }

  .app-chat-runtime__job-actions .ant-btn {
    width: 100%;
    min-height: 40px;
    padding-inline: 12px;
    border-radius: 12px;
  }

  .app-chat-runtime__job-meta {
    gap: 8px;
  }

  .app-chat-runtime__log-modal {
    height: calc(100dvh - 52px);
    padding: 16px;
  }

  .app-chat-runtime__drawer .ant-drawer-header {
    padding: 14px 16px;
  }

  .app-chat-runtime__log-viewer {
    padding: 12px;
    font-size: 11px;
  }
}

.chat-v2 {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.chat-v2__toolbar {
  display: flex;
  justify-content: center;
  padding: 8px 0 12px;
}

.chat-v2__chat-layout {
  display: flex;
  min-height: 0;
  height: 100%;
}

.chat-v2__pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  overflow: hidden;
}

.chat-v2__pane--list {
  flex: 0 0 320px;
  max-width: 320px;
}

.chat-v2__pane--room,
.chat-v2__pane--runtime,
.chat-v2__pane--errors {
  flex: 1 1 auto;
}

.chat-v2__pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(248, 250, 252, 0.96);
}

.chat-v2__pane > .ant-input-search,
.chat-v2__pane > .ant-input-affix-wrapper,
.chat-v2__pane > .ant-input-group-wrapper {
  margin: 12px 16px 0;
}

.chat-v2__state {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}

.chat-v2__conversation-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 10px 10px;
}

.chat-v2__conversation-list .ant-list-item {
  padding: 0;
  border-block-end: 0;
}

.chat-v2__conversation-item {
  appearance: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 0;
  outline: none;
  box-shadow: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.chat-v2__conversation-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.chat-v2__conversation-item:focus,
.chat-v2__conversation-item:focus-visible {
  outline: none;
  box-shadow: none;
}

.chat-v2__conversation-item--active {
  background: rgba(22, 119, 255, 0.08);
}

.chat-v2__conversation-title {
  color: #111827;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-v2__conversation-preview {
  color: #6b7280;
  font-size: 13px;
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 1180px) {
  .chat-v2__pane--list {
    flex-basis: auto;
    max-width: none;
  }
}

@media (min-width: 1181px) {
  .app-chat-panel {
    background:
      linear-gradient(180deg, rgba(244, 246, 248, 0.98), rgba(238, 241, 244, 0.98)),
      radial-gradient(circle at top left, rgba(148, 163, 184, 0.08), transparent 28%);
  }

  .app-chat-panel .ant-card-head {
    background: rgba(248, 249, 250, 0.9);
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  }

  .app-chat-panel__conversation-shell {
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
  }

  .app-chat-panel__conversation-list {
    background: rgba(246, 247, 249, 0.92);
    border-right: 1px solid rgba(148, 163, 184, 0.12);
  }

  .app-chat-panel__conversation-section-title,
  .app-chat-panel__conversation-section-header--unread .app-chat-panel__conversation-section-title {
    color: #475569;
  }

  .app-chat-panel__conversation-section-count,
  .app-chat-panel__conversation-section-header--unread .app-chat-panel__conversation-section-count {
    background: rgba(226, 232, 240, 0.92);
    color: #475569;
    box-shadow: none;
  }

  .app-chat-panel__conversation-item {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  }

  .app-chat-panel__conversation-item--active {
    border-color: transparent;
    background: rgba(248, 250, 252, 0.98);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
  }

  .app-chat-panel__conversation-item--unread {
    border-color: transparent;
    background:
      linear-gradient(90deg, rgba(241, 245, 249, 0.98), rgba(248, 250, 252, 0.99) 42%, rgba(255, 255, 255, 0.99) 78%),
      #fff;
    box-shadow:
      inset 4px 0 0 rgba(100, 116, 139, 0.62),
      0 10px 24px rgba(15, 23, 42, 0.06);
  }

  .app-chat-panel__conversation-item--unread-section {
    border-color: transparent;
    background:
      linear-gradient(135deg, rgba(241, 245, 249, 1), rgba(248, 250, 252, 0.99) 46%, rgba(255, 255, 255, 1) 86%),
      #fff;
    box-shadow:
      inset 6px 0 0 rgba(100, 116, 139, 0.68),
      0 12px 26px rgba(15, 23, 42, 0.07);
  }

  .app-chat-panel__conversation-item--unread::after,
  .app-chat-panel__conversation-item-unread-dot {
    background: #64748b;
    box-shadow:
      0 0 0 4px rgba(226, 232, 240, 0.9),
      0 0 8px rgba(100, 116, 139, 0.18);
  }

  .app-chat-panel__conversation-item--active.app-chat-panel__conversation-item--unread {
    border-color: transparent;
    background:
      linear-gradient(90deg, rgba(226, 232, 240, 1), rgba(241, 245, 249, 0.99) 34%, rgba(248, 250, 252, 1) 68%, rgba(255, 255, 255, 1) 88%),
      #fff;
    box-shadow:
      inset 4px 0 0 rgba(100, 116, 139, 0.82),
      0 12px 24px rgba(15, 23, 42, 0.08);
  }

  .app-chat-panel__conversation-item--active.app-chat-panel__conversation-item--unread-section {
    border-color: transparent;
    background:
      linear-gradient(135deg, rgba(226, 232, 240, 1), rgba(241, 245, 249, 1) 36%, rgba(248, 250, 252, 1) 68%, rgba(255, 255, 255, 1) 88%),
      #fff;
    box-shadow:
      inset 6px 0 0 rgba(100, 116, 139, 0.84),
      0 14px 28px rgba(15, 23, 42, 0.08);
  }

  .app-chat-panel__conversation-item--unread .app-chat-panel__conversation-item-title,
  .app-chat-panel__conversation-item--unread .app-chat-panel__conversation-item-time,
  .app-chat-panel__conversation-item--unread .app-chat-panel__conversation-item-id,
  .app-chat-panel__conversation-item--unread .app-chat-panel__conversation-item-preview {
    color: #334155;
  }

  .app-chat-panel__conversation-item--unread .app-chat-panel__conversation-item-title-wrap {
    background: linear-gradient(90deg, rgba(241, 245, 249, 0.92), rgba(241, 245, 249, 0));
  }

  .app-chat-panel__conversation-item--unread .app-chat-panel__conversation-item-time {
    background: rgba(241, 245, 249, 0.96);
  }

  .app-chat-panel__conversation-item-flag--unread,
  .app-chat-panel__conversation-item-unread-badge {
    color: #475569;
    background: rgba(226, 232, 240, 0.92);
    border-color: rgba(148, 163, 184, 0.24);
    box-shadow: none;
  }
}
