@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
  height: 100vh; overflow: hidden;
  background: #f5f4ef;
  color: #2d2b28;
  -webkit-font-smoothing: antialiased;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px }
::-webkit-scrollbar-track { background: transparent }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 10px }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2) }

/* ---- Animations ---- */
@keyframes fadeUp { from { opacity:0; transform:translateY(12px) } to { opacity:1; transform:translateY(0) } }
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
@keyframes bounce { 0%,80%,100% { transform:translateY(0) } 40% { transform:translateY(-4px) } }

/* ---- Login ---- */
.login-page {
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f5f4ef; padding: 24px;
}
.login-card {
  background: #fff; border-radius: 16px; padding: 48px 40px;
  max-width: 420px; width: 100%;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  animation: fadeUp 0.4s ease-out;
}
.login-card h1 { font-size: 24px; font-weight: 700; color: #1a1915; letter-spacing: -0.02em }
.login-card .sub { color: #8b8780; font-size: 14px; margin-top: 6px }
.login-card label { color: #5d5a54; font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px }
.login-card input {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: #fff; border: 1px solid #e0ddd7;
  color: #1a1915; font-size: 14px; outline: none; transition: border-color 0.2s;
}
.login-card input:focus { border-color: #c77b3f }
.login-btn {
  width: 100%; padding: 12px 0; border-radius: 10px; border: none;
  background: #c77b3f; color: #fff; font-weight: 600; font-size: 15px;
  cursor: pointer; margin-top: 20px; transition: background 0.2s;
}
.login-btn:hover { background: #b56d35 }
.login-btn:disabled { background: #d5d3ce; color: #9e9b95; cursor: default }
.login-tip {
  margin-top: 20px; padding: 14px 16px; border-radius: 10px;
  background: #faf8f5; border: 1px solid #ece9e3;
  color: #8b8780; font-size: 12px; line-height: 1.8;
}
.tab-row { display: flex; gap: 8px; margin-bottom: 24px; justify-content: center }
.tab-btn {
  padding: 8px 20px; border-radius: 8px; border: 1px solid #e0ddd7;
  background: transparent; color: #8b8780; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.tab-btn.active { background: #c77b3f; color: #fff; border-color: #c77b3f }
.login-error { color: #c4553d; font-size: 13px; margin-top: 8px; display: none }

/* ---- Main Layout ---- */
.app { display: flex; height: 100vh }

/* ---- Sidebar ---- */
.sidebar {
  width: 316px; min-width: 316px;
  background: #1a1915; display: flex; flex-direction: column;
  transition: all 0.3s ease;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar.collapsed { width: 0; min-width: 0; overflow: hidden }
.sidebar-header {
  padding: 20px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-header .logo-text { color: #f5f4ef; font-weight: 700; font-size: 15px }
.sidebar-header .logo-sub { color: #6b6860; font-size: 11px; margin-top: 2px }
.sidebar-list { flex: 1; padding: 8px; overflow-y: auto }
.sidebar-list .section-label {
  color: #6b6860; font-size: 11px; font-weight: 600;
  padding: 8px 10px 6px; text-transform: uppercase; letter-spacing: 0.05em;
}
.agent-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer; text-align: left;
  transition: all 0.15s; margin-bottom: 2px;
}
.agent-btn:hover { background: rgba(255,255,255,0.05) }
.agent-btn.active { background: rgba(255,255,255,0.08) }
.agent-btn .icon-box {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
  background: rgba(255,255,255,0.06);
}
.agent-btn.active .icon-box { background: rgba(199,123,63,0.2) }
.agent-btn .name { color: #a09d96; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.agent-btn.active .name { color: #f5f4ef; font-weight: 600 }
.agent-btn .desc { color: #5d5a54; font-size: 11px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.agent-btn .badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px;
  border-radius: 10px; flex-shrink: 0;
  background: rgba(199,123,63,0.15); color: #c77b3f;
}

.sidebar-footer {
  padding: 10px 8px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar-footer button {
  width: 100%; padding: 9px 10px; border-radius: 8px;
  background: transparent; border: none;
  color: #8b8780; font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; text-align: left;
}
.sidebar-footer button:hover { background: rgba(255,255,255,0.05); color: #c7c4bd }
.sidebar-footer button.workspace-nav-btn.active {
  background: rgba(199,123,63,0.18);
  color: #f5f4ef;
}

.sidebar-top {
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.sidebar-brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(199,123,63,0.28), rgba(199,123,63,0.1));
  color: #f5f4ef;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-brand-copy {
  min-width: 0;
}
.sidebar-brand-title {
  color: #f5f4ef;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-action-btn {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  background: transparent;
  color: #d7d2ca;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}
.sidebar-action-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.sidebar-action-btn.full {
  width: 100%;
  text-align: left;
}
.sidebar-action-btn.primary {
  background: rgba(255,255,255,0.045);
  border-color: rgba(255,255,255,0.06);
  color: #fff3e5;
}
.sidebar-action-btn.primary:hover {
  background: rgba(255,255,255,0.08);
}
.sidebar-action-btn.secondary {
  color: #bcb5ab;
}
.sidebar-action-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
  font-size: 13px;
}
.sidebar-action-label {
  color: #f2ede5;
  font-size: 13px;
  font-weight: 650;
}
.sidebar-mode-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-mode-btn {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #9d978f;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}
.sidebar-mode-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #f5f4ef;
}
.sidebar-mode-btn.active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.04);
  color: #f5f4ef;
}
.sidebar-mode-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  flex-shrink: 0;
  font-size: 12px;
}
.sidebar-mode-label {
  color: #f1ece4;
  font-size: 13px;
  font-weight: 650;
}
.sidebar-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px 12px;
}
.sidebar-mode-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-platform-section {
  gap: 0;
}
.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 2px;
}
.sidebar-section-title {
  color: #b1aca4;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}
.sidebar-section-meta {
  color: #6f6b64;
  font-size: 11px;
}
.sidebar-empty-state {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: #8d8881;
  font-size: 12px;
  line-height: 1.7;
}
.sidebar-agent-group-list,
.sidebar-session-list,
.sidebar-workspace-list,
.sidebar-chat-agent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-session-group-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-session-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-session-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.03);
  color: #cfc8bf;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-session-group-toggle:hover {
  background: rgba(255,255,255,0.06);
}
.sidebar-session-group-title {
  font-size: 12px;
  font-weight: 700;
}
.sidebar-session-group-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #8b867e;
  font-size: 11px;
}
.sidebar-session-group-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: #dfd7cd;
  font-weight: 700;
}
.sidebar-session-group-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-chat-agent-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.03);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-chat-agent-card.active {
  border-color: rgba(199,123,63,0.26);
  background: rgba(199,123,63,0.1);
}
.sidebar-chat-agent-open {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 2px;
}
.sidebar-chat-agent-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  font-size: 20px;
  flex-shrink: 0;
}
.sidebar-chat-agent-copy {
  min-width: 0;
  flex: 1;
}
.sidebar-chat-agent-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-chat-agent-name {
  color: #f5f0e8;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-chat-agent-count {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: #d6cec3;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-chat-agent-actions {
  display: flex;
}
.sidebar-chat-agent-new {
  width: 100%;
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #f2ddc5;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-chat-agent-new:hover {
  background: rgba(255,255,255,0.08);
}
.sidebar-agent-group {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.025);
  overflow: hidden;
}
.sidebar-agent-group.active {
  border-color: rgba(199,123,63,0.24);
  background: rgba(199,123,63,0.08);
}
.sidebar-agent-head {
  display: flex;
  align-items: stretch;
  gap: 8px;
  padding: 8px;
}
.sidebar-agent-open {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.sidebar-agent-open:hover {
  background: rgba(255,255,255,0.04);
}
.sidebar-agent-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  font-size: 18px;
  flex-shrink: 0;
}
.sidebar-agent-copy {
  min-width: 0;
  flex: 1;
}
.sidebar-agent-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-agent-name {
  color: #f3efe8;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-agent-count {
  flex-shrink: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: #c9c4bc;
  font-size: 11px;
  font-weight: 700;
}
.sidebar-agent-toggle {
  width: 34px;
  border: none;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: #c8c2bb;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.sidebar-agent-toggle:hover {
  background: rgba(255,255,255,0.09);
  color: #fff;
}
.sidebar-agent-body {
  padding: 0 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sidebar-agent-new-chat {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(199,123,63,0.22);
  background: rgba(199,123,63,0.12);
  color: #f1d6ba;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-agent-new-chat:hover {
  background: rgba(199,123,63,0.22);
}
.sidebar-chat-agent-actions .sidebar-agent-new-chat {
  min-height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #f2ddc5;
  font-size: 12px;
  font-weight: 700;
}
.sidebar-chat-agent-actions .sidebar-agent-new-chat:hover {
  background: rgba(255,255,255,0.08);
}
.sidebar-platform-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.03);
}
.sidebar-platform-card.active {
  border-color: rgba(199,123,63,0.26);
  background: rgba(199,123,63,0.1);
}
.sidebar-platform-open {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.sidebar-platform-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: #fff5e8;
  font-size: 18px;
  flex-shrink: 0;
}
.sidebar-platform-copy {
  min-width: 0;
  flex: 1;
}
.sidebar-platform-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-platform-name {
  color: #f5f0e8;
  font-size: 13px;
  font-weight: 700;
}
.sidebar-platform-meta {
  margin-top: 4px;
  color: #938d84;
  font-size: 11px;
  line-height: 1.45;
}
.sidebar-platform-count {
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: #d6cec3;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-agent-session-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar-more-link {
  padding: 7px 10px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #d6a97c;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.sidebar-more-link:hover {
  background: rgba(255,255,255,0.05);
}
.sidebar-session-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.sidebar-session-open {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.sidebar-session-open.compact {
  padding: 8px 9px;
}
.sidebar-session-open:hover {
  background: rgba(255,255,255,0.07);
}
.sidebar-session-open.is-draft {
  cursor: default;
  border-style: dashed;
  border-color: rgba(199,123,63,0.18);
  background: rgba(199,123,63,0.08);
}
.sidebar-session-row.active .sidebar-session-open {
  border-color: rgba(199,123,63,0.24);
  background: rgba(199,123,63,0.14);
}
.sidebar-session-row.pending-draft.active .sidebar-session-open {
  border-color: rgba(199,123,63,0.3);
  background: rgba(199,123,63,0.18);
}
.sidebar-session-main {
  min-width: 0;
}
.sidebar-session-title {
  color: #ece7de;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-session-meta {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: #827d75;
  font-size: 10px;
}
.sidebar-session-source {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #d8d2ca;
}
.sidebar-session-source.is-platform {
  background: rgba(199,123,63,0.2);
  color: #f5dfc5;
}
.sidebar-session-draft-flag {
  color: #d7b087;
}
.sidebar-session-del {
  width: 28px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: #746f67;
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s ease;
}
.sidebar-session-row:hover .sidebar-session-del {
  opacity: 1;
}
.sidebar-session-del:hover {
  background: rgba(196,85,61,0.18);
  color: #ffb0a2;
}
.sidebar-workspace-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  background: rgba(255,255,255,0.03);
  color: #efe8de;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.sidebar-workspace-link:hover {
  background: rgba(255,255,255,0.07);
}
.sidebar-workspace-link.active {
  border-color: rgba(199,123,63,0.24);
  background: rgba(199,123,63,0.14);
}
.sidebar-workspace-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.06);
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-workspace-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.sidebar-workspace-label {
  color: #f2ede5;
  font-size: 13px;
  font-weight: 700;
}
.sidebar-workspace-desc {
  color: #8d8881;
  font-size: 11px;
  line-height: 1.5;
}
.sidebar-account {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  position: relative;
}
.sidebar-account-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sidebar-account-bar:hover,
.sidebar-account-bar.active {
  background: rgba(255,255,255,0.06);
}
.sidebar-account-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.sidebar-account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(199,123,63,0.18);
  color: #fff6ec;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-account-copy {
  min-width: 0;
}
.sidebar-account-name {
  color: #f2ede5;
  font-size: 13px;
  font-weight: 700;
}
.sidebar-account-role {
  margin-top: 3px;
  color: #8d8881;
  font-size: 11px;
}
.sidebar-account-caret {
  color: #bfb9b0;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-account-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: #23211d;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}
.sidebar-account-popover {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 8px);
  z-index: 20;
}
.sidebar-account-menu button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: #d5d0c8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}
.sidebar-account-menu button:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
}
.sidebar-search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 14, 12, 0.44);
  backdrop-filter: blur(4px);
}
.sidebar-search-panel {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  margin: 56px auto 0;
  border-radius: 22px;
  background: #fdfaf5;
  border: 1px solid #eee3d6;
  box-shadow: 0 24px 60px rgba(32, 24, 18, 0.24);
  overflow: hidden;
  animation: fadeUp 0.18s ease;
}
.sidebar-search-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px 12px;
}
.sidebar-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid #e6ddd1;
  background: #fff;
}
.sidebar-search-icon {
  color: #9c9388;
  font-size: 15px;
}
.sidebar-search-input {
  flex: 1;
  min-height: 48px;
  border: none;
  background: transparent;
  color: #2d2b28;
  font-size: 14px;
  outline: none;
}
.sidebar-search-note {
  padding: 0 20px 12px;
  color: #8b8780;
  font-size: 12px;
  line-height: 1.6;
}
.sidebar-search-body {
  max-height: min(68vh, 720px);
  overflow-y: auto;
  padding: 0 14px 16px;
}
.sidebar-search-group + .sidebar-search-group {
  margin-top: 14px;
}
.sidebar-search-group-title {
  padding: 0 6px 8px;
  color: #8b6c49;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sidebar-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.sidebar-search-result:hover {
  background: #f6efe5;
}
.sidebar-search-result-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #eadfd2;
  color: #6b5846;
  flex-shrink: 0;
}
.sidebar-search-result-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sidebar-search-result-title {
  color: #241d16;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-search-result-meta {
  color: #8b8780;
  font-size: 12px;
  line-height: 1.5;
}
.sidebar-search-empty {
  padding: 28px 20px 34px;
  text-align: center;
  color: #8b8780;
  font-size: 13px;
}

/* ---- Chat Area ---- */
.chat-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #f5f4ef }
.chat-area.workspace-mode { background: #f7f3ec; }
.chat-view { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-header {
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #e8e5df; background: #f5f4ef; flex-shrink: 0;
}
.chat-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.toggle-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid #ddd9d2;
  background: #fff; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: #8b8780; flex-shrink: 0;
}
.toggle-btn:hover { background: #f0ede7 }
.chat-header .agent-icon {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
  background: rgba(199,123,63,0.1);
}
.chat-header.platform .agent-icon {
  background: rgba(199,123,63,0.14);
  color: #8b4f1f;
}
.chat-header.agent .agent-icon {
  background: rgba(199,123,63,0.08);
}
.chat-header-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.chat-header-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.chat-header .agent-title {
  font-weight: 650;
  font-size: 15px;
  color: #1a1915;
  min-width: 0;
}
.chat-header .agent-desc {
  color: #8b8780;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-context-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.chat-context-pill.platform {
  background: rgba(199,123,63,0.12);
  color: #9b5d28;
}
.chat-context-pill.agent {
  background: #ebe7de;
  color: #6c675f;
}
.header-actions { display: flex; gap: 6px; margin-left: auto }
.header-actions button {
  padding: 6px 12px; border-radius: 8px; background: transparent;
  border: 1px solid #ddd9d2; color: #8b8780; font-size: 12px;
  font-weight: 500; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.header-actions button:hover { background: #fff; border-color: #c7c4bd }
.header-actions .clear-btn:hover { background: #fef2f0; border-color: #e8b4a8; color: #c4553d }
.header-model-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #ddd9d2;
  background: #fff;
  color: #5d5a54;
  font-size: 12px;
  font-weight: 500;
  outline: none;
}
.header-model-select:focus { border-color: #c77b3f; }
.header-model-select:disabled {
  color: #857867;
  background: #f4efe6;
  cursor: not-allowed;
}
.chat-knowledge-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px 12px;
  border-bottom: 1px solid #ece7de;
  background: #f7f4ee;
  flex-wrap: wrap;
}
.chat-knowledge-modes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-knowledge-modes .workspace-summary-pill {
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-knowledge-meta {
  color: #857867;
  font-size: 12px;
}
.chat-method-panel {
  margin: 14px auto 0;
  width: min(740px, calc(100% - 48px));
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #eadfce;
  background: #fffaf3;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.chat-method-panel-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.chat-method-panel-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.chat-method-panel-label {
  color: #9b6d3b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.chat-method-panel-copy strong {
  color: #2d2b28;
  font-size: 14px;
}
.chat-method-panel-copy span:last-child {
  color: #7b6e5f;
  font-size: 12px;
  line-height: 1.6;
}
.chat-method-panel-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chat-method-picker {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-method-search-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ddd9d2;
  background: #fff;
  color: #4f4b45;
  font-size: 13px;
  outline: none;
}
.chat-method-search-input:focus {
  border-color: #c77b3f;
}
.chat-method-picker-list {
  display: grid;
  gap: 10px;
}
.chat-method-picker-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e6dfd3;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.chat-method-picker-item:hover,
.chat-method-picker-item.active {
  border-color: #c77b3f;
  box-shadow: 0 8px 20px rgba(199,123,63,0.08);
  transform: translateY(-1px);
}
.chat-method-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.chat-method-picker-head strong {
  color: #2d2b28;
  font-size: 14px;
}
.chat-method-picker-head span {
  color: #9a8a74;
  font-size: 12px;
  white-space: nowrap;
}
.chat-method-picker-desc {
  color: #5f5951;
  font-size: 13px;
  line-height: 1.7;
}
.chat-method-picker-meta {
  margin-top: 6px;
  color: #968672;
  font-size: 12px;
}
.pending-action-banner {
  margin: 14px auto 0;
  width: min(740px, calc(100% - 48px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #eadfce;
  background: linear-gradient(180deg, #fffaf3 0%, #f9f1e6 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.pending-action-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.pending-action-copy strong {
  color: #2d2b28;
  font-size: 13px;
  line-height: 1.5;
}
.pending-action-kicker {
  color: #9b6d3b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Messages */
.messages { flex: 1; overflow-y: auto; padding: 0; background: #f5f4ef }
.messages-inner {
  max-width: 740px; margin: 0 auto; padding: 28px 24px 16px;
}
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 10px; animation: fadeIn 0.5s ease;
  padding: 40px 24px;
}
.empty-kicker {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #ebe7de;
  color: #7b756d;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.empty-state.platform .empty-kicker {
  background: rgba(199,123,63,0.12);
  color: #975a27;
}
.empty-icon {
  width: 64px; height: 64px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; font-size: 32px;
  background: rgba(199,123,63,0.08);
}
.empty-state.platform .empty-icon {
  background: rgba(199,123,63,0.12);
}
.empty-title { font-weight: 700; font-size: 20px; color: #1a1915 }
.empty-desc {
  color: #8b8780;
  font-size: 14px;
  line-height: 1.7;
  max-width: 560px;
  text-align: center;
}
.empty-capability-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 560px;
}
.empty-capability-pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e3dfd8;
  color: #6a665f;
  font-size: 12px;
  font-weight: 600;
}
.quick-btns { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; max-width: 500px }
.quick-btn {
  padding: 8px 16px; border-radius: 20px; background: #fff;
  border: 1px solid #e0ddd7; color: #5d5a54; font-size: 13px;
  cursor: pointer; transition: all 0.2s;
}
.quick-btn:hover { border-color: #c77b3f; color: #c77b3f; background: #fdf9f5 }

/* Message Rows */
.msg-row { margin-bottom: 4px; }
.msg-row.user { display: flex; justify-content: flex-end; align-items: flex-start; padding: 8px 0 }
.msg-row.assistant { display: flex; justify-content: flex-start; align-items: flex-start; padding: 12px 0 }
.msg-row.is-streaming { animation: none; }
.msg-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: flex-start;
  align-items: flex-start;
  height: auto;
  max-width: min(68%, 520px);
}
.msg-row.user .msg-stack {
  align-items: flex-end;
  max-width: min(72%, 560px);
}
.msg-bubble {
  display: inline-flex;
  align-items: flex-start;
  width: auto;
  max-width: 100%;
  height: auto;
  min-height: 0;
  padding: 9px 14px; font-size: 14px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  vertical-align: top;
}
.msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}
.msg-row.user .msg-bubble {
  background: #c77b3f; color: #fff; border-radius: 18px 18px 4px 18px;
}
.msg-row.assistant .msg-bubble {
  background: #fff; color: #2d2b28; border-radius: 18px 18px 18px 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.msg-bubble.live {
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.typing-dots { display: flex; gap: 5px; padding: 6px 0; align-items: center }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: #c7c4bd;
  animation: bounce 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s }
.typing-dots span:nth-child(3) { animation-delay: 0.3s }
.msg-citations {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #eadfce;
  background: #fbf7f1;
  padding: 12px;
}
.search-payload-card {
  width: 100%;
  border-radius: 16px;
  border: 1px solid #eadfce;
  background: #fffdfa;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.search-payload-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-payload-scope {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(199,123,63,0.12);
  color: #9b612d;
  font-size: 11px;
  font-weight: 700;
}
.search-payload-head strong {
  color: #2c2823;
  font-size: 13px;
  line-height: 1.6;
}
.search-payload-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-payload-provenance,
.search-payload-explanation {
  font-size: 12px;
  line-height: 1.6;
}
.search-payload-provenance {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff7ec;
  border: 1px solid #f0dfc6;
  color: #7c5c39;
  font-weight: 700;
}
.search-payload-explanation {
  color: #7a6955;
}
.search-payload-suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.search-payload-suggestion-label {
  font-size: 12px;
  font-weight: 700;
  color: #8b6c49;
}
.search-payload-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-payload-suggestion-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f7efe3;
  border: 1px solid #e8d8c3;
  color: #7a5c3b;
  font-size: 12px;
  font-weight: 700;
}
.search-payload-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f5ede2;
  color: #7f6347;
  font-size: 11px;
  font-weight: 700;
}
.search-payload-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.search-payload-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.search-payload-top-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.search-payload-top-card {
  border: 1px solid #e6dbc9;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf2 0%, #fff 100%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.search-payload-top-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.search-payload-top-card-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.search-payload-top-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-payload-group {
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #efe6da;
}
.search-payload-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.search-payload-group-title {
  color: #2d2924;
  font-size: 13px;
  font-weight: 700;
}
.search-payload-group-meta {
  color: #8a7b68;
  font-size: 12px;
}
.search-payload-hit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-payload-hit {
  border: 1px solid #ece2d5;
  border-radius: 12px;
  background: #fcfaf7;
  overflow: hidden;
}
.search-payload-hit summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}
.search-payload-hit summary::-webkit-details-marker {
  display: none;
}
.search-payload-hit-title {
  color: #2d2924;
  font-size: 13px;
  font-weight: 700;
}
.search-payload-hit-meta {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: #8a7b68;
  font-size: 12px;
}
.search-payload-hit-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.search-payload-hit-type.exact {
  background: rgba(78, 154, 106, 0.12);
  color: #2e7b46;
}
.search-payload-hit-type.related {
  background: rgba(199, 123, 63, 0.12);
  color: #9b612d;
}
.search-payload-hit-type.semantic {
  background: rgba(118, 95, 72, 0.12);
  color: #6f5842;
}
.search-payload-hit-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 14px 14px;
}
.search-payload-hit-snippet {
  color: #4c463e;
  font-size: 13px;
  line-height: 1.7;
}
.search-payload-hit-snippet.strong {
  font-size: 14px;
  line-height: 1.8;
}
.search-payload-hit-note {
  color: #8b6c49;
  font-size: 12px;
  line-height: 1.6;
}
.search-payload-hit-provenance,
.search-payload-hit-match {
  font-size: 12px;
  line-height: 1.6;
}
.search-payload-hit-provenance {
  color: #8b6c49;
  font-weight: 700;
}
.search-payload-hit-match {
  color: #6f5842;
}
.search-payload-hit-why {
  color: #7a6955;
  font-size: 12px;
  line-height: 1.6;
}
.search-payload-hit-raw {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7f2ea;
}
.search-payload-hit-raw-label {
  color: #8a7b68;
  font-size: 11px;
  font-weight: 700;
}
.search-payload-hit-raw-text {
  color: #3a342f;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.search-hit-highlight {
  background: rgba(199,123,63,0.2);
  color: #7a4518;
  padding: 0 2px;
  border-radius: 4px;
  font-weight: 700;
}
.msg-citations-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9b7b57;
  margin-bottom: 8px;
}
.explanation-card {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #eadfce;
  background: #fffdfa;
  overflow: hidden;
}
.explanation-card summary {
  list-style: none;
  cursor: pointer;
  padding: 11px 12px;
  color: #5e5040;
  font-size: 12px;
  font-weight: 600;
}
.explanation-card summary::-webkit-details-marker {
  display: none;
}
.explanation-card[open] summary {
  border-bottom: 1px solid #f0e7dc;
  background: #fcf6ee;
}
.explanation-card.compact summary {
  padding: 10px 12px;
}
.explanation-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.explanation-card-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.explanation-card-label {
  color: #9b7b57;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.explanation-card-row strong {
  color: #2d2b28;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
}
.explanation-card-hit-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.citation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.citation-card {
  border-radius: 12px;
  border: 1px solid #eadfce;
  background: #fffdf9;
  padding: 10px 12px;
}
.citation-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.citation-file {
  font-size: 13px;
  font-weight: 700;
  color: #3d2e20;
}
.citation-rank {
  flex-shrink: 0;
  font-size: 11px;
  color: #9b7b57;
  background: #f7ede0;
  border-radius: 999px;
  padding: 3px 8px;
}
.citation-kb {
  font-size: 12px;
  color: #7c6956;
  margin-bottom: 6px;
}
.citation-snippet {
  font-size: 12px;
  color: #4b3c2f;
  line-height: 1.6;
}
.task-citation-list {
  margin-top: 8px;
}

/* Error */
.error-bar {
  max-width: 720px; margin: 0 auto; padding: 10px 16px; border-radius: 10px;
  background: #fef2f0; border: 1px solid #f0d0c8; color: #c4553d;
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.error-bar .close { background: none; border: none; color: #c4553d; cursor: pointer; font-weight: 700; font-size: 16px }

/* Input Area */
.input-area {
  padding: 0 24px 24px; background: #f5f4ef; flex-shrink: 0;
}
.input-wrapper {
  max-width: 720px; margin: 0 auto;
}
.input-row {
  display: flex; gap: 10px; align-items: flex-end;
  background: #fff; border-radius: 16px; padding: 8px 8px 8px 18px;
  border: 1px solid #e0ddd7; transition: border-color 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.input-row:focus-within { border-color: #c77b3f; box-shadow: 0 2px 12px rgba(199,123,63,0.08) }
.input-row textarea {
  flex: 1; padding: 8px 0; border: none; background: transparent;
  color: #2d2b28; font-size: 14px; line-height: 1.5;
  resize: none; max-height: 120px;
  font-family: inherit; outline: none;
}
.input-row textarea::placeholder { color: #b5b2ab }
.send-btn {
  width: 36px; height: 36px; border-radius: 10px; border: none;
  color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
  background: #c77b3f;
}
.send-btn:disabled { background: #e0ddd7 !important; color: #b5b2ab; cursor: default }
.send-btn:not(:disabled):hover { background: #b56d35 }
.input-meta {
  display: flex; justify-content: space-between; margin-top: 8px; padding: 0 4px;
  color: #b5b2ab; font-size: 11px;
}
.input-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding: 0 4px;
}
.content-save-trigger {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e0ddd7;
  background: #fff;
  color: #5d5a54;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.content-save-trigger:hover { border-color: #c77b3f; color: #c77b3f; background: #fdf9f5 }
.content-save-trigger:disabled {
  border-color: #ece9e3;
  background: #faf8f5;
  color: #b5b2ab;
  cursor: not-allowed;
}
.input-tools-hint {
  color: #a7a39c;
  font-size: 11px;
}

.btn-row,
.workspace-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 20px;
}
.btn-cancel {
  padding: 9px 20px; border-radius: 8px; border: 1px solid #e0ddd7;
  background: #fff; color: #8b8780; font-weight: 500; font-size: 14px; cursor: pointer;
}
.btn-cancel:hover { background: #faf8f5 }
.btn-cancel.btn-compact {
  padding: 8px 12px;
  font-size: 12px;
}
.btn-save {
  padding: 9px 20px; border-radius: 8px; border: none;
  background: #c77b3f; color: #fff; font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn-save:hover { background: #b56d35 }
.btn-delete {
  padding: 5px 10px; border-radius: 6px; border: 1px solid #f0d0c8;
  background: #fff; color: #c4553d; font-size: 12px; cursor: pointer;
}
.btn-delete:hover { background: #fef2f0 }
.btn-delete:disabled,
.btn-save:disabled {
  cursor: not-allowed; opacity: 0.55;
}
.btn-delete:disabled:hover,
.btn-save:disabled:hover {
  background: inherit;
}

/* ---- Workspace ---- */
.workspace-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.workspace-header {
  padding: 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #e8e0d5;
  background: #f8f4ed;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.workspace-header-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.workspace-header-copy {
  min-width: 0;
}
.workspace-title {
  font-size: 15px;
  font-weight: 700;
  color: #241d16;
}
.workspace-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: #8b8780;
}
.workspace-back-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
}
.workspace-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 20px 24px;
}
.workspace-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.workspace-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.workspace-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 0 0 8px;
  background: #f7f3ec;
}
.workspace-page-copy h2 {
  font-size: 20px;
  color: #241d16;
  margin-bottom: 0;
}
.workspace-page-copy p {
  color: #8b8780;
  font-size: 13px;
  line-height: 1.6;
}
.workspace-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0 0 12px;
  background: #fff;
}
.workspace-toolbar h3 {
  margin-bottom: 4px;
}
.workspace-toolbar-note,
.workspace-list-meta {
  color: #8b8780;
  font-size: 12px;
  line-height: 1.6;
}
.workspace-search {
  width: min(360px, 100%);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #dfd7cb;
  background: #fff;
  color: #2d2b28;
  font-size: 14px;
  outline: none;
}
.workspace-search:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
}
.workspace-page a {
  color: #a15a28;
  text-decoration: none;
}
.workspace-page a:hover {
  text-decoration: underline;
}
.workspace-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.workspace-panel-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff8ec;
  border: 1px solid #f2ddba;
  color: #9c5c22;
  font-size: 12px;
  font-weight: 600;
}
.workspace-choice-grid {
  align-items: start;
}
.workspace-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.workspace-collapsible {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2dbcf;
}
.workspace-collapsed-note {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #faf8f5;
  border: 1px dashed #ddd3c4;
  color: #8b8780;
  font-size: 13px;
}
.workspace-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.workspace-summary-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #eadfce;
  color: #6d6155;
  font-size: 12px;
}
.workspace-summary-pill.active {
  background: #fff4e8;
  border-color: #ddb27c;
  color: #8f5c27;
}
.workspace-inline-tip {
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #faf8f5;
  border: 1px dashed #ddd3c4;
  color: #8b8780;
  font-size: 13px;
  line-height: 1.7;
}
.workspace-search.compact {
  width: 100%;
  min-width: 0;
  padding: 8px 12px;
  font-size: 13px;
}
.choice-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid #e2dacc;
  background: #fff;
  color: #5d5a54;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.choice-chip:hover {
  border-color: #d0b08c;
  background: #fff9f3;
  color: #9c5c22;
}
.choice-chip.active {
  border-color: #c77b3f;
  background: #fff1e1;
  color: #9c5c22;
  box-shadow: 0 0 0 2px rgba(199,123,63,0.08);
}
.task-lock-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.task-lock-picker {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-lock-search-row {
  display: flex;
}
.task-lock-filter-row {
  display: flex;
}
.task-lock-filter-row .choice-chip-row {
  width: 100%;
  gap: 8px;
}
.task-lock-filter-row .choice-chip {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
}
.task-lock-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.task-lock-selected {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-lock-selected-label {
  color: #8b8780;
  font-size: 11px;
  font-weight: 700;
}
.task-lock-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.task-lock-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e4c7a8;
  background: #fff3e3;
  color: #8f5523;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.task-lock-chip:hover {
  background: #ffeed8;
}
.task-lock-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid #e6dfd2;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.task-lock-item:hover {
  border-color: #d4b99c;
  background: #fffaf5;
}
.task-lock-item.active {
  border-color: #c77b3f;
  background: #fff4e8;
  box-shadow: 0 0 0 2px rgba(199,123,63,0.08);
}
.task-lock-title {
  color: #2d2b28;
  font-size: 13px;
  font-weight: 600;
}
.task-lock-meta {
  color: #8b8780;
  font-size: 11px;
  line-height: 1.5;
}
.task-lock-empty {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed #ddd3c4;
  background: #faf8f5;
  color: #8b8780;
  font-size: 12px;
}
.task-method-hint {
  margin-top: 14px;
}
.task-center-page {
  position: relative;
  gap: 14px;
}
.task-center-shell,
.task-detail-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.task-center-hero {
  padding: 4px 2px 0;
}
.task-center-hero-copy {
  max-width: 720px;
}
.task-center-kicker {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #efe6d8;
  color: #8d6438;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.task-center-hero h2 {
  margin: 12px 0 8px;
  color: #241d16;
  font-size: 30px;
  line-height: 1.2;
}
.task-center-hero p {
  color: #73685b;
  font-size: 14px;
  line-height: 1.75;
}
.task-compose-card,
.task-history-card,
.task-detail-card,
.task-result-card {
  background: #f8f3ea;
  border: 1px solid #e7ddcf;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.task-compose-card {
  padding: 22px 24px 20px;
  background: linear-gradient(180deg, #f4eee4 0%, #f0e9dd 100%);
}
.task-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.task-compose-copy h3 {
  font-size: 18px;
  color: #241d16;
  margin-bottom: 0;
}
.task-compose-subtitle {
  color: #7d7264;
  font-size: 14px;
  line-height: 1.6;
}
.task-agent-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.task-agent-select-copy label,
.task-compose-field label,
.task-main-field label,
.task-advanced-panel .field label {
  display: block;
  color: #4e4032;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.task-agent-select-copy p {
  color: #817769;
  font-size: 12px;
  line-height: 1.6;
  max-width: 460px;
}
.task-agent-select-wrap {
  width: min(280px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-agent-select {
  width: 100%;
  min-height: 46px;
  padding: 0 42px 0 14px;
  border-radius: 14px;
  border: 1px solid #ddd6ca;
  background-color: #fffdfa;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%23817669' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
  color: #2d2b28;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  appearance: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.85);
}
.task-agent-select:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
}
.task-agent-current {
  display: inline-flex;
  align-items: center;
  height: 26px;
  width: fit-content;
  max-width: 100%;
  padding: 0 10px;
  border-radius: 999px;
  background: #f2eee7;
  color: #665d53;
  font-size: 12px;
  font-weight: 600;
}
.task-agent-current.platform {
  background: #f6ede2;
  color: #9c5c22;
}
.task-context-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #faf7f1;
  border: 1px solid #ede1cf;
  color: #6c6155;
  font-size: 12px;
}
.task-context-label {
  color: #9a9188;
}
.task-context-value {
  color: #4e4032;
  font-weight: 700;
}
.task-compose-field + .task-compose-field,
.task-main-field {
  margin-top: 16px;
}
.task-compose-card input[type=text],
.task-compose-card textarea,
.task-compose-card select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #ddd6ca;
  background: #fffdfa;
  color: #2d2b28;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.task-compose-card input[type=text]:focus,
.task-compose-card textarea:focus,
.task-compose-card select:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
  background: #fff;
}
.task-choice-row .choice-chip-row {
  gap: 10px;
}
.task-choice-row .choice-chip {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 14px;
  background: #f3efe8;
  border-color: #dfd6c9;
}
.task-main-input {
  width: 100% !important;
  min-height: 216px !important;
  padding: 20px 20px !important;
  border-radius: 20px !important;
  border: 1px solid #e1d8c9 !important;
  background: #fffdf9 !important;
  font-size: 15px !important;
  line-height: 1.75 !important;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.task-main-input:focus {
  border-color: #c77b3f !important;
  box-shadow: 0 0 0 4px rgba(199,123,63,0.08);
}
.task-compose-footnote {
  margin-top: 12px;
  color: #8b8780;
  font-size: 12px;
  line-height: 1.6;
}
.task-compose-actions {
  margin-top: 18px;
}
.task-compose-actions .btn-save {
  min-width: 132px;
}
.task-advanced-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e5dbce;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.task-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.task-advanced-textarea {
  margin-bottom: 0;
}
.task-advanced-locks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.task-advanced-heading {
  color: #8b8780;
  font-size: 12px;
  font-weight: 600;
}
.task-lock-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.task-lock-grid.compact .field {
  margin-bottom: 0;
}
.task-lock-picker {
  gap: 8px;
}
.task-lock-list {
  max-height: 168px;
}
.task-lock-item {
  padding: 10px 11px;
}
.task-history-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f4eee4 0%, #f1eadf 100%);
}
.task-history-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.task-history-head h3 {
  margin-bottom: 4px;
  color: #241d16;
  font-size: 16px;
}
.task-history-tools {
  width: min(360px, 100%);
}
.task-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 500px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid #eadfce;
  background: rgba(255,251,245,0.78);
}
.task-history-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 1px 0 rgba(255,255,255,0.72);
  transition: all 0.15s ease;
}
.task-history-row:hover {
  border-color: #d8c1a4;
  background: #fff;
  transform: translateY(-1px);
}
.task-history-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.task-history-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-history-type {
  color: #2c241d;
  font-size: 13px;
  font-weight: 700;
}
.task-history-mode {
  color: #7a6f64;
  font-size: 12px;
  font-weight: 600;
}
.task-history-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.task-history-status.pending {
  background: #fff7ed;
  color: #b45309;
}
.task-history-status.success {
  background: #ecfdf3;
  color: #047857;
}
.task-history-status.failed {
  background: #fef2f2;
  color: #b91c1c;
}
.task-history-agent {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1ece4;
  color: #685f55;
  font-size: 11px;
  font-weight: 700;
}
.task-history-agent.platform {
  background: #f6ede2;
  color: #9c5c22;
}
.task-history-summary {
  color: #2d2b28;
  font-size: 13px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.task-history-meta {
  color: #8b8780;
  font-size: 12px;
}
.task-history-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-history-chip {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #faf6ef;
  border: 1px solid #eee0ca;
  color: #6c6155;
  font-size: 11px;
  font-weight: 600;
}
.task-history-open {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid #e3d9cb;
  background: #fff;
  color: #6d6155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.task-history-open:hover {
  border-color: #cfb08d;
  background: #fff8f0;
  color: #9c5c22;
}
.task-detail-topbar {
  padding-bottom: 0;
  background: transparent;
}
.task-detail-card {
  padding: 22px 24px;
  background: linear-gradient(180deg, #f7f3ec 0%, #f4efe6 100%);
}
.task-detail-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.task-detail-summary {
  color: #241d16;
  font-size: 16px;
  line-height: 1.8;
}
.task-detail-extra {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #faf7f1;
  border: 1px solid #efe3d4;
  color: #6d6155;
  font-size: 13px;
  line-height: 1.7;
}
.task-detail-meta {
  margin-top: 12px;
  color: #8b8780;
  font-size: 12px;
}
.task-detail-reference-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.task-detail-reference-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.task-detail-reference-label {
  color: #8b8780;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.task-detail-chip-row {
  margin-top: 0;
}
.task-result-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.task-result-card {
  padding: 18px 20px;
  background: linear-gradient(180deg, #f8f4ed 0%, #f5f0e7 100%);
}
.task-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.task-result-copy {
  min-width: 0;
  flex: 1;
}
.task-result-title {
  color: #241d16;
  font-size: 16px;
  font-weight: 700;
}
.task-result-meta {
  margin-top: 6px;
  color: #8b8780;
  font-size: 12px;
  line-height: 1.6;
}
.task-result-body {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid #e7dfd4;
  background: #fdfcf9;
  color: #2d2b28;
  font-size: 14px;
  line-height: 1.85;
}
.release-center-page {
  position: relative;
}
.release-center-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 16px;
}
.release-center-list-card,
.release-center-detail-card {
  border-radius: 24px;
  border: 1px solid #e7ddcf;
  background: linear-gradient(180deg, #f6f0e6 0%, #f2ebdf 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.release-center-list-card {
  padding: 16px;
}
.release-center-detail-card {
  padding: 22px 24px;
}
.release-center-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.release-center-head h3 {
  margin-bottom: 4px;
  color: #241d16;
  font-size: 16px;
}
.release-version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.release-version-row {
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: #fffdfa;
  cursor: pointer;
  transition: all 0.15s ease;
}
.release-version-row:hover,
.release-version-row.active {
  border-color: #d2b391;
  background: #fff7ee;
}
.release-version-topline,
.release-detail-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.release-version-number {
  color: #8f5523;
  font-size: 12px;
  font-weight: 800;
}
.release-version-date {
  color: #8b8780;
  font-size: 12px;
}
.release-version-title {
  margin-top: 8px;
  color: #241d16;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}
.release-detail-head h2 {
  margin: 10px 0 0;
  color: #241d16;
  font-size: 22px;
  line-height: 1.35;
}
.release-detail-note {
  margin-top: 10px;
  color: #6d6155;
  font-size: 14px;
  line-height: 1.7;
}
.release-change-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}
.release-change-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #e9dece;
  background: #fffdfa;
}
.release-change-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 76px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.release-change-tag.feature {
  background: #eef8f1;
  color: #166534;
}
.release-change-tag.ui {
  background: #eef4ff;
  color: #1d4ed8;
}
.release-change-tag.architecture {
  background: #f6ecff;
  color: #7c3aed;
}
.release-change-tag.fix {
  background: #fff5e8;
  color: #c2410c;
}
.release-change-detail {
  color: #2d2b28;
  font-size: 14px;
  line-height: 1.7;
}
.learning-center-page {
  position: relative;
  gap: 14px;
}
.learning-center-shell,
.learning-detail-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.learning-center-hero {
  padding: 4px 2px 0;
}
.learning-center-hero-copy {
  max-width: 760px;
}
.learning-center-hero-copy h2 {
  margin: 12px 0 8px;
  color: #241d16;
  font-size: 30px;
  line-height: 1.2;
}
.learning-center-hero-copy p {
  color: #73685b;
  font-size: 14px;
  line-height: 1.75;
}
.learning-compose-card,
.learning-list-card,
.learning-detail-card {
  background: #f8f3ea;
  border: 1px solid #e7ddcf;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.learning-compose-topbar {
  padding-bottom: 0;
  background: transparent;
}
.learning-compose-card {
  padding: 22px 24px 20px;
  background: linear-gradient(180deg, #f4eee4 0%, #f0e9dd 100%);
}
.learning-main-field,
.learning-inline-grid {
  margin-top: 16px;
}
.learning-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.learning-inline-field label,
.learning-main-field label,
.learning-advanced-panel .learning-inline-field label {
  display: block;
  color: #4e4032;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}
.learning-compose-card input[type=text],
.learning-compose-card textarea,
.learning-compose-card select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #ddd6ca;
  background: #fffdfa;
  color: #2d2b28;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.learning-compose-card input[type=text]:focus,
.learning-compose-card textarea:focus,
.learning-compose-card select:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
  background: #fff;
}
.learning-main-input {
  min-height: 220px !important;
  padding: 20px !important;
  border-radius: 20px !important;
  border: 1px solid #e1d8c9 !important;
  background: #fffdf9 !important;
  font-size: 15px !important;
  line-height: 1.8 !important;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.learning-main-input:focus {
  border-color: #c77b3f !important;
  box-shadow: 0 0 0 4px rgba(199,123,63,0.08);
}
.learning-inline-tip {
  margin-top: 14px;
}
.learning-advanced-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed #e5dbce;
}
.learning-advanced-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.learning-note-field {
  margin-top: 14px;
}
.learning-note-field textarea {
  min-height: 88px;
}
.learning-list-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f4eee4 0%, #f2eadf 100%);
}
.learning-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.learning-list-head h3 {
  margin-bottom: 4px;
  color: #241d16;
  font-size: 16px;
}
.learning-list-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.learning-type-tab-row {
  margin-bottom: 10px;
}
.learning-scope-row {
  margin-bottom: 12px;
}
.learning-filter-row {
  margin-bottom: 12px;
}
.learning-case-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid #eadfce;
  background: rgba(255,251,245,0.78);
}
.learning-case-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 1px 0 rgba(255,255,255,0.72);
  transition: all 0.15s ease;
}
.learning-case-row:hover {
  border-color: #d8c1a4;
  background: #fff;
  transform: translateY(-1px);
}
.learning-case-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.learning-case-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.learning-case-title {
  color: #241d16;
  font-size: 16px;
  font-weight: 700;
}
.learning-case-summary {
  color: #3d352d;
  font-size: 13px;
  line-height: 1.72;
}
.learning-empty-box {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(255, 251, 245, 0.86);
  border-style: dashed;
}
.learning-case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.learning-case-meta {
  color: #8b8780;
  font-size: 12px;
}
.learning-case-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.learning-detail-topbar {
  padding-bottom: 0;
  background: transparent;
}
.learning-detail-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.learning-detail-card {
  padding: 22px 24px;
  background: linear-gradient(180deg, #f7f3ec 0%, #f4efe6 100%);
}
.learning-detail-card h3 {
  color: #241d16;
  font-size: 15px;
  margin-bottom: 12px;
}
.learning-detail-signals,
.learning-detail-tags {
  margin-top: 14px;
}
.learning-evidence-card {
  background: #fffdfa;
  border-color: #e8dfd3;
}
.learning-core-grid,
.learning-judgment-grid {
  margin-top: 14px;
}
.learning-core-item strong {
  line-height: 1.7;
}
.learning-deep-dive-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.learning-method-actions {
  margin-top: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.learning-detail-page {
  --color-background-primary: #ffffff;
  --color-background-secondary: #f6f4ef;
  --color-background-tertiary: #f8f6f2;
  --color-border-tertiary: #e7e1d6;
  --color-border-secondary: #d8cfbf;
  --color-text-primary: #2d2b28;
  --color-text-secondary: #6f675d;
  --color-text-info: #2f6fed;
  --font-mono: "SFMono-Regular", "Menlo", "Monaco", monospace;
}

.learning-text-card {
  margin: 0 0 24px;
  padding: 20px 24px;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 12px;
  box-shadow: none;
}

.learning-text-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.learning-text-toggle-btn {
  flex-shrink: 0;
}

.learning-text-card .clib-detail-body {
  padding: 0;
  border: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.8;
}

.learning-text-preview-note {
  margin-top: 12px;
  color: var(--color-text-secondary);
  font-size: 12px;
}

.module-card {
  margin: 0 0 24px;
  padding: 20px 24px;
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 12px;
}

.module-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

.status-bar {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
  flex-wrap: wrap;
}

.status-pill {
  padding: 6px 14px;
  background: var(--color-background-secondary);
  border-radius: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.status-pill.quality-pass {
  background: #eaf3de;
  color: #27500a;
}

.status-pill.quality-medium {
  background: #faeeda;
  color: #633806;
}

.status-pill.quality-low,
.status-pill.quality-fail {
  background: #fcebeb;
  color: #791f1f;
}

.module1-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-primary);
  margin: 0;
}

.skeleton-table,
.mechanism-table {
  display: grid;
  gap: 1px;
  background: var(--color-border-tertiary);
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 8px;
  overflow: hidden;
}

.skeleton-table {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 2fr);
}

.mechanism-table {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 1.5fr);
}

.skeleton-table .header-cell,
.mechanism-table .header-cell {
  background: var(--color-background-secondary);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.skeleton-table .data-cell,
.mechanism-table .data-cell {
  background: var(--color-background-primary);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--color-text-primary);
  word-break: break-word;
}

.skeleton-table .data-cell:nth-child(3n + 1),
.mechanism-table .data-cell:nth-child(3n + 1) {
  font-weight: 500;
}

.segment-card {
  margin: 0 0 20px;
  border: 0.5px solid var(--color-border-tertiary);
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-background-primary);
}

.segment-card:last-child {
  margin-bottom: 0;
}

.segment-header {
  padding: 12px 16px;
  background: var(--color-background-secondary);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.segment-quote {
  margin: 12px 16px;
  padding: 12px 16px;
  background: var(--color-background-tertiary);
  border-left: 3px solid var(--color-border-secondary);
  border-radius: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.segment-analysis {
  padding: 0 16px 12px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-primary);
}

.segment-analysis .analysis-label {
  font-weight: 500;
  margin-bottom: 4px;
}

.segment-tip {
  margin: 0 16px 16px;
  padding: 12px 16px;
  background: #e6f1fb;
  border-left: 3px solid #378add;
  border-radius: 0;
}

.segment-tip-name {
  font-size: 13px;
  font-weight: 500;
  color: #0c447c;
  margin: 0 0 4px;
}

.segment-tip-formula {
  font-size: 12px;
  color: #185fa5;
  line-height: 1.6;
  margin: 0 0 4px;
  font-family: var(--font-mono);
}

.segment-tip-scope {
  font-size: 12px;
  color: #185fa5;
  line-height: 1.6;
  margin: 0;
}

.fingerprint-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--color-border-tertiary);
}

.fingerprint-row:last-of-type {
  border-bottom: none;
}

.fingerprint-summary-line {
  font-size: 14px;
  color: var(--color-text-primary);
  margin-bottom: 12px;
}

.fp-label {
  min-width: 72px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-secondary);
  padding-top: 2px;
  flex-shrink: 0;
}

.fp-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #e1f5ee;
  color: #085041;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  margin-right: 8px;
}

.fp-tag-structure {
  background: #eeedfe;
  color: #3c3489;
}

.fp-tag-vertical {
  background: #f1efe8;
  color: #444441;
}

.fp-evidence {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}

.fp-progress {
  margin: 12px 0 0;
  padding: 12px 16px;
  background: var(--color-background-secondary);
  border-radius: 8px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.segment-raw-fallback {
  margin: 0;
  padding: 16px;
  border-radius: 12px;
  background: #f8f6f1;
  border: 1px solid #e7e0d6;
  color: #3d352d;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.fp-progress strong {
  font-weight: 500;
  color: var(--color-text-info);
}

.fingerprint-details {
  margin-top: 14px;
}

.fingerprint-toggle {
  cursor: pointer;
  color: var(--color-text-info);
  font-size: 13px;
  font-weight: 500;
  list-style: none;
}

.fingerprint-toggle::-webkit-details-marker {
  display: none;
}

.fingerprint-details .when-open {
  display: none;
}

.fingerprint-details[open] .when-open {
  display: inline;
}

.fingerprint-details[open] .when-closed {
  display: none;
}

.fingerprint-details-body {
  margin-top: 12px;
}

.narrative-section {
  margin: 0 0 18px;
}

.narrative-section:last-of-type {
  margin-bottom: 0;
}

.narrative-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0 0 8px;
}

.narrative-section-body {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.72;
  margin: 0;
  white-space: pre-line;
}

.narrative-chain {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.narrative-chain-node {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3eee6;
  color: #3b352e;
  font-size: 12px;
  line-height: 1.3;
}

.narrative-chain-arrow {
  color: #9c5c22;
  font-size: 13px;
  font-weight: 600;
}

.technique-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.technique-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #e8ddd0;
  background: linear-gradient(180deg, #fffdfa 0%, #f8f3ea 100%);
}

.technique-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.technique-card-head h4 {
  margin: 0;
  font-size: 14px;
  color: #2d2b28;
}

.technique-card-index {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0f6e56;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.technique-card-logic {
  margin: 0 0 12px;
  font-size: 13px;
  color: #3d352d;
  line-height: 1.68;
}

.technique-card-section {
  margin-top: 12px;
}

.technique-card-section ul {
  margin: 6px 0 0 18px;
  padding: 0;
}

.technique-card-section li {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 4px;
}

.technique-card-section p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.65;
  white-space: pre-line;
}

.technique-card-label,
.guidance-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #8a5426;
}

.guidance-group {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fbf7f0;
  border: 1px solid #eee2d3;
}

.guidance-group ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.guidance-group li {
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.68;
  margin-bottom: 4px;
}

.learning-markdown-shell {
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid #e7dccf;
  background: linear-gradient(180deg, #fffdf9 0%, #f7f1e7 100%);
}

.learning-markdown {
  color: #312b25;
}

.learning-markdown h2,
.learning-markdown h3,
.learning-markdown h4 {
  margin: 0;
  color: #2d2b28;
}

.learning-markdown h2 {
  font-size: 20px;
  line-height: 1.35;
  margin-bottom: 16px;
}

.learning-markdown h3 {
  font-size: 15px;
  line-height: 1.45;
  margin-top: 20px;
  margin-bottom: 10px;
}

.learning-markdown h4 {
  font-size: 14px;
  line-height: 1.45;
  margin-top: 16px;
  margin-bottom: 8px;
}

.learning-markdown p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.78;
  color: #4a443d;
}

.learning-markdown ul,
.learning-markdown ol {
  margin: 8px 0 12px 18px;
  padding: 0;
}

.learning-markdown li {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.72;
  color: #4a443d;
}

.learning-markdown hr {
  border: none;
  border-top: 1px solid #eadfce;
  margin: 16px 0;
}

.learning-markdown strong {
  color: #2d2b28;
  font-weight: 600;
}

.learning-markdown code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #efe6d8;
  color: #6a3f17;
  font-size: 12px;
}

.learning-markdown-arrow {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f1ece3;
  color: #6e4d2d;
  font-size: 12px;
  line-height: 1.65;
}

.inspiration-step {
  margin: 0 0 12px;
}

.inspiration-step-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 0 0 4px;
}

.inspiration-step-body {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin: 0;
}

.inspiration-notes {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid var(--color-border-tertiary);
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.module-action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn-create-with-framework {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  background: #0f6e56;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-create-with-framework:hover {
  background: #085041;
}

.btn-create-with-framework:disabled {
  background: #d7ddd9;
  color: #8b948f;
  cursor: default;
}

.btn-copy-framework {
  padding: 10px 20px;
  font-size: 14px;
  color: var(--color-text-secondary);
  background: transparent;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: 8px;
  cursor: pointer;
}

.btn-copy-framework:hover {
  background: var(--color-background-secondary);
}

.btn-copy-framework:disabled {
  color: #a5a8a6;
  border-color: var(--color-border-tertiary);
  background: transparent;
  cursor: default;
}

.module6-mode-note {
  margin-bottom: 16px;
}

.module6-guide-details {
  margin-top: 18px;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: 12px;
  background: #faf7f2;
}

.module6-guide-details summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--color-text-primary);
  list-style: none;
}

.module6-guide-details summary::-webkit-details-marker {
  display: none;
}

.module6-guide-body {
  padding: 0 16px 16px;
}

.module6-preview-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 62vh;
  overflow: auto;
  padding-right: 4px;
}

.module6-preview-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8b8780;
}

.module6-preview-notes {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e7dccf;
  background: #fbf6ef;
}

.module6-preview-notes-title {
  font-size: 13px;
  font-weight: 600;
  color: #2d2b28;
  margin-bottom: 8px;
}

.module6-preview-notes ul {
  margin: 0 0 0 18px;
  padding: 0;
}

.module6-preview-notes li {
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: #4a443d;
}

.analysis-state-card {
  padding: 0;
}

.analysis-loading {
  text-align: center;
  padding: 60px 24px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.analysis-progress-bar {
  width: min(420px, 60%);
  height: 6px;
  background: var(--color-background-secondary);
  border-radius: 3px;
  margin: 16px auto;
  overflow: hidden;
}

.analysis-progress-fill {
  height: 100%;
  background: var(--color-text-info);
  border-radius: 3px;
  transition: width 0.3s;
}

.analysis-step-name {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.analysis-loading-note {
  font-size: 12px;
  color: #90877c;
  margin-top: 10px;
}

.analysis-loading-failed {
  color: #7d2c2c;
}

.analysis-loading-failed .analysis-step-name {
  color: #8f5a5a;
}

.analysis-failure-detail {
  max-width: 560px;
  margin: 10px auto 0;
  line-height: 1.6;
  color: #8f5a5a;
}

.reanalyze-btn {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
  background: transparent;
  border: 0.5px solid var(--color-border-secondary);
  border-radius: 8px;
  cursor: pointer;
}

.reanalyze-btn:hover {
  background: var(--color-background-secondary);
}

.method-center-page {
  position: relative;
  gap: 14px;
}
.method-center-shell,
.method-detail-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.method-center-hero {
  padding: 4px 2px 0;
}
.method-center-hero-copy {
  max-width: 760px;
}
.method-center-hero-copy h2 {
  margin: 12px 0 8px;
  color: #241d16;
  font-size: 30px;
  line-height: 1.2;
}
.method-center-hero-copy p {
  color: #73685b;
  font-size: 14px;
  line-height: 1.75;
}
.method-list-card,
.method-detail-card {
  background: #f8f3ea;
  border: 1px solid #e7ddcf;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.method-list-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f4eee4 0%, #f1eadf 100%);
}
.method-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.method-list-head h3 {
  margin-bottom: 4px;
  color: #241d16;
  font-size: 16px;
}
.method-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid #eadfce;
  background: rgba(255,251,245,0.78);
}
.method-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 1px 0 rgba(255,255,255,0.72);
  transition: all 0.15s ease;
}
.method-row:hover {
  border-color: #d8c1a4;
  background: #fff;
  transform: translateY(-1px);
}
.method-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.method-row-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.method-row-title {
  color: #241d16;
  font-size: 15px;
  font-weight: 700;
}
.method-row-summary {
  color: #3d352d;
  font-size: 13px;
  line-height: 1.72;
}
.method-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.method-row-meta {
  color: #8b8780;
  font-size: 12px;
}
.method-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.method-detail-topbar {
  padding-bottom: 0;
  background: transparent;
}
.method-detail-card {
  padding: 22px 24px;
  background: linear-gradient(180deg, #f7f3ec 0%, #f4efe6 100%);
}
.method-detail-card h3 {
  color: #241d16;
  font-size: 15px;
  margin-bottom: 12px;
}

.method-guide-text {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid #eadfce;
  color: #3d352d;
  font-size: 13px;
  line-height: 1.75;
}

.method-detail-signals,
.method-detail-tags {
  margin-top: 14px;
}

.content-lib-page {
  position: relative;
  gap: 14px;
}
.content-lib-shell,
.content-detail-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.content-lib-hero {
  padding: 4px 2px 0;
}
.content-lib-hero-copy {
  max-width: 760px;
}
.content-lib-hero-copy h2 {
  margin: 12px 0 8px;
  color: #241d16;
  font-size: 30px;
  line-height: 1.2;
}
.content-lib-hero-copy p {
  color: #73685b;
  font-size: 14px;
  line-height: 1.75;
}
.content-list-card,
.content-detail-card {
  background: #f8f3ea;
  border: 1px solid #e7ddcf;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.content-list-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f4eee4 0%, #f1eadf 100%);
}
.content-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.content-list-head h3 {
  margin-bottom: 4px;
  color: #241d16;
  font-size: 16px;
}
.content-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid #eadfce;
  background: rgba(255,251,245,0.78);
}
.content-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 1px 0 rgba(255,255,255,0.72);
  transition: all 0.15s ease;
}
.content-row:hover {
  border-color: #d8c1a4;
  background: #fff;
  transform: translateY(-1px);
}
.content-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.content-row-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.content-row-summary {
  color: #3d352d;
  font-size: 13px;
  line-height: 1.72;
}
.content-row-meta {
  color: #8b8780;
  font-size: 12px;
}
.content-row-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.content-lib-queue-actions {
  justify-content: flex-start;
  margin: 12px 0 14px;
}
.content-batch-row {
  align-items: stretch;
}
.content-batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.content-batch-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.content-batch-field span {
  color: #6d6155;
  font-size: 12px;
  font-weight: 700;
}
.content-batch-field input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ddd6ca;
  background: #fffdf9;
  color: #2d2b28;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.content-batch-field input:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
}
.content-detail-topbar {
  padding-bottom: 0;
  background: transparent;
}
.content-detail-card {
  padding: 22px 24px;
  background: linear-gradient(180deg, #f7f3ec 0%, #f4efe6 100%);
}
.content-detail-card h3 {
  color: #241d16;
  font-size: 15px;
  margin-bottom: 12px;
}
.content-detail-actions {
  margin-top: 0;
}

.knowledge-center-page {
  position: relative;
  gap: 14px;
}
.knowledge-center-shell,
.knowledge-detail-shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.knowledge-center-hero {
  padding: 4px 2px 0;
}
.knowledge-center-hero-copy {
  max-width: 760px;
}
.knowledge-center-hero-copy h2 {
  margin: 12px 0 8px;
  color: #241d16;
  font-size: 30px;
  line-height: 1.2;
}
.knowledge-center-hero-copy p {
  color: #73685b;
  font-size: 14px;
  line-height: 1.75;
}
.knowledge-create-card,
.knowledge-list-card,
.knowledge-detail-card {
  background: #f8f3ea;
  border: 1px solid #e7ddcf;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.knowledge-create-card,
.knowledge-list-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f4eee4 0%, #f1eadf 100%);
}
.knowledge-create-grid,
.knowledge-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
}
.knowledge-inline-field label {
  display: block;
  color: #4e4032;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}
.knowledge-create-card input[type=text],
.knowledge-create-card textarea,
.knowledge-detail-card input[type=text],
.knowledge-detail-card textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #ddd6ca;
  background: #fffdfa;
  color: #2d2b28;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.knowledge-create-card input[type=text]:focus,
.knowledge-create-card textarea:focus,
.knowledge-detail-card input[type=text]:focus,
.knowledge-detail-card textarea:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
  background: #fff;
}
.knowledge-create-btn {
  align-self: end;
  min-height: 46px;
}
.knowledge-create-desc,
.knowledge-description-field {
  margin-top: 14px;
}
.knowledge-create-desc textarea,
.knowledge-description-field textarea {
  min-height: 92px;
}
.knowledge-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.knowledge-list-head h3 {
  margin-bottom: 4px;
  color: #241d16;
  font-size: 16px;
}
.knowledge-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid #eadfce;
  background: rgba(255,251,245,0.78);
}
.knowledge-base-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 1px 0 rgba(255,255,255,0.72);
  transition: all 0.15s ease;
}
.knowledge-base-row:hover {
  border-color: #d8c1a4;
  background: #fff;
  transform: translateY(-1px);
}
.knowledge-base-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.knowledge-base-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.knowledge-base-summary {
  color: #3d352d;
  font-size: 13px;
  line-height: 1.72;
}
.knowledge-base-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.knowledge-base-empty {
  color: #8b8780;
  font-size: 12px;
}
.knowledge-base-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.knowledge-detail-topbar {
  padding-bottom: 0;
  background: transparent;
}
.knowledge-detail-card {
  padding: 22px 24px;
  background: linear-gradient(180deg, #f7f3ec 0%, #f4efe6 100%);
}
.knowledge-detail-card h3 {
  color: #241d16;
  font-size: 15px;
  margin-bottom: 12px;
}
.knowledge-bound-section {
  margin-top: 14px;
}
.knowledge-bound-list {
  margin-top: 8px;
}

.agent-manager-page {
  position: relative;
  gap: 14px;
}
.agent-manager-shell,
.agent-detail-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-manager-list-card,
.agent-detail-card {
  background: #f8f3ea;
  border: 1px solid #e7ddcf;
  border-radius: 24px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}
.agent-manager-list-card {
  padding: 16px 18px;
  background: linear-gradient(180deg, #f4eee4 0%, #f1eadf 100%);
}
.agent-manager-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.agent-manager-toolbar {
  margin-bottom: 14px;
}
.agent-manager-toolbar h3 {
  margin-bottom: 4px;
  color: #241d16;
  font-size: 16px;
}
.agent-manager-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.agent-manager-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.agent-manager-row-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 560px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid #eadfce;
  background: rgba(255,251,245,0.78);
}
.agent-manager-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: #fffdfa;
  box-shadow: 0 1px 0 rgba(255,255,255,0.72);
  transition: all 0.15s ease;
}
.agent-manager-row:hover {
  border-color: #d8c1a4;
  background: #fff;
  transform: translateY(-1px);
}
.agent-manager-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agent-manager-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.agent-manager-summary {
  color: #3d352d;
  font-size: 13px;
  line-height: 1.72;
}
.agent-manager-meta {
  color: #8b8780;
  font-size: 12px;
  line-height: 1.6;
}
.agent-manager-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.agent-manager-topbar {
  padding-bottom: 0;
  background: transparent;
}
.agent-detail-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.agent-detail-summary-item {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #e7ddcf;
  background: linear-gradient(180deg, #f5efe6 0%, #f1eadf 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}
.agent-detail-summary-item span,
.agent-kb-summary-item span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: #9b938b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.agent-detail-summary-item strong,
.agent-kb-summary-item strong {
  color: #2d2b28;
  font-size: 14px;
}
.agent-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 14px;
  align-items: start;
}
.agent-detail-main,
.agent-detail-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agent-detail-card {
  padding: 22px 24px;
  background: linear-gradient(180deg, #f7f3ec 0%, #f4efe6 100%);
}
.agent-detail-card h3 {
  color: #241d16;
  font-size: 15px;
  margin-bottom: 12px;
}
.agent-inline-field {
  margin-bottom: 0;
}
.agent-inline-field-spaced {
  margin-top: 14px;
}
.agent-inline-field label {
  display: block;
  color: #4e4032;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}
.agent-detail-card input[type=text],
.agent-detail-card textarea,
.agent-detail-card select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid #ddd6ca;
  background: #fffdfa;
  color: #2d2b28;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.agent-detail-card input[type=text]:focus,
.agent-detail-card textarea:focus,
.agent-detail-card select:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
  background: #fff;
}
.agent-quick-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.7;
}
.agent-prompt-textarea {
  min-height: 480px;
  resize: vertical;
  line-height: 1.75;
}
.agent-prompt-card {
  min-height: 100%;
}
.agent-kb-summary {
  margin-top: 14px;
}
.agent-kb-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.agent-kb-summary-item {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #ece3d7;
  background: #fffdfa;
}
.agent-kb-shared {
  margin-top: 14px;
}
.agent-kb-shared-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.agent-detail-actions {
  margin-top: 0;
}

.filter-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e2dacc;
  background: #fff;
  color: #6d6155;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-chip:hover {
  border-color: #cfae8d;
  color: #9c5c22;
  background: #fffaf4;
}
.filter-chip.active {
  background: #fff1e1;
  border-color: #c77b3f;
  color: #9c5c22;
}

/* ---- Modals ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; animation: fadeIn 0.15s ease;
  backdrop-filter: blur(4px);
}
.modal {
  background: #fff; border-radius: 16px; width: 90%; max-width: 600px;
  max-height: 85vh; overflow-y: auto; padding: 28px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.12);
  animation: fadeUp 0.25s ease;
}
.modal h2 { font-size: 18px; font-weight: 700; color: #1a1915; margin-bottom: 4px }
.modal .modal-sub { color: #8b8780; font-size: 13px; margin-bottom: 20px }
.modal label { display: block; font-size: 13px; font-weight: 600; color: #5d5a54; margin-bottom: 6px }
.modal input[type=text], .modal textarea {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1px solid #e0ddd7; font-size: 14px; color: #2d2b28;
  font-family: inherit; outline: none; transition: border-color 0.2s;
}
.modal input[type=text]:focus, .modal textarea:focus { border-color: #c77b3f }
.modal textarea { min-height: 140px; resize: vertical; line-height: 1.6 }
.modal .field { margin-bottom: 16px }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.modal .btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px }
.modal .btn-add {
  width: 100%; padding: 10px; border-radius: 10px; border: 2px dashed #e0ddd7;
  background: #faf8f5; color: #8b8780; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.modal .btn-add:hover { border-color: #c77b3f; color: #c77b3f; background: #fdf9f5 }
.modal .btn-delete { margin-left: auto; }
.modal .btn-delete:hover { background: #fef2f0 }

/* ---- Knowledge ---- */
.kb-create-row {
  grid-template-columns: minmax(0, 1fr) 200px !important;
}
.kb-nav-list {
  display: flex; flex-direction: column; gap: 12px;
}
.kb-nav-card {
  display: flex; align-items: stretch; gap: 14px; padding: 16px; border: 1px solid #e7e1d8;
  border-radius: 14px; background: #fff; transition: all 0.15s ease;
}
.kb-nav-card:hover {
  border-color: #d7c5b1; box-shadow: 0 8px 18px rgba(128, 82, 41, 0.06);
}
.kb-nav-main { flex: 1; min-width: 0; }
.kb-nav-title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px;
}
.kb-nav-title {
  font-size: 16px; font-weight: 700; color: #2b2218; min-width: 0;
}
.kb-nav-counts {
  flex-shrink: 0; font-size: 12px; color: #8b8780;
}
.kb-nav-desc {
  font-size: 13px; color: #4b3c2f; line-height: 1.6; margin-bottom: 10px;
}
.kb-nav-line {
  display: flex; gap: 10px; font-size: 12px; color: #6d6155; line-height: 1.6;
}
.kb-nav-label {
  width: 72px; flex-shrink: 0; color: #9b938b;
}
.kb-info-box {
  display: flex; flex-direction: column; gap: 8px; min-height: 42px; padding: 10px 12px;
  border: 1px solid #e7e1d8; border-radius: 12px; background: #fffaf6; font-size: 13px; color: #5b4633;
}
.kb-bound-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.kb-bound-item {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.kb-bound-item .btn-delete {
  margin-left: 0;
}
.kb-list {
  display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto;
}
.kb-item {
  padding: 14px; border: 1px solid #e7e1d8; border-radius: 14px; background: #fff;
  cursor: pointer; transition: all 0.15s ease;
}
.kb-item:hover { border-color: #d7c5b1; box-shadow: 0 8px 18px rgba(128, 82, 41, 0.06) }
.kb-item.active {
  border-color: #c97d3d; background: #fff6ef; box-shadow: 0 10px 22px rgba(201, 125, 61, 0.12);
}
.kb-card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px;
}
.kb-card-title-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px;
}
.kb-card-title {
  font-size: 15px; font-weight: 700; color: #2b2218; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kb-card-badge {
  flex-shrink: 0; padding: 4px 8px; border-radius: 999px; background: #f8ead9; color: #9c5c22;
  font-size: 11px; font-weight: 600;
}
.kb-card-meta { font-size: 12px; color: #8b8780; line-height: 1.5 }
.kb-card-section + .kb-card-section { margin-top: 10px }
.kb-card-label {
  font-size: 11px; color: #9b938b; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px;
}
.kb-card-text { font-size: 13px; color: #47392d; line-height: 1.6 }
.kb-chip-row,
.kb-file-list {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.kb-chip,
.kb-file-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px;
  background: #fffaf6; border: 1px solid #ead9c6; font-size: 12px; color: #5b4633;
  max-width: 100%;
}
.kb-chip.is-empty,
.kb-file-chip.is-empty {
  color: #8b8780; border-style: dashed; background: #faf8f5;
}
.kb-file-list-detail { min-height: 44px }
.kb-card-note,
.kb-detail-note {
  margin-top: 12px; font-size: 12px; color: #a15a28; background: #fff4ea;
  border: 1px solid #f1d7c1; border-radius: 10px; padding: 10px 12px; line-height: 1.5;
}
.kb-detail-note-ok {
  color: #2f6a43; background: #f3fbf5; border-color: #cfe7d6;
}
.kb-doc-list {
  max-height: 320px; overflow: auto; padding-right: 4px;
}
.doc-list { list-style: none }
.doc-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 10px;
  border-radius: 8px; margin-bottom: 4px; transition: background 0.15s;
}
.doc-item:hover { background: #faf8f5 }
.doc-main { flex: 1; min-width: 0; }
.doc-topline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px;
}
.doc-item .doc-name { flex: 1; font-size: 13px; color: #2d2b28; font-weight: 600; min-width: 0 }
.doc-item .doc-size { font-size: 11px; color: #b5b2ab; flex-shrink: 0 }
.doc-meta-row {
  display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: #8b8780; margin-bottom: 6px;
}
.doc-status {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; font-weight: 600;
  border: 1px solid transparent;
}
.doc-status.status-ready,
.doc-status.status-ocr {
  background: #f3fbf5; color: #2f6a43; border-color: #cfe7d6;
}
.doc-status.status-warning,
.doc-status.status-needs_ocr {
  background: #fff8ec; color: #9a641b; border-color: #f1d7a5;
}
.doc-status.status-empty,
.doc-status.status-failed {
  background: #fef2f0; color: #b54735; border-color: #f3c8c1;
}
.doc-status.status-pending {
  background: #f3f4f6; color: #4b5563; border-color: #d1d5db;
}
.doc-note {
  font-size: 12px; color: #6d6155; line-height: 1.5;
}
.doc-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
}
.doc-item .doc-retry,
.doc-item .doc-del {
  padding: 4px 10px; border-radius: 6px; border: 1px solid #f0d0c8;
  background: #fff; color: #c4553d; font-size: 11px; cursor: pointer;
}
.doc-item .doc-retry {
  border-color: #e5d3b8;
  color: #8b6c49;
}
.doc-item .doc-retry:hover {
  background: #fdf9f2;
}
.doc-item .doc-del:hover { background: #fef2f0 }
.upload-area {
  border: 2px dashed #e0ddd7; border-radius: 10px; padding: 24px;
  text-align: center; color: #8b8780; font-size: 13px; cursor: pointer;
  transition: all 0.15s;
}
.upload-area:hover { border-color: #c77b3f; color: #c77b3f; background: #fdf9f5 }
.upload-area.drag-active {
  border-color: #c77b3f;
  color: #c77b3f;
  background: #fdf9f5;
  box-shadow: 0 0 0 4px rgba(199, 123, 63, 0.08);
}
.upload-area input[type=file] { display: none }
.upload-area-note {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.5;
}

/* ---- Content Library ---- */
.clib-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.clib-item {
  padding: 16px;
  border: 1px solid #e7e1d8;
  border-radius: 14px;
  background: #fff;
}
.clib-item-top,
.clib-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.clib-item-meta,
.clib-item-date {
  font-size: 12px;
  color: #8b8780;
}
.clib-item-preview {
  margin: 10px 0 12px;
  font-size: 13px;
  color: #2d2b28;
  line-height: 1.7;
}
.clib-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #faf8f5;
  color: #8b8780;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #ece8e0;
}
.clib-status.is-ready {
  background: #eefbf5;
  color: #178f63;
  border-color: #ccefdc;
}
.clib-status.review-status-tag {
  background: #fff7ed;
  color: #b45309;
  border-color: #fed7aa;
}
.clib-status.level-high {
  background: #ecfdf3;
  color: #047857;
  border-color: #bbf7d0;
}
.clib-status.level-medium {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
.clib-status.level-low {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}
.clib-status.level-none,
.clib-status.score-tag {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}
.clib-item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.clib-meta-grid,
.clib-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.clib-meta-card,
.clib-info-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #ece7de;
  background: #fcfbf8;
}
.clib-meta-label,
.clib-info-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: #9b938b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.clib-meta-card strong,
.clib-info-item strong {
  color: #2d2b28;
  font-size: 13px;
}
.clib-detail-body {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #ece7de;
  background: #fcfbf8;
  color: #2d2b28;
  font-size: 14px;
  line-height: 1.8;
  white-space: normal;
  word-break: break-word;
}
.clib-empty-box {
  padding: 18px;
  border: 1px dashed #ddd6cb;
  border-radius: 12px;
  background: #faf8f5;
  color: #8b8780;
  font-size: 13px;
}
.clib-highlight-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.6;
}
.clib-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.clib-review-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #ece7de;
  background: #fff;
}
.clib-review-text {
  color: #3d352d;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 100;
    height: 100vh;
    width: min(88vw, 320px);
    min-width: min(88vw, 320px);
  }
  .sidebar.collapsed { width: 0 }
  .sidebar-search-panel {
    width: calc(100vw - 18px);
    margin-top: 18px;
  }
  .sidebar-actions,
  .sidebar-account-actions {
    grid-template-columns: 1fr;
  }
  .sidebar-mode-nav {
    grid-template-columns: 1fr;
  }
  .messages-inner { padding: 20px 16px 12px }
  .input-area { padding: 0 12px 16px }
  .input-tools {
    flex-direction: column;
    align-items: flex-start;
  }
  .workspace-header,
  .workspace-page-header,
  .workspace-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .workspace-body {
    padding: 18px 14px 24px;
  }
  .workspace-search {
    width: 100%;
  }
  .task-center-shell,
  .task-detail-shell,
  .content-lib-shell,
  .content-detail-shell,
  .learning-center-shell,
  .learning-detail-shell,
  .method-center-shell,
  .method-detail-shell,
  .agent-manager-shell,
  .agent-detail-shell,
  .knowledge-center-shell,
  .knowledge-detail-shell,
  .release-center-shell {
    width: 100%;
  }
  .task-compose-card,
  .task-history-card,
  .task-detail-card,
  .task-result-card,
  .content-list-card,
  .content-detail-card,
  .learning-compose-card,
  .learning-list-card,
  .learning-detail-card,
  .method-list-card,
  .method-detail-card,
  .agent-manager-summary-card,
  .agent-manager-list-card,
  .agent-detail-card,
  .knowledge-create-card,
  .knowledge-list-card,
  .knowledge-detail-card,
  .release-center-list-card,
  .release-center-detail-card {
    padding: 16px;
    border-radius: 16px;
  }
  .module-card,
  .learning-text-card {
    padding: 16px;
    border-radius: 12px;
  }
  .task-compose-head,
  .task-agent-select-row,
  .task-history-row,
  .content-list-head,
  .content-row,
  .task-result-head,
  .agent-manager-toolbar,
  .learning-list-head,
  .learning-case-row,
  .method-list-head,
  .method-row,
  .agent-manager-row,
  .knowledge-list-head,
  .knowledge-base-row,
  .release-center-head,
  .release-change-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .release-center-shell {
    grid-template-columns: 1fr;
  }
  .task-context-inline,
  .task-agent-select-wrap,
  .task-history-tools,
  .task-history-open,
  .content-row-actions,
  .content-row-actions .task-history-open,
  .task-result-head .btn-save,
  .agent-manager-toolbar-actions,
  .learning-case-actions,
  .learning-case-actions .btn-cancel,
  .learning-case-actions .task-history-open,
  .method-row-actions,
  .method-row-actions .btn-cancel,
  .method-row-actions .task-history-open,
  .agent-manager-actions,
  .agent-manager-actions .task-history-open,
  .knowledge-base-actions,
  .knowledge-base-actions .task-history-open {
    width: 100%;
  }
  .task-context-inline {
    justify-content: space-between;
  }
  .task-advanced-grid,
  .knowledge-create-grid,
  .knowledge-edit-grid,
  .task-lock-grid.compact,
  .learning-advanced-grid,
  .learning-inline-grid,
  .agent-detail-grid,
  .agent-detail-summary-strip,
  .agent-kb-summary-grid {
    grid-template-columns: 1fr;
  }
  .task-history-list,
  .content-row-list,
  .learning-case-list,
  .method-row-list,
  .agent-manager-row-list,
  .knowledge-row-list {
    max-height: none;
  }
  .task-lock-grid {
    grid-template-columns: 1fr;
  }
  .kb-create-row,
  .modal .row2,
  .clib-meta-grid,
  .clib-info-grid,
  .clib-review-grid { grid-template-columns: 1fr }
  .kb-nav-card { flex-direction: column }
  .kb-nav-title-row,
  .agent-manager-topline { align-items: flex-start; flex-direction: column }
  .kb-nav-label { width: 60px }
  .kb-card-title-row { align-items: flex-start; flex-direction: column }
  .doc-topline { align-items: flex-start; flex-direction: column }
  .clib-item-bottom { align-items: flex-start; flex-direction: column }
  .agent-prompt-textarea { min-height: 320px }
  .analysis-progress-bar { width: 100% }
  .fingerprint-row { flex-direction: column; gap: 8px }
  .fp-label { min-width: 0; padding-top: 0 }
  .technique-card-grid { grid-template-columns: 1fr }
  .narrative-chain { align-items: flex-start }
}

/* ---- System Messages ---- */
.msg-row.system { display: flex; justify-content: center; padding: 6px 0 }
.msg-bubble.system-msg {
  background: #f0fdf4; color: #16a34a; border-radius: 10px;
  font-size: 13px; padding: 8px 16px; border: 1px solid #bbf7d0;
}

/* ---- Content Picker ---- */
.picker-list { max-height: 320px; overflow-y: auto }
.picker-msg {
  padding: 12px 14px; border: 1px solid #e8e5df; border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: flex-start; gap: 10px;
}
.picker-msg:hover { border-color: #c77b3f; background: #fdf9f5 }
.picker-msg.selected { border-color: #c77b3f; background: #fdf9f5; box-shadow: 0 0 0 2px rgba(199,123,63,0.2) }
.picker-preview { flex: 1; font-size: 13px; color: #2d2b28; line-height: 1.6 }
.picker-wc {
  flex-shrink: 0; font-size: 11px; color: #8b8780; background: #f5f4ef;
  padding: 2px 8px; border-radius: 10px;
}
.picker-type-btn:hover { border-color: #c77b3f !important; color: #c77b3f !important }

/* ---- Session List ---- */
.agent-group { margin-bottom: 2px }
.agent-sessions {
  padding-left: 10px; margin: 0 0 6px;
  border-left: 2px solid rgba(199,123,63,0.25);
  margin-left: 20px;
}
.agent-sessions .session-section-header {
  padding: 4px 4px 2px; justify-content: flex-start;
}
.agent-sessions .new-chat-btn {
  width: 100%; padding: 7px 0; border-radius: 6px; text-align: center;
  font-size: 12px; font-weight: 600;
  background: rgba(199,123,63,0.12); color: #c77b3f; border: none;
  cursor: pointer; transition: all 0.15s; margin: 2px 0 4px;
  display: block;
}
.agent-sessions .new-chat-btn:hover { background: rgba(199,123,63,0.25) }
.agent-sessions .session-empty {
  font-size: 11px; padding: 4px 8px; text-align: left; color: #5d5a54;
}
.agent-sessions .session-item {
  padding: 5px 8px; border-radius: 6px;
}
.agent-sessions .session-title { font-size: 11px }
.agent-sessions .session-time { font-size: 9px }
.sidebar-divider {
  height: 1px; background: rgba(255,255,255,0.06); margin: 8px 2px;
}
.session-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px 4px;
}
.new-chat-btn {
  padding: 4px 12px; border-radius: 6px;
  border: none;
  background: rgba(199,123,63,0.15); color: #c77b3f; font-size: 11px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.new-chat-btn:hover { background: rgba(199,123,63,0.3); color: #fff }
.session-empty {
  color: #5d5a54; font-size: 12px; padding: 12px 10px; text-align: center;
}
.session-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: all 0.15s; margin-bottom: 1px;
}
.session-item:hover { background: rgba(255,255,255,0.05) }
.session-item.active { background: rgba(255,255,255,0.08) }
.session-info { flex: 1; min-width: 0 }
.session-title {
  color: #a09d96; font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-item.active .session-title { color: #f5f4ef }
.session-time { color: #5d5a54; font-size: 10px; margin-top: 1px }
.session-del {
  width: 20px; height: 20px; border-radius: 4px; border: none;
  background: transparent; color: #5d5a54; font-size: 14px;
  cursor: pointer; opacity: 0; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.session-item:hover .session-del { opacity: 1 }
.session-del:hover { background: rgba(196,85,61,0.2); color: #c4553d }

/* ---- Memory Modal ---- */
.memory-list { max-height: 400px; overflow-y: auto }
.memory-section + .memory-section { margin-top: 18px }
.memory-section-title {
  font-size: 12px; font-weight: 700; color: #8b6c49;
  letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px;
}
.memory-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border: 1px solid #e8e5df; border-radius: 10px;
  margin-bottom: 6px; transition: background 0.15s;
}
.memory-item:hover { background: #faf8f5 }
.memory-item.is-superseded {
  background: #faf8f5;
  border-style: dashed;
  opacity: 0.8;
}
.memory-main { flex: 1; min-width: 0 }
.memory-meta-row {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px;
}
.memory-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; color: #7a5330; background: #f8ead9;
}
.memory-badge.subtle {
  color: #7b756e;
  background: #f3f0eb;
}
.memory-badge.is-off {
  color: #a05a4b;
  background: #f8e5e0;
}
.memory-content { flex: 1; font-size: 13px; color: #2d2b28; line-height: 1.6 }
.memory-del {
  padding: 3px 8px; border-radius: 6px; border: 1px solid #f0d0c8;
  background: #fff; color: #c4553d; font-size: 11px; cursor: pointer;
  flex-shrink: 0;
}
.memory-del:hover { background: #fef2f0 }

/* ---- Skills Market ---- */
.skill-market-modal { max-width: 980px !important; max-height: 88vh; }
.skill-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sm-tab-btn {
  padding: 8px 14px; border-radius: 8px; border: 1px solid #e0ddd7;
  background: #fff; color: #5d5a54; font-size: 13px; cursor: pointer;
}
.sm-tab-btn.active { background: #c77b3f; color: #fff; border-color: #c77b3f; }
.skill-block { margin-top: 8px; }
.skill-block-title { font-size: 13px; font-weight: 600; color: #5d5a54; margin-bottom: 10px; }
.skill-search-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.skill-search-row input,
.skill-search-row select {
  min-width: 120px; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #e0ddd7; background: #fff; font-size: 13px; color: #2d2b28;
}
.skill-search-row button {
  padding: 8px 14px; border-radius: 8px; border: 1px solid #c77b3f;
  background: #c77b3f; color: #fff; cursor: pointer; font-size: 13px;
}
.skill-list { display: grid; grid-template-columns: 1fr; gap: 10px; max-height: 44vh; overflow: auto; padding-right: 2px; }
.skill-card {
  border: 1px solid #e8e5df; border-radius: 12px; background: #fff; padding: 12px;
}
.skill-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.skill-name { font-weight: 700; font-size: 14px; color: #1a1915; }
.skill-meta { color: #8b8780; font-size: 11px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.skill-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
.skill-card-actions button {
  padding: 6px 10px; border-radius: 8px; border: 1px solid #e0ddd7;
  background: #fff; color: #5d5a54; font-size: 12px; cursor: pointer;
}
.skill-card-actions .skill-install-btn { border-color: #c77b3f; color: #c77b3f; }
.skill-desc { margin-top: 8px; font-size: 13px; line-height: 1.6; color: #2d2b28; }
.skill-tags { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.skill-tag {
  font-size: 11px; color: #6b6860; background: #f5f4ef; border-radius: 999px;
  padding: 2px 8px; border: 1px solid #ece9e3;
}
.skill-meta-row { margin-top: 8px; font-size: 11px; color: #8b8780; display: flex; gap: 10px; }
.skill-reason { margin-top: 8px; font-size: 12px; color: #c77b3f; }
.skill-empty {
  border: 1px dashed #e0ddd7; border-radius: 10px; padding: 18px;
  text-align: center; font-size: 13px; color: #8b8780; background: #faf8f5;
}
.skill-exec-box { margin-top: 12px; border-top: 1px solid #f0ede7; padding-top: 12px; }
.skill-exec-box textarea {
  width: 100%; border: 1px solid #e0ddd7; border-radius: 8px; padding: 10px;
  font-size: 13px; resize: vertical; min-height: 88px; margin-bottom: 10px;
}
.skill-admin-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.skill-admin-row button {
  padding: 6px 10px; border-radius: 8px; border: 1px solid #e0ddd7;
  background: #fff; font-size: 12px; cursor: pointer; color: #5d5a54;
}
.skill-run-action { display: flex; gap: 8px; margin-bottom: 12px; }
.skill-run-action button {
  padding: 6px 10px; border-radius: 8px; border: 1px solid #e0ddd7;
  background: #fff; font-size: 12px; cursor: pointer; color: #5d5a54;
}
.skill-run-list { border-top: 1px solid #f0ede7; padding-top: 10px; margin-top: 8px; max-height: 20vh; overflow: auto; }
.skill-run-item { border: 1px solid #ece9e3; border-radius: 8px; padding: 8px; margin-bottom: 8px; font-size: 12px; color: #2d2b28; }
.skill-run-meta { color: #8b8780; font-size: 11px; margin-top: 3px; }
.skill-run-error { margin-top: 5px; color: #c4553d; font-size: 11px; white-space: pre-wrap; }

.modal select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #e0ddd7;
  font-size: 14px;
  color: #2d2b28;
  background: #fff;
  outline: none;
}
.modal select:focus { border-color: #c77b3f; }

/* ---- Studio ---- */
.studio-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.studio-stat-card {
  border: 1px solid #e7e1d8;
  border-radius: 14px;
  background: #fffaf6;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-stat-card strong {
  font-size: 22px;
  color: #2b2218;
}
.studio-stat-label {
  font-size: 12px;
  color: #8b8780;
}
.studio-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.studio-chip-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #e0ddd7;
  background: #fff;
  color: #5d5a54;
  font-size: 12px;
  cursor: pointer;
}
.studio-chip-btn.active {
  border-color: #c77b3f;
  background: #fff3e8;
  color: #9c5c22;
}
.studio-tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.studio-tab-btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #e0ddd7;
  background: #fff;
  color: #5d5a54;
  font-size: 13px;
  cursor: pointer;
}
.studio-tab-btn.active {
  background: #c77b3f;
  border-color: #c77b3f;
  color: #fff;
}
.studio-card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.studio-card {
  border: 1px solid #e7e1d8;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}
.studio-card.compact {
  padding: 12px;
}
.studio-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.studio-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #2b2218;
}
.studio-card-kicker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.studio-card-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #8b8780;
  line-height: 1.5;
}
.studio-card-body {
  margin-top: 10px;
  font-size: 13px;
  color: #3d352d;
  line-height: 1.7;
}
.studio-prewrap {
  white-space: pre-wrap;
}
.studio-card-footer {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.studio-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f7f2ec;
  border: 1px solid #ece1d5;
  color: #6d6155;
  font-size: 11px;
}
.studio-pill.primary {
  background: #fff1e1;
  border-color: #f0d1ae;
  color: #9c5c22;
  font-weight: 700;
}
.studio-inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 760px) {
  .studio-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.role-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  white-space: nowrap;
}

.role-badge.creator {
  background: #fff6df;
  border-color: #f0cf82;
  color: #8b5e12;
}

.role-badge.admin {
  background: #f6efe4;
  border-color: #e4c79e;
  color: #9a5d1a;
}

.role-badge.user {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #4b5563;
}

.role-badge.view {
  background: #eef4ff;
  border-color: #c7d6f7;
  color: #4a6aa4;
}

.sidebar-account-role {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-center-shell {
  display: grid;
  gap: 18px;
}

.profile-center-main-card {
  background: #fff;
  border: 1px solid #ece6de;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 12px 32px rgba(31, 41, 55, 0.05);
}

.profile-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.profile-summary-card {
  border: 1px solid #ece6de;
  border-radius: 16px;
  padding: 16px;
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
  display: grid;
  gap: 8px;
}

.profile-summary-card strong {
  font-size: 18px;
  color: #1f2937;
}

.profile-summary-label {
  font-size: 12px;
  color: #8b8780;
}

.profile-role-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-capability-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: #faf7f2;
  border: 1px solid #eee5d8;
}

.profile-capability-box h3,
.profile-section-head h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: #1f2937;
}

.profile-capability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-learning-note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: #f7f9ff;
  border: 1px solid #d8e1f3;
  color: #51617f;
  line-height: 1.7;
}

.profile-center-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.profile-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.profile-section-head p {
  margin: 4px 0 0;
  color: #8b8780;
  font-size: 13px;
  line-height: 1.6;
}

.profile-user-table {
  display: grid;
  gap: 10px;
}

.profile-user-table-head,
.profile-user-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr 1fr 0.9fr;
  gap: 12px;
  align-items: center;
}

.profile-user-table-head {
  padding: 0 12px;
  color: #8b8780;
  font-size: 12px;
  font-weight: 600;
}

.profile-user-row {
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid #ece6de;
  background: #fffdf9;
}

.profile-user-row .btn-save,
.profile-user-row .btn-delete {
  width: 100%;
}

.profile-action-note {
  color: #8b8780;
  font-size: 12px;
}

@media (max-width: 960px) {
  .profile-summary-grid {
    grid-template-columns: 1fr;
  }

  .profile-user-table-head {
    display: none;
  }

  .profile-user-row {
    grid-template-columns: 1fr;
  }
}

.workspace-toolbar-left,
.workspace-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.material-center-page {
  position: relative;
  gap: 14px;
}
.material-center-shell,
.material-compose-shell,
.material-detail-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 312px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.material-compose-main,
.material-compose-side,
.material-detail-main,
.material-detail-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.material-history-panel {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid #e5ded3;
  border-radius: 24px;
  background: rgba(250, 247, 241, 0.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88);
  min-height: calc(100vh - 132px);
}
.material-history-head h3,
.material-main-header h2,
.material-section-head h3,
.material-overview-hero h3 {
  color: #241d16;
}
.material-history-head h3 {
  font-size: 18px;
  margin: 8px 0 6px;
}
.material-history-head p,
.material-main-header p,
.material-section-head p,
.material-overview-hero p,
.material-overview-card span {
  color: #6f675d;
  font-size: 13px;
  line-height: 1.72;
}
.material-pane-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #9a6b38;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.material-history-search {
  margin-top: 4px;
}
.material-history-list,
.material-version-list,
.material-source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.material-history-list {
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}
.material-history-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 12px 12px 11px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.material-history-item:hover {
  background: rgba(255,255,255,0.88);
  border-color: #e3d4c1;
}
.material-history-item.active {
  background: #fffdfa;
  border-color: #d7b28a;
  box-shadow: 0 8px 20px rgba(180, 132, 83, 0.08);
}
.material-history-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.material-history-item-topline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.material-history-item-title {
  color: #241d16;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}
.material-history-item-status,
.material-history-item-model {
  color: #8a6340;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.material-history-item-meta,
.material-history-item-time {
  color: #8b8780;
  font-size: 12px;
}
.material-history-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}
.material-history-item-side {
  flex-shrink: 0;
  padding-top: 1px;
}

.material-main-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.material-main-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 4px 4px 0;
}
.material-main-header h2 {
  margin: 8px 0 8px;
  font-size: 34px;
  line-height: 1.18;
}
.material-main-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.material-overview-surface,
.material-compose-surface,
.material-surface {
  background: #fbf9f4;
  border: 1px solid #e7e0d5;
  border-radius: 28px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88);
}
.material-overview-surface,
.material-compose-surface,
.material-surface {
  padding: 24px 26px;
}
.material-overview-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid #eee4d7;
}
.material-overview-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.material-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.material-overview-card {
  padding: 16px 16px 15px;
  border-radius: 18px;
  border: 1px solid #ebe2d6;
  background: #fffdfa;
}
.material-overview-card strong {
  display: block;
  margin-bottom: 8px;
  color: #342b23;
  font-size: 14px;
}

.material-compose-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, 0.82fr);
  gap: 18px;
  align-items: start;
}
.material-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.material-inline-field label,
.material-main-field label {
  display: block;
  color: #4e4032;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 7px;
}
.material-compose-surface input[type=text],
.material-compose-surface textarea,
.material-compose-surface input[type=file] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #ddd6ca;
  background: #fffdfa;
  color: #2d2b28;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.material-compose-surface input[type=text]:focus,
.material-compose-surface textarea:focus,
.material-compose-surface input[type=file]:focus {
  border-color: #c77b3f;
  box-shadow: 0 0 0 3px rgba(199,123,63,0.08);
  background: #fff;
}
.material-file-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.material-field-note {
  color: #8b8780;
  font-size: 12px;
  line-height: 1.7;
}
.material-main-input {
  min-height: 360px !important;
  padding: 20px !important;
  border-radius: 22px !important;
  border: 1px solid #e1d8c9 !important;
  background: #fffdf9 !important;
  font-size: 15px !important;
  line-height: 1.8 !important;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.material-main-input:focus {
  border-color: #c77b3f !important;
  box-shadow: 0 0 0 4px rgba(199,123,63,0.08);
}
.material-compose-note {
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid #eadcc8;
  background: rgba(255, 251, 245, 0.84);
  color: #6d6257;
  font-size: 13px;
  line-height: 1.7;
}
.material-side-panel {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid #eadfd0;
  background: #fffdfa;
}
.material-side-panel-title {
  color: #241d16;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
}
.material-side-panel-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px dashed #e4d7c6;
}
.material-side-panel-item:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.material-side-panel-item strong {
  color: #3b3128;
  font-size: 13px;
}
.material-side-panel-item span {
  color: #6f675d;
  font-size: 13px;
  line-height: 1.72;
}

.material-detail-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.material-summary-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #e8dfd3;
  background: #fbf9f5;
}
.material-summary-item span {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: #9b938b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.material-summary-item strong {
  color: #2d2b28;
  font-size: 14px;
  line-height: 1.5;
}
.material-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: 16px;
  align-items: start;
}
.material-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.material-markdown-view {
  padding-top: 4px;
}

.material-version-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid #e8dfd3;
  background: #fffdfa;
}
.material-version-row.active {
  border-color: #d7b28a;
  background: #fffaf4;
}
.material-version-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.material-version-row-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.material-version-row-title {
  color: #241d16;
  font-size: 15px;
  font-weight: 700;
}
.material-version-row-time {
  color: #8b8780;
  font-size: 12px;
}
.material-version-row-preview {
  color: #3d352d;
  font-size: 13px;
  line-height: 1.72;
}
.material-version-row-side {
  flex-shrink: 0;
}

.material-source-card {
  border: 1px solid #ebe2d5;
  border-radius: 20px;
  background: #fcfaf6;
  padding: 15px 16px;
}
.material-source-card summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}
.material-source-card summary::-webkit-details-marker {
  display: none;
}
.material-source-summary-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.material-source-title {
  color: #241d16;
  font-size: 14px;
  font-weight: 700;
}
.material-source-meta {
  color: #8b8780;
  font-size: 12px;
  line-height: 1.6;
}
.material-source-toggle {
  flex-shrink: 0;
  color: #b56e34;
  font-size: 12px;
  font-weight: 700;
}
.material-source-card[open] .material-source-toggle {
  color: #875327;
}
.material-source-note {
  margin: 12px 0 10px;
  color: #8b8780;
  font-size: 12px;
}
.material-source-text {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 14px;
  border: 1px solid #efe7da;
  background: #fff;
  padding: 14px;
  font-size: 13px;
  line-height: 1.72;
  color: #2d2b28;
}

.material-chat-surface {
  position: sticky;
  top: 76px;
}
.material-messages {
  min-height: 360px;
  max-height: 620px;
  border: 1px solid #ebe2d5;
  border-radius: 18px;
  overflow: auto;
  background: #fffdfa;
}
.material-input-area {
  padding: 0;
  margin-top: 14px;
}

@media (max-width: 1220px) {
  .material-center-shell,
  .material-compose-shell,
  .material-detail-shell {
    grid-template-columns: 280px minmax(0, 1fr);
  }
}

@media (max-width: 1080px) {
  .material-center-shell,
  .material-compose-shell,
  .material-detail-shell,
  .material-compose-grid,
  .material-detail-layout,
  .material-detail-summary-strip {
    grid-template-columns: 1fr;
  }

  .material-history-panel,
  .material-chat-surface {
    position: static;
    min-height: auto;
  }

  .material-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .material-history-panel,
  .material-overview-surface,
  .material-compose-surface,
  .material-surface {
    padding: 16px;
    border-radius: 18px;
  }

  .material-main-header h2 {
    font-size: 26px;
  }

  .material-main-header,
  .material-section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .material-inline-grid {
    grid-template-columns: 1fr;
  }

  .material-version-row,
  .material-main-header-actions,
  .material-overview-actions {
    width: 100%;
    align-items: flex-start;
  }
}
