/* OpenClaw Control UI polish v2 - 极简高级聊天风
   回滚：恢复 /app/dist/control-ui/openclaw-polish.css.bak.* 或删除本文件并移除 index.html 引用 */
:root {
  --oc-bg: #f7f8fb;
  --oc-panel: rgba(255, 255, 255, 0.82);
  --oc-panel-solid: #ffffff;
  --oc-text: #111827;
  --oc-muted: #6b7280;
  --oc-border: rgba(15, 23, 42, 0.08);
  --oc-border-strong: rgba(15, 23, 42, 0.13);
  --oc-blue: #2563eb;
  --oc-sky: #0ea5e9;
  --oc-shadow: 0 18px 50px rgba(15, 23, 42, 0.09);
  --oc-soft-shadow: 0 8px 24px rgba(15, 23, 42, 0.055);
  --oc-radius-xl: 28px;
  --oc-radius-lg: 20px;
}

html[data-theme-mode="dark"] {
  --oc-bg: #070a12;
  --oc-panel: rgba(15, 23, 42, 0.72);
  --oc-panel-solid: #0f172a;
  --oc-text: #e5e7eb;
  --oc-muted: #94a3b8;
  --oc-border: rgba(148, 163, 184, 0.13);
  --oc-border-strong: rgba(148, 163, 184, 0.20);
  --oc-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  --oc-soft-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
}

body {
  background:
    radial-gradient(circle at 18% -8%, rgba(37, 99, 235, 0.12), transparent 34rem),
    radial-gradient(circle at 92% 2%, rgba(14, 165, 233, 0.10), transparent 28rem),
    var(--oc-bg) !important;
}

html[data-theme-mode="dark"] body {
  background:
    radial-gradient(circle at 20% -8%, rgba(37, 99, 235, 0.22), transparent 34rem),
    radial-gradient(circle at 92% 2%, rgba(168, 85, 247, 0.13), transparent 30rem),
    var(--oc-bg) !important;
}

/* 整体聊天容器：减少后台感，变成干净对话页 */
.chat-main,
.chat-session,
.chat-thread {
  background: transparent !important;
}

.chat-thread-inner {
  max-width: 920px !important;
  margin: 0 auto !important;
  padding: 22px clamp(12px, 3vw, 34px) 120px !important;
}

/* 顶部栏：半透明磨砂 */
.chat-header {
  background: var(--oc-panel) !important;
  border: 1px solid var(--oc-border) !important;
  border-radius: 0 0 24px 24px !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--oc-soft-shadow) !important;
}

.chat-header__left,
.chat-header__right {
  gap: 10px !important;
}

/* 控制按钮：更安静；不隐藏功能，只降低存在感 */
.chat-controls {
  gap: 8px !important;
  opacity: .78;
  transition: opacity .18s ease;
}
.chat-controls:hover { opacity: 1; }
.chat-controls__separator { opacity: .22 !important; }

.chat-controls .btn,
.chat-header .btn,
.btn--icon {
  border-radius: 14px !important;
  border-color: var(--oc-border) !important;
  background: rgba(255,255,255,.52) !important;
  box-shadow: none !important;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, opacity .16s ease !important;
}
html[data-theme-mode="dark"] .chat-controls .btn,
html[data-theme-mode="dark"] .chat-header .btn,
html[data-theme-mode="dark"] .btn--icon {
  background: rgba(15,23,42,.56) !important;
}
.chat-controls .btn:hover,
.chat-header .btn:hover,
.btn--icon:hover {
  transform: translateY(-1px);
  box-shadow: var(--oc-soft-shadow) !important;
}
.chat-controls .btn.active {
  color: var(--oc-blue) !important;
  border-color: rgba(37, 99, 235, .34) !important;
  background: rgba(37, 99, 235, .08) !important;
}

/* 消息组和时间弱化 */
.chat-group,
.chat-line,
.chat-msg {
  margin-block: 12px !important;
}
.chat-group-timestamp,
.chat-stamp,
.chat-sender-name {
  color: var(--oc-muted) !important;
  opacity: .68 !important;
  font-size: 12px !important;
}

/* 头像更小更精致 */
.chat-avatar {
  border-radius: 14px !important;
  box-shadow: 0 6px 18px rgba(15,23,42,.08) !important;
}

/* 气泡：助手像卡片，用户像高级蓝 */
.chat-bubble {
  border-radius: 22px !important;
  border: 1px solid var(--oc-border) !important;
  background: var(--oc-panel-solid) !important;
  box-shadow: var(--oc-soft-shadow) !important;
  line-height: 1.78 !important;
  padding: 14px 18px !important;
}
html[data-theme-mode="dark"] .chat-bubble {
  background: rgba(15, 23, 42, .78) !important;
}

.chat-msg.user .chat-bubble,
.chat-msg--user .chat-bubble,
.chat-line.user .chat-bubble,
.chat-line--user .chat-bubble {
  background: linear-gradient(135deg, var(--oc-blue), var(--oc-sky)) !important;
  border-color: rgba(255,255,255,.20) !important;
  color: #fff !important;
  box-shadow: 0 14px 34px rgba(37, 99, 235, .22) !important;
}
.chat-msg.user .chat-text,
.chat-msg--user .chat-text,
.chat-line.user .chat-text,
.chat-line--user .chat-text { color: #fff !important; }

.chat-text {
  font-size: 15.8px !important;
  letter-spacing: .005em !important;
}
.chat-text p { margin-block: .55em !important; }
.chat-text code {
  border-radius: 8px !important;
  padding: .16em .42em !important;
}
.chat-text pre {
  border-radius: 18px !important;
  border: 1px solid var(--oc-border) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04) !important;
}

/* 工具调用：默认更像折叠信息，不抢主对话 */
.chat-tool-card,
.chat-tools-summary,
.chat-tool-msg-summary,
.chat-thinking {
  border-radius: 18px !important;
  border-color: var(--oc-border) !important;
  background: rgba(148, 163, 184, .08) !important;
  box-shadow: none !important;
  opacity: .86;
}
.chat-tool-card:hover,
.chat-tools-summary:hover,
.chat-tool-msg-summary:hover {
  opacity: 1;
  border-color: var(--oc-border-strong) !important;
}
.chat-tool-card__output,
.chat-tool-card__raw-body,
.chat-tool-card__detail {
  border-radius: 14px !important;
}

/* 输入区：ChatGPT/Claude 风格大圆角 */
.chat-compose {
  width: min(960px, calc(100% - 24px)) !important;
  margin: 0 auto 14px !important;
  border: 1px solid var(--oc-border) !important;
  border-radius: var(--oc-radius-xl) !important;
  background: var(--oc-panel) !important;
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--oc-shadow) !important;
  padding: 10px !important;
}
.chat-compose__row {
  gap: 10px !important;
}
.chat-compose__field,
.chat-compose textarea,
.chat-compose input[type="text"] {
  border-radius: 20px !important;
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 15.5px !important;
  line-height: 1.65 !important;
}
.chat-compose__field:focus-within,
.chat-compose textarea:focus,
.chat-compose input[type="text"]:focus {
  box-shadow: none !important;
  outline: none !important;
}
.chat-compose__actions {
  align-items: center !important;
}
.chat-send-btn {
  border-radius: 18px !important;
  background: linear-gradient(135deg, var(--oc-blue), var(--oc-sky)) !important;
  box-shadow: 0 12px 30px rgba(37, 99, 235, .30) !important;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease !important;
}
.chat-send-btn:hover {
  transform: translateY(-1px) !important;
  filter: brightness(1.04);
  box-shadow: 0 16px 36px rgba(37, 99, 235, .36) !important;
}

/* 附件/队列/新消息提示 */
.chat-attachments-preview,
.chat-queue,
.chat-new-messages,
.chat-reading-indicator,
.chat-focus-exit {
  border-radius: 999px !important;
  box-shadow: var(--oc-soft-shadow) !important;
  border-color: var(--oc-border) !important;
}
.chat-attachments-preview,
.chat-queue {
  border-radius: 20px !important;
}

/* 侧栏/弹出结果保持同一设计语言 */
.chat-sidebar,
.chat-side-result,
.chat-controls-dropdown {
  border-radius: 22px !important;
  border-color: var(--oc-border) !important;
  background: var(--oc-panel) !important;
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  box-shadow: var(--oc-shadow) !important;
}

/* 移动端：输入区占满且留舒适边距 */
@media (max-width: 720px) {
  .chat-thread-inner {
    padding: 14px 10px 118px !important;
  }
  .chat-header {
    border-radius: 0 0 18px 18px !important;
  }
  .chat-bubble {
    border-radius: 19px !important;
    padding: 12px 14px !important;
  }
  .chat-text {
    font-size: 15px !important;
  }
  .chat-compose {
    width: calc(100% - 14px) !important;
    margin-bottom: 8px !important;
    border-radius: 24px !important;
    padding: 8px !important;
  }
  .chat-controls {
    gap: 6px !important;
  }
}

/* v3 Doubao-like full-page minimal white layout */
html[data-theme-mode="light"] {
  --oc-doubao-bg: #ffffff;
  --oc-doubao-sidebar: #f7f7f8;
  --oc-doubao-sidebar-hover: #ffffff;
  --oc-doubao-main: #ffffff;
  --oc-doubao-line: #e9e9ec;
  --oc-doubao-text: #0f1115;
  --oc-doubao-muted: #9ca3af;
  --oc-doubao-chip: #f3f4f6;
  --oc-doubao-chip-hover: #eceef2;
}

/* Force light Doubao canvas for the chat page */
html[data-theme-mode="light"] body,
html[data-theme-mode="light"] .shell,
html[data-theme-mode="light"] .shell--chat,
html[data-theme-mode="light"] .topnav-shell,
html[data-theme-mode="light"] .topnav-shell__content,
html[data-theme-mode="light"] .chat-main,
html[data-theme-mode="light"] .chat-session,
html[data-theme-mode="light"] .chat-thread {
  background: var(--oc-doubao-main) !important;
  background-image: none !important;
}

/* Left navigation: Doubao-like pale side rail */
html[data-theme-mode="light"] .sidebar,
html[data-theme-mode="light"] .shell-nav,
html[data-theme-mode="light"] .sidebar-shell,
html[data-theme-mode="light"] .sidebar-content,
html[data-theme-mode="light"] .sidebar-panel {
  background: var(--oc-doubao-sidebar) !important;
  border-color: var(--oc-doubao-line) !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .sidebar,
html[data-theme-mode="light"] .shell-nav {
  border-right: 1px solid var(--oc-doubao-line) !important;
}

html[data-theme-mode="light"] .sidebar-brand,
html[data-theme-mode="light"] .sidebar-header {
  padding: 18px 18px 12px !important;
}

html[data-theme-mode="light"] .sidebar-brand__title,
html[data-theme-mode="light"] .sidebar-title {
  color: var(--oc-doubao-text) !important;
  font-size: 15px !important;
  font-weight: 650 !important;
}

html[data-theme-mode="light"] .sidebar-brand__eyebrow,
html[data-theme-mode="light"] .sidebar-version,
html[data-theme-mode="light"] .nav-section__label {
  color: #9aa0aa !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

html[data-theme-mode="light"] .nav-item,
html[data-theme-mode="light"] .sidebar-utility-link,
html[data-theme-mode="light"] .sidebar-mode-switch,
html[data-theme-mode="light"] .nav-collapse-toggle {
  border-radius: 12px !important;
  border: 1px solid transparent !important;
  color: var(--oc-doubao-text) !important;
  min-height: 44px !important;
  margin-inline: 12px !important;
  padding-inline: 12px !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .nav-item:hover,
html[data-theme-mode="light"] .sidebar-utility-link:hover,
html[data-theme-mode="light"] .sidebar-mode-switch:hover,
html[data-theme-mode="light"] .nav-collapse-toggle:hover {
  background: var(--oc-doubao-sidebar-hover) !important;
  border-color: rgba(15, 17, 21, .04) !important;
}

html[data-theme-mode="light"] .nav-item--active,
html[data-theme-mode="light"] .nav-item.active {
  background: #ffffff !important;
  border-color: rgba(15, 17, 21, .05) !important;
  box-shadow: 0 6px 18px rgba(15, 17, 21, .04) !important;
}

html[data-theme-mode="light"] .nav-item__icon,
html[data-theme-mode="light"] .sidebar-utility-link svg {
  color: #111827 !important;
}

/* Top bar: thin and white, like screenshot */
html[data-theme-mode="light"] .chat-header,
html[data-theme-mode="light"] .topnav-shell {
  min-height: 70px !important;
  background: rgba(255,255,255,.96) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--oc-doubao-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme-mode="light"] .chat-controls .btn,
html[data-theme-mode="light"] .chat-header .btn,
html[data-theme-mode="light"] .topnav-shell .btn,
html[data-theme-mode="light"] .btn--icon {
  background: #ffffff !important;
  border: 1px solid #eceef2 !important;
  color: #111827 !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .chat-controls .btn:hover,
html[data-theme-mode="light"] .chat-header .btn:hover,
html[data-theme-mode="light"] .topnav-shell .btn:hover,
html[data-theme-mode="light"] .btn--icon:hover {
  background: #f7f7f8 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Chat empty/new view: centered and airy */
html[data-theme-mode="light"] .chat-thread-inner {
  max-width: 1120px !important;
  min-height: calc(100vh - 210px) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  padding: 40px 24px 170px !important;
}

/* If messages exist, keep comfortable reading width */
html[data-theme-mode="light"] .chat-group,
html[data-theme-mode="light"] .chat-line,
html[data-theme-mode="light"] .chat-msg {
  width: min(920px, 100%) !important;
  margin-inline: auto !important;
}

html[data-theme-mode="light"] .chat-bubble {
  background: #ffffff !important;
  border-color: #eef0f3 !important;
  box-shadow: none !important;
  color: #111827 !important;
}

html[data-theme-mode="light"] .chat-msg.user .chat-bubble,
html[data-theme-mode="light"] .chat-msg--user .chat-bubble,
html[data-theme-mode="light"] .chat-line.user .chat-bubble,
html[data-theme-mode="light"] .chat-line--user .chat-bubble {
  background: #f3f4f6 !important;
  color: #111827 !important;
  border-color: #eef0f3 !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .chat-msg.user .chat-text,
html[data-theme-mode="light"] .chat-msg--user .chat-text,
html[data-theme-mode="light"] .chat-line.user .chat-text,
html[data-theme-mode="light"] .chat-line--user .chat-text {
  color: #111827 !important;
}

/* Composer: large floating white rounded box */
html[data-theme-mode="light"] .chat-compose {
  width: min(1000px, calc(100% - 96px)) !important;
  margin: 0 auto 20px !important;
  padding: 14px 16px !important;
  border-radius: 28px !important;
  border: 1px solid #e6e8ec !important;
  background: #ffffff !important;
  box-shadow: 0 18px 50px rgba(15, 17, 21, .12) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme-mode="light"] .chat-compose__field,
html[data-theme-mode="light"] .chat-compose textarea,
html[data-theme-mode="light"] .chat-compose input[type="text"] {
  background: #ffffff !important;
  color: #111827 !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 16px !important;
}

html[data-theme-mode="light"] .chat-compose textarea::placeholder,
html[data-theme-mode="light"] .chat-compose input::placeholder {
  color: #a7adb7 !important;
}

html[data-theme-mode="light"] .chat-send-btn {
  border-radius: 999px !important;
  background: #111827 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
html[data-theme-mode="light"] .chat-send-btn:hover {
  background: #000000 !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Chips/cards/tool areas match the reference */
html[data-theme-mode="light"] .chat-tool-card,
html[data-theme-mode="light"] .chat-tools-summary,
html[data-theme-mode="light"] .chat-tool-msg-summary,
html[data-theme-mode="light"] .chat-thinking,
html[data-theme-mode="light"] .chat-attachments-preview,
html[data-theme-mode="light"] .chat-queue {
  background: #f6f7f9 !important;
  border-color: #eef0f3 !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .chat-new-messages,
html[data-theme-mode="light"] .chat-reading-indicator,
html[data-theme-mode="light"] .chat-focus-exit {
  background: #ffffff !important;
  border: 1px solid #eceef2 !important;
  color: #111827 !important;
  box-shadow: 0 10px 28px rgba(15,17,21,.08) !important;
}

/* Make general cards/pages more Doubao-like too */
html[data-theme-mode="light"] .card,
html[data-theme-mode="light"] .config-layout,
html[data-theme-mode="light"] .agents-layout,
html[data-theme-mode="light"] .usage-page .card,
html[data-theme-mode="light"] .session-detail-panel,
html[data-theme-mode="light"] .sessions-card {
  border-radius: 18px !important;
  border-color: #eceef2 !important;
  background: #ffffff !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] input,
html[data-theme-mode="light"] textarea,
html[data-theme-mode="light"] select,
html[data-theme-mode="light"] .cfg-input,
html[data-theme-mode="light"] .cfg-textarea,
html[data-theme-mode="light"] .cfg-select {
  border-radius: 12px !important;
  border-color: #e6e8ec !important;
  background: #ffffff !important;
}

@media (max-width: 820px) {
  html[data-theme-mode="light"] .chat-thread-inner {
    padding: 24px 12px 142px !important;
    min-height: calc(100vh - 180px) !important;
  }
  html[data-theme-mode="light"] .chat-compose {
    width: calc(100% - 20px) !important;
    margin-bottom: 10px !important;
    border-radius: 24px !important;
  }
}

/* v4 Composer: Doubao-like centered floating prompt box */
html[data-theme-mode="light"] .chat-compose {
  width: min(680px, calc(100% - 32px)) !important;
  min-height: 82px !important;
  margin: 0 auto 18px !important;
  padding: 0 !important;
  border-radius: 18px !important;
  border: 1px solid #e7e9ee !important;
  background: #ffffff !important;
  box-shadow: 0 14px 42px rgba(15, 17, 21, .13) !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .chat-compose__row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(46px, auto) 42px !important;
  gap: 0 !important;
  align-items: stretch !important;
}

html[data-theme-mode="light"] .chat-compose__field {
  grid-row: 1 !important;
  width: 100% !important;
  min-height: 46px !important;
  padding: 13px 16px 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
}

html[data-theme-mode="light"] .chat-compose textarea,
html[data-theme-mode="light"] .chat-compose input[type="text"] {
  min-height: 28px !important;
  max-height: 150px !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  color: #111827 !important;
  background: transparent !important;
}

html[data-theme-mode="light"] .chat-compose textarea::placeholder,
html[data-theme-mode="light"] .chat-compose input::placeholder {
  color: #a0a6b2 !important;
}

html[data-theme-mode="light"] .chat-compose__actions {
  grid-row: 2 !important;
  min-height: 42px !important;
  padding: 0 10px 9px 12px !important;
  border-top: 1px solid #f0f1f4 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: #fff !important;
}

/* Keep attachment / mic buttons on the left and send button on the right when possible */
html[data-theme-mode="light"] .chat-compose__actions > * {
  flex: 0 0 auto !important;
}
html[data-theme-mode="light"] .chat-compose__actions > :last-child {
  margin-left: auto !important;
}

html[data-theme-mode="light"] .chat-compose__actions .btn,
html[data-theme-mode="light"] .chat-compose__actions button,
html[data-theme-mode="light"] .chat-attachment-remove {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: transparent !important;
  color: #6b7280 !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .chat-compose__actions .btn:hover,
html[data-theme-mode="light"] .chat-compose__actions button:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
  transform: none !important;
}

html[data-theme-mode="light"] .chat-send-btn,
html[data-theme-mode="light"] .chat-compose__actions .chat-send-btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  margin-top: -3px !important;
  border-radius: 999px !important;
  background: #171923 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .chat-send-btn:hover,
html[data-theme-mode="light"] .chat-compose__actions .chat-send-btn:hover {
  background: #000000 !important;
  color: #ffffff !important;
}

/* If the app renders small plus/download buttons near send, make them Doubao-style */
html[data-theme-mode="light"] .chat-compose__actions svg {
  width: 18px !important;
  height: 18px !important;
}

/* Mobile composer */
@media (max-width: 720px) {
  html[data-theme-mode="light"] .chat-compose {
    width: calc(100% - 18px) !important;
    margin-bottom: 9px !important;
    border-radius: 18px !important;
  }
}

/* v5 Composer exact Doubao-like: shorter, centered, floating higher */
html[data-theme-mode="light"] .chat-compose {
  width: min(760px, calc(100% - 360px)) !important;
  min-width: 560px !important;
  min-height: 118px !important;
  margin: 0 auto 40px !important;
  border-radius: 22px !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  box-shadow: 0 18px 46px rgba(15, 17, 21, .13) !important;
}

html[data-theme-mode="light"] .chat-compose__row {
  grid-template-rows: 58px 54px !important;
}

html[data-theme-mode="light"] .chat-compose__field {
  min-height: 58px !important;
  padding: 19px 24px 6px !important;
}

html[data-theme-mode="light"] .chat-compose textarea,
html[data-theme-mode="light"] .chat-compose input[type="text"] {
  font-size: 17px !important;
  line-height: 1.5 !important;
}

html[data-theme-mode="light"] .chat-compose textarea::placeholder,
html[data-theme-mode="light"] .chat-compose input::placeholder {
  color: #b3b8c2 !important;
  font-size: 17px !important;
}

html[data-theme-mode="light"] .chat-compose__actions {
  min-height: 54px !important;
  padding: 0 14px 12px 22px !important;
  border-top: 0 !important;
  gap: 12px !important;
}

html[data-theme-mode="light"] .chat-compose__actions .btn,
html[data-theme-mode="light"] .chat-compose__actions button {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  color: #111827 !important;
}

html[data-theme-mode="light"] .chat-compose__actions .chat-send-btn,
html[data-theme-mode="light"] .chat-send-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  margin-top: -4px !important;
  background: #111827 !important;
}

/* On narrow screens, keep it usable instead of overflowing */
@media (max-width: 1100px) {
  html[data-theme-mode="light"] .chat-compose {
    width: min(760px, calc(100% - 48px)) !important;
    min-width: 0 !important;
  }
}

@media (max-width: 720px) {
  html[data-theme-mode="light"] .chat-compose {
    width: calc(100% - 18px) !important;
    min-height: 104px !important;
    margin-bottom: 10px !important;
    border-radius: 20px !important;
  }
  html[data-theme-mode="light"] .chat-compose__row {
    grid-template-rows: 52px 48px !important;
  }
  html[data-theme-mode="light"] .chat-compose__field {
    padding: 15px 18px 4px !important;
  }
}

/* v6 Real current composer target: .agent-chat__input */
html[data-theme-mode="light"] .chat-compose {
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 0 36px !important;
  background: linear-gradient(to bottom, transparent, #ffffff 30%) !important;
}

html[data-theme-mode="light"] .agent-chat__input {
  width: min(760px, calc(100vw - 440px)) !important;
  min-width: 560px !important;
  max-width: 760px !important;
  min-height: 116px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: 22px !important;
  border: 1px solid #e5e7eb !important;
  background: #ffffff !important;
  box-shadow: 0 18px 46px rgba(15, 17, 21, .14) !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .agent-chat__input > textarea {
  min-height: 58px !important;
  max-height: 160px !important;
  padding: 20px 24px 6px !important;
  font-size: 17px !important;
  line-height: 1.5 !important;
  color: #111827 !important;
  background: #ffffff !important;
}

html[data-theme-mode="light"] .agent-chat__input > textarea::placeholder {
  color: #b3b8c2 !important;
  font-size: 17px !important;
}

html[data-theme-mode="light"] .agent-chat__toolbar {
  min-height: 54px !important;
  padding: 0 14px 12px 22px !important;
  border-top: 0 !important;
  background: #ffffff !important;
}

html[data-theme-mode="light"] .agent-chat__toolbar-left,
html[data-theme-mode="light"] .agent-chat__toolbar-right {
  gap: 10px !important;
}

html[data-theme-mode="light"] .agent-chat__input-btn,
html[data-theme-mode="light"] .agent-chat__toolbar .btn--ghost,
html[data-theme-mode="light"] .agent-chat__toolbar button {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: transparent !important;
  color: #111827 !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .agent-chat__input-btn:hover,
html[data-theme-mode="light"] .agent-chat__toolbar .btn--ghost:hover,
html[data-theme-mode="light"] .agent-chat__toolbar button:hover {
  background: #f3f4f6 !important;
  color: #111827 !important;
}

html[data-theme-mode="light"] .agent-chat__toolbar .chat-send-btn,
html[data-theme-mode="light"] .agent-chat__input .chat-send-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  margin-top: -4px !important;
  border-radius: 999px !important;
  background: #111827 !important;
  color: #ffffff !important;
}

html[data-theme-mode="light"] .agent-chat__toolbar .chat-send-btn:hover,
html[data-theme-mode="light"] .agent-chat__input .chat-send-btn:hover {
  background: #000000 !important;
  color: #ffffff !important;
}

@media (max-width: 1180px) {
  html[data-theme-mode="light"] .agent-chat__input {
    width: min(760px, calc(100vw - 64px)) !important;
    min-width: 0 !important;
  }
}

@media (max-width: 720px) {
  html[data-theme-mode="light"] .chat-compose {
    padding: 8px 0 10px !important;
  }
  html[data-theme-mode="light"] .agent-chat__input {
    width: calc(100vw - 18px) !important;
    min-height: 104px !important;
    border-radius: 20px !important;
  }
  html[data-theme-mode="light"] .agent-chat__input > textarea {
    min-height: 52px !important;
    padding: 16px 18px 4px !important;
    font-size: 15.5px !important;
  }
  html[data-theme-mode="light"] .agent-chat__toolbar {
    min-height: 48px !important;
    padding: 0 10px 9px 16px !important;
  }
}

/* v7 Dark mode: apply the same centered Doubao-like composer */
html[data-theme-mode="dark"] .chat-compose {
  align-items: center !important;
  justify-content: center !important;
  padding: 12px 0 36px !important;
  background: linear-gradient(to bottom, transparent, #070a12 30%) !important;
}

html[data-theme-mode="dark"] .agent-chat__input {
  width: min(760px, calc(100vw - 440px)) !important;
  min-width: 560px !important;
  max-width: 760px !important;
  min-height: 116px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border-radius: 22px !important;
  border: 1px solid rgba(148, 163, 184, .18) !important;
  background: #111827 !important;
  box-shadow: 0 22px 56px rgba(0, 0, 0, .42) !important;
  overflow: hidden !important;
}

html[data-theme-mode="dark"] .agent-chat__input:focus-within {
  border-color: rgba(148, 163, 184, .30) !important;
  box-shadow: 0 22px 56px rgba(0, 0, 0, .46), 0 0 0 2px rgba(59, 130, 246, .12) !important;
}

html[data-theme-mode="dark"] .agent-chat__input > textarea {
  min-height: 58px !important;
  max-height: 160px !important;
  padding: 20px 24px 6px !important;
  font-size: 17px !important;
  line-height: 1.5 !important;
  color: #e5e7eb !important;
  background: #111827 !important;
}

html[data-theme-mode="dark"] .agent-chat__input > textarea::placeholder {
  color: #6b7280 !important;
  font-size: 17px !important;
}

html[data-theme-mode="dark"] .agent-chat__toolbar {
  min-height: 54px !important;
  padding: 0 14px 12px 22px !important;
  border-top: 0 !important;
  background: #111827 !important;
}

html[data-theme-mode="dark"] .agent-chat__toolbar-left,
html[data-theme-mode="dark"] .agent-chat__toolbar-right {
  gap: 10px !important;
}

html[data-theme-mode="dark"] .agent-chat__input-btn,
html[data-theme-mode="dark"] .agent-chat__toolbar .btn--ghost,
html[data-theme-mode="dark"] .agent-chat__toolbar button {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  border: 0 !important;
  background: transparent !important;
  color: #cbd5e1 !important;
  box-shadow: none !important;
}

html[data-theme-mode="dark"] .agent-chat__input-btn:hover,
html[data-theme-mode="dark"] .agent-chat__toolbar .btn--ghost:hover,
html[data-theme-mode="dark"] .agent-chat__toolbar button:hover {
  background: rgba(148, 163, 184, .12) !important;
  color: #ffffff !important;
}

html[data-theme-mode="dark"] .agent-chat__toolbar .chat-send-btn,
html[data-theme-mode="dark"] .agent-chat__input .chat-send-btn {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px !important;
  min-height: 42px !important;
  margin-top: -4px !important;
  border-radius: 999px !important;
  background: #f8fafc !important;
  color: #020617 !important;
}

html[data-theme-mode="dark"] .agent-chat__toolbar .chat-send-btn:hover,
html[data-theme-mode="dark"] .agent-chat__input .chat-send-btn:hover {
  background: #ffffff !important;
  color: #000000 !important;
}

@media (max-width: 1180px) {
  html[data-theme-mode="dark"] .agent-chat__input {
    width: min(760px, calc(100vw - 64px)) !important;
    min-width: 0 !important;
  }
}

@media (max-width: 720px) {
  html[data-theme-mode="dark"] .chat-compose {
    padding: 8px 0 10px !important;
  }
  html[data-theme-mode="dark"] .agent-chat__input {
    width: calc(100vw - 18px) !important;
    min-height: 104px !important;
    border-radius: 20px !important;
  }
  html[data-theme-mode="dark"] .agent-chat__input > textarea {
    min-height: 52px !important;
    padding: 16px 18px 4px !important;
    font-size: 15.5px !important;
  }
  html[data-theme-mode="dark"] .agent-chat__toolbar {
    min-height: 48px !important;
    padding: 0 10px 9px 16px !important;
  }
}

/* v8 Chat top header: merge controls into one Doubao-like row */
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  min-height: 64px !important;
  height: 64px !important;
  padding: 0 18px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header__left,
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header__right,
html[data-theme-mode="dark"] .shell--chat .chat-header__right {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex: 0 0 auto !important;
}

/* The row that contains session/model/detail selects */
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

html[data-theme-mode="light"] .shell--chat .chat-controls__session,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session,
html[data-theme-mode="light"] .shell--chat .chat-controls__model,
html[data-theme-mode="dark"] .shell--chat .chat-controls__model {
  margin: 0 !important;
  min-width: 0 !important;
}

html[data-theme-mode="light"] .shell--chat .chat-controls__session select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session select,
html[data-theme-mode="light"] .shell--chat .chat-controls__model select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__model select,
html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="dark"] .shell--chat .chat-header select {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 14px !important;
  padding: 0 34px 0 14px !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}

html[data-theme-mode="light"] .shell--chat .chat-controls__session select {
  background-color: #ffffff !important;
  border-color: #e6e8ec !important;
  color: #111827 !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-controls__session select {
  background-color: #111827 !important;
  border-color: rgba(148,163,184,.18) !important;
  color: #e5e7eb !important;
}

/* Make three selects compact like Doubao top bar */
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row label:nth-of-type(1) select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row label:nth-of-type(1) select {
  width: 140px !important;
}
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row label:nth-of-type(2) select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row label:nth-of-type(2) select {
  width: 180px !important;
}
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row label:nth-of-type(3) select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row label:nth-of-type(3) select {
  width: 150px !important;
}

/* Icon controls stay on the same row */
html[data-theme-mode="light"] .shell--chat .chat-controls,
html[data-theme-mode="dark"] .shell--chat .chat-controls {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
  opacity: .88 !important;
}

html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn {
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  padding: 0 !important;
  border-radius: 14px !important;
}

html[data-theme-mode="light"] .shell--chat .chat-controls__separator,
html[data-theme-mode="dark"] .shell--chat .chat-controls__separator {
  display: none !important;
}

/* If the topnav/breadcrumb takes its own row, make it compact so header appears as one line */
html[data-theme-mode="light"] .shell--chat .topnav-shell,
html[data-theme-mode="dark"] .shell--chat .topnav-shell {
  min-height: 0 !important;
  height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* Prevent content from being pushed down by the old second row */
html[data-theme-mode="light"] .shell--chat .chat-main,
html[data-theme-mode="dark"] .shell--chat .chat-main {
  padding-top: 0 !important;
}

@media (max-width: 980px) {
  html[data-theme-mode="light"] .shell--chat .chat-header,
  html[data-theme-mode="dark"] .shell--chat .chat-header {
    height: auto !important;
    min-height: 64px !important;
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
  }
  html[data-theme-mode="light"] .shell--chat .chat-controls__session-row,
  html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row {
    flex-wrap: wrap !important;
  }
}

/* v9 Remove the extra topbar blank row on chat page */
html[data-theme-mode="light"] .shell.shell--chat,
html[data-theme-mode="dark"] .shell.shell--chat {
  --shell-topbar-height: 0px !important;
  grid-template-rows: 0px 1fr !important;
}

html[data-theme-mode="light"] .shell.shell--chat > .topbar,
html[data-theme-mode="dark"] .shell.shell--chat > .topbar,
html[data-theme-mode="light"] .shell--chat .topbar,
html[data-theme-mode="dark"] .shell--chat .topbar {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .shell--chat .content,
html[data-theme-mode="dark"] .shell--chat .content {
  grid-area: content !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Keep the real chat control row as the only top row */
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  position: relative !important;
  top: 0 !important;
  margin-top: 0 !important;
  border-top: 0 !important;
  z-index: 20 !important;
}

/* v10 Doubao-like sidebar collapse: fully hide rail, keep toggle on main top-left */
.shell {
  --oc-sidebar-toggle-left-open: calc(var(--shell-nav-width, 258px) + 14px);
}

/* Put the existing collapse button on the main/header side, not inside the rail visually */
.shell .nav-collapse-toggle,
.shell .topbar-nav-toggle {
  position: fixed !important;
  top: 13px !important;
  left: var(--oc-sidebar-toggle-left-open) !important;
  z-index: 1000 !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  margin: 0 !important;
  border-radius: 14px !important;
  border: 1px solid #e6e8ec !important;
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: 0 8px 24px rgba(15, 17, 21, .08) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

html[data-theme-mode="dark"] .shell .nav-collapse-toggle,
html[data-theme-mode="dark"] .shell .topbar-nav-toggle {
  border-color: rgba(148,163,184,.18) !important;
  background: #111827 !important;
  color: #e5e7eb !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.34) !important;
}

.shell .nav-collapse-toggle:hover,
.shell .topbar-nav-toggle:hover {
  background: #f7f7f8 !important;
  transform: none !important;
}
html[data-theme-mode="dark"] .shell .nav-collapse-toggle:hover,
html[data-theme-mode="dark"] .shell .topbar-nav-toggle:hover {
  background: #1f2937 !important;
}

/* Expanded sidebar: leave room so the toggle sits just before the main title row */
.shell:not(.shell--nav-collapsed):not(.shell--chat-focus) .chat-header__left {
  padding-left: 48px !important;
}

/* Collapsed sidebar should be truly gone, not a 78px icon rail */
.shell.shell--nav-collapsed {
  --shell-nav-rail-width: 0px !important;
  grid-template-columns: 0px minmax(0, 1fr) !important;
}

.shell.shell--nav-collapsed .shell-nav,
.shell.shell--nav-collapsed .sidebar,
.shell.shell--nav-collapsed .sidebar-shell {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}

/* Hide everything in the collapsed sidebar except the toggle button */
.shell.shell--nav-collapsed .shell-nav :not(.nav-collapse-toggle):not(.nav-collapse-toggle *),
.shell.shell--nav-collapsed .sidebar :not(.nav-collapse-toggle):not(.nav-collapse-toggle *),
.shell.shell--nav-collapsed .sidebar-shell :not(.nav-collapse-toggle):not(.nav-collapse-toggle *) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.shell.shell--nav-collapsed .nav-collapse-toggle,
.shell.shell--nav-collapsed .topbar-nav-toggle {
  left: 14px !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* When collapsed, the main title row needs left padding for the floating button */
.shell.shell--nav-collapsed .chat-header__left,
.shell.shell--chat-focus .chat-header__left {
  padding-left: 48px !important;
}

/* Focus mode should also have no sidebar footprint */
.shell.shell--chat-focus {
  grid-template-columns: 0px minmax(0, 1fr) !important;
}
.shell.shell--chat-focus .shell-nav,
.shell.shell--chat-focus .sidebar,
.shell.shell--chat-focus .sidebar-shell {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border: 0 !important;
  overflow: visible !important;
}

@media (max-width: 720px) {
  .shell .nav-collapse-toggle,
  .shell .topbar-nav-toggle,
  .shell.shell--nav-collapsed .nav-collapse-toggle,
  .shell.shell--nav-collapsed .topbar-nav-toggle {
    top: 10px !important;
    left: 10px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }
  .shell .chat-header__left,
  .shell.shell--nav-collapsed .chat-header__left {
    padding-left: 44px !important;
  }
}

/* v11 Independent main-left sidebar toggle, Doubao style */
.oc-main-sidebar-toggle {
  position: fixed !important;
  top: 13px !important;
  left: calc(var(--shell-nav-width, 258px) + 14px);
  z-index: 3000 !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 1px solid #e6e8ec !important;
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: 0 8px 24px rgba(15, 17, 21, .08) !important;
  cursor: pointer !important;
}
.oc-main-sidebar-toggle:hover {
  background: #f7f7f8 !important;
}
.oc-main-sidebar-toggle svg {
  width: 19px !important;
  height: 19px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}
html[data-theme-mode="dark"] .oc-main-sidebar-toggle {
  border-color: rgba(148,163,184,.18) !important;
  background: #111827 !important;
  color: #e5e7eb !important;
  box-shadow: 0 12px 30px rgba(0,0,0,.34) !important;
}
html[data-theme-mode="dark"] .oc-main-sidebar-toggle:hover {
  background: #1f2937 !important;
}

/* Reserve space before main/session selector row for the new independent button */
.shell--chat .chat-header {
  padding-left: 66px !important;
}
.shell--chat.shell--nav-collapsed .chat-header,
.shell--chat.shell--chat-focus .chat-header {
  padding-left: 66px !important;
}

/* Hide the original sidebar-contained collapse button to avoid duplicate/vanishing buttons */
.shell-nav .nav-collapse-toggle,
.sidebar .nav-collapse-toggle,
.sidebar-shell .nav-collapse-toggle {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 720px) {
  .oc-main-sidebar-toggle {
    top: 10px !important;
    left: 10px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }
  .shell--chat .chat-header {
    padding-left: 54px !important;
  }
}

/* v12 Fix top row overlap: reserve actual left slot for independent sidebar button */
.oc-main-sidebar-toggle {
  left: 18px !important;
  top: 8px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  border-radius: 16px !important;
}

/* Chat header starts after the fixed sidebar button */
.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  padding-left: 78px !important;
  padding-right: 16px !important;
  box-sizing: border-box !important;
}

.shell--chat .chat-header__left,
.shell--chat .chat-controls__session-row {
  min-width: 0 !important;
}

/* Remove older padding added to left internals; header itself now owns the slot */
.shell:not(.shell--nav-collapsed):not(.shell--chat-focus) .chat-header__left,
.shell.shell--nav-collapsed .chat-header__left,
.shell.shell--chat-focus .chat-header__left,
html[data-theme-mode="light"] .shell--chat .chat-header__left,
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  padding-left: 0 !important;
}

/* Keep compact select sizes so all controls share one row */
.shell--chat .chat-controls__session-row label:nth-of-type(1) select {
  width: 190px !important;
}
.shell--chat .chat-controls__session-row label:nth-of-type(2) select {
  width: 220px !important;
}
.shell--chat .chat-controls__session-row label:nth-of-type(3) select {
  width: 190px !important;
}

@media (max-width: 980px) {
  .oc-main-sidebar-toggle {
    left: 12px !important;
    top: 10px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }
  .shell--chat .chat-header,
  html[data-theme-mode="light"] .shell--chat .chat-header,
  html[data-theme-mode="dark"] .shell--chat .chat-header {
    padding-left: 62px !important;
  }
}

/* v13 Force chat top controls into exactly one row */
.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
}

.shell--chat .chat-header__left,
html[data-theme-mode="light"] .shell--chat .chat-header__left,
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  max-width: none !important;
  gap: 10px !important;
}

.shell--chat .chat-header__right,
html[data-theme-mode="light"] .shell--chat .chat-header__right,
html[data-theme-mode="dark"] .shell--chat .chat-header__right {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex: 0 0 auto !important;
  min-width: max-content !important;
  gap: 8px !important;
}

.shell--chat .chat-controls__session-row,
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px !important;
  width: auto !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  overflow: hidden !important;
}

.shell--chat .chat-controls__session-row label,
.shell--chat .chat-controls__session,
.shell--chat .chat-controls__model {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  width: auto !important;
}

/* shorter select widths so the right buttons can stay on the same line */
.shell--chat .chat-controls__session-row label:nth-of-type(1) select,
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row label:nth-of-type(1) select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row label:nth-of-type(1) select {
  width: 120px !important;
  max-width: 120px !important;
}
.shell--chat .chat-controls__session-row label:nth-of-type(2) select,
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row label:nth-of-type(2) select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row label:nth-of-type(2) select {
  width: 150px !important;
  max-width: 150px !important;
}
.shell--chat .chat-controls__session-row label:nth-of-type(3) select,
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row label:nth-of-type(3) select,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row label:nth-of-type(3) select {
  width: 138px !important;
  max-width: 138px !important;
}

.shell--chat .chat-controls,
html[data-theme-mode="light"] .shell--chat .chat-controls,
html[data-theme-mode="dark"] .shell--chat .chat-controls {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  gap: 6px !important;
}

.shell--chat .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
}

/* Override old responsive wrapping rule */
@media (max-width: 980px) {
  .shell--chat .chat-header,
  html[data-theme-mode="light"] .shell--chat .chat-header,
  html[data-theme-mode="dark"] .shell--chat .chat-header {
    flex-wrap: nowrap !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
  }
  .shell--chat .chat-controls__session-row,
  html[data-theme-mode="light"] .shell--chat .chat-controls__session-row,
  html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row {
    flex-wrap: nowrap !important;
  }
}

/* v14 Move sidebar toggle into the right function button group; remove floating overlap */
.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  padding-left: 16px !important;
  padding-right: 16px !important;
}

.shell--chat .chat-header__left,
.shell.shell--nav-collapsed .chat-header__left,
.shell.shell--chat-focus .chat-header__left,
html[data-theme-mode="light"] .shell--chat .chat-header__left,
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  padding-left: 0 !important;
}

/* Inline toggle inside the icon toolbar */
.oc-main-sidebar-toggle,
.oc-main-sidebar-toggle.oc-main-sidebar-toggle--inline,
.shell--chat .chat-controls .oc-main-sidebar-toggle {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  z-index: auto !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 14px !important;
  border: 1px solid #e6e8ec !important;
  background: #ffffff !important;
  color: #111827 !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex: 0 0 auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

html[data-theme-mode="dark"] .oc-main-sidebar-toggle,
html[data-theme-mode="dark"] .shell--chat .chat-controls .oc-main-sidebar-toggle {
  border-color: rgba(148,163,184,.18) !important;
  background: #111827 !important;
  color: #e5e7eb !important;
}

.oc-main-sidebar-toggle:hover,
.shell--chat .chat-controls .oc-main-sidebar-toggle:hover {
  background: #f7f7f8 !important;
  transform: none !important;
  box-shadow: none !important;
}
html[data-theme-mode="dark"] .oc-main-sidebar-toggle:hover,
html[data-theme-mode="dark"] .shell--chat .chat-controls .oc-main-sidebar-toggle:hover {
  background: #1f2937 !important;
}

.oc-main-sidebar-toggle svg,
.shell--chat .chat-controls .oc-main-sidebar-toggle svg {
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* Keep original sidebar-contained collapse button hidden; custom inline button replaces it */
.shell-nav .nav-collapse-toggle,
.sidebar .nav-collapse-toggle,
.sidebar-shell .nav-collapse-toggle,
.topbar-nav-toggle {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* v15 Native inline sidebar toggle inside chat-controls */
.shell--chat .chat-controls .oc-inline-sidebar-toggle {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  flex: 0 0 auto !important;
}

/* old external custom toggle is disabled/no-op; ensure if cached instance appears it does not float */
body > .oc-main-sidebar-toggle {
  display: none !important;
}

/* v16 Doubao-like integrated chat top row: full-page chat, inline controls */
.shell--chat .content,
html[data-theme-mode="light"] .shell--chat .content,
html[data-theme-mode="dark"] .shell--chat .content {
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.shell--chat .chat-main,
.shell--chat .chat-session,
.shell--chat .chat-thread,
html[data-theme-mode="light"] .shell--chat .chat-main,
html[data-theme-mode="light"] .shell--chat .chat-session,
html[data-theme-mode="light"] .shell--chat .chat-thread,
html[data-theme-mode="dark"] .shell--chat .chat-main,
html[data-theme-mode="dark"] .shell--chat .chat-session,
html[data-theme-mode="dark"] .shell--chat .chat-thread {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Top row becomes part of the chat canvas, not a separate boxed area */
.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 60 !important;
  width: 100% !important;
  height: 72px !important;
  min-height: 72px !important;
  max-height: 72px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(15, 17, 21, .08) !important;
  box-shadow: none !important;
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  gap: 14px !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header {
  background: rgba(255,255,255,.96) !important;
  color: #111827 !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header {
  background: rgba(7,10,18,.94) !important;
  border-bottom-color: rgba(148,163,184,.14) !important;
  color: #e5e7eb !important;
}

/* Left side: the selects stay inline and travel with this row */
.shell--chat .chat-header__left,
html[data-theme-mode="light"] .shell--chat .chat-header__left,
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  grid-column: 1 / 3 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}

.shell--chat .chat-controls__session-row,
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 10px !important;
  min-width: 0 !important;
  width: auto !important;
  overflow: visible !important;
}

.shell--chat .chat-controls__session-row label,
.shell--chat .chat-controls__session,
.shell--chat .chat-controls__model {
  display: inline-flex !important;
  margin: 0 !important;
  width: auto !important;
  min-width: 0 !important;
}

.shell--chat .chat-header select,
.shell--chat .chat-controls__session-row select,
html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="dark"] .shell--chat .chat-header select {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 14px !important;
  border: 1px solid transparent !important;
  padding: 0 30px 0 13px !important;
  font-size: 14px !important;
  line-height: 38px !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header select {
  background-color: #f7f7f8 !important;
  color: #111827 !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header select {
  background-color: #111827 !important;
  color: #e5e7eb !important;
  border-color: rgba(148,163,184,.12) !important;
}

.shell--chat .chat-controls__session-row label:nth-of-type(1) select,
.shell--chat .chat-controls__session-row label:nth-of-type(2) select,
.shell--chat .chat-controls__session-row label:nth-of-type(3) select {
  width: auto !important;
  min-width: 98px !important;
  max-width: 190px !important;
}

/* Right side function area aligned in the same top row */
.shell--chat .chat-header__right,
html[data-theme-mode="light"] .shell--chat .chat-header__right,
html[data-theme-mode="dark"] .shell--chat .chat-header__right {
  grid-column: 3 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  min-width: max-content !important;
  padding: 0 !important;
  margin: 0 !important;
}

.shell--chat .chat-controls,
html[data-theme-mode="light"] .shell--chat .chat-controls,
html[data-theme-mode="dark"] .shell--chat .chat-controls {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  opacity: 1 !important;
  white-space: nowrap !important;
}

.shell--chat .chat-controls .btn,
.shell--chat .chat-controls .oc-inline-sidebar-toggle,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 14px !important;
  padding: 0 !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: #f7f7f8 !important;
  border-color: transparent !important;
  color: #111827 !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: #111827 !important;
  border-color: rgba(148,163,184,.12) !important;
  color: #e5e7eb !important;
}

.shell--chat .chat-controls__separator {
  display: none !important;
}

/* The scroll/content area begins directly under the integrated row */
.shell--chat .chat-thread-inner,
html[data-theme-mode="light"] .shell--chat .chat-thread-inner,
html[data-theme-mode="dark"] .shell--chat .chat-thread-inner {
  min-height: calc(100vh - 72px) !important;
  padding-top: 24px !important;
}

@media (max-width: 880px) {
  .shell--chat .chat-header,
  html[data-theme-mode="light"] .shell--chat .chat-header,
  html[data-theme-mode="dark"] .shell--chat .chat-header {
    grid-template-columns: 1fr auto !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    padding: 0 10px !important;
    gap: 8px !important;
  }
  .shell--chat .chat-header__left { grid-column: 1 !important; }
  .shell--chat .chat-header__right { grid-column: 2 !important; }
  .shell--chat .chat-controls__session-row label:nth-of-type(2),
  .shell--chat .chat-controls__session-row label:nth-of-type(3) {
    display: none !important;
  }
}

/* v17 Refined comfortable premium look: not plain, still minimal */
html[data-theme-mode="light"] body,
html[data-theme-mode="light"] .shell--chat,
html[data-theme-mode="light"] .shell--chat .content,
html[data-theme-mode="light"] .shell--chat .chat-main,
html[data-theme-mode="light"] .shell--chat .chat-session,
html[data-theme-mode="light"] .shell--chat .chat-thread {
  background:
    radial-gradient(circle at 18% -12%, rgba(59, 130, 246, .105), transparent 34rem),
    radial-gradient(circle at 86% 4%, rgba(20, 184, 166, .075), transparent 28rem),
    linear-gradient(180deg, #fbfcff 0%, #f7f8fb 42%, #ffffff 100%) !important;
}

html[data-theme-mode="dark"] body,
html[data-theme-mode="dark"] .shell--chat,
html[data-theme-mode="dark"] .shell--chat .content,
html[data-theme-mode="dark"] .shell--chat .chat-main,
html[data-theme-mode="dark"] .shell--chat .chat-session,
html[data-theme-mode="dark"] .shell--chat .chat-thread {
  background:
    radial-gradient(circle at 18% -12%, rgba(37, 99, 235, .22), transparent 34rem),
    radial-gradient(circle at 86% 4%, rgba(168, 85, 247, .12), transparent 28rem),
    linear-gradient(180deg, #070a12 0%, #0b1020 48%, #080b12 100%) !important;
}

/* Top row: glass but subtle */
html[data-theme-mode="light"] .shell--chat .chat-header {
  background: rgba(248, 250, 252, .82) !important;
  border-bottom: 1px solid rgba(15, 23, 42, .075) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header {
  background: rgba(7, 10, 18, .78) !important;
  border-bottom: 1px solid rgba(148, 163, 184, .14) !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
}

/* Selects/buttons: pill chips, less heavy */
html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(255, 255, 255, .78) !important;
  border: 1px solid rgba(15, 23, 42, .07) !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .035) !important;
}
html[data-theme-mode="light"] .shell--chat .chat-controls .btn:hover,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle:hover {
  background: #ffffff !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .065) !important;
}

/* Chat reading area: centered paper feeling without obvious box */
.shell--chat .chat-thread-inner,
html[data-theme-mode="light"] .shell--chat .chat-thread-inner,
html[data-theme-mode="dark"] .shell--chat .chat-thread-inner {
  max-width: 1040px !important;
  margin-inline: auto !important;
  padding-left: clamp(18px, 4vw, 58px) !important;
  padding-right: clamp(18px, 4vw, 58px) !important;
}

html[data-theme-mode="light"] .chat-group,
html[data-theme-mode="light"] .chat-line,
html[data-theme-mode="light"] .chat-msg {
  filter: drop-shadow(0 10px 22px rgba(15, 23, 42, .025));
}

html[data-theme-mode="light"] .chat-bubble {
  background: rgba(255,255,255,.86) !important;
  border: 1px solid rgba(15, 23, 42, .075) !important;
  box-shadow: 0 12px 34px rgba(15, 23, 42, .045) !important;
}
html[data-theme-mode="dark"] .chat-bubble {
  background: rgba(15, 23, 42, .72) !important;
  border: 1px solid rgba(148, 163, 184, .14) !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.24) !important;
}

html[data-theme-mode="light"] .chat-msg.user .chat-bubble,
html[data-theme-mode="light"] .chat-msg--user .chat-bubble,
html[data-theme-mode="light"] .chat-line.user .chat-bubble,
html[data-theme-mode="light"] .chat-line--user .chat-bubble {
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%) !important;
  border-color: rgba(37, 99, 235, .12) !important;
}

/* Composer: premium floating card */
html[data-theme-mode="light"] .agent-chat__input {
  background: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(15,23,42,.08) !important;
  box-shadow:
    0 22px 70px rgba(15, 23, 42, .13),
    0 1px 0 rgba(255,255,255,.9) inset !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
}
html[data-theme-mode="dark"] .agent-chat__input {
  background: rgba(17,24,39,.90) !important;
  border: 1px solid rgba(148,163,184,.18) !important;
  box-shadow:
    0 26px 80px rgba(0,0,0,.44),
    0 1px 0 rgba(255,255,255,.035) inset !important;
  backdrop-filter: blur(18px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
}

html[data-theme-mode="light"] .agent-chat__input > textarea,
html[data-theme-mode="light"] .agent-chat__toolbar {
  background: transparent !important;
}
html[data-theme-mode="dark"] .agent-chat__input > textarea,
html[data-theme-mode="dark"] .agent-chat__toolbar {
  background: transparent !important;
}

html[data-theme-mode="light"] .agent-chat__toolbar .chat-send-btn,
html[data-theme-mode="light"] .agent-chat__input .chat-send-btn {
  background: linear-gradient(135deg, #111827, #334155) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .22) !important;
}
html[data-theme-mode="dark"] .agent-chat__toolbar .chat-send-btn,
html[data-theme-mode="dark"] .agent-chat__input .chat-send-btn {
  background: linear-gradient(135deg, #f8fafc, #cbd5e1) !important;
  box-shadow: 0 12px 30px rgba(255,255,255,.10) !important;
}

html[data-theme-mode="light"] .agent-chat__input-btn:hover,
html[data-theme-mode="light"] .agent-chat__toolbar .btn--ghost:hover,
html[data-theme-mode="light"] .agent-chat__toolbar button:hover {
  background: rgba(15,23,42,.055) !important;
}

/* Tiny metadata under messages: cleaner and calmer */
.chat-group-footer,
.chat-stamp,
.chat-sender-name {
  opacity: .58 !important;
}

/* Tool/code cards: more polished */
html[data-theme-mode="light"] .chat-tool-card,
html[data-theme-mode="light"] .chat-tools-summary,
html[data-theme-mode="light"] .chat-tool-msg-summary,
html[data-theme-mode="light"] .chat-thinking,
html[data-theme-mode="light"] .chat-text pre {
  background: rgba(248,250,252,.92) !important;
  border-color: rgba(15,23,42,.075) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8) !important;
}

/* v18 Premium tech style: blue-purple glass, futuristic but restrained */
:root {
  --tech-blue: #3b82f6;
  --tech-cyan: #06b6d4;
  --tech-purple: #8b5cf6;
  --tech-pink: #d946ef;
}

html[data-theme-mode="light"] body,
html[data-theme-mode="light"] .shell--chat,
html[data-theme-mode="light"] .shell--chat .content,
html[data-theme-mode="light"] .shell--chat .chat-main,
html[data-theme-mode="light"] .shell--chat .chat-session,
html[data-theme-mode="light"] .shell--chat .chat-thread {
  background:
    radial-gradient(circle at 12% -10%, rgba(59,130,246,.18), transparent 34rem),
    radial-gradient(circle at 90% 0%, rgba(139,92,246,.13), transparent 30rem),
    radial-gradient(circle at 50% 112%, rgba(6,182,212,.10), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0%, #f4f7ff 44%, #ffffff 100%) !important;
}

html[data-theme-mode="dark"] body,
html[data-theme-mode="dark"] .shell--chat,
html[data-theme-mode="dark"] .shell--chat .content,
html[data-theme-mode="dark"] .shell--chat .chat-main,
html[data-theme-mode="dark"] .shell--chat .chat-session,
html[data-theme-mode="dark"] .shell--chat .chat-thread {
  background:
    radial-gradient(circle at 12% -10%, rgba(59,130,246,.34), transparent 34rem),
    radial-gradient(circle at 90% 0%, rgba(139,92,246,.26), transparent 32rem),
    radial-gradient(circle at 48% 112%, rgba(6,182,212,.16), transparent 36rem),
    linear-gradient(180deg, #050814 0%, #09111f 45%, #050713 100%) !important;
}

/* subtle sci-fi grid glow */
.shell--chat .chat-thread::before {
  content: "";
  position: fixed;
  inset: 72px 0 0 0;
  pointer-events: none;
  z-index: 0;
  opacity: .36;
  background-image:
    linear-gradient(rgba(59,130,246,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59,130,246,.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 72%, transparent);
}
html[data-theme-mode="dark"] .shell--chat .chat-thread::before {
  opacity: .42;
  background-image:
    linear-gradient(rgba(96,165,250,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,.06) 1px, transparent 1px);
}

.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  background: linear-gradient(90deg, rgba(255,255,255,.70), rgba(255,255,255,.52)) !important;
  border-bottom: 1px solid rgba(59,130,246,.16) !important;
  box-shadow: 0 10px 40px rgba(59,130,246,.07) !important;
  backdrop-filter: blur(22px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(170%) !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header {
  background: linear-gradient(90deg, rgba(7,12,28,.78), rgba(15,23,42,.56)) !important;
  border-bottom-color: rgba(96,165,250,.20) !important;
  box-shadow: 0 12px 46px rgba(0,0,0,.34), 0 0 36px rgba(59,130,246,.08) !important;
}

/* top controls become tech chips */
html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(255,255,255,.68) !important;
  border: 1px solid rgba(59,130,246,.16) !important;
  color: #0f172a !important;
  box-shadow: 0 7px 22px rgba(59,130,246,.075), inset 0 1px 0 rgba(255,255,255,.75) !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header select,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(15,23,42,.72) !important;
  border: 1px solid rgba(96,165,250,.20) !important;
  color: #dbeafe !important;
  box-shadow: 0 8px 24px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.045) !important;
}
html[data-theme-mode="light"] .shell--chat .chat-controls .btn:hover,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle:hover,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn:hover,
html[data-theme-mode="dark"] .shell--chat .chat-controls .oc-inline-sidebar-toggle:hover {
  border-color: rgba(59,130,246,.36) !important;
  box-shadow: 0 10px 28px rgba(59,130,246,.16), 0 0 0 3px rgba(59,130,246,.08) !important;
}

/* message cards: glass with very soft neon edges */
html[data-theme-mode="light"] .chat-bubble {
  background: rgba(255,255,255,.78) !important;
  border: 1px solid rgba(59,130,246,.10) !important;
  box-shadow: 0 16px 42px rgba(15,23,42,.055), 0 0 0 1px rgba(255,255,255,.62) inset !important;
  backdrop-filter: blur(10px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(135%) !important;
}
html[data-theme-mode="dark"] .chat-bubble {
  background: rgba(15,23,42,.62) !important;
  border: 1px solid rgba(96,165,250,.14) !important;
  box-shadow: 0 18px 52px rgba(0,0,0,.30), 0 0 24px rgba(59,130,246,.045) !important;
  backdrop-filter: blur(10px) saturate(135%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(135%) !important;
}

html[data-theme-mode="light"] .chat-msg.user .chat-bubble,
html[data-theme-mode="light"] .chat-msg--user .chat-bubble,
html[data-theme-mode="light"] .chat-line.user .chat-bubble,
html[data-theme-mode="light"] .chat-line--user .chat-bubble {
  background: linear-gradient(135deg, rgba(239,246,255,.92), rgba(250,245,255,.84)) !important;
  border-color: rgba(59,130,246,.18) !important;
}
html[data-theme-mode="dark"] .chat-msg.user .chat-bubble,
html[data-theme-mode="dark"] .chat-msg--user .chat-bubble,
html[data-theme-mode="dark"] .chat-line.user .chat-bubble,
html[data-theme-mode="dark"] .chat-line--user .chat-bubble {
  background: linear-gradient(135deg, rgba(30,64,175,.42), rgba(88,28,135,.30)) !important;
  border-color: rgba(96,165,250,.22) !important;
}

/* composer: glowing tech command box */
html[data-theme-mode="light"] .agent-chat__input {
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.76)) !important;
  border: 1px solid rgba(59,130,246,.18) !important;
  box-shadow:
    0 28px 90px rgba(59,130,246,.18),
    0 10px 36px rgba(15,23,42,.08),
    inset 0 1px 0 rgba(255,255,255,.9) !important;
}
html[data-theme-mode="dark"] .agent-chat__input {
  background: linear-gradient(180deg, rgba(15,23,42,.90), rgba(17,24,39,.76)) !important;
  border: 1px solid rgba(96,165,250,.22) !important;
  box-shadow:
    0 30px 96px rgba(0,0,0,.52),
    0 0 54px rgba(59,130,246,.16),
    inset 0 1px 0 rgba(255,255,255,.05) !important;
}
html[data-theme-mode="light"] .agent-chat__input:focus-within,
html[data-theme-mode="dark"] .agent-chat__input:focus-within {
  border-color: rgba(59,130,246,.48) !important;
  box-shadow:
    0 30px 96px rgba(59,130,246,.22),
    0 0 0 4px rgba(59,130,246,.10),
    inset 0 1px 0 rgba(255,255,255,.10) !important;
}

html[data-theme-mode="light"] .agent-chat__toolbar .chat-send-btn,
html[data-theme-mode="light"] .agent-chat__input .chat-send-btn {
  background: linear-gradient(135deg, var(--tech-blue), var(--tech-purple)) !important;
  box-shadow: 0 14px 36px rgba(59,130,246,.32), 0 0 18px rgba(139,92,246,.18) !important;
}
html[data-theme-mode="dark"] .agent-chat__toolbar .chat-send-btn,
html[data-theme-mode="dark"] .agent-chat__input .chat-send-btn {
  background: linear-gradient(135deg, #60a5fa, #a78bfa) !important;
  color: #020617 !important;
  box-shadow: 0 14px 38px rgba(96,165,250,.24), 0 0 24px rgba(167,139,250,.18) !important;
}

/* tool/code panels as terminal-like glass */
html[data-theme-mode="dark"] .chat-tool-card,
html[data-theme-mode="dark"] .chat-tools-summary,
html[data-theme-mode="dark"] .chat-tool-msg-summary,
html[data-theme-mode="dark"] .chat-thinking,
html[data-theme-mode="dark"] .chat-text pre {
  background: rgba(2,6,23,.52) !important;
  border-color: rgba(96,165,250,.16) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 20px rgba(59,130,246,.035) !important;
}

/* v19 Top toolbar polish: floating glass pill, remove harsh white strip */
.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  width: calc(100% - 32px) !important;
  height: 58px !important;
  min-height: 58px !important;
  max-height: 58px !important;
  margin: 12px 16px 0 !important;
  padding: 0 12px !important;
  border-radius: 22px !important;
  border: 1px solid rgba(96, 165, 250, .16) !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header {
  background:
    linear-gradient(90deg, rgba(255,255,255,.82), rgba(245,249,255,.74) 45%, rgba(250,245,255,.72)) !important;
  box-shadow:
    0 16px 46px rgba(59, 130, 246, .10),
    0 1px 0 rgba(255,255,255,.86) inset !important;
}

html[data-theme-mode="dark"] .shell--chat .chat-header {
  background:
    linear-gradient(90deg, rgba(15,23,42,.84), rgba(15,23,42,.64) 48%, rgba(30,27,75,.56)) !important;
  border-color: rgba(96, 165, 250, .22) !important;
  box-shadow:
    0 18px 52px rgba(0,0,0,.40),
    0 0 34px rgba(59,130,246,.10),
    0 1px 0 rgba(255,255,255,.045) inset !important;
}

/* Add a very soft highlight behind the toolbar so it feels intentional */
.shell--chat .chat-header::before {
  content: "";
  position: absolute;
  inset: -80px 12% auto 12%;
  height: 120px;
  pointer-events: none;
  background: radial-gradient(circle, rgba(96,165,250,.22), transparent 64%);
  filter: blur(18px);
  opacity: .55;
}

/* Make controls less bulky inside the floating bar */
.shell--chat .chat-header select,
.shell--chat .chat-controls .btn,
.shell--chat .chat-controls .oc-inline-sidebar-toggle,
html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="dark"] .shell--chat .chat-header select,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn {
  height: 38px !important;
  min-height: 38px !important;
  border-radius: 16px !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(255,255,255,.62) !important;
  border-color: rgba(15,23,42,.06) !important;
  box-shadow: 0 6px 18px rgba(15,23,42,.045), inset 0 1px 0 rgba(255,255,255,.80) !important;
}

html[data-theme-mode="dark"] .shell--chat .chat-header select,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(2,6,23,.34) !important;
  border-color: rgba(148,163,184,.16) !important;
}

.shell--chat .chat-controls .btn,
.shell--chat .chat-controls .oc-inline-sidebar-toggle {
  width: 38px !important;
  min-width: 38px !important;
}

/* Remove the hard white strip under the toolbar */
.shell--chat .chat-thread,
html[data-theme-mode="light"] .shell--chat .chat-thread,
html[data-theme-mode="dark"] .shell--chat .chat-thread {
  padding-top: 0 !important;
  margin-top: 0 !important;
  background: transparent !important;
}

.shell--chat .chat-thread-inner,
html[data-theme-mode="light"] .shell--chat .chat-thread-inner,
html[data-theme-mode="dark"] .shell--chat .chat-thread-inner {
  min-height: calc(100vh - 70px) !important;
  padding-top: 20px !important;
}

/* Ensure the chat content starts beneath the floating toolbar without a rectangular band */
.shell--chat .chat-session,
.shell--chat .chat-main {
  background: transparent !important;
}

@media (max-width: 720px) {
  .shell--chat .chat-header,
  html[data-theme-mode="light"] .shell--chat .chat-header,
  html[data-theme-mode="dark"] .shell--chat .chat-header {
    width: calc(100% - 16px) !important;
    margin: 8px 8px 0 !important;
    border-radius: 18px !important;
    height: 56px !important;
    min-height: 56px !important;
    max-height: 56px !important;
  }
}

/* v20 Top toolbar: remove full strip, use separated glass control groups */
.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  width: calc(100% - 40px) !important;
  height: 58px !important;
  min-height: 58px !important;
  max-height: 58px !important;
  margin: 12px 20px 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: grid !important;
  grid-template-columns: max-content 1fr max-content !important;
  align-items: center !important;
  gap: 14px !important;
  overflow: visible !important;
}

.shell--chat .chat-header::before {
  display: none !important;
}

/* Left selector group: one soft container instead of three harsh edge pills */
.shell--chat .chat-header__left,
html[data-theme-mode="light"] .shell--chat .chat-header__left,
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  grid-column: 1 !important;
  width: max-content !important;
  max-width: min(620px, calc(100vw - 360px)) !important;
  height: 46px !important;
  padding: 5px !important;
  border-radius: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header__left {
  background: rgba(255,255,255,.58) !important;
  border: 1px solid rgba(15,23,42,.055) !important;
  box-shadow: 0 12px 34px rgba(59,130,246,.075), inset 0 1px 0 rgba(255,255,255,.78) !important;
  backdrop-filter: blur(18px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(155%) !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  background: rgba(15,23,42,.56) !important;
  border: 1px solid rgba(148,163,184,.14) !important;
  box-shadow: 0 14px 38px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.04) !important;
  backdrop-filter: blur(18px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(155%) !important;
}

.shell--chat .chat-controls__session-row,
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row {
  gap: 5px !important;
  overflow: hidden !important;
}

.shell--chat .chat-header select,
.shell--chat .chat-controls__session-row select,
html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="dark"] .shell--chat .chat-header select {
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 15px !important;
  border: 1px solid transparent !important;
  padding: 0 28px 0 13px !important;
  font-size: 14px !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header select {
  background-color: rgba(255,255,255,.54) !important;
  color: #111827 !important;
}
html[data-theme-mode="light"] .shell--chat .chat-header select:hover {
  background-color: rgba(255,255,255,.82) !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header select {
  background-color: rgba(2,6,23,.30) !important;
  color: #e5e7eb !important;
}

.shell--chat .chat-controls__session-row label:nth-of-type(1) select {
  width: 112px !important;
  max-width: 112px !important;
}
.shell--chat .chat-controls__session-row label:nth-of-type(2) select {
  width: 132px !important;
  max-width: 132px !important;
}
.shell--chat .chat-controls__session-row label:nth-of-type(3) select {
  width: 148px !important;
  max-width: 148px !important;
}

/* Right function group: a matching small glass cluster */
.shell--chat .chat-header__right,
html[data-theme-mode="light"] .shell--chat .chat-header__right,
html[data-theme-mode="dark"] .shell--chat .chat-header__right {
  grid-column: 3 !important;
  height: 46px !important;
  padding: 5px !important;
  border-radius: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
}
html[data-theme-mode="light"] .shell--chat .chat-header__right {
  background: rgba(255,255,255,.48) !important;
  border: 1px solid rgba(15,23,42,.05) !important;
  box-shadow: 0 12px 34px rgba(139,92,246,.07), inset 0 1px 0 rgba(255,255,255,.72) !important;
  backdrop-filter: blur(18px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(155%) !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header__right {
  background: rgba(15,23,42,.54) !important;
  border: 1px solid rgba(148,163,184,.14) !important;
  box-shadow: 0 14px 38px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.04) !important;
  backdrop-filter: blur(18px) saturate(155%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(155%) !important;
}

.shell--chat .chat-controls,
html[data-theme-mode="light"] .shell--chat .chat-controls,
html[data-theme-mode="dark"] .shell--chat .chat-controls {
  gap: 5px !important;
}

.shell--chat .chat-controls .btn,
.shell--chat .chat-controls .oc-inline-sidebar-toggle,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 15px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(255,255,255,.50) !important;
  color: #111827 !important;
}
html[data-theme-mode="light"] .shell--chat .chat-controls .btn:hover,
html[data-theme-mode="light"] .shell--chat .chat-controls .oc-inline-sidebar-toggle:hover {
  background: rgba(255,255,255,.86) !important;
}

/* So the page starts naturally below floating groups */
.shell--chat .chat-thread-inner,
html[data-theme-mode="light"] .shell--chat .chat-thread-inner,
html[data-theme-mode="dark"] .shell--chat .chat-thread-inner {
  padding-top: 12px !important;
}

@media (max-width: 880px) {
  .shell--chat .chat-header,
  html[data-theme-mode="light"] .shell--chat .chat-header,
  html[data-theme-mode="dark"] .shell--chat .chat-header {
    width: calc(100% - 20px) !important;
    margin: 8px 10px 0 !important;
    grid-template-columns: 1fr max-content !important;
  }
  .shell--chat .chat-header__left {
    max-width: 100% !important;
  }
  .shell--chat .chat-controls__session-row label:nth-of-type(2),
  .shell--chat .chat-controls__session-row label:nth-of-type(3) {
    display: none !important;
  }
}

/* v21 Remove occupied top row; turn controls into floating toolbar over chat canvas */
.shell--chat .chat-header,
html[data-theme-mode="light"] .shell--chat .chat-header,
html[data-theme-mode="dark"] .shell--chat .chat-header {
  position: fixed !important;
  top: 14px !important;
  left: calc(var(--shell-nav-width, 258px) + 24px) !important;
  right: 24px !important;
  z-index: 1200 !important;
  width: auto !important;
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: grid !important;
  grid-template-columns: max-content 1fr max-content !important;
  align-items: center !important;
  gap: 12px !important;
  overflow: visible !important;
  pointer-events: none !important;
}

.shell.shell--nav-collapsed .chat-header,
.shell.shell--chat-focus .chat-header,
html[data-theme-mode="light"] .shell.shell--nav-collapsed .chat-header,
html[data-theme-mode="dark"] .shell.shell--nav-collapsed .chat-header,
html[data-theme-mode="light"] .shell.shell--chat-focus .chat-header,
html[data-theme-mode="dark"] .shell.shell--chat-focus .chat-header {
  left: 24px !important;
}

.shell--chat .chat-header::before,
.shell--chat .chat-header::after {
  display: none !important;
}

/* Floating left selector capsule */
.shell--chat .chat-header__left,
html[data-theme-mode="light"] .shell--chat .chat-header__left,
html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  pointer-events: auto !important;
  grid-column: 1 !important;
  height: 48px !important;
  width: max-content !important;
  max-width: min(620px, calc(100vw - 420px)) !important;
  padding: 6px !important;
  margin: 0 !important;
  border-radius: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header__left {
  background: rgba(255,255,255,.64) !important;
  border: 1px solid rgba(15,23,42,.06) !important;
  box-shadow:
    0 18px 48px rgba(59,130,246,.12),
    inset 0 1px 0 rgba(255,255,255,.78) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}

html[data-theme-mode="dark"] .shell--chat .chat-header__left {
  background: rgba(15,23,42,.64) !important;
  border: 1px solid rgba(148,163,184,.16) !important;
  box-shadow:
    0 20px 54px rgba(0,0,0,.42),
    0 0 34px rgba(59,130,246,.10),
    inset 0 1px 0 rgba(255,255,255,.045) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}

/* Floating right function capsule */
.shell--chat .chat-header__right,
html[data-theme-mode="light"] .shell--chat .chat-header__right,
html[data-theme-mode="dark"] .shell--chat .chat-header__right {
  pointer-events: auto !important;
  grid-column: 3 !important;
  height: 48px !important;
  padding: 6px !important;
  margin: 0 !important;
  border-radius: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header__right {
  background: rgba(255,255,255,.58) !important;
  border: 1px solid rgba(15,23,42,.055) !important;
  box-shadow:
    0 18px 48px rgba(139,92,246,.11),
    inset 0 1px 0 rgba(255,255,255,.76) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}

html[data-theme-mode="dark"] .shell--chat .chat-header__right {
  background: rgba(15,23,42,.62) !important;
  border: 1px solid rgba(148,163,184,.16) !important;
  box-shadow:
    0 20px 54px rgba(0,0,0,.42),
    0 0 34px rgba(139,92,246,.10),
    inset 0 1px 0 rgba(255,255,255,.045) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}

/* Make inner controls fit floating capsules */
.shell--chat .chat-controls__session-row,
html[data-theme-mode="light"] .shell--chat .chat-controls__session-row,
html[data-theme-mode="dark"] .shell--chat .chat-controls__session-row {
  gap: 5px !important;
  overflow: hidden !important;
}

.shell--chat .chat-header select,
.shell--chat .chat-controls__session-row select,
html[data-theme-mode="light"] .shell--chat .chat-header select,
html[data-theme-mode="dark"] .shell--chat .chat-header select {
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 16px !important;
  padding: 0 28px 0 13px !important;
  font-size: 14px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}

html[data-theme-mode="light"] .shell--chat .chat-header select {
  background-color: rgba(255,255,255,.52) !important;
  color: #111827 !important;
}
html[data-theme-mode="dark"] .shell--chat .chat-header select {
  background-color: rgba(2,6,23,.34) !important;
  color: #e5e7eb !important;
}

.shell--chat .chat-controls .btn,
.shell--chat .chat-controls .oc-inline-sidebar-toggle,
html[data-theme-mode="light"] .shell--chat .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .chat-controls .btn {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 16px !important;
  box-shadow: none !important;
}

/* Since header is floating, chat area should own the full page and just leave breathing room */
.shell--chat .content,
.shell--chat .chat-main,
.shell--chat .chat-session,
.shell--chat .chat-thread,
html[data-theme-mode="light"] .shell--chat .content,
html[data-theme-mode="dark"] .shell--chat .content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

.shell--chat .chat-thread-inner,
html[data-theme-mode="light"] .shell--chat .chat-thread-inner,
html[data-theme-mode="dark"] .shell--chat .chat-thread-inner {
  padding-top: 86px !important;
  min-height: 100vh !important;
}

@media (max-width: 880px) {
  .shell--chat .chat-header,
  html[data-theme-mode="light"] .shell--chat .chat-header,
  html[data-theme-mode="dark"] .shell--chat .chat-header {
    top: 8px !important;
    left: 10px !important;
    right: 10px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    grid-template-columns: 1fr max-content !important;
  }
  .shell--chat .chat-header__left,
  .shell--chat .chat-header__right {
    height: 44px !important;
    border-radius: 20px !important;
  }
  .shell--chat .chat-controls__session-row label:nth-of-type(2),
  .shell--chat .chat-controls__session-row label:nth-of-type(3) {
    display: none !important;
  }
  .shell--chat .chat-thread-inner {
    padding-top: 68px !important;
  }
}

/* v22 Correct target: chat top controls are .content-header, not .chat-header */
.shell--chat .content-header,
html[data-theme-mode="light"] .shell--chat .content-header,
html[data-theme-mode="dark"] .shell--chat .content-header {
  position: fixed !important;
  top: 14px !important;
  left: calc(var(--shell-nav-width, 258px) + 24px) !important;
  right: 24px !important;
  z-index: 1600 !important;
  width: auto !important;
  height: 54px !important;
  min-height: 54px !important;
  max-height: 54px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: grid !important;
  grid-template-columns: max-content 1fr max-content !important;
  align-items: center !important;
  gap: 12px !important;
  overflow: visible !important;
  pointer-events: none !important;
}

.shell.shell--nav-collapsed.shell--chat .content-header,
.shell.shell--chat-focus.shell--chat .content-header,
html[data-theme-mode="light"] .shell.shell--nav-collapsed.shell--chat .content-header,
html[data-theme-mode="dark"] .shell.shell--nav-collapsed.shell--chat .content-header,
html[data-theme-mode="light"] .shell.shell--chat-focus.shell--chat .content-header,
html[data-theme-mode="dark"] .shell.shell--chat-focus.shell--chat .content-header {
  left: 24px !important;
}

/* Left selector floating capsule: wraps Bk(e) */
.shell--chat .content-header > div:first-child,
html[data-theme-mode="light"] .shell--chat .content-header > div:first-child,
html[data-theme-mode="dark"] .shell--chat .content-header > div:first-child {
  pointer-events: auto !important;
  grid-column: 1 !important;
  width: max-content !important;
  max-width: min(620px, calc(100vw - 420px)) !important;
  height: 48px !important;
  padding: 6px !important;
  margin: 0 !important;
  border-radius: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  overflow: hidden !important;
}

html[data-theme-mode="light"] .shell--chat .content-header > div:first-child {
  background: rgba(255,255,255,.64) !important;
  border: 1px solid rgba(15,23,42,.06) !important;
  box-shadow: 0 18px 48px rgba(59,130,246,.12), inset 0 1px 0 rgba(255,255,255,.78) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}
html[data-theme-mode="dark"] .shell--chat .content-header > div:first-child {
  background: rgba(15,23,42,.64) !important;
  border: 1px solid rgba(148,163,184,.16) !important;
  box-shadow: 0 20px 54px rgba(0,0,0,.42), 0 0 34px rgba(59,130,246,.10), inset 0 1px 0 rgba(255,255,255,.045) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}

/* Right function floating capsule: wraps Vk(e) */
.shell--chat .content-header .page-meta,
html[data-theme-mode="light"] .shell--chat .content-header .page-meta,
html[data-theme-mode="dark"] .shell--chat .content-header .page-meta {
  pointer-events: auto !important;
  grid-column: 3 !important;
  height: 48px !important;
  padding: 6px !important;
  margin: 0 !important;
  border-radius: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 5px !important;
  min-width: max-content !important;
}

html[data-theme-mode="light"] .shell--chat .content-header .page-meta {
  background: rgba(255,255,255,.58) !important;
  border: 1px solid rgba(15,23,42,.055) !important;
  box-shadow: 0 18px 48px rgba(139,92,246,.11), inset 0 1px 0 rgba(255,255,255,.76) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}
html[data-theme-mode="dark"] .shell--chat .content-header .page-meta {
  background: rgba(15,23,42,.62) !important;
  border: 1px solid rgba(148,163,184,.16) !important;
  box-shadow: 0 20px 54px rgba(0,0,0,.42), 0 0 34px rgba(139,92,246,.10), inset 0 1px 0 rgba(255,255,255,.045) !important;
  backdrop-filter: blur(22px) saturate(165%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
}

/* Remove old full-width header footprint and make chat canvas fill the page */
.shell--chat main.content,
html[data-theme-mode="light"] .shell--chat main.content,
html[data-theme-mode="dark"] .shell--chat main.content {
  padding: 0 !important;
  margin: 0 !important;
  gap: 0 !important;
  overflow: hidden !important;
}

.shell--chat .card.chat,
html[data-theme-mode="light"] .shell--chat .card.chat,
html[data-theme-mode="dark"] .shell--chat .card.chat {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  height: 100% !important;
  min-height: 100% !important;
}

.shell--chat .chat-split-container,
.shell--chat .chat-main,
.shell--chat .chat-session,
.shell--chat .chat-thread,
html[data-theme-mode="light"] .shell--chat .chat-split-container,
html[data-theme-mode="light"] .shell--chat .chat-main,
html[data-theme-mode="light"] .shell--chat .chat-session,
html[data-theme-mode="light"] .shell--chat .chat-thread,
html[data-theme-mode="dark"] .shell--chat .chat-split-container,
html[data-theme-mode="dark"] .shell--chat .chat-main,
html[data-theme-mode="dark"] .shell--chat .chat-session,
html[data-theme-mode="dark"] .shell--chat .chat-thread {
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.shell--chat .chat-thread-inner,
html[data-theme-mode="light"] .shell--chat .chat-thread-inner,
html[data-theme-mode="dark"] .shell--chat .chat-thread-inner {
  padding-top: 86px !important;
}

/* Actual selects/buttons inside the real content header */
.shell--chat .content-header .chat-controls__session-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  overflow: hidden !important;
}
.shell--chat .content-header .chat-controls__session-row label,
.shell--chat .content-header .chat-controls__session {
  margin: 0 !important;
  display: inline-flex !important;
  min-width: 0 !important;
}
.shell--chat .content-header select {
  height: 36px !important;
  min-height: 36px !important;
  border-radius: 16px !important;
  padding: 0 28px 0 13px !important;
  font-size: 14px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
html[data-theme-mode="light"] .shell--chat .content-header select {
  background-color: rgba(255,255,255,.52) !important;
  color: #111827 !important;
}
html[data-theme-mode="dark"] .shell--chat .content-header select {
  background-color: rgba(2,6,23,.34) !important;
  color: #e5e7eb !important;
}
.shell--chat .content-header .chat-controls__session-row label:nth-of-type(1) select { width: 112px !important; max-width: 112px !important; }
.shell--chat .content-header .chat-controls__session-row label:nth-of-type(2) select { width: 132px !important; max-width: 132px !important; }
.shell--chat .content-header .chat-controls__session-row label:nth-of-type(3) select { width: 148px !important; max-width: 148px !important; }

.shell--chat .content-header .chat-controls {
  display: inline-flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 5px !important;
  opacity: 1 !important;
}
.shell--chat .content-header .chat-controls .btn,
.shell--chat .content-header .chat-controls .oc-inline-sidebar-toggle {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  border-radius: 16px !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
}
html[data-theme-mode="light"] .shell--chat .content-header .chat-controls .btn,
html[data-theme-mode="light"] .shell--chat .content-header .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(255,255,255,.50) !important;
  color: #111827 !important;
}
html[data-theme-mode="dark"] .shell--chat .content-header .chat-controls .btn,
html[data-theme-mode="dark"] .shell--chat .content-header .chat-controls .oc-inline-sidebar-toggle {
  background: rgba(2,6,23,.34) !important;
  color: #e5e7eb !important;
}
.shell--chat .content-header .chat-controls__separator { display: none !important; }

@media (max-width: 880px) {
  .shell--chat .content-header,
  html[data-theme-mode="light"] .shell--chat .content-header,
  html[data-theme-mode="dark"] .shell--chat .content-header {
    top: 8px !important;
    left: 10px !important;
    right: 10px !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    grid-template-columns: 1fr max-content !important;
  }
  .shell--chat .content-header > div:first-child,
  .shell--chat .content-header .page-meta {
    height: 44px !important;
    border-radius: 20px !important;
  }
  .shell--chat .content-header .chat-controls__session-row label:nth-of-type(2),
  .shell--chat .content-header .chat-controls__session-row label:nth-of-type(3) {
    display: none !important;
  }
}

/* v23 Auto-hide left session/model/thinking selector; show on hover/focus */
.shell--chat .content-header > div:first-child,
html[data-theme-mode="light"] .shell--chat .content-header > div:first-child,
html[data-theme-mode="dark"] .shell--chat .content-header > div:first-child {
  opacity: 0 !important;
  transform: translateY(-8px) scale(.985) !important;
  transition:
    opacity .22s ease,
    transform .22s ease,
    filter .22s ease !important;
  pointer-events: auto !important;
  filter: blur(.2px) !important;
}

/* Hover anywhere on the floating top control row to reveal the left selector */
.shell--chat .content-header:hover > div:first-child,
.shell--chat .content-header > div:first-child:hover,
.shell--chat .content-header > div:first-child:focus-within,
html[data-theme-mode="light"] .shell--chat .content-header:hover > div:first-child,
html[data-theme-mode="dark"] .shell--chat .content-header:hover > div:first-child {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
  filter: blur(0) !important;
}

/* Keep a tiny invisible hover target so it can be triggered even when hidden */
.shell--chat .content-header > div:first-child::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 28px;
  pointer-events: none;
}

/* Right function buttons remain visible, but a bit softer when idle */
.shell--chat .content-header .page-meta,
html[data-theme-mode="light"] .shell--chat .content-header .page-meta,
html[data-theme-mode="dark"] .shell--chat .content-header .page-meta {
  opacity: .72 !important;
  transition: opacity .22s ease, transform .22s ease !important;
}

.shell--chat .content-header:hover .page-meta,
.shell--chat .content-header .page-meta:hover,
.shell--chat .content-header .page-meta:focus-within {
  opacity: 1 !important;
}

/* v24 Account/password login gate polish */
.login-gate__account-field input {
  font-weight: 600 !important;
  letter-spacing: .01em !important;
}
.login-gate__connect {
  border-radius: 16px !important;
  min-height: 46px !important;
  font-weight: 700 !important;
}
.login-gate__help {
  display: none !important;
}


/* OpenClaw custom: obvious New Chat button */
.oc-new-chat-btn{
  border: 0 !important;
  padding: 0 14px !important;
  min-height: 34px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
  color: #fff !important;
  background: linear-gradient(135deg,#ef4444 0%,#f97316 45%,#fb7185 100%) !important;
  box-shadow: 0 12px 26px rgba(239,68,68,.22), inset 0 1px 0 rgba(255,255,255,.28) !important;
}
.oc-new-chat-btn:hover{ transform: translateY(-1px); filter: brightness(1.03); }
.oc-new-chat-btn:disabled{ opacity:.48 !important; transform:none; filter:grayscale(.15); }
@media (max-width: 720px){ .oc-new-chat-btn{ padding:0 10px !important; font-size:12px !important; } }
