:root {
  --bg: #f7f4ed;
  --surface: #ffffff;
  --panel: #fbf9f3;
  --border: rgba(30, 41, 59, 0.12);
  --text: #1f2a37;
  --muted: rgba(31, 42, 55, 0.55);
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.10);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --user-bg: rgba(59, 130, 246, 0.12);
  --assistant-bg: #ffffff;
  --plan-bg: rgba(31, 41, 55, 0.04);
  --danger: #d64545;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app-shell { height: 100%; padding: 14px 14px 18px; }

.layout-3 {
  height: 100%;
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 14px;
  min-height: 0;
}

.sidebar, .main, .rightpanel {
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  min-height: 0;
}

.sidebar { display: flex; flex-direction: column; overflow: hidden; }
.sidebar-head,
.sidebar-title,
.sidebar-footer,
.nav-item { display: none; }

.sidebar-top {
  padding: 12px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}
.sidebar-top-title { font-size: 1.05rem; font-weight: 750; color: rgba(31,42,55,0.70); }
.sidebar-top-actions { display: inline-flex; align-items: center; gap: 8px; }
.icon-ghost {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,55,0.10);
  background: rgba(255,255,255,0.60);
  color: rgba(31,42,55,0.65);
}
.icon-ghost:not(:disabled) { cursor: pointer; }
.icon-ghost:not(:disabled):hover {
  background: rgba(255,255,255,0.92);
  border-color: rgba(31,41,55,0.16);
  color: rgba(31,42,55,0.82);
}
.icon-ghost:disabled { opacity: 0.55; cursor: not-allowed; }

.sidebar-expand-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 6;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,55,0.10);
  background: rgba(255,255,255,0.88);
  color: rgba(31,42,55,0.65);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.sidebar-expand-btn:hover {
  background: rgba(255,255,255,0.96);
  border-color: rgba(31,41,55,0.16);
  color: rgba(31,42,55,0.82);
}

.layout-3.sidebar-collapsed { grid-template-columns: 1fr 320px; }
.layout-3.sidebar-collapsed .sidebar { display: none; }

.connect-card {
  margin: 6px 12px 10px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.10);
  background: rgba(255,255,255,0.70);
  display: grid;
  grid-template-columns: 28px 1fr 12px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: rgba(31,42,55,0.65);
}
.connect-card:disabled { opacity: 0.85; }
.connect-icon { opacity: 0.7; }
.connect-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(31,41,55,0.10); justify-self: end; }
.connect-dot.is-on { background: #22c55e; box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25); }

.sidebar-nav {
  padding: 0 12px 10px;
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
}
.nav-link {
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: rgba(31,42,55,0.68);
  cursor: pointer;
}
.nav-link.is-active {
  background: rgba(59,130,246,0.10);
  color: rgba(31,42,55,0.82);
}
.nav-link:disabled { opacity: 0.85; cursor: not-allowed; }
.activity-modal-card {
  width: min(960px, calc(100vw - 24px));
  height: min(680px, calc(100vh - 32px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
  display: flex;
  flex-direction: column;
}
.activity-modal-close {
  font-size: 1.35rem;
  line-height: 1;
  color: rgba(31, 42, 55, 0.45);
}
.activity-modal-split {
  display: grid;
  grid-template-columns: minmax(240px, 280px) 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.activity-modal-list-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(31, 41, 55, 0.10);
  background: rgba(31, 41, 55, 0.02);
}
.activity-list-search {
  margin: 10px 10px 8px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,55,0.10);
  background: rgba(255,255,255,0.75);
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
}
.activity-session-list {
  flex: 1;
  overflow: auto;
  padding: 0 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.activity-session-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(31, 41, 55, 0.10);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
}
.activity-session-item:hover {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(255, 255, 255, 0.95);
}
.activity-session-item.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.08);
}
.activity-session-item-title {
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.4;
  margin-bottom: 4px;
}
.activity-session-item-meta {
  font-size: 0.74rem;
  color: rgba(31, 42, 55, 0.52);
  line-height: 1.4;
}
.activity-modal-detail-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.activity-detail-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: rgba(31, 42, 55, 0.45);
  text-align: center;
}
.activity-detail-empty.hidden { display: none; }
.activity-detail-head {
  flex-shrink: 0;
  padding: 12px 16px 10px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}
.activity-detail-head.hidden { display: none; }
.activity-detail-title {
  font-size: 0.95rem;
  font-weight: 650;
  color: rgba(31, 42, 55, 0.78);
}
.activity-detail-meta {
  margin-top: 4px;
  font-size: 0.76rem;
  color: rgba(31, 42, 55, 0.5);
}
.activity-detail-chat {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 14px 16px;
  -webkit-overflow-scrolling: touch;
}
.activity-detail-chat.chat {
  height: auto;
  max-height: none;
}
.activity-detail-chat.hidden { display: none; }
.activity-detail-chat .chat-footer { display: none !important; }
.activity-detail-chat .chat-item .chat-footer { display: none !important; }
.activity-detail-chat .think-summary { cursor: pointer; }
.nav-ico { width: 20px; text-align: center; opacity: 0.75; }

.sidebar-sep {
  height: 1px;
  background: rgba(31,41,55,0.08);
  margin: 4px 12px 10px;
  flex: 0 0 auto;
}

.sidebar-search {
  margin: 0 12px 10px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.10);
  background: rgba(31,41,55,0.03);
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}
.search-ico { color: rgba(31,42,55,0.38); font-size: 0.9rem; }
.search:disabled { opacity: 0.45; cursor: not-allowed; }
.search {
  width: 100%;
  height: 100%;
  line-height: 1;
  min-height: 0;
  font-size: 0.9rem;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(31,42,55,0.72);
}

.sidebar-section { padding: 6px 12px 10px; }
.sidebar-section:last-of-type {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-section:last-of-type .sessions {
  flex: 1 1 auto;
  min-height: 0;
}
.section-title {
  font-size: 0.92rem;
  font-weight: 650;
  color: rgba(31,42,55,0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.section-plus { opacity: 0.5; }
.section-empty { font-size: 0.85rem; color: rgba(31,42,55,0.40); padding: 6px 4px 0; }

.sessions {
  padding: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-card {
  width: 100%;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.55);
  text-align: left;
  padding: 12px 12px 10px;
  border-radius: 12px;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.session-card:hover {
  background: rgba(255,255,255,0.85);
  border-color: rgba(31,41,55,0.08);
}
.session-card.active {
  background: rgba(59,130,246,0.08);
  border-color: rgba(59,130,246,0.22);
}
.session-card.is-generating {
  border-color: rgba(59,130,246,0.18);
}
.session-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: rgba(31,42,55,0.82);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}
.session-card-busy {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(59,130,246,0.85);
  background: rgba(59,130,246,0.1);
  border-radius: 999px;
  padding: 1px 6px;
}
.session-card-kind {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 600;
  color: rgba(139,92,246,0.9);
  background: rgba(139,92,246,0.12);
  border-radius: 999px;
  padding: 1px 6px;
}
.meeting-hero .hero-sub {
  margin: 0.5rem 0 0;
  font-size: 0.92rem;
  color: rgba(31,42,55,0.55);
  line-height: 1.55;
  max-width: 36rem;
}
.chat-item.meeting .chat-name {
  font-weight: 650;
  color: rgba(31,42,55,0.82);
}
.chat-avatar.meeting-avatar {
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-item.meeting .meeting-bubble {
  border-left: 3px solid rgba(139,92,246,0.35);
}
.session-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
}
.session-card-meta {
  flex: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: rgba(31,42,55,0.42);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
}
.session-card:hover .session-card-actions,
.session-card:focus-within .session-card-actions {
  opacity: 1;
  pointer-events: auto;
}
.session-act {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1;
  color: rgba(31,42,55,0.45);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.session-act:hover {
  background: rgba(31,41,55,0.06);
  color: rgba(31,42,55,0.78);
}

.btn, .btn-primary {
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.75);
  color: var(--text);
}
.btn:hover { border-color: rgba(31,41,55,0.22); }
.btn-primary {
  background: var(--accent);
  border-color: rgba(59,130,246,0.35);
  color: #fff;
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-danger {
  background: var(--danger);
  border-color: rgba(214, 69, 69, 0.45);
  color: #fff;
}
.btn-danger:hover { filter: brightness(0.96); }

body.has-dialog { overflow: hidden; }

.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.app-dialog.hidden { display: none; }
.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
}
.app-dialog-card {
  position: relative;
  width: min(420px, 100%);
  max-height: min(85vh, 560px);
  overflow: auto;
  padding: 20px 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow), 0 24px 48px rgba(15, 23, 42, 0.12);
}
.app-dialog-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}
.app-dialog-body { margin-bottom: 8px; }
.app-dialog-message {
  font-size: 0.92rem;
  line-height: 1.6;
  color: rgba(31, 42, 55, 0.82);
}
.app-dialog-extra { margin-top: 10px; }
.app-dialog-field { margin-top: 14px; }
.app-dialog-field .settings-input { width: 100%; }
.app-dialog-error {
  margin: 8px 0 4px;
  font-size: 0.82rem;
  color: var(--danger);
}
.app-dialog-error.hidden { display: none; }
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
  padding-top: 4px;
}
.dialog-preset-list {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.04);
  border: 1px solid var(--border);
  max-height: 160px;
  overflow: auto;
}
.dialog-preset-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 0.88rem;
  color: rgba(31, 42, 55, 0.75);
}
.dialog-preset-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.main { position: relative; display: flex; flex-direction: column; overflow: hidden; }
.chat-view {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.chat {
  height: 100%;
  overflow: auto;
  padding: 16px 28px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.chat-minimap {
  position: absolute;
  top: 8px;
  right: 4px;
  bottom: 8px;
  width: 16px;
  z-index: 6;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: flex-end;
}
.chat-minimap.hidden { display: none; }
.chat-minimap-bar {
  position: static;
  flex-shrink: 0;
  width: 12px;
  height: 3px;
  border: none;
  border-radius: 2px;
  padding: 0;
  background: #a8b8c1;
  pointer-events: auto;
  cursor: pointer;
  transition: width 0.12s ease, background 0.12s ease;
}
.chat-minimap-bar:hover,
.chat-minimap-bar.is-active {
  width: 14px;
  background: #7a9aab;
}
.chat-minimap-preview {
  position: absolute;
  top: 16px;
  right: 22px;
  z-index: 25;
  width: min(272px, calc(100% - 48px));
  max-height: min(72%, 420px);
  overflow: auto;
  padding: 6px 0;
  border-radius: 10px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.14);
}
.chat-minimap-preview.hidden { display: none; }
.chat-minimap-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: rgba(31, 42, 55, 0.82);
}
.chat-minimap-preview-row:hover { background: rgba(59, 130, 246, 0.06); }
.chat-minimap-preview-text {
  flex: 1;
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-minimap-preview-dash {
  flex-shrink: 0;
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: #a8b8c1;
}
.chat-minimap-preview-row:hover .chat-minimap-preview-dash,
.chat-minimap-preview-row.is-active .chat-minimap-preview-dash {
  background: #7a9aab;
}
.chat:has(.hero) {
  background-color: #f2f0e9;
  background-image: radial-gradient(rgba(31, 41, 55, 0.04) 1px, transparent 1px);
  background-size: 12px 12px;
}
.hero {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px 24px;
  text-align: center;
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 400px;
  width: 100%;
}
.hero-avatar-ring {
  padding: 5px;
  border-radius: 999px;
  border: 1px solid rgba(31, 41, 55, 0.14);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
  margin-bottom: 22px;
}
.hero-avatar {
  width: 88px;
  height: 88px;
  border-radius: 999px;
  overflow: hidden;
  background: #e8e4dc;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
}
.hero-avatar.has-image { background-color: #e8e4dc; }
.hero-avatar-default svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hero-title {
  font-family: "Noto Serif SC", "Songti SC", "STSong", Georgia, serif;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(55, 65, 75, 0.82);
  margin: 0 0 20px;
  line-height: 1.5;
}
.hero-workspace-wrap {
  position: relative;
  margin-bottom: 14px;
}
.hero-workspace-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: rgba(71, 85, 105, 0.88);
  font-size: 0.88rem;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.hero-workspace-btn:hover { background: rgba(31, 41, 55, 0.05); }
.hero-workspace-label { letter-spacing: 0.02em; }
.hero-workspace-name { color: rgba(51, 65, 85, 0.95); font-weight: 500; }
.hero-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(71, 85, 105, 0.75);
}
.hero-ico svg { display: block; }
.hero-ico-refresh { opacity: 0.85; }
.hero-workspace-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  min-width: 260px;
  padding: 8px 0;
  border-radius: 12px;
  border: 1px solid rgba(31, 41, 55, 0.1);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  text-align: left;
}
.hero-workspace-menu.hidden { display: none; }
.hero-ws-section { padding: 4px 0; }
.hero-ws-label {
  padding: 6px 14px 4px;
  font-size: 0.72rem;
  color: rgba(31, 42, 55, 0.45);
}
.hero-ws-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  color: rgba(31, 42, 55, 0.78);
  cursor: pointer;
  text-align: left;
}
.hero-ws-option:hover { background: rgba(59, 130, 246, 0.06); }
.hero-ws-option.is-active {
  color: #2563eb;
  font-weight: 500;
}
.hero-ws-divider {
  height: 1px;
  margin: 4px 0;
  background: rgba(31, 41, 55, 0.08);
}
.hero-chat-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.05);
  border: 1px solid rgba(31, 41, 55, 0.08);
}
.hero-mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: rgba(71, 85, 105, 0.78);
  font-size: 0.84rem;
  cursor: pointer;
  border-radius: 999px;
  letter-spacing: 0.04em;
  transition: background 0.15s, color 0.15s;
}
.hero-mode-opt:hover {
  background: rgba(31, 41, 55, 0.05);
  color: rgba(31, 42, 55, 0.85);
}
.hero-mode-opt.is-active {
  background: #fff;
  color: #2563eb;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(31, 41, 55, 0.08);
}
.hero-mode-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: rgba(100, 116, 139, 0.85);
  letter-spacing: 0.02em;
}
.hero-memory-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: none;
  background: transparent;
  color: rgba(71, 85, 105, 0.72);
  font-size: 0.84rem;
  cursor: pointer;
  border-radius: 8px;
  letter-spacing: 0.04em;
}
.hero-memory-link:hover { background: rgba(31, 41, 55, 0.05); color: rgba(31, 42, 55, 0.85); }
.hero-ico-diamond {
  font-size: 0.72rem;
  opacity: 0.75;
}
.composer {
  padding: 12px 12px 14px;
  background: transparent;
}
.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px 8px;
}
.composer-attachments.hidden { display: none; }
.composer-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
  background: rgba(31, 41, 55, 0.06);
  border: 1px solid rgba(31, 41, 55, 0.1);
  font-size: 0.78rem;
  max-width: 100%;
}
.composer-attach-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
}
.composer-attach-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.composer-attach-remove {
  border: none;
  background: transparent;
  cursor: pointer;
  color: rgba(31, 41, 55, 0.45);
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}
.hidden { display: none !important; }
.chat-user-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.chat-user-text + .chat-user-images { margin-top: 8px; }

.chat-image-thumb-wrap {
  display: inline-block;
  margin: 6px 0;
  padding: 0;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(31, 41, 55, 0.04);
  cursor: zoom-in;
  line-height: 0;
  max-width: min(240px, 100%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-image-thumb-wrap:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.chat-image-thumb-wrap:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.45);
  outline-offset: 2px;
}
.chat-image-thumb {
  display: block;
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  object-position: center;
}
.chat-bubble.md .chat-image-thumb-wrap { margin: 0.5rem 0; }
.chat-bubble.md p:has(.chat-image-thumb-wrap) { margin: 0.35rem 0; }

.chat-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
}
.chat-image-lightbox.hidden { display: none !important; }
.chat-image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
}
.chat-image-lightbox-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0 56px;
}
.chat-image-lightbox-img {
  max-width: min(96vw, 1400px);
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.chat-image-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 64px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}
.chat-image-lightbox-nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.22);
}
.chat-image-lightbox-nav:disabled {
  opacity: 0.25;
  cursor: default;
}
.chat-image-lightbox-prev { left: 16px; }
.chat-image-lightbox-next { right: 16px; }
.chat-image-lightbox-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 0 8px;
}
.chat-image-lightbox-toolbar-spacer { flex: 1; }
.chat-image-lightbox-counter {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.9rem;
  min-width: 4.5rem;
}
.chat-image-lightbox-toolbar .btn {
  height: 34px;
  padding: 0 14px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.95);
}
.chat-image-lightbox-toolbar .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.2);
}
.chat-image-lightbox-toolbar .btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}
.chat-image-lightbox-toolbar .btn.is-saved:disabled {
  opacity: 0.78;
}
.chat-image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.chat-image-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
}
body.chat-image-lightbox-open { overflow: hidden; }

.composer-card {
  border-radius: 16px;
  border: 1px solid rgba(31,41,55,0.12);
  background: rgba(255,255,255,0.70);
  box-shadow: 0 16px 40px rgba(15,23,42,0.10);
  padding: 14px 14px 12px;
}
.composer-bar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.composer-left, .composer-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,55,0.14);
  background: rgba(255,255,255,0.75);
  color: rgba(31,42,55,0.70);
  cursor: pointer;
}
.icon-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.context-usage {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 8px 0 4px;
  border: none;
  background: transparent;
  color: rgba(31, 42, 55, 0.62);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  cursor: default;
  border-radius: 8px;
}
.context-usage:not(:disabled):hover,
.context-usage:not(:disabled):focus-visible {
  background: rgba(31, 41, 55, 0.05);
  outline: none;
}
.context-usage:disabled { opacity: 0.45; cursor: default; }
.context-ring {
  display: inline-flex;
  flex-shrink: 0;
}
.context-ring svg { display: block; transform: rotate(-90deg); }
.context-ring .ring-bg {
  stroke: rgba(31, 41, 55, 0.14);
  stroke-width: 2.5;
}
.context-ring .ring-fg {
  stroke: #3b82f6;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 43.98;
  stroke-dashoffset: 43.98;
  transition: stroke-dashoffset 0.2s ease;
}
.context-label {
  min-width: 4.8em;
  font-size: 0.72rem;
  text-align: left;
  letter-spacing: -0.02em;
}
.context-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  min-width: 148px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(31, 42, 55, 0.78);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.context-tip-line { display: block; }
.context-tip-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(31, 41, 55, 0.08);
  max-width: 260px;
  white-space: normal;
  line-height: 1.4;
  color: rgba(180, 83, 9, 0.92);
}
.context-tip-note.hidden { display: none; }
.context-usage:not(:disabled):hover .context-tip,
.context-usage:not(:disabled):focus-visible .context-tip {
  opacity: 1;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(31,41,55,0.14);
  background: rgba(255,255,255,0.75);
  color: rgba(31,42,55,0.70);
  padding: 0 12px;
  height: 34px;
  border-radius: 999px;
  font-size: 0.85rem;
}
.pill input { accent-color: var(--accent); }
.select-btn {
  height: 34px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.14);
  background: rgba(255,255,255,0.75);
  padding: 0 12px;
  color: rgba(31,42,55,0.65);
}
.select-btn:disabled { opacity: 0.65; }
.role-select {
  max-width: 160px;
  cursor: pointer;
  color: var(--text);
}
.role-select:disabled { cursor: not-allowed; }
textarea {
  width: 100%;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(31,41,55,0.10);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 12px;
  resize: none;
  font: inherit;
  line-height: 1.45;
  min-height: 46px;
}
textarea:focus { outline: none; border-color: rgba(59,130,246,0.45); box-shadow: 0 0 0 3px rgba(59,130,246,0.10); }
textarea:disabled { opacity: 0.7; }

.rightpanel { display: flex; flex-direction: column; overflow: hidden; }
.rightpanel-head { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); }
.rightpanel-title { font-size: 0.95rem; font-weight: 650; }
.dot-sep { margin: 0 6px; opacity: 0.7; }
.rightpanel-body { flex: 1; overflow: auto; padding: 12px; }
.empty {
  height: 100%;
  border: 1px dashed rgba(31,41,55,0.18);
  background: rgba(255,255,255,0.55);
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  color: var(--muted);
}
.empty-title { font-size: 0.92rem; color: rgba(31,42,55,0.75); font-weight: 650; }
.empty-sub { margin-top: 6px; font-size: 0.8rem; }

.desk-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}
.desk-toolbar .desk-usage {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.desk-usage {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}
.desk-usage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.desk-usage-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(31, 42, 55, 0.55);
  letter-spacing: 0.02em;
}
.desk-usage-num {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: rgba(31, 42, 55, 0.72);
  white-space: nowrap;
}
.desk-usage-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.08);
  overflow: hidden;
}
.desk-usage-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8eb4c5 0%, #a8b8c1 100%);
  transition: width 0.25s ease;
}
.desk-usage-fill.is-warn {
  background: linear-gradient(90deg, #e8a84b 0%, #f0b429 100%);
}
.desk-usage-fill.is-danger {
  background: linear-gradient(90deg, #e57373 0%, #ef5350 100%);
}

.desk-files { display: flex; flex-direction: column; gap: 6px; }
.desk-file {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.6);
  color: var(--text);
  transition: background 0.15s;
}
.desk-file:hover,
.desk-file:focus-within { background: rgba(255,255,255,0.95); }
.desk-file-main {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 9px 10px 9px 12px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.desk-file-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding-right: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.desk-file:hover .desk-file-actions,
.desk-file:focus-within .desk-file-actions,
.shelf-tree-row:hover .desk-file-actions,
.shelf-tree-row.is-selected .desk-file-actions {
  opacity: 1;
  pointer-events: auto;
}
@media (hover: none) {
  .desk-file-actions {
    opacity: 0.85;
    pointer-events: auto;
  }
}
.desk-file-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: rgba(31, 42, 55, 0.42);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.desk-file-act:hover {
  background: rgba(31, 41, 55, 0.07);
  color: rgba(31, 42, 55, 0.78);
}
.desk-file-feishu:hover {
  background: rgba(51, 112, 255, 0.1);
  color: #3370ff;
}
.desk-file-delete:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}
.shelf-tree-actions {
  margin-left: auto;
  padding-right: 4px;
}
.desk-file-name { font-size: 0.86rem; font-weight: 600; word-break: break-all; }
.desk-file-meta { margin-top: 4px; font-size: 0.72rem; color: var(--muted); }

.shelf-toolbar { margin-bottom: 10px; }

.shelf-explorer {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 10px;
  background: #f3f3f2;
  border: 1px solid rgba(31, 41, 55, 0.08);
  overflow: hidden;
}
.shelf-explorer-head {
  padding: 10px 10px 8px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.07);
  background: rgba(255, 255, 255, 0.55);
}
.shelf-search {
  width: 100%;
  box-sizing: border-box;
  height: 32px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font-size: 0.84rem;
  color: rgba(31, 42, 55, 0.88);
}
.shelf-search::placeholder { color: rgba(31, 42, 55, 0.38); }
.shelf-search:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.08);
}
.shelf-explorer-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.shelf-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: rgba(31, 42, 55, 0.52);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 0.76rem;
  cursor: pointer;
  line-height: 1;
}
.shelf-action-btn:hover:not(:disabled) {
  background: rgba(31, 41, 55, 0.06);
  color: rgba(31, 42, 55, 0.78);
}
.shelf-action-btn.is-active {
  background: rgba(59, 130, 246, 0.1);
  color: rgba(37, 99, 235, 0.92);
}
.shelf-action-btn.is-disabled,
.shelf-action-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}
.shelf-action-label {
  font-size: 0.76rem;
  font-weight: 500;
}

.shelf-tree {
  flex: 1;
  min-height: 120px;
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding: 6px 0 10px;
  background: #f7f7f6;
}
.shelf-tree-row {
  --shelf-depth: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 8px 0 calc(8px + var(--shelf-depth) * 16px);
  color: rgba(31, 42, 55, 0.86);
  cursor: pointer;
  user-select: none;
}
.shelf-tree-row:hover {
  background: rgba(31, 41, 55, 0.04);
}
.shelf-tree-row.is-selected {
  background: #ececeb;
}
.shelf-tree-chevron {
  width: 16px;
  height: 16px;
  border: none;
  background: transparent;
  padding: 0;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}
.shelf-tree-chevron::before {
  content: "";
  position: absolute;
  inset: 3px 5px;
  border-right: 1.5px solid rgba(31, 42, 55, 0.45);
  border-bottom: 1.5px solid rgba(31, 42, 55, 0.45);
  transform: rotate(-45deg);
  transition: transform 0.12s ease;
}
.shelf-tree-chevron.is-open::before {
  transform: rotate(45deg);
}
.shelf-tree-chevron--spacer {
  pointer-events: none;
  visibility: hidden;
}
.shelf-tree-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(31, 42, 55, 0.55);
  border-radius: 3px;
}
.shelf-tree-icon--folder {
  width: 16px;
  height: 14px;
  border: 1.5px solid rgba(31, 42, 55, 0.42);
  border-radius: 2px 3px 3px 3px;
  position: relative;
  background: transparent;
}
.shelf-tree-icon--folder::before {
  content: "";
  position: absolute;
  top: -4px;
  left: -1px;
  width: 8px;
  height: 4px;
  border: 1.5px solid rgba(31, 42, 55, 0.42);
  border-bottom: none;
  border-radius: 2px 2px 0 0;
}
.shelf-tree-icon--md {
  gap: 1px;
  font-size: 0.58rem;
  letter-spacing: -0.02em;
  color: rgba(31, 42, 55, 0.62);
}
.shelf-tree-icon-arrow {
  font-size: 0.52rem;
  line-height: 1;
  transform: translateY(1px);
}
.shelf-tree-icon--image { font-size: 0.72rem; font-weight: 400; }
.shelf-tree-icon--code,
.shelf-tree-icon--data,
.shelf-tree-icon--file {
  font-size: 0.58rem;
  font-weight: 650;
}
.shelf-tree-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.84rem;
  line-height: 1.2;
}
.trash-modal-card { max-width: 640px; width: min(92vw, 640px); }
.trash-modal-body { max-height: min(60vh, 480px); overflow: auto; }
.trash-hint {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
}
.trash-list { display: flex; flex-direction: column; gap: 8px; }
.trash-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(31, 41, 55, 0.08);
  background: rgba(255, 255, 255, 0.65);
}
.trash-row-main { flex: 1; min-width: 0; }
.trash-row-name { font-size: 0.88rem; font-weight: 650; word-break: break-all; }
.trash-row-path {
  margin-top: 4px;
  font-size: 0.76rem;
  color: rgba(31, 42, 55, 0.62);
  word-break: break-all;
}
.trash-row-meta {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--muted);
}
.trash-row-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.trash-row-actions .btn,
.trash-row-actions .btn-primary {
  padding: 6px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}
.shelf-tree-empty {
  padding: 28px 16px;
  text-align: center;
  color: rgba(31, 42, 55, 0.45);
}
.shelf-tree-empty-title {
  font-size: 0.88rem;
  font-weight: 650;
  color: rgba(31, 42, 55, 0.62);
}
.shelf-tree-empty-sub {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.agent-trace {
  margin: 8px 0 12px;
  padding: 0 4px;
}
.agent-trace-block {
  margin-bottom: 10px;
  border-left: 3px solid rgba(59,130,246,0.45);
  padding-left: 12px;
}
.agent-trace-block.done { border-left-color: rgba(34,197,94,0.55); }
.agent-trace-block.failed { border-left-color: rgba(239,68,68,0.55); }
.agent-trace-head {
  font-size: 0.82rem;
  font-weight: 650;
  color: rgba(31,42,55,0.85);
}
.agent-trace-sub {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
  white-space: pre-wrap;
}
.agent-trace-steps {
  margin-top: 6px;
  font-size: 0.76rem;
  color: rgba(31,42,55,0.65);
}
.agent-trace-artifacts {
  margin-top: 6px;
  font-size: 0.76rem;
}
.rightpanel-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.rightpanel-tab {
  border: none;
  background: transparent;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.rightpanel-tab.active {
  background: rgba(59,130,246,0.12);
  color: var(--accent);
}
.meeting-members-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
  line-height: 1.45;
}
.meeting-members {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.meeting-member-card {
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.62);
  padding: 10px 10px 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.meeting-member-card.is-active {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.08);
  background: rgba(255, 255, 255, 0.92);
}
.meeting-member-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.meeting-member-avatar {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}
.meeting-member-meta {
  flex: 1;
  min-width: 0;
}
.meeting-member-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.meeting-member-id {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 1px;
}
.meeting-member-status {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.06);
  color: rgba(31, 41, 55, 0.55);
  white-space: nowrap;
}
.meeting-member-status.is-pulse {
  animation: meeting-member-pulse 1.4s ease-in-out infinite;
}
@keyframes meeting-member-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}
.meeting-member-status--thinking,
.meeting-member-status--working,
.meeting-member-status--tool,
.meeting-member-status--replying,
.meeting-member-status--delegating {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}
.meeting-member-status--acknowledged {
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}
.meeting-member-status--done {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}
.meeting-member-status--failed {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.meeting-member-exec {
  margin-top: 8px;
  height: 72px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(31, 41, 55, 0.04);
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 41, 55, 0.2) transparent;
}
.meeting-member-exec::-webkit-scrollbar {
  width: 5px;
}
.meeting-member-exec::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.18);
}
.meeting-member-exec .meeting-member-detail {
  margin-top: 0;
}
.meeting-member-exec .meeting-member-activities {
  margin-top: 4px;
}
.meeting-member-detail {
  font-size: 0.76rem;
  color: rgba(31, 41, 55, 0.72);
  line-height: 1.4;
  word-break: break-word;
}
.meeting-member-desc {
  margin-top: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.meeting-member-activities {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: disc;
}
.meeting-member-activity {
  font-size: 0.7rem;
  color: rgba(31, 41, 55, 0.58);
  line-height: 1.35;
  margin: 2px 0;
  word-break: break-word;
}
.memory-panel-hint { margin: 0 0 12px; font-size: 0.82rem; }
.memory-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  margin: 12px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.memory-section-title--inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.memory-section-head--sk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 8px;
  position: relative;
  z-index: 2;
}
.memory-section-head--sk .kb-help {
  position: static;
}
.memory-section-head--sk .kb-help-tip {
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  bottom: auto;
  transform: none;
  width: auto;
  max-width: none;
}
.kb-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(31, 41, 55, 0.18);
  background: rgba(255, 255, 255, 0.85);
  cursor: help;
  flex-shrink: 0;
  text-transform: none;
  letter-spacing: 0;
}
.kb-help-mark {
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  color: rgba(31, 42, 55, 0.55);
}
.kb-help-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  width: max-content;
  max-width: 260px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.45;
  color: rgba(31, 42, 55, 0.78);
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.kb-help:hover .kb-help-tip,
.kb-help:focus-visible .kb-help-tip {
  opacity: 1;
  visibility: visible;
}
.system-knowledge-modal-title .kb-help-tip {
  left: auto;
  right: 0;
  top: calc(100% + 8px);
  bottom: auto;
  transform: none;
}
.system-knowledge-entry { margin-bottom: 4px; }
.system-knowledge-open-btn {
  width: 100%;
  justify-content: center;
  gap: 8px;
}
.system-knowledge-count {
  font-size: 0.72rem;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: rgba(37, 99, 235, 0.92);
}
.system-knowledge-count.hidden { display: none; }
.system-knowledge-modal-card { width: min(640px, calc(100vw - 32px)); max-height: min(82vh, 760px); }
.system-knowledge-modal-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
}
.system-knowledge-modal-body { min-height: 280px; }
.system-knowledge-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.system-knowledge-search { margin: 0; }
.system-knowledge-modal-list { max-height: min(52vh, 480px); overflow: auto; }
.system-knowledge-modal-meta { font-size: 0.78rem; color: var(--muted); }
.memory-row-recall-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: rgba(22, 163, 74, 0.95);
}
.memory-row-recall-score {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 650;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.1);
  color: rgba(37, 99, 235, 0.88);
}
.memory-row.is-recalled {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.04);
}
.memory-list { display: flex; flex-direction: column; gap: 4px; }
.memory-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  overflow: hidden;
}
.memory-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.memory-row-main:hover { background: rgba(59, 130, 246, 0.06); }
.memory-row-text {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(31, 42, 55, 0.88);
}
.memory-row-url {
  margin-top: 6px;
  font-size: 0.78rem;
  word-break: break-all;
}
.memory-row-url a {
  color: rgba(59, 130, 246, 0.85);
  text-decoration: none;
}
.memory-row-url a:hover { text-decoration: underline; }

.memory-row-meta {
  flex-shrink: 0;
  font-size: 0.68rem;
  color: var(--muted);
  max-width: 42%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.memory-row-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  flex-shrink: 0;
}
.memory-row-btn {
  border: none;
  background: transparent;
  color: rgba(31, 42, 55, 0.55);
  font-size: 0.78rem;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.memory-row-btn:hover { background: rgba(31, 41, 55, 0.06); color: rgba(31, 42, 55, 0.85); }
.memory-row-btn-primary {
  color: #2563eb;
  background: rgba(59, 130, 246, 0.1);
}
.memory-row-btn-primary:hover { background: rgba(59, 130, 246, 0.18); }
.memory-row-btn-danger:hover { color: #dc2626; }
.memory-row-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.memory-detail-full {
  max-height: min(50vh, 320px);
  overflow: auto;
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(31, 42, 55, 0.9);
  padding: 4px 0;
}
.memory-detail-meta { margin: 10px 0 0; font-size: 0.78rem; }
.memory-archive-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  cursor: pointer;
}
.memory-archive-pick:last-child { border-bottom: none; }
.memory-archive-pick input { margin-top: 4px; flex-shrink: 0; }
.memory-archive-pick-content {
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(31, 42, 55, 0.88);
}
.memory-archive-pick-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 4px;
}
.memory-recall-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  font-size: 0.82rem;
}
.memory-recall-sep { color: var(--muted); }
.memory-recall-toolbar .btn-link {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent, #2563eb);
  cursor: pointer;
  font: inherit;
}
.memory-recall-toolbar .btn-link:hover { text-decoration: underline; }
.memory-pending-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.memory-pending-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px dashed rgba(59,130,246,0.35);
  background: rgba(59,130,246,0.06);
}
.memory-pending-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}
.memory-pending-content {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 10px;
}
.memory-pending-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rightpanel-tab { position: relative; }
.memory-tab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 650;
}
.memory-proposal { max-width: 92%; align-self: flex-start; }
.memory-proposal-inner {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,0.28);
  background: rgba(59,130,246,0.06);
}
.memory-proposal-title { font-weight: 650; margin-bottom: 8px; }
.memory-proposal-content {
  font-size: 0.92rem;
  line-height: 1.55;
  margin-bottom: 12px;
  color: rgba(31,42,55,0.85);
}
.memory-proposal-actions { display: flex; gap: 8px; }
.roles-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.roles-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.roles-editor-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.roles-badge.custom { background: rgba(168,85,247,0.12); color: #7c3aed; }

.agent-trace-artifacts code {
  display: block;
  margin-top: 2px;
  font-size: 0.74rem;
}

/* 可折叠思考过程 */
.think-panel {
  margin: 0 0 10px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.86rem;
  max-width: 100%;
}
.think-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 6px;
  cursor: pointer;
  color: rgba(31, 42, 55, 0.45);
  font-weight: 500;
  font-size: 0.82rem;
  list-style: none;
  user-select: none;
}
.think-summary::-webkit-details-marker { display: none; }
.think-chevron {
  display: inline-block;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.18s ease;
  color: rgba(31, 42, 55, 0.38);
}
.think-panel:not([open]) .think-chevron {
  transform: rotate(-90deg);
}
.think-body {
  padding: 0;
  overflow: visible;
}
.think-quote {
  margin: 0;
  padding: 0 0 0 14px;
  border-left: 2px solid rgba(31, 41, 55, 0.18);
  color: rgba(31, 42, 55, 0.48);
}
.think-prose {
  margin: 0 0 0.65em;
  font-style: italic;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.think-prose:last-child { margin-bottom: 0; }
.think-prose-event { opacity: 0.95; }

.msg {
  max-width: 92%;
  padding: 12px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.95rem;
  line-height: 1.55;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
}
.msg-header { margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.5rem; }
.msg-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid rgba(31,41,55,0.18);
  color: rgba(31,42,55,0.75);
  background: rgba(31,41,55,0.04);
}
.msg-badge.user { border-color: rgba(59,130,246,0.25); color: rgba(31,42,55,0.8); }
.msg-badge.assistant { border-color: rgba(59,130,246,0.35); color: rgba(59,130,246,0.9); }
.msg-badge.plan { border-style: dashed; color: rgba(31,42,55,0.55); }
.msg-badge.error { border-color: rgba(214,69,69,0.6); color: rgba(214,69,69,1); }
.msg-body { white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--user-bg); }
.msg.assistant { align-self: flex-start; background: var(--assistant-bg); }
.msg.error { border-color: rgba(214,69,69,0.55); color: rgba(214,69,69,1); }
.chat-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.chat-item.user .chat-content { align-items: flex-end; }
.chat-reply-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 0.8rem;
  color: rgba(31, 42, 55, 0.5);
}
.chat-reply-status.is-loading .chat-reply-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: chat-reply-pulse 1.1s ease-in-out infinite;
}
@keyframes chat-reply-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1); }
}
.chat-item-footer {
  display: flex;
  gap: 8px;
  margin-top: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.chat-item-footer.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.chat-item:hover .chat-item-footer,
.chat-item:focus-within .chat-item-footer {
  opacity: 1;
  pointer-events: auto;
}
.chat-item.user .chat-item-footer { justify-content: flex-end; }
.msg-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(31,41,55,0.12);
  color: rgba(31,42,55,0.62);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}
.msg-action:hover {
  border-color: rgba(31,41,55,0.22);
  color: rgba(31,42,55,0.88);
  background: #fff;
}
.msg-action-ico { font-size: 0.85rem; line-height: 1; }
.msg.plan {
  align-self: stretch;
  max-width: 100%;
  background: var(--plan-bg);
  border: 1px dashed rgba(31,41,55,0.18);
  font-size: 0.86rem;
  color: var(--muted);
}
.msg.md { white-space: normal; }
.msg.md p { margin: 0.35rem 0; }
.msg.md p:first-child { margin-top: 0; }
.msg.md p:last-child { margin-bottom: 0; }
.msg.md ul, .msg.md ol { margin: 0.35rem 0 0.35rem 1.25rem; }
.msg.md li { margin: 0.15rem 0; }
.msg.md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  background: rgba(31,41,55,0.04);
  border: 1px solid rgba(31,41,55,0.12);
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}
.msg.md pre {
  background: rgba(31,41,55,0.03);
  border: 1px solid rgba(31,41,55,0.10);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  overflow: auto;
}
.msg.md pre code { background: transparent; border: none; padding: 0; }
.msg.md a { color: var(--accent); text-decoration: none; }
.msg.md a:hover { text-decoration: underline; }

.chat-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: min(820px, 96%);
}
.chat-item.user { align-self: flex-end; }
.chat-item.assistant { align-self: flex-start; }
.chat-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  color: rgba(31,42,55,0.70);
  font-size: 0.88rem;
}
.chat-item.user .chat-top { align-self: flex-end; }
.chat-name {
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.2;
}
.chat-avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-shrink: 0;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(31,41,55,0.12);
  background-color: rgba(255,255,255,0.75);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.chat-avatar.has-image {
  border-color: rgba(31,41,55,0.16);
  background-color: #e8e4dc;
}
.chat-avatar.assistant:not(.has-image) {
  background-image:
    radial-gradient(circle at 35% 30%, rgba(59,130,246,0.25), transparent 55%),
    radial-gradient(circle at 70% 70%, rgba(31,41,55,0.12), transparent 60%);
}
.chat-avatar.user:not(.has-image) {
  background-image:
    radial-gradient(circle at 35% 30%, rgba(31,41,55,0.14), transparent 55%);
}
.chat-bubble {
  position: relative;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
  font-size: 0.98rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 100%;
}
.chat-bubble.user {
  background: var(--user-bg);
  border-color: rgba(59,130,246,0.15);
}
.chat-bubble.assistant,
.chat-bubble.assistant-reply {
  background: transparent;
  border: none;
  padding: 4px 2px 8px;
  font-family: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, "Times New Roman", serif;
  color: rgba(31, 42, 55, 0.9);
}
.chat-bubble.error { border-color: rgba(214,69,69,0.55); color: rgba(214,69,69,1); }
.chat-bubble.plan {
  background: var(--plan-bg);
  border: 1px dashed rgba(31,41,55,0.18);
  font-size: 0.95rem;
  color: rgba(31,42,55,0.60);
}
.chat-bubble.md { white-space: normal; }
.chat-bubble.md p { margin: 0.35rem 0; }
.chat-bubble.md p:first-child { margin-top: 0; }
.chat-bubble.md p:last-child { margin-bottom: 0; }
.chat-bubble.md ul, .chat-bubble.md ol { margin: 0.35rem 0 0.35rem 1.25rem; }
.chat-bubble.md li { margin: 0.15rem 0; }
.chat-bubble.md strong {
  font-weight: 650;
  color: rgba(31, 42, 55, 0.92);
}
.chat-bubble.md code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  background: rgba(31,41,55,0.06);
  border: none;
  border-radius: 6px;
  padding: 0.12em 0.4em;
}
.chat-bubble.md pre,
.chat-bubble.md pre.code-block {
  position: relative;
  background: rgba(31,41,55,0.05);
  border: none;
  border-radius: 12px;
  padding: 2.2rem 0.9rem 0.85rem;
  overflow: auto;
  margin: 0.65rem 0;
}
.chat-bubble.md pre code { background: transparent; border: none; padding: 0; font-family: ui-monospace, Menlo, monospace; font-size: 0.84em; }
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(255,255,255,0.9);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.72rem;
  color: rgba(31,42,55,0.55);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.code-copy-btn:hover { color: var(--accent); }
.chat-bubble.md hr {
  border: none;
  border-top: 1px solid rgba(31,41,55,0.1);
  margin: 0.85rem 0;
}
.chat-bubble.md a { color: var(--accent); text-decoration: none; }
.chat-bubble.md a:hover { text-decoration: underline; }
.chat-bubble.md img:not(.chat-image-thumb) {
  max-width: min(240px, 100%);
  max-height: 200px;
  border-radius: 10px;
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 3.5rem 1rem;
  line-height: 1.6;
}

.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 80; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,23,42,0.35); backdrop-filter: blur(4px); }
.modal-card {
  position: relative;
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  margin: 12px auto;
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(31,41,55,0.14);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(15,23,42,0.20);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-head {
  padding: 12px 12px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(31,41,55,0.10);
}
.modal-title { font-size: 1.05rem; font-weight: 750; color: rgba(31,42,55,0.75); }
.modal-body { padding: 12px; overflow: auto; display: grid; gap: 12px; }
.modal-foot {
  padding: 12px;
  border-top: 1px solid rgba(31,41,55,0.10);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-foot .spacer { flex: 1; }
.desk-file-modal-card {
  width: min(880px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
}
.desk-file-modal-close {
  font-size: 1.35rem;
  line-height: 1;
  color: rgba(31, 42, 55, 0.45);
}
.desk-file-modal-meta {
  font-size: 0.78rem;
  color: var(--muted);
}
.desk-file-preview {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.04);
  border: 1px solid rgba(31, 41, 55, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(31, 42, 55, 0.88);
  max-height: min(68vh, 640px);
  overflow: auto;
}
.form-row { display: grid; gap: 8px; }
.label { font-size: 0.9rem; font-weight: 650; color: rgba(31,42,55,0.65); }
.text, .select {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.14);
  background: rgba(255,255,255,0.75);
  padding: 0 12px;
  color: rgba(31,42,55,0.78);
  outline: none;
}
.text:focus, .select:focus { border-color: rgba(59,130,246,0.45); box-shadow: 0 0 0 3px rgba(59,130,246,0.10); }
.row-2 { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.file-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; height: 40px; }
.file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.avatar-preview { display: flex; align-items: center; gap: 12px; }
.muted { font-size: 0.85rem; color: rgba(31,42,55,0.55); line-height: 1.4; }

.schedules-modal-card {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  margin: 16px auto;
}
.schedules-modal-body { display: flex; flex-direction: column; gap: 0; min-height: 0; }
.schedules-hint {
  font-size: 0.82rem;
  color: rgba(31,42,55,0.5);
  margin-bottom: 12px;
  line-height: 1.5;
}
.schedules-list {
  max-height: min(58vh, 520px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#schedulesDetailPanel.hidden { display: none; }
#schedulesListPanel.hidden { display: none; }
.schedules-modal-close,
.schedule-detail-close {
  font-size: 1.35rem;
  line-height: 1;
  color: rgba(31, 42, 55, 0.45);
}
.schedule-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.12);
  background: rgba(255,255,255,0.85);
}
.schedule-card.is-paused { opacity: 0.65; }
.schedule-card-title { font-weight: 650; font-size: 0.95rem; margin-bottom: 4px; }
.schedule-card-meta { font-size: 0.78rem; color: rgba(31,42,55,0.55); line-height: 1.45; }
.schedule-card-instruction {
  margin-top: 8px;
  font-size: 0.82rem;
  color: rgba(31,42,55,0.62);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.schedule-card-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.schedule-card-actions .btn { height: 32px; padding: 0 12px; font-size: 0.82rem; }
.schedule-card-actions .btn:disabled,
.schedule-card-actions .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.schedule-card { cursor: pointer; }
.schedule-card-actions { position: relative; z-index: 1; }
.schedule-card-actions .btn { cursor: pointer; }

.schedule-detail-section { margin-bottom: 16px; }
.schedule-detail-section:last-child { margin-bottom: 0; }
.schedule-detail-label {
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(31, 42, 55, 0.5);
  margin-bottom: 6px;
}
.schedule-detail-value {
  font-size: 0.88rem;
  line-height: 1.55;
  color: rgba(31, 42, 55, 0.82);
  word-break: break-word;
}
.schedule-detail-instruction {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.04);
  border: 1px solid rgba(31, 41, 55, 0.08);
  white-space: pre-wrap;
}
.schedule-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}
.schedule-detail-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.schedule-detail-badge.is-on { background: rgba(34, 197, 94, 0.15); color: #15803d; }
.schedule-detail-badge.is-off { background: rgba(31, 41, 55, 0.08); color: rgba(31, 42, 55, 0.55); }
.schedule-detail-badge.is-run { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; }
.schedule-runs-list { display: flex; flex-direction: column; gap: 8px; }
.schedule-run-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(31, 41, 55, 0.03);
  border: 1px solid rgba(31, 41, 55, 0.08);
}
.schedule-run-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.schedule-run-status { font-size: 0.82rem; font-weight: 600; }
.schedule-run-status.ok { color: #15803d; }
.schedule-run-status.fail { color: #dc2626; }
.schedule-run-status.run { color: #1d4ed8; }
.schedule-run-time { font-size: 0.76rem; color: rgba(31, 42, 55, 0.5); margin-top: 2px; }
.schedule-run-summary {
  margin-top: 6px;
  font-size: 0.8rem;
  color: rgba(31, 42, 55, 0.65);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.schedule-run-open {
  flex-shrink: 0;
  height: 28px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.settings-modal {
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.settings-modal.hidden { display: none !important; }
.settings-modal-card {
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 0;
  z-index: 1;
  background: #f7f4ed;
  overflow: hidden;
}
.settings-shell {
  height: min(720px, calc(100vh - 80px));
  min-height: min(420px, calc(100vh - 80px));
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}
.settings-nav {
  background: rgba(255,255,255,0.55);
  border-right: 1px solid rgba(31,41,55,0.10);
  padding: 16px 12px;
  overflow-y: auto;
  min-height: 0;
}
.settings-modal-close {
  font-size: 1.35rem;
  line-height: 1;
  color: rgba(31, 42, 55, 0.45);
}
.settings-nav-head {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.settings-back {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(31,41,55,0.10);
  background: rgba(255,255,255,0.6);
  color: rgba(31,42,55,0.70);
  cursor: pointer;
}
.settings-nav-title { font-size: 1.05rem; font-weight: 750; color: rgba(31,42,55,0.70); }
.settings-nav-items { display: grid; gap: 6px; margin-top: 8px; }
.settings-nav-item {
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  color: rgba(31,42,55,0.68);
  cursor: pointer;
}
.settings-nav-item .sico { width: 18px; text-align: center; opacity: 0.7; }
.settings-nav-item.active { background: rgba(59,130,246,0.10); color: rgba(31,42,55,0.78); }
.settings-nav-item:disabled { opacity: 0.5; cursor: not-allowed; }

.settings-main {
  padding: 18px 20px 22px;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.settings-main-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0 14px;
}
.settings-main-title {
  font-size: 1.35rem;
  font-weight: 750;
  color: rgba(31,42,55,0.70);
  letter-spacing: 0.2px;
}
.settings-main-body {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: grid;
  place-items: start center;
  width: 100%;
  scrollbar-gutter: stable;
}
.settings-main-body.wide {
  place-items: stretch start;
  max-width: 1040px;
  margin: 0 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  scrollbar-gutter: stable;
}
.settings-main-body.wide .providers-panel,
.settings-main-body.wide .providers-layout,
.settings-main-body.wide .providers-editor-wrap {
  width: 100%;
  max-width: 100%;
}
.center-hint { text-align: center; margin: 8px 0 0; }
.center-hint code { font-size: 0.85em; }
.settings-card {
  width: min(720px, 100%);
  background: transparent;
  border-radius: 18px;
  padding: 14px 8px 18px;
}
.settings-card.center {
  display: grid;
  justify-items: center;
  gap: 14px;
}
.assistant-avatar-wrap {
  position: relative;
  margin-top: 8px;
  width: 78px;
  height: 78px;
  flex-shrink: 0;
}
.assistant-avatar {
  width: 100%;
  height: 100%;
  min-width: 78px;
  min-height: 78px;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid rgba(31, 41, 55, 0.12);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
  background-color: #e8e4dc;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
.settings-card .chat-avatar {
  width: 78px;
  height: 78px;
  min-width: 78px;
  min-height: 78px;
}
.assistant-avatar.has-image {
  background-color: #e8e4dc;
}
.avatar-upload-hint {
  margin-top: -4px;
  margin-bottom: 12px;
}
.profile-card { max-width: 520px; margin: 0 auto; }
.profile-code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.profile-code-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
}
.profile-background {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.settings-textarea {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.85);
}
.settings-textarea:focus {
  outline: 2px solid rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.45);
}
.avatar-upload {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.avatar-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.settings-field { width: min(420px, 100%); }
.settings-check-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 550;
  color: rgba(31,42,55,0.82);
}
.settings-check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
}
.settings-input, .settings-select {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.14);
  background: rgba(255,255,255,0.70);
  padding: 0 14px;
  color: rgba(31,42,55,0.78);
  outline: none;
}
.settings-input.xl { text-align: center; font-size: 1.05rem; font-weight: 650; }
.settings-input:focus, .settings-select:focus { border-color: rgba(59,130,246,0.45); box-shadow: 0 0 0 3px rgba(59,130,246,0.10); }

.model-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  align-items: center;
  width: min(520px, 100%);
}
.model-pill {
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.10);
  background: rgba(31,41,55,0.03);
  display: grid;
  place-items: center;
  color: rgba(31,42,55,0.55);
  font-size: 0.92rem;
}
.settings-muted {
  color: rgba(31,42,55,0.50);
  font-size: 0.88rem;
}
.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.settings-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 650;
  color: rgba(31,42,55,0.65);
  margin-bottom: 6px;
}
.settings-textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 12px;
  border: 1px solid rgba(31,41,55,0.14);
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  background: rgba(255,255,255,0.85);
}
.settings-textarea:focus {
  border-color: rgba(59,130,246,0.45);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.10);
  outline: none;
}

.roles-settings { width: 100%; }
.roles-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 20px;
  width: 100%;
  align-items: start;
}
.roles-list-wrap {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
  padding: 10px;
}
.roles-list-title {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--muted);
  padding: 4px 6px 8px;
}
.roles-list { display: grid; gap: 6px; }
.roles-list-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px;
  background: transparent;
  cursor: pointer;
}
.roles-list-item:hover { background: rgba(59,130,246,0.06); }
.roles-list-item.active {
  background: rgba(59,130,246,0.10);
  border-color: rgba(59,130,246,0.22);
}
.roles-list-name { font-size: 0.88rem; font-weight: 650; }
.roles-list-meta { margin-top: 3px; font-size: 0.72rem; color: var(--muted); }
.roles-list-row { display: flex; flex-direction: column; gap: 2px; }
.roles-badge {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(59,130,246,0.12);
  color: rgba(37,99,235,0.9);
  font-weight: 600;
  vertical-align: middle;
}
.roles-badge.default { background: rgba(34,197,94,0.12); color: rgba(22,163,74,0.95); }

.roles-editor-wrap {
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  padding: 20px 22px;
  min-height: 480px;
}
.roles-editor { width: 100%; max-width: 720px; }
.mono-meta { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.role-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.role-form-block { margin-bottom: 18px; }
.role-model-block {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(59,130,246,0.04);
  border: 1px solid rgba(59,130,246,0.12);
}
.model-mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}
.model-mode-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
}
.model-panel-row { margin-top: 8px; }
.model-panel-row .settings-select,
.model-panel-row .settings-input { width: 100%; max-width: 100%; }
.roles-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.roles-editor-title { font-size: 1rem; font-weight: 700; }
.roles-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 0.84rem;
}
.roles-delegate-list { display: grid; gap: 6px; margin-top: 4px; }
.roles-editor-actions { margin-top: 20px; justify-content: flex-end; }

.slots-panel { width: 100%; }
.slots-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}
.slots-panel-title { font-size: 1rem; font-weight: 700; }
.slots-list { display: grid; gap: 12px; }
.slot-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.6);
}
.slot-row-grid {
  display: grid;
  grid-template-columns: 140px 1fr 1.2fr 1.4fr auto;
  gap: 12px 14px;
  align-items: end;
}
.slot-field .settings-input,
.slot-field .settings-select { width: 100%; }
.slot-field-wide { grid-column: span 1; }
.slot-actions { display: flex; align-items: center; justify-content: flex-end; min-height: 38px; }
.slot-usage { margin-top: 8px; font-size: 0.72rem; }
.slots-actions { margin-top: 20px; justify-content: flex-end; }

.providers-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.providers-layout {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 24px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.providers-layout > * {
  min-width: 0;
}
.providers-list-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.55);
  padding: 12px;
  min-width: 0;
  max-height: calc(100vh - 160px);
  overflow: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}
.providers-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.providers-list-title { font-weight: 700; font-size: 0.85rem; color: var(--muted); }
.btn-icon {
  border: none;
  background: rgba(59,130,246,0.1);
  color: var(--accent);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.providers-list { display: grid; gap: 4px; }
.providers-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.providers-list-item:hover { background: rgba(0,0,0,0.04); }
.providers-list-item.active {
  background: rgba(59,130,246,0.12);
  color: var(--accent);
}
.providers-list-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}
.providers-list-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.providers-list-count {
  font-size: 0.75rem;
  color: var(--muted);
  background: rgba(0,0,0,0.06);
  padding: 2px 8px;
  border-radius: 999px;
}
.prov-active-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.providers-editor-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.65);
  padding: 20px 22px 24px;
  width: 100%;
  min-width: 0;
  max-height: calc(100vh - 160px);
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.providers-editor {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.providers-editor .settings-actions {
  margin-top: 0;
  padding-top: 20px;
  padding-bottom: 4px;
}
.providers-editor-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
}
.providers-editor-head-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.providers-editor-title {
  font-size: 1.05rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.providers-editor-head .mono-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.providers-editor-head-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex-shrink: 1;
  width: min(200px, 100%);
  min-width: 0;
  min-height: 38px;
  align-items: stretch;
}
.providers-editor-head-actions .btn {
  width: 100%;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
  font-size: 0.82rem;
  white-space: nowrap;
}
.providers-editor-head-actions .btn.is-placeholder {
  visibility: hidden;
  pointer-events: none;
}
.btn.danger { color: #dc2626; border-color: rgba(220,38,38,0.35); }
.prov-form-block {
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}
.providers-editor .settings-input,
.providers-editor .settings-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.prov-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}
.prov-apikey-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.prov-apikey-row .settings-input {
  min-width: 0;
  width: 100%;
}
.prov-apikey-row .btn {
  white-space: nowrap;
}
.prov-api-hint,
.prov-models-hint,
.prov-probe-status {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.prov-api-hint,
.prov-models-hint {
  margin: 6px 0 0;
  min-height: 2.6em;
  line-height: 1.45;
  max-width: 100%;
}
.prov-models-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}
.prov-probe-status {
  margin-top: 6px;
  font-size: 0.85rem;
  line-height: 1.45;
  min-height: 2.6em;
  max-width: 100%;
}
.prov-probe-status.is-ok { color: #15803d; }
.prov-probe-status.is-err { color: var(--danger); }
.prov-probe-status.is-muted { color: var(--muted); }
.prov-models-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  min-height: 72px;
  align-content: flex-start;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  box-sizing: border-box;
}
.prov-form-block--models {
  display: block;
  padding-bottom: 8px;
}
.prov-models-empty { margin: 0; width: 100%; }
.prov-model-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(100%, 420px);
  min-width: 0;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(31,41,55,0.12);
  background: rgba(255,255,255,0.85);
  overflow: hidden;
  box-sizing: border-box;
}
.prov-model-chip-label {
  font-size: 0.88rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  flex: 1;
}
.prov-model-chip .prov-model-del {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
}
.prov-model-add-wrap {
  position: relative;
  min-width: 0;
  max-width: 100%;
}
.prov-model-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 20;
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 6px;
}
.prov-model-suggest-item {
  display: block;
  width: 100%;
  max-width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}
.prov-model-suggest-item:hover,
.prov-model-suggest-item.is-active {
  background: var(--accent-soft);
  color: var(--text);
}
.prov-model-suggest-empty {
  padding: 8px 10px;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.45;
}
.tool-models-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.5);
}
.tool-models-title { font-weight: 700; margin-bottom: 14px; }
.tool-models-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 14px;
}
.tool-model-block .settings-select { width: 100%; }
.vision-toggle { margin-bottom: 12px; }

.providers-panel-intro { margin: 0 0 12px; }
.roles-panel-intro { margin: 0 0 12px; max-width: 100%; }
.social-platforms-panel { max-width: 720px; }
.social-platforms-intro { margin-bottom: 18px; }
.social-save-status { font-size: 0.85em; }
.social-save-status.is-pending { color: rgba(31, 42, 55, 0.5); }
.social-save-status.is-ok { color: #15803d; }
.social-save-status.is-err { color: #b91c1c; }
.social-connect-modal { z-index: 86; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
.social-connect-modal.hidden { display: none !important; }
.social-connect-card {
  width: min(1120px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 40px));
  max-height: calc(100vh - 40px);
  margin: 0;
  z-index: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.social-connect-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  background: #fff;
}
.social-connect-tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.social-connect-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(31, 42, 55, 0.62);
  font-size: 0.92rem;
  cursor: pointer;
}
.social-connect-tab:hover { background: rgba(255, 255, 255, 0.55); }
.social-connect-tab.active {
  background: rgba(255, 255, 255, 0.85);
  color: rgba(31, 42, 55, 0.82);
  box-shadow: 0 1px 4px rgba(31, 41, 55, 0.06);
}
.social-connect-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(31, 41, 55, 0.18);
  flex-shrink: 0;
}
.social-connect-tab-dot.is-on {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}
.social-connect-close {
  flex-shrink: 0;
  font-size: 1.35rem;
  line-height: 1;
  color: rgba(31, 42, 55, 0.45);
}
.social-connect-body {
  flex: 1;
  min-height: 320px;
  overflow: auto;
  padding: 28px 24px 32px;
}
.social-connect-body.has-inbox {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.social-connect-empty {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.social-connect-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(31, 41, 55, 0.05);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: rgba(31, 42, 55, 0.35);
}
.social-connect-empty-title {
  margin: 0;
  font-size: 1rem;
  color: rgba(31, 42, 55, 0.55);
}
.social-connect-settings-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.social-connect-settings-ico { opacity: 0.85; }
.social-inbox-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.social-inbox-chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
  background: #fff;
  z-index: 2;
}
.social-inbox-chat-header-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
}
.social-inbox-chat-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.social-inbox-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: #dedede;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.social-inbox-chat-avatar::before,
.social-inbox-chat-avatar::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 1px;
  background: #b0b0b0;
}
.social-inbox-chat-user-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.social-inbox-chat-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.social-inbox-chat-sub {
  font-size: 0.8rem;
  color: rgba(31, 42, 55, 0.45);
}
.social-inbox-gateway-status {
  font-size: 0.75rem;
  color: rgba(31, 42, 55, 0.42);
}
.social-inbox-gateway-status.hidden {
  display: none;
}
.social-inbox-chat-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
}
.social-inbox-chat-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: rgba(31, 42, 55, 0.82);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.social-inbox-chat-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.social-inbox-restart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid rgba(31, 41, 55, 0.12);
  background: #fff;
  color: rgba(31, 42, 55, 0.72);
}
.social-inbox-restart-btn:hover {
  background: rgba(31, 41, 55, 0.04);
  border-color: rgba(31, 41, 55, 0.18);
}
.social-inbox-open-main-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  color: rgba(31, 42, 55, 0.45);
  border-radius: 8px;
}
.social-inbox-open-main-btn:hover {
  color: rgba(31, 42, 55, 0.75);
  background: rgba(31, 41, 55, 0.05);
}
.social-inbox-restart-ico {
  font-size: 1rem;
  line-height: 1;
  opacity: 0.75;
}
.social-inbox-more-btn {
  width: 34px;
  height: 34px;
  font-size: 1rem;
  color: rgba(31, 42, 55, 0.5);
}
.social-inbox-chat {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.social-inbox-chat .chat-item {
  max-width: min(92%, 760px);
}
.social-inbox-chat .chat-item.user {
  align-self: flex-end;
}
.social-inbox-chat .chat-item.user .chat-top {
  display: none;
}
.social-inbox-chat .social-chat-item.user {
  align-self: flex-end;
  max-width: min(78%, 520px);
}
.social-inbox-chat .social-chat-item.user .chat-bubble {
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.95rem;
}
.social-inbox-chat-empty,
.social-inbox-chat-loading {
  margin: auto;
  text-align: center;
  color: rgba(31, 42, 55, 0.45);
  font-size: 0.9rem;
}
.social-inbox-settings-link { height: 32px; padding: 0 12px; font-size: 0.85rem; }
.social-inbox-empty-wrap {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.social-inbox-empty {
  width: 100%;
  padding: 32px 20px;
  text-align: center;
  border-radius: 14px;
  border: 1px dashed rgba(31, 41, 55, 0.12);
  background: rgba(255, 255, 255, 0.45);
}
.social-inbox-empty p { margin: 0 0 8px; }
.social-platform-card {
  border: 1px solid var(--border, #e8e4dc);
  border-radius: 14px;
  padding: 20px 22px;
  margin-bottom: 16px;
  background: var(--surface-elevated, #faf9f7);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.social-platform-card--focus {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.social-platform-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.social-platform-head-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.social-platform-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}
.social-platform-status {
  font-size: 0.85rem;
  color: var(--muted, #8a8278);
}
.social-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  cursor: pointer;
}
.social-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.social-switch-slider {
  position: relative;
  display: block;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d4cfc6;
  transition: background 0.2s;
}
.social-switch-slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}
.social-switch input:checked + .social-switch-slider {
  background: #3b82f6;
}
.social-switch input:checked + .social-switch-slider::after {
  transform: translateX(20px);
}
.social-account-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #ebe7e0);
}
.social-account-title {
  font-weight: 600;
  margin-bottom: 6px;
}
.social-probe-status {
  margin: 8px 0 0;
  font-size: 0.85rem;
}
.social-probe-status.is-ok { color: #15803d; }
.social-probe-status.is-err { color: #b91c1c; }
.social-probe-status.is-muted { color: var(--muted, #8a8278); }

@media (max-width: 860px) {
  .settings-modal { padding: 8px; }
  .settings-modal-card {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
  .settings-shell {
    height: calc(100vh - 16px);
    min-height: 0;
    grid-template-columns: 1fr;
  }
  .settings-nav { display: none; }
  .settings-main { padding: 14px 12px 18px; }
  .roles-layout { grid-template-columns: 1fr; }
  .role-form-grid { grid-template-columns: 1fr; }
  .slot-row-grid { grid-template-columns: 1fr; }
  .providers-layout {
    grid-template-columns: 1fr;
    width: 100%;
  }
  .providers-editor-wrap {
    width: 100%;
    max-width: 100%;
  }
  .prov-form-grid { grid-template-columns: 1fr; }
  .tool-models-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .layout-3 { grid-template-columns: 260px 1fr; }
  .layout-3.sidebar-collapsed { grid-template-columns: 1fr; }
  .rightpanel { display: none; }
}
@media (max-width: 860px) {
  .layout-3 { grid-template-columns: 1fr; }
  .layout-3.sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar-expand-btn { display: none !important; }
  .topbar { grid-template-columns: 1fr auto; }
  .topbar-center { display: none; }
}
