@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

#tool-body {
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: rgba(13, 148, 136, 0.1);
  --accent-ring: rgba(13, 148, 136, 0.28);
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --user-bg: #0d9488;
  --user-fg: #fff;
  --bot-bg: #ffffff;
  --bot-border: #e5e7eb;
  --danger: #dc2626;
  --ok: #059669;
  --code-bg: #0f172a;
  --code-fg: #e2e8f0;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.04);
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.theme-dark-mode #tool-body {
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.14);
  --accent-ring: rgba(45, 212, 191, 0.28);
  --bg: #0a0e14;
  --surface: #121821;
  --surface-2: #18202b;
  --border: #2a3544;
  --border-strong: #3b4a5c;
  --text: #eef2f7;
  --text-2: #a8b3c2;
  --text-3: #7a8698;
  --user-bg: #0f766e;
  --bot-bg: #18202b;
  --bot-border: #2a3544;
  --code-bg: #0a0e14;
  --code-fg: #cbd5e1;
  --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.28);
}

#tool-body * { box-sizing: border-box; }
#tool-body button { font-family: inherit; }
#tool-body input,
#tool-body textarea,
#tool-body select { font-family: inherit; }

#tool-body .llm-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

/* ---- Sidebar ---- */
#tool-body .llm-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  /*       max-height: min(720px, 85vh);
  overflow-y: auto; */
}
#tool-body .llm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
#tool-body .llm-card-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  user-select: none;
}
#tool-body .llm-card-hd h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
#tool-body .llm-card-hd h3 i { color: var(--accent); font-size: 13px; }
#tool-body .llm-chevron {
  color: var(--text-3);
  transition: transform 0.2s ease;
  font-size: 12px;
}
#tool-body .llm-card.is-collapsed .llm-chevron { transform: rotate(-90deg); }
#tool-body .llm-card.is-collapsed .llm-card-bd { display: none; }
#tool-body .llm-card-bd { padding: 14px; }

#tool-body .llm-field { margin-bottom: 12px; }
#tool-body .llm-field:last-child { margin-bottom: 0; }
#tool-body .llm-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}
#tool-body .llm-help {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
#tool-body .llm-help:hover { background: var(--accent); color: #fff; }

#tool-body .llm-input,
#tool-body .llm-textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#tool-body .llm-input:focus,
#tool-body .llm-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
#tool-body .llm-textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}
#tool-body .llm-input::placeholder,
#tool-body .llm-textarea::placeholder { color: var(--text-3); }

#tool-body .llm-model-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
#tool-body .llm-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
#tool-body .llm-icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

#tool-body .llm-temp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
#tool-body .llm-temp-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
#tool-body .llm-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--pct, 35%), var(--border) var(--pct, 35%), var(--border) 100%);
  outline: none;
  cursor: pointer;
}
#tool-body .llm-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}
.theme-dark-mode #tool-body .llm-range::-webkit-slider-thumb { border-color: var(--surface); }

#tool-body .llm-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
#tool-body .llm-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
#tool-body .llm-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
#tool-body .llm-switch span {
  position: absolute;
  inset: 0;
  background: var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
#tool-body .llm-switch span::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
#tool-body .llm-switch input:checked + span { background: var(--accent); }
#tool-body .llm-switch input:checked + span::after { transform: translateX(18px); }

#tool-body .llm-ghost-btn {
  width: 100%;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
#tool-body .llm-ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

#tool-body .llm-session-hd-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
#tool-body .llm-session-list { max-height: 200px; overflow-y: auto; }
#tool-body .llm-session-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
#tool-body .llm-session-item:last-child { border-bottom: none; }
#tool-body .llm-session-item:hover { background: var(--accent-soft); }
#tool-body .llm-session-item.is-active { background: var(--accent-soft); }
#tool-body .llm-session-item .main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  border: none;
  background: transparent;
  text-align: left;
  padding: 0;
  color: inherit;
  font-family: inherit;
}
#tool-body .llm-session-item .t {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
#tool-body .llm-session-item .tm {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
#tool-body .llm-session-del {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  flex-shrink: 0;
}
#tool-body .llm-session-del:hover {
  background: rgba(220, 38, 38, 0.12);
  color: var(--danger);
}
#tool-body .llm-empty-mini {
  padding: 20px 14px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
}

/* ---- Main ---- */
#tool-body .llm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 740px;
  max-height: 95vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
#tool-body .llm-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}
#tool-body .llm-mode-seg {
  display: inline-flex;
  padding: 3px;
  background: var(--bg);
  border-radius: 999px;
  border: 1px solid var(--border);
}
#tool-body .llm-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
#tool-body .llm-mode-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.theme-dark-mode #tool-body .llm-mode-btn.active {
  background: var(--surface-2);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
#tool-body .llm-top-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

#tool-body .llm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
#tool-body .llm-btn:disabled { opacity: 0.55; cursor: not-allowed; }
#tool-body .llm-btn-primary {
  background: var(--accent);
  color: #fff;
}
#tool-body .llm-btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
#tool-body .llm-btn-soft {
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--border);
}
#tool-body .llm-btn-soft:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--surface-2);
}
#tool-body .llm-btn-danger {
  background: var(--danger);
  color: #fff;
}
#tool-body .llm-btn-sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

#tool-body .llm-privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 14px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}
.theme-dark-mode #tool-body .llm-privacy {
  border: 1px solid rgba(45, 212, 191, 0.22);
}
#tool-body .llm-privacy i {
  color: var(--accent);
  margin-top: 1px;
  flex-shrink: 0;
}
#tool-body .llm-privacy-body { flex: 1; min-width: 0; }
#tool-body .llm-privacy-close {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#tool-body .llm-privacy-close:hover {
  background: rgba(0,0,0,0.06);
  color: var(--text);
}
.theme-dark-mode #tool-body .llm-privacy-close:hover {
  background: rgba(255,255,255,0.08);
}

/* Chat */
#tool-body .llm-chat-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#tool-body .llm-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 8px;
  min-height: 0;
  scroll-behavior: smooth;
}
#tool-body .llm-welcome {
  max-width: 420px;
  margin: 48px auto;
  text-align: center;
}
#tool-body .llm-welcome .logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #14b8a6, #0d9488 55%, #0f766e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.35);
}
#tool-body .llm-welcome h4 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 650;
}
#tool-body .llm-welcome p {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 13px;
}
#tool-body .llm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
#tool-body .llm-chip {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
#tool-body .llm-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

#tool-body .llm-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  animation: llm-in 0.25s ease;
}
@keyframes llm-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
#tool-body .llm-msg.user { flex-direction: row-reverse; }
#tool-body .llm-av {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
}
#tool-body .llm-msg.user .llm-av { background: var(--accent); }
#tool-body .llm-msg.assistant .llm-av {
  background: linear-gradient(135deg, #334155, #1e293b);
}
#tool-body .llm-bubble {
  max-width: min(78%, 680px);
  padding: 11px 14px;
  border-radius: 16px;
  line-height: 1.65;
  word-break: break-word;
  font-size: 14px;
}
#tool-body .llm-msg.user .llm-bubble {
  background: var(--user-bg);
  color: var(--user-fg);
  border-bottom-right-radius: 6px;
  white-space: pre-wrap;
}
#tool-body .llm-msg.assistant .llm-bubble {
  background: var(--bot-bg);
  border: 1px solid var(--bot-border);
  color: var(--text);
  border-bottom-left-radius: 6px;
}
#tool-body .llm-bubble pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 8px 0;
  font-family: var(--mono);
  font-size: 12.5px;
}
#tool-body .llm-bubble code { font-family: var(--mono); font-size: 0.92em; }
#tool-body .llm-bubble :not(pre) > code {
  background: var(--accent-soft);
  color: var(--accent-hover);
  padding: 1px 5px;
  border-radius: 4px;
}
.theme-dark-mode #tool-body .llm-bubble :not(pre) > code { color: #5eead4; }
#tool-body .llm-bubble p { margin: 0 0 8px; }
#tool-body .llm-bubble p:last-child { margin-bottom: 0; }
#tool-body .llm-bubble ul,
#tool-body .llm-bubble ol { margin: 6px 0; padding-left: 1.3em; }
#tool-body .llm-bubble table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 13px;
}
#tool-body .llm-bubble th,
#tool-body .llm-bubble td {
  border: 1px solid var(--border);
  padding: 5px 8px;
}
#tool-body .llm-typing::after {
  content: '\25AE';
  animation: llm-blink 0.9s step-end infinite;
  color: var(--accent);
  margin-left: 1px;
}
@keyframes llm-blink { 50% { opacity: 0; } }
#tool-body .llm-msg-col {
  display: flex;
  flex-direction: column;
  max-width: min(78%, 680px);
  min-width: 0;
}
#tool-body .llm-msg.user .llm-msg-col { align-items: flex-end; }
#tool-body .llm-msg.assistant .llm-msg-col { align-items: flex-start; }
#tool-body .llm-msg-col .llm-bubble { max-width: 100%; }
#tool-body .llm-msg-actions {
  display: flex;
  gap: 2px;
  margin-top: 4px;
  padding: 0 2px;
  min-height: 28px;
  opacity: 0.35;
  transition: opacity 0.15s;
}
#tool-body .llm-msg:hover .llm-msg-actions,
#tool-body .llm-msg-actions:focus-within { opacity: 1; }
#tool-body .llm-act-btn {
  border: none;
  background: transparent;
  color: var(--text-3);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
#tool-body .llm-act-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
#tool-body .llm-key-wrap {
  position: relative;
}
#tool-body .llm-key-wrap .llm-input {
  padding-right: 40px;
}
#tool-body .llm-eye-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
#tool-body .llm-eye-btn:hover { color: var(--accent); background: var(--accent-soft); }

#tool-body .llm-composer {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
#tool-body .llm-composer-box {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-2);
  padding: 10px 10px 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#tool-body .llm-composer-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  background: var(--surface);
}
#tool-body .llm-composer-box textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 52px;
  max-height: 160px;
  padding: 2px 6px;
}
#tool-body .llm-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 2px 0;
}
#tool-body .llm-composer-left {
  display: flex;
  align-items: center;
  gap: 4px;
}
#tool-body .llm-file-input { display: none; }
#tool-body .llm-attach-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 6px 8px;
}
#tool-body .llm-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 12px;
}
#tool-body .llm-attach-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
#tool-body .llm-attach-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 14px;
}
#tool-body .llm-base-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  position: relative;
}
#tool-body .llm-base-menu {
  display: none;
  position: absolute;
  left: 0;
  right: 46px;
  top: calc(100% + 4px);
  z-index: 30;
  max-height: 240px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
}
#tool-body .llm-base-menu.open { display: block; }
#tool-body .llm-base-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
#tool-body .llm-base-opt:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}
#tool-body .llm-base-opt .sub {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  font-family: var(--mono);
  word-break: break-all;
}

/* Debug */
#tool-body .llm-debug-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
#tool-body .llm-debug-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
#tool-body .llm-debug-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 420px;
}
#tool-body .llm-debug-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
#tool-body .llm-debug-pane + .llm-debug-pane { border-left: 1px solid var(--border); }
#tool-body .llm-debug-pane-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
#tool-body .llm-meta {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}
#tool-body .llm-meta .ok { color: var(--ok); }
#tool-body .llm-meta .err { color: var(--danger); }
#tool-body .llm-code {
  flex: 1;
  width: 100%;
  min-height: 380px;
  border: none;
  resize: vertical;
  padding: 14px;
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  outline: none;
}
#tool-body .llm-code:focus { background: var(--surface-2); }

/* Modals content (also used inside layui layer, outside #tool-body) */
#tool-body .llm-guide-wrap,
.llm-guide-wrap { padding: 4px 2px 0; }
#tool-body .llm-guide-lead,
.llm-guide-lead {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.1);
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}
.theme-dark-mode .llm-guide-lead {
  background: rgba(45, 212, 191, 0.14);
  color: #a8b3c2;
}
#tool-body .llm-guide-step,
.llm-guide-step {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
#tool-body .llm-guide-num,
.llm-guide-num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #0d9488;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.theme-dark-mode .llm-guide-num {
  background: #2dd4bf;
  color: #042f2e;
}
#tool-body .llm-guide-step h4,
.llm-guide-step h4 { margin: 2px 0 4px; font-size: 14px; color: inherit; }
#tool-body .llm-guide-step p,
.llm-guide-step p { margin: 0; color: #4b5563; font-size: 13px; line-height: 1.5; }
.theme-dark-mode .llm-guide-step p { color: #a8b3c2; }
#tool-body .llm-url-list,
.llm-url-list { margin: 0; padding-left: 18px; line-height: 1.85; font-size: 13px; }
#tool-body .llm-url-list code,
.llm-url-list code {
  font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
  font-size: 11.5px;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  padding: 1px 6px;
  border-radius: 5px;
}
.theme-dark-mode .llm-url-list code {
  background: #18202b;
  border-color: #2a3544;
  color: #cbd5e1;
}

/* layer is appended to body, so skin styles cannot be scoped under #tool-body */
.llm-layer-skin {
  border-radius: 16px !important;
  overflow: hidden;
  border: 1px solid #e5e7eb !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18) !important;
}
.llm-layer-skin .layui-layer-title {
  background: #f8f9fb !important;
  border-bottom: 1px solid #e5e7eb !important;
  color: #111827 !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  height: 48px !important;
  line-height: 48px !important;
  padding: 0 18px !important;
}
.llm-layer-skin .layui-layer-content {
  background: #fff !important;
  color: #111827 !important;
  padding: 16px 18px !important;
}
.llm-layer-skin .layui-layer-btn {
  background: #f8f9fb !important;
  border-top: 1px solid #e5e7eb !important;
  padding: 12px 18px !important;
}
.llm-layer-skin .layui-layer-btn a {
  border-radius: 10px !important;
  height: 34px !important;
  line-height: 34px !important;
  padding: 0 16px !important;
  border: none !important;
  background: #0d9488 !important;
  color: #fff !important;
}
.theme-dark-mode .llm-layer-skin {
  border-color: #2a3544 !important;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55) !important;
}
.theme-dark-mode .llm-layer-skin .layui-layer-title {
  background: #18202b !important;
  border-bottom-color: #2a3544 !important;
  color: #eef2f7 !important;
}
.theme-dark-mode .llm-layer-skin .layui-layer-content {
  background: #121821 !important;
  color: #eef2f7 !important;
}
.theme-dark-mode .llm-layer-skin .layui-layer-btn {
  background: #18202b !important;
  border-top-color: #2a3544 !important;
}
.theme-dark-mode .llm-layer-skin .layui-layer-btn a {
  background: #2dd4bf !important;
  color: #042f2e !important;
}

@media (max-width: 1000px) {
  #tool-body .llm-shell { grid-template-columns: 1fr; }
  #tool-body .llm-side { max-height: none; }
  #tool-body .llm-main { height: min(580px, 80vh); max-height: min(580px, 80vh); }
  #tool-body .llm-debug-grid { grid-template-columns: 1fr; }
  #tool-body .llm-debug-pane + .llm-debug-pane {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  #tool-body .llm-code { min-height: 220px; }
  #tool-body .llm-bubble { max-width: 88%; }
  #tool-body .llm-msg-col { max-width: 88%; }
}

#tool-body .llm-card.is-collapsed .llm-card-hd {
  border-bottom: none;
}