:root {
  color-scheme: dark;
  --bg: #0a0a0e;
  --panel: #111114;
  --panel2: #16161c;
  --line: #25252e;
  --line2: #2e2e38;
  --fg: #e8e8ec;
  --fg2: #a8a8b2;
  --muted: #6e6e78;
  --accent: #39ff14;
  --accent2: #2bd109;
  --link: #58a6ff;
  --user-bg: #1a1d24;
  --bot-bg: transparent;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100dvh; overflow: hidden; }
body { background: var(--bg); color: var(--fg); font-family: ui-sans-serif, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; line-height: 1.55; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* App layout: sidebar | main */
#root, .app { display: flex; height: 100dvh; }

/* ─── sidebar ─── */
.sidebar {
  width: 260px; flex: none;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 12px 8px;
}
.sidebar-brand {
  font-size: 17px; font-weight: 700; padding: 6px 10px 14px;
  letter-spacing: -0.4px;
}
.sidebar-brand .accent { color: var(--accent); }
.new-chat {
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line2);
  border-radius: 8px; padding: 10px 12px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  transition: background 0.12s, border-color 0.12s;
}
.new-chat:hover { background: #1a1a22; border-color: #353542; }
.new-chat .plus { color: var(--accent); font-size: 16px; font-weight: 700; }
.chat-list { margin-top: 16px; flex: 1; overflow-y: auto; padding-right: 4px; }
.chat-list-group { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; padding: 14px 10px 6px; font-weight: 600; }
.chat-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; color: var(--fg2);
  transition: background 0.1s;
}
.chat-row:hover { background: var(--panel2); color: var(--fg); }
.chat-row.active { background: var(--panel2); color: var(--fg); }
.chat-row .icon { font-size: 14px; flex: none; opacity: 0.9; }
.chat-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── main ─── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* top tab strip */
.tabs {
  display: flex; gap: 4px; padding: 8px 16px 0;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.tab {
  background: transparent; border: 0; color: var(--fg2);
  padding: 10px 16px; font-size: 13px; font-weight: 500;
  border-radius: 6px 6px 0 0; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s, border-color 0.12s;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }

/* subtab strip */
.subtabs {
  display: flex; gap: 4px; padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.subtab {
  background: var(--panel2); border: 1px solid var(--line2); color: var(--fg2);
  padding: 5px 12px; font-size: 12px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.subtab:hover { color: var(--fg); border-color: #404050; }
.subtab.active { background: var(--accent); color: #0a0a0e; border-color: var(--accent); font-weight: 600; }
.subtab .icon { font-size: 13px; }

/* chat area */
.chat-area {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}
.messages {
  flex: 1; overflow-y: auto; padding: 24px 0;
}
.msg-row {
  max-width: 760px; margin: 0 auto; padding: 14px 24px;
  display: flex; gap: 14px;
}
.msg-avatar {
  width: 28px; height: 28px; border-radius: 6px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.msg-avatar.u { background: var(--user-bg); color: var(--link); }
.msg-avatar.a { background: var(--accent); color: #0a0a0e; }
.msg-body { flex: 1; min-width: 0; word-wrap: break-word; }
.msg-body p { margin: 0 0 8px; }
.msg-body p:last-child { margin-bottom: 0; }
.msg-body img, .msg-body video { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.msg-body iframe { width: 100%; height: 420px; border: 1px solid var(--line2); border-radius: 8px; margin: 8px 0; background: #000; }
.msg-body pre { background: var(--panel2); padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 12px; }
.msg-body .upload-form {
  background: var(--panel); border: 1px dashed var(--line2);
  border-radius: 8px; padding: 14px; margin: 10px 0;
  display: flex; gap: 10px; align-items: center;
}
.msg-body .upload-form input[type=file] {
  background: transparent; border: 0; color: var(--fg2); font-size: 12px; flex: 1;
}
.msg-body .upload-form button {
  background: var(--accent); color: #0a0a0e; border: 0;
  padding: 8px 16px; border-radius: 6px; font-weight: 600;
}

/* composer */
.composer-wrap {
  border-top: 1px solid var(--line); padding: 16px 24px 20px;
  background: var(--bg);
}
.composer {
  max-width: 760px; margin: 0 auto; position: relative;
  display: flex; align-items: flex-end;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 14px; padding: 8px 8px 8px 16px;
}
.composer:focus-within { border-color: #404050; }
.composer textarea {
  flex: 1; background: transparent; border: 0; color: var(--fg);
  font-size: 14px; line-height: 1.5; resize: none; outline: none;
  padding: 8px 0; max-height: 180px; min-height: 22px;
}
.composer textarea::placeholder { color: var(--muted); }
.send-btn {
  background: var(--accent); color: #0a0a0e; border: 0;
  width: 36px; height: 36px; border-radius: 8px; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-left: 8px; transition: background 0.12s, opacity 0.12s;
}
.send-btn:hover { background: var(--accent2); }
.send-btn:disabled { background: var(--line2); color: var(--muted); cursor: not-allowed; }

/* empty / picker states */
.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; color: var(--fg2);
}
.empty h1 { font-size: 28px; margin: 0 0 8px; color: var(--fg); font-weight: 700; }
.empty p { font-size: 14px; color: var(--fg2); margin: 0 0 28px; max-width: 480px; text-align: center; }
.workflow-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; max-width: 720px; width: 100%;
}
.wf-card {
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 10px; padding: 18px; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  color: var(--fg); transition: border-color 0.12s, transform 0.1s;
}
.wf-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.wf-card .icon { font-size: 24px; }
.wf-card .label { font-weight: 600; font-size: 14px; }
.wf-card .desc { font-size: 12px; color: var(--fg2); line-height: 1.5; }

/* settings button (bottom of sidebar) */
.settings-btn {
  background: transparent; color: var(--fg2); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 12px; font-size: 12.5px;
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.settings-btn:hover { background: var(--panel2); color: var(--fg); border-color: var(--line2); }
.settings-btn .gear { font-size: 14px; }

/* settings overlay + modal */
.settings-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.settings-modal {
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: 14px; width: 100%; max-width: 880px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.settings-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line);
}
.settings-title { font-size: 18px; font-weight: 700; }
.settings-sub { font-size: 12.5px; color: var(--fg2); margin-top: 4px; }
.settings-close {
  background: transparent; color: var(--fg2); border: 0; font-size: 24px;
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
}
.settings-close:hover { background: var(--panel2); color: var(--fg); }
.settings-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 20px 24px 24px; overflow-y: auto;
}
@media (max-width: 700px) { .settings-grid { grid-template-columns: 1fr; } }
.acct-card {
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px;
}
.acct-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.acct-icon { font-size: 17px; }
.acct-label { flex: 1; font-weight: 600; font-size: 13.5px; }
.acct-status { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 12px; letter-spacing: 0.3px; }
.acct-status.empty { background: #1a1a22; color: var(--muted); }
.acct-status.partial { background: #2a2618; color: #d4a437; }
.acct-status.configured { background: #1a2a18; color: #6dc26d; }
.acct-status.verified { background: var(--accent); color: #0a0a0e; }
.acct-fields { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.acct-fields input {
  background: var(--bg); border: 1px solid var(--line); color: var(--fg);
  padding: 7px 10px; border-radius: 6px; font-size: 12px; font-family: ui-monospace, monospace;
}
.acct-fields input:focus { border-color: var(--link); outline: none; }
.acct-actions { display: flex; gap: 6px; align-items: center; }
.acct-actions button {
  background: var(--link); color: white; border: 0;
  padding: 6px 12px; border-radius: 5px; font-size: 11.5px; font-weight: 600;
}
.acct-actions button:hover { filter: brightness(1.15); }
.acct-actions button.test { background: var(--accent); color: #0a0a0e; }
.acct-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.acct-feedback { font-size: 11px; margin-left: 4px; }
.acct-feedback.ok { color: var(--accent); }
.acct-feedback.err { color: #f88; }

/* scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #2a2a35; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #353542; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── Phase 7: status dots ─── */
.status-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; font-size: 0; line-height: 0;
  vertical-align: middle; margin-right: 4px; flex: none;
}
.status-dot.status-red    { background: #ff4d4f; box-shadow: 0 0 6px rgba(255,77,79,0.5); animation: status-pulse 1.4s ease-in-out infinite; }
.status-dot.status-yellow { background: #f5a524; }
.status-dot.status-green  { background: #39ff14; }
.status-dot.status-idle   { background: #4a4a55; }
@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.45; transform: scale(0.75); }
}
@media (prefers-reduced-motion: reduce) {
  .status-dot.status-red { animation: none; }
}

/* ─── Phase 7: folder render ─── */
.folder-render { padding-top: 6px; }
.folder-actions { padding: 4px 8px; }
.folder-add-btn {
  background: transparent; color: var(--fg2); border: 1px dashed var(--line2);
  border-radius: 6px; padding: 4px 10px; font-size: 11px; cursor: pointer;
  width: 100%; text-align: left;
}
.folder-add-btn:hover { color: var(--accent); border-color: var(--accent); }
.folder-block { margin: 4px 0; }
.folder-header {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: var(--fg);
  cursor: pointer; border-left: 3px solid transparent;
  transition: background 0.1s;
}
.folder-header:hover { background: var(--panel2); }
.folder-header.expanded { background: var(--panel2); }
.folder-caret { width: 12px; color: var(--fg2); font-size: 10px; }
.folder-icon { font-size: 13px; }
.folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-count { font-size: 10px; color: var(--muted); }
.status-folder-red    .folder-header { border-left-color: #ff4d4f; }
.status-folder-yellow .folder-header { border-left-color: #f5a524; }
.status-folder-green  .folder-header { border-left-color: #39ff14; }
.status-folder-idle   .folder-header { border-left-color: var(--line2); }
.chat-row.in-folder { padding-left: 22px; position: relative; }
.loose-section { margin-top: 6px; }
.todo-section { margin-top: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.todo-section .chat-list-group { color: var(--accent); }
.move-menu {
  position: absolute; right: 4px; top: 100%; z-index: 20;
  background: var(--panel); border: 1px solid var(--line2);
  border-radius: 6px; padding: 4px; min-width: 160px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  display: flex; flex-direction: column; gap: 2px;
}
.move-menu-head {
  font-size: 10px; color: var(--muted);
  padding: 4px 8px; text-transform: uppercase; letter-spacing: 0.6px;
}
.move-menu-item {
  background: transparent; color: var(--fg); border: 0;
  padding: 5px 8px; border-radius: 4px; font-size: 12px; text-align: left;
  cursor: pointer;
}
.move-menu-item:hover { background: var(--panel2); color: var(--accent); }

/* ─── Phase 7: breadcrumb pill ─── */
.breadcrumb-pill {
  max-width: 760px; margin: 0 auto 6px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 4px 10px; font-size: 11px;
  background: var(--panel2); border: 1px solid var(--line2);
  border-radius: 999px;
  color: var(--fg2); font-family: ui-monospace, monospace;
}
.breadcrumb-pill .bc-slash { color: var(--muted); }
.breadcrumb-pill .bc-folder { color: var(--accent); font-weight: 600; }
.breadcrumb-pill .bc-flow { color: var(--fg); }
.breadcrumb-pill .bc-sep { color: var(--muted); }
.breadcrumb-pill .bc-count { color: var(--link); font-weight: 600; }
.breadcrumb-pill .bc-save {
  margin-left: auto; background: var(--accent); color: #0a0a0e;
  border: 0; border-radius: 999px; padding: 3px 10px;
  font-size: 11px; font-weight: 600; cursor: pointer;
}
.breadcrumb-pill .bc-save:hover { filter: brightness(1.15); }

/* ─── Phase 7: composer button row ─── */
.composer-buttons {
  max-width: 760px; margin: 6px auto 0;
  display: flex; align-items: center; gap: 6px;
}
.composer-btn {
  background: var(--panel2); color: var(--fg2);
  border: 1px solid var(--line2); border-radius: 8px;
  padding: 6px 10px; font-size: 13px; cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.composer-btn:hover { background: var(--panel); color: var(--fg); border-color: var(--line2); }
.composer-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.composer-btn.todo-btn.on { background: var(--accent); color: #0a0a0e; border-color: var(--accent); font-weight: 600; }
.composer-btn.attach-btn { font-size: 15px; }

/* ═════════════════════════════════════════════════════════════════════════ */
/* ─── PHASE 10: Card grammar + lineage + slide transitions ──────────────── */
/* ═════════════════════════════════════════════════════════════════════════ */

/* Slide-container — wraps .messages so it animates without disturbing scroll */
.messages-container {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
  will-change: transform;
  transform: translateX(0);
  transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.messages-container.slide-in {
  animation: card-slide-in 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes card-slide-in {
  from { transform: translateX(8%); opacity: 0.7; }
  to   { transform: translateX(0);  opacity: 1;   }
}

/* Row wrapper retains avatar + body alignment; card sits inside .msg-body */
.msg-row.card-row {
  outline: none;
  transition: background 120ms;
  position: relative;
}
.msg-row.card-row:hover { background: rgba(255,255,255,0.012); }
.msg-row.card-row:focus { background: rgba(57,255,20,0.03); }

/* ─── Card grammar — uniform shape ──────────────────────────────────────── */
.card {
  background: var(--panel2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 12px 14px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.card.lineage-glow {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(57,255,20,0.25);
}
.card-caption {
  font-size: 10.5px; color: var(--muted); letter-spacing: 0.4px;
  text-transform: uppercase; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.card-body {
  font-size: 13.5px; color: var(--fg); line-height: 1.5;
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
}
.card-footer {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding-top: 8px; border-top: 1px solid var(--line);
}
.card-btn {
  background: var(--panel); color: var(--fg2); border: 1px solid var(--line2);
  border-radius: 6px; padding: 5px 10px; font-size: 11.5px; cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
}
.card-btn:hover { background: var(--panel2); color: var(--fg); border-color: var(--line2); }
.card-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.card-btn.card-btn-accent { background: var(--accent); color: #0a0a0e; border-color: var(--accent); font-weight: 600; }
.card-btn.card-btn-accent:hover { background: var(--accent2); }
.card-btn.card-btn-warn { background: transparent; color: #ff7e7e; border-color: #5a2a2a; }
.card-btn.card-btn-warn:hover { background: #2a1818; color: #ff9d9d; }
.card-btn-menu { position: relative; }
.card-menu {
  position: absolute; top: 100%; left: 0; z-index: 30; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--line2); border-radius: 8px;
  min-width: 200px; padding: 4px; display: flex; flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.card-menu-item {
  background: transparent; color: var(--fg); border: 0; text-align: left;
  padding: 6px 10px; font-size: 12px; border-radius: 4px; cursor: pointer;
}
.card-menu-item:hover { background: var(--panel2); color: var(--accent); }

/* ─── TextCard (fallback / legacy) ──────────────────────────────────────── */
.card-text {
  background: transparent;
  border: 0;
  padding: 0;
}
.card-text.card-user .card-body {
  background: var(--user-bg); padding: 10px 14px; border-radius: 12px;
  border: 1px solid var(--line);
}

/* ─── EmailCard ─────────────────────────────────────────────────────────── */
.card-email .email-from { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.card-email .email-from-name { font-weight: 600; color: var(--fg); }
.card-email .email-from-addr { color: var(--muted); font-family: ui-monospace, monospace; font-size: 11.5px; }
.card-email .email-subject { font-size: 14.5px; font-weight: 600; color: var(--fg); margin-top: 2px; }
.card-email .email-body {
  font-size: 13px; color: var(--fg2); white-space: pre-wrap; line-height: 1.5;
  max-height: 240px; overflow-y: auto;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px;
}
.card-email .email-attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.card-email .att-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line2);
  font-size: 11.5px; color: var(--fg);
  text-decoration: none;
}
.card-email .att-chip:hover { border-color: var(--accent); color: var(--accent); }
.card-email .att-icon { font-size: 12.5px; }

/* ─── CallCard ──────────────────────────────────────────────────────────── */
.card-call .call-from { font-weight: 600; font-size: 13px; }
.card-call .call-transcript {
  font-size: 12.5px; color: var(--fg2); white-space: pre-wrap;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; max-height: 180px; overflow-y: auto;
}

/* ─── DocumentCard ──────────────────────────────────────────────────────── */
.card-doc iframe {
  width: 100%; height: 380px; border: 1px solid var(--line);
  border-radius: 6px; background: #fff;
}
.card-doc .doc-icon-block {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 14px;
}
.card-doc .doc-icon { font-size: 28px; }

/* ─── MediaCard ─────────────────────────────────────────────────────────── */
.card-media img, .card-media video {
  max-width: 100%; border-radius: 8px; display: block;
}

/* ─── ApprovalCard ──────────────────────────────────────────────────────── */
.card-approval { border-style: dashed; border-color: #5a4528; }
.card-approval textarea {
  width: 100%; min-height: 120px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font-family: ui-monospace, monospace; font-size: 12.5px;
  resize: vertical; outline: none;
}
.card-approval textarea:focus { border-color: var(--accent); }

/* ─── RecallCard ────────────────────────────────────────────────────────── */
.card-recall .recall-chip {
  display: flex; gap: 8px; align-items: baseline;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px;
  font-size: 12px;
}
.card-recall .recall-score {
  font-family: ui-monospace, monospace; font-size: 11px;
  color: var(--accent); min-width: 36px;
}
.card-recall .recall-source { color: var(--link); font-size: 11px; min-width: 80px; }
.card-recall .recall-text { color: var(--fg2); flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* ─── TemplateCard ──────────────────────────────────────────────────────── */
.card-template .template-preview {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 12px;
}
.card-template .template-icon { font-size: 26px; }
.card-template .template-name { font-weight: 600; font-size: 13px; }
.card-template .template-snippet { font-size: 11.5px; color: var(--fg2); margin-top: 4px; }

/* ─── WorkflowStepCard ──────────────────────────────────────────────────── */
.card-workflow-step .step-ask { font-size: 13.5px; color: var(--fg); }
.card-workflow-step .card-status { font-size: 11px; color: var(--muted); font-style: italic; }

/* ─── EntityCard ────────────────────────────────────────────────────────── */
.card-entity .entity-name { font-weight: 600; font-size: 14px; color: var(--fg); }
.card-entity .entity-kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 12px; }
.card-entity .entity-k { color: var(--muted); font-family: ui-monospace, monospace; }
.card-entity .entity-v { color: var(--fg); }
.card-entity .entity-events { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--fg2); }
.card-entity .entity-event { font-family: ui-monospace, monospace; padding: 2px 0; }

/* ─── SystemCard (small muted breadcrumb) ───────────────────────────────── */
.card-system {
  background: transparent; border: 0; padding: 4px 0;
  max-width: 760px; margin: 2px auto;
}
.card-system .card-body {
  font-size: 11.5px; color: var(--muted); font-style: italic;
  font-family: ui-monospace, monospace;
}

/* ─── Lineage affordance + drawer ───────────────────────────────────────── */
.lineage-affordance {
  position: absolute; right: 12px; top: 14px;
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 6px; width: 24px; height: 24px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; opacity: 0;
  transition: opacity 150ms, color 150ms, border-color 150ms;
}
.msg-row.card-row:hover .lineage-affordance,
.msg-row.card-row:focus .lineage-affordance { opacity: 1; }
.lineage-affordance:hover { color: var(--accent); border-color: var(--accent); }

.lineage-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 88vw); z-index: 80;
  background: var(--panel); border-left: 1px solid var(--line2);
  box-shadow: -8px 0 24px rgba(0,0,0,0.4);
  display: flex; flex-direction: column;
  transform: translateX(0);
  animation: lineage-drawer-in 240ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes lineage-drawer-in {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.lineage-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.lineage-drawer-title { font-weight: 700; font-size: 14px; }
.lineage-drawer-close {
  background: transparent; color: var(--fg2); border: 0;
  font-size: 18px; width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
}
.lineage-drawer-close:hover { background: var(--panel2); color: var(--fg); }
.lineage-drawer-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.lineage-empty { color: var(--muted); font-size: 12px; font-style: italic; }
.lineage-node {
  display: flex; gap: 8px; align-items: baseline; font-size: 12px;
  padding: 4px 0; border-bottom: 1px dashed var(--line);
}
.lineage-kind { font-size: 13px; }
.lineage-role { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: 0.4px; min-width: 50px; }
.lineage-text { color: var(--fg); flex: 1; }

/* Breadcrumb lineage-pulse on new message landing */
.breadcrumb-pill.lineage-pulse {
  animation: lineage-pulse 450ms ease;
}
@keyframes lineage-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(57,255,20,0.6); }
  50%  { box-shadow: 0 0 0 6px rgba(57,255,20,0.18); }
  100% { box-shadow: 0 0 0 0 rgba(57,255,20,0); }
}

/* prefers-reduced-motion — kill all Phase 10 animations */
@media (prefers-reduced-motion: reduce) {
  .card, .messages-container, .lineage-drawer, .breadcrumb-pill {
    transition: none !important;
    animation: none !important;
  }
}

/* ─── Phase 11: LLMCard ─────────────────────────────────────────────────── */
.card-llm {
  border: 1px solid var(--line2);
  background: linear-gradient(180deg, rgba(57,255,20,0.025), transparent 80%);
}
.card-llm .llm-caption { display: flex; align-items: center; gap: 8px; }
.llm-path { font-family: ui-monospace, monospace; font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); }
.llm-path-cold { color: var(--muted); }
.llm-path-lora { color: var(--accent); border-color: var(--accent); }
.llm-path-relay { color: #ffd86b; border-color: #5a4a1a; }
.llm-thoughts { margin-bottom: 10px; }
.llm-thoughts > summary {
  cursor: pointer; color: var(--fg2); font-size: 11.5px;
  font-family: ui-monospace, monospace; list-style: none;
  padding: 4px 6px; border-radius: 4px; user-select: none;
}
.llm-thoughts > summary:hover { background: var(--panel2); color: var(--fg); }
.llm-thoughts > summary::-webkit-details-marker { display: none; }
.llm-thoughts-body {
  padding: 10px 12px; margin-top: 4px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 6px; font-size: 12px; color: var(--fg2); line-height: 1.5;
  white-space: pre-wrap;
}
.llm-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.llm-choice {
  text-align: left; cursor: pointer;
  background: var(--panel2); color: var(--fg);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font: inherit;
  transition: background 120ms, border-color 120ms, transform 80ms;
}
.llm-choice:hover { background: var(--panel); border-color: var(--line2); }
.llm-choice:active { transform: translateY(1px); }
.llm-choice:disabled { opacity: 0.5; cursor: not-allowed; }
.llm-choice-suggested {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(57,255,20,0.35);
}
.llm-choice-custom { border-style: dashed; color: var(--fg2); }
.llm-choice-label { font-size: 13px; font-weight: 500; }
.llm-choice-hint {
  margin-top: 3px; font-size: 11px; color: var(--muted);
  font-family: ui-monospace, monospace;
}
.llm-custom { display: flex; gap: 6px; align-items: center; }
.llm-custom > input {
  flex: 1; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line2); border-radius: 6px;
  padding: 8px 10px; font: inherit; font-size: 13px;
}
.llm-picked {
  display: flex; gap: 10px; align-items: center; margin-top: 6px;
}
.llm-picked-pill {
  background: rgba(57,255,20,0.1); color: var(--accent);
  border: 1px solid var(--accent); padding: 6px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600;
}
.llm-undo {
  background: transparent; color: var(--muted); border: 1px solid var(--line);
  border-radius: 6px; padding: 3px 8px; font-size: 11px; cursor: pointer;
}
.llm-refine { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.llm-refine textarea {
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font: inherit; font-size: 12px; resize: vertical;
}
.llm-refine-row { display: flex; gap: 6px; }
.llm-footer { gap: 6px; }

/* ─── Phase 11: CardBuilderModal ────────────────────────────────────────── */
.composer-btn.card-builder-btn {
  font-size: 11.5px; padding: 4px 10px;
  border-color: var(--line2); color: var(--fg2);
}
.composer-btn.card-builder-btn:hover { color: var(--accent); border-color: var(--accent); }
.card-builder-modal .cb-steps-row {
  display: flex; gap: 6px; padding: 8px 24px;
  border-bottom: 1px solid var(--line);
}
.cb-step-pip {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 999px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line);
  font-size: 11px; color: var(--muted); flex: 1; min-width: 0;
}
.cb-step-pip:hover { color: var(--fg); border-color: var(--line2); }
.cb-step-active { background: var(--accent); color: #0a0a0e; border-color: var(--accent); font-weight: 600; }
.cb-step-n { font-weight: 700; }
.cb-step-l { font-size: 10.5px; }
.cb-label {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.4px; margin-top: 4px;
}
.cb-input {
  background: var(--bg); border: 1px solid var(--line); color: var(--fg);
  padding: 8px 10px; border-radius: 6px; font: inherit; font-size: 13px;
}
.cb-input:focus { outline: none; border-color: var(--accent); }
.cb-field-row { display: flex; gap: 6px; align-items: center; }
.cb-checkbox-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--fg2); padding: 4px 8px;
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.cb-checkbox-label:has(input:checked) {
  border-color: var(--accent); color: var(--accent);
  background: rgba(57,255,20,0.06);
}
.cb-checkbox-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-preview {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 12px; font-size: 11px; color: var(--fg2);
  max-height: 280px; overflow: auto; white-space: pre-wrap;
}
.cb-error { color: #ff7e7e; font-size: 12px; padding: 4px 0; }
.cb-nav-row { display: flex; gap: 6px; margin-top: 10px; align-items: center; }

/* ─── Phase 11: CustomerSummaryCard + generic UserTemplateCard ──────────── */
.card-customer-summary .customer-cases {
  margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line);
}
.card-user-template .card-text-body { font-size: 13px; line-height: 1.5; color: var(--fg); }
.card-user-template .card-table {
  width: 100%; font-size: 12px; border-collapse: collapse;
}
.card-user-template .card-table td {
  padding: 4px 8px; border-bottom: 1px dashed var(--line);
  font-family: ui-monospace, monospace; color: var(--fg2);
}
.card-user-template .card-iframe {
  width: 100%; min-height: 240px; border: 1px solid var(--line); border-radius: 6px;
}
.entity-events-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--muted); margin-bottom: 4px;
}

/* ─── Phase 11.5: UI Tour Guide — glow, tooltip, 💡 button ────────────────── */
@keyframes tour-glow-pulse {
  0%,100% { box-shadow: 0 0 0 2px var(--accent), 0 0 16px var(--accent); }
  50%     { box-shadow: 0 0 0 4px var(--accent), 0 0 28px var(--accent); }
}
.tour-glow {
  animation: tour-glow-pulse 1.4s ease-in-out infinite;
  position: relative; z-index: 50;
  border-radius: 6px; outline: 2px solid var(--accent);
}
.tour-tooltip {
  position: fixed; z-index: 100;
  background: var(--panel); border: 1px solid var(--accent);
  border-radius: 8px; padding: 12px 14px; font-size: 13px;
  max-width: 280px; box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  color: var(--fg);
}
.tour-tooltip::before {
  content: ""; position: absolute; top: -7px; left: 24px;
  width: 12px; height: 12px; background: var(--panel);
  border-left: 1px solid var(--accent); border-top: 1px solid var(--accent);
  transform: rotate(45deg);
}
.tour-tooltip-goal {
  font-size: 11px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 4px;
}
.tour-tooltip-step {
  font-size: 10.5px; color: var(--accent); margin-bottom: 6px;
}
.tour-tooltip-body { line-height: 1.45; }
.tour-tooltip .actions {
  margin-top: 8px; display: flex; gap: 6px;
}
.tour-tooltip .tour-btn-text {
  background: transparent; border: 1px solid var(--line2);
  color: var(--fg2); padding: 4px 10px; border-radius: 5px;
  font: inherit; font-size: 12px; cursor: pointer;
}
.tour-tooltip .tour-btn-text:hover { color: var(--accent); border-color: var(--accent); }
.tour-tooltip .tour-btn-done { color: var(--accent); border-color: var(--accent); }
.tour-btn {
  background: transparent; color: var(--accent); border: 1px solid var(--line);
  width: 28px; height: 28px; border-radius: 50%; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none;
}
.tour-btn:hover { border-color: var(--accent); background: rgba(57,255,20,0.06); }
.system-card-footer { padding: 6px 10px 10px; }
@media (prefers-reduced-motion: reduce) {
  .tour-glow { animation: none; outline-width: 3px; }
}

/* ─── Phase 13a: Settings nav-rail + pane layout ─────────────────────────── */
.settings-modal-wide  { max-width: 1180px; }
.settings-layout      { display: flex; gap: 0; height: calc(90vh - 80px);
                        min-height: 0; }
.settings-nav         { width: 260px; flex: none; border-right: 1px solid var(--line);
                        overflow-y: auto; padding: 8px 0; background: var(--panel); }
.settings-group       { display: flex; flex-direction: column; }
.settings-group-header{ font-size: 10px; color: var(--muted); padding: 14px 14px 6px;
                        text-transform: uppercase; letter-spacing: 0.6px;
                        user-select: none; }
.settings-group-header:hover { color: var(--fg2); }
.settings-nav-item    { display: flex; align-items: center; gap: 9px; padding: 8px 14px;
                        font-size: 13px; color: var(--fg2); cursor: pointer;
                        border-right: 2px solid transparent; user-select: none; }
.settings-nav-item:hover { background: var(--panel2); color: var(--fg); }
.settings-nav-item.active{ background: var(--panel2); color: var(--accent);
                           border-right: 2px solid var(--accent); }
.settings-nav-item .icon{ font-size: 14px; flex: none; }
.settings-pane        { flex: 1; overflow-y: auto; padding: 24px 28px;
                        min-width: 0; }
.settings-pane h2     { font-size: 20px; margin: 0 0 18px; color: var(--fg); }
.settings-placeholder { padding: 24px; background: var(--panel2);
                        border: 1px dashed var(--line2); border-radius: 8px;
                        color: var(--muted); font-size: 13px; text-align: center; }
.settings-grid-inline { padding: 0; overflow-y: visible; }
@media (max-width: 760px) {
  .settings-modal-wide  { max-width: 100%; }
  .settings-layout      { flex-direction: column; height: auto; }
  .settings-nav         { width: 100%; border-right: 0;
                          border-bottom: 1px solid var(--line); }
  .settings-pane        { padding: 18px; }
}

/* ─── Phase 13g: Inflow / Outflow box-node styles ───────────────────────── */
.io-feed                      { display: flex; flex-direction: column; gap: 10px; }
.io-feed-embed                { padding: 0; }
.io-feed-filters              { display: flex; gap: 12px; align-items: center;
                                padding: 8px 10px; background: var(--panel2);
                                border: 1px solid var(--line); border-radius: 8px; }
.io-feed-filters label        { font-size: 12px; color: var(--fg2); display: flex; gap: 5px; align-items: center; }
.io-feed-filters select       { background: var(--panel); color: var(--fg);
                                border: 1px solid var(--line2); border-radius: 4px;
                                padding: 3px 6px; font-size: 12px; }
.io-feed-count                { margin-left: auto; font-size: 11px; color: var(--muted); }
.io-feed-refresh              { background: transparent; color: var(--accent);
                                border: 1px solid var(--line2); border-radius: 4px;
                                padding: 2px 8px; font-size: 12px; }
.io-feed-table                { display: flex; flex-direction: column; gap: 4px; max-height: 70vh; overflow-y: auto; }
.io-feed-empty                { text-align: center; padding: 24px; color: var(--muted);
                                background: var(--panel2); border: 1px dashed var(--line2);
                                border-radius: 8px; }
.io-feed-row                  { background: var(--panel2); border: 1px solid var(--line);
                                border-radius: 6px; padding: 6px 10px;
                                display: flex; gap: 8px; align-items: center; font-size: 12px; }
.io-feed-row-head             { display: flex; gap: 8px; align-items: center; flex: 1; cursor: pointer; }
.io-feed-row-body             { width: 100%; margin-top: 8px;
                                border-top: 1px dashed var(--line2); padding-top: 8px; }
.io-feed-pill                 { font-size: 10px; padding: 2px 8px; border-radius: 10px;
                                font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px;
                                background: var(--line2); color: var(--fg2); flex: none; }
.io-feed-pill.ok              { background: var(--accent); color: #0a0a0e; }
.io-feed-pill.received        { background: var(--link); color: #0a0a0e; }
.io-feed-pill.err             { background: #f85149; color: #fff; }
.io-feed-pill.muted           { background: var(--line2); color: var(--muted); }
.io-feed-chip                 { font-size: 11px; padding: 1px 7px; border-radius: 10px;
                                background: var(--panel); border: 1px solid var(--line2);
                                color: var(--fg); flex: none; }
.io-feed-source               { flex: 1; white-space: nowrap; overflow: hidden;
                                text-overflow: ellipsis; color: var(--fg); }
.io-feed-ts                   { color: var(--muted); font-size: 10px; flex: none; }
.io-feed-retries              { color: var(--muted); font-size: 10px; flex: none; }
.io-feed-err                  { color: #f85149; font-size: 10px; flex: 1;
                                white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.io-feed-chat                 { color: var(--accent); font-size: 11px; }
.io-feed-payload              { background: var(--panel); border: 1px solid var(--line2);
                                border-radius: 6px; padding: 8px; font-size: 11px;
                                color: var(--fg2); max-height: 240px; overflow: auto; }
.io-feed-actions              { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.io-feed-actions button       { background: var(--panel); color: var(--fg);
                                border: 1px solid var(--line2); border-radius: 4px;
                                padding: 4px 9px; font-size: 11px; }
.io-feed-actions button:hover { border-color: var(--accent); color: var(--accent); }
.io-feed-actions input        { background: var(--panel); color: var(--fg);
                                border: 1px solid var(--line2); border-radius: 4px;
                                padding: 3px 8px; font-size: 12px; }
.io-feed-bulk                 { display: flex; gap: 6px; padding: 6px 10px;
                                background: var(--panel2); border: 1px solid var(--line);
                                border-radius: 6px; }
.io-feed-bulk button          { background: var(--panel); color: var(--fg);
                                border: 1px solid var(--line2); border-radius: 4px;
                                padding: 4px 9px; font-size: 11px; }
.io-feed-bulk button:disabled { opacity: 0.4; cursor: not-allowed; }
.io-feed-bulk button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.io-feed-tabs                 { display: flex; gap: 8px; }
.io-feed-tab                  { background: var(--panel2); color: var(--fg2);
                                border: 1px solid var(--line); border-radius: 6px;
                                padding: 6px 12px; font-size: 13px; }
.io-feed-tab.active           { background: var(--accent); color: #0a0a0e; border-color: var(--accent); }

.inflow-row                   { /* derived from .io-feed-row — kept for selector hooks */ }
.outflow-row                  { /* derived from .io-feed-row — kept for selector hooks */ }
.inflow-feed, .outflow-feed   { /* prefix hooks for Phase 13g scopes */ }

.io-sidebar                   { padding: 0; }
.io-sidebar-item              { color: var(--fg); }
.io-sidebar-item:hover        { background: var(--panel2); color: var(--accent); }
.io-sidebar-count             { color: var(--muted); font-size: 11px; }
.inflow-sidebar               { /* hook */ }
.outflow-sidebar              { /* hook */ }


/* ─── Phase 13c: Pipeline Sections — Public Endpoints / MCP Servers / System Prompts ─ */
.endpoint-table        { width: 100%; border-collapse: collapse; font-size: 12px;
                         margin-top: 10px; }
.endpoint-table th     { text-align: left; padding: 6px 8px; font-weight: 500;
                         color: var(--muted); text-transform: uppercase;
                         letter-spacing: 0.5px; font-size: 10px;
                         border-bottom: 1px solid var(--line); }
.endpoint-table td     { padding: 8px; border-bottom: 1px dashed var(--line);
                         vertical-align: top; }
.endpoint-row-kind     { color: var(--accent); font-family: ui-monospace, monospace;
                         font-size: 10px; text-transform: uppercase; }
.endpoint-url          { font-family: ui-monospace, monospace; font-size: 11.5px;
                         color: var(--fg); word-break: break-all; }
.endpoint-url a        { color: var(--accent); text-decoration: none; }
.endpoint-url a:hover  { text-decoration: underline; }
.endpoint-auth-pill    { display: inline-block; padding: 1px 7px; border-radius: 10px;
                         font-size: 10px; background: var(--panel2); color: var(--fg2);
                         border: 1px solid var(--line2); }
.endpoint-auth-none    { color: var(--muted); }
.endpoint-auth-api_key { color: #ffd166; border-color: #c79100; }
.endpoint-auth-wallet  { color: #39ff14; border-color: var(--accent); }
.endpoint-auth-session { color: #6ad0ff; border-color: #2d7ba8; }
.endpoint-actions      { display: flex; gap: 6px; }
.endpoint-actions button {
  background: transparent; color: var(--fg2); border: 1px solid var(--line);
  padding: 3px 9px; font-size: 11px; border-radius: 4px; cursor: pointer; font: inherit;
}
.endpoint-actions button:hover { color: var(--accent); border-color: var(--accent); }
.endpoint-captures     { color: var(--muted); font-size: 11px;
                         font-family: ui-monospace, monospace; }
.endpoint-clipboard-row{ display: flex; gap: 8px; margin: 10px 0 4px; }
.endpoint-clipboard-row button {
  background: var(--panel2); color: var(--fg); border: 1px solid var(--line2);
  padding: 6px 12px; border-radius: 5px; font: inherit; font-size: 12px;
  cursor: pointer;
}
.endpoint-clipboard-row button:hover { border-color: var(--accent); color: var(--accent); }
.endpoint-captures-panel {
  margin-top: 8px; padding: 8px 10px; background: var(--panel2);
  border: 1px dashed var(--line2); border-radius: 6px;
  font-family: ui-monospace, monospace; font-size: 11px; color: var(--fg2);
  white-space: pre-wrap; max-height: 200px; overflow-y: auto;
}

.mcp-server-table      { width: 100%; border-collapse: collapse; font-size: 12px;
                         margin-top: 10px; }
.mcp-server-table th   { text-align: left; padding: 6px 8px; font-weight: 500;
                         color: var(--muted); text-transform: uppercase;
                         letter-spacing: 0.5px; font-size: 10px;
                         border-bottom: 1px solid var(--line); }
.mcp-server-table td   { padding: 8px; border-bottom: 1px dashed var(--line);
                         vertical-align: top; }
.mcp-server-status     { display: inline-block; padding: 2px 8px; border-radius: 10px;
                         font-size: 11px; }
.mcp-server-status-running { background: rgba(57,255,20,0.12); color: var(--accent);
                             border: 1px solid var(--accent); }
.mcp-server-status-paused  { background: rgba(255,194,68,0.10); color: #ffc244;
                             border: 1px solid #c79100; }
.mcp-server-status-crashed { background: rgba(255,99,99,0.10); color: #ff7e7e;
                             border: 1px solid #c44; }
.mcp-server-log        { font-family: ui-monospace, monospace; font-size: 10.5px;
                         color: var(--muted); white-space: pre-wrap;
                         max-width: 320px; }
.mcp-server-actions    { display: flex; gap: 6px; flex-wrap: wrap; }
.mcp-server-actions button {
  background: transparent; color: var(--fg2); border: 1px solid var(--line);
  padding: 3px 9px; font-size: 11px; border-radius: 4px; cursor: pointer; font: inherit;
}
.mcp-server-actions button:hover { color: var(--accent); border-color: var(--accent); }
.mcp-server-actions .mcp-server-btn-pause { color: #ffc244; border-color: #6b4f00; }
.mcp-server-actions .mcp-server-btn-pause:hover { color: #ffd166; border-color: #c79100; }

.sysprompt-layout      { display: grid; grid-template-columns: 280px 1fr;
                         gap: 16px; margin-top: 10px; }
.sysprompt-list        { border: 1px solid var(--line); border-radius: 6px;
                         overflow-y: auto; max-height: 540px; background: var(--panel); }
.sysprompt-list-item   { padding: 10px 12px; border-bottom: 1px dashed var(--line);
                         cursor: pointer; }
.sysprompt-list-item:hover { background: var(--panel2); }
.sysprompt-list-item.active { background: var(--panel2); border-left: 3px solid var(--accent); }
.sysprompt-list-item-name { font-size: 13px; color: var(--fg); }
.sysprompt-list-item-preview {
  font-size: 11px; color: var(--muted); margin-top: 3px;
  font-family: ui-monospace, monospace;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.sysprompt-list-item-meta { font-size: 10px; color: var(--muted); margin-top: 4px;
                            display: flex; gap: 8px; }
.sysprompt-list-add    { padding: 10px; border: 1px dashed var(--line2);
                         border-radius: 6px; margin-bottom: 8px;
                         text-align: center; color: var(--accent);
                         background: transparent; cursor: pointer;
                         font: inherit; font-size: 12px; width: 100%; }
.sysprompt-list-add:hover { background: var(--panel2); }
.sysprompt-editor      { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sysprompt-editor input,
.sysprompt-editor textarea {
  background: var(--panel2); border: 1px solid var(--line2); color: var(--fg);
  padding: 8px 10px; border-radius: 5px; font: inherit; font-size: 13px;
  font-family: ui-monospace, monospace;
}
.sysprompt-editor textarea { min-height: 280px; resize: vertical; line-height: 1.5; }
.sysprompt-editor input:focus,
.sysprompt-editor textarea:focus { outline: none; border-color: var(--accent); }
.sysprompt-label       { font-size: 10.5px; color: var(--muted); text-transform: uppercase;
                         letter-spacing: 0.5px; margin-bottom: 2px; }
.sysprompt-chips       { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.sysprompt-chip        { display: inline-block; padding: 2px 8px; border-radius: 10px;
                         font-size: 11px; background: var(--panel2);
                         border: 1px solid var(--line2); color: var(--accent);
                         font-family: ui-monospace, monospace; }
.sysprompt-actions     { display: flex; gap: 8px; align-items: center;
                         margin-top: 4px; }
.sysprompt-actions button {
  background: var(--accent); color: #001; border: 1px solid var(--accent);
  padding: 7px 14px; border-radius: 5px; font: inherit; font-weight: 500;
  cursor: pointer;
}
.sysprompt-actions button:disabled { opacity: 0.5; cursor: default; }
.sysprompt-actions .sysprompt-btn-secondary {
  background: transparent; color: var(--fg2); border-color: var(--line2); font-weight: 400;
}
.sysprompt-actions .sysprompt-btn-secondary:hover { color: var(--accent); border-color: var(--accent); }
.sysprompt-empty       { padding: 28px; color: var(--muted); text-align: center;
                         font-size: 13px; background: var(--panel2);
                         border: 1px dashed var(--line2); border-radius: 6px; }
.sysprompt-feedback    { font-size: 11.5px; }
.sysprompt-feedback.ok { color: var(--accent); }
.sysprompt-feedback.err { color: #ff7e7e; }
.sysprompt-modal-back  { position: fixed; inset: 0; background: rgba(0,0,0,0.6);
                         display: flex; align-items: center; justify-content: center;
                         z-index: 200; }
.sysprompt-modal       { background: var(--panel); border: 1px solid var(--line);
                         border-radius: 8px; padding: 18px 20px; width: 520px;
                         max-width: 92vw; display: flex; flex-direction: column;
                         gap: 10px; }
@media (max-width: 760px) {
  .sysprompt-layout { grid-template-columns: 1fr; }
  .sysprompt-list   { max-height: 240px; }
}



/* ─── Phase 13d: Proxy / Capture / Marketplace ─────────────────────────── */
.settings-pane-loading {
  padding: 24px; color: #7d8590; font-size: 13px; font-style: italic;
}

/* ProxyGatewaySection */
.proxy-table {
  width: 100%; border-collapse: collapse; margin-bottom: 16px;
  font-size: 13px;
}
.proxy-table thead th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: #7d8590; padding: 6px 10px; border-bottom: 1px solid #21262d;
  font-weight: normal;
}
.proxy-table tbody tr.proxy-row {
  border-bottom: 1px solid #161b22;
}
.proxy-table tbody tr.proxy-row:hover {
  background: #161b22;
}
.proxy-table tbody tr.proxy-row-dirty {
  background: rgba(88, 166, 255, 0.08);
}
.proxy-svc { padding: 8px 10px; }
.proxy-svc code {
  background: #161b22; border: 1px solid #21262d; border-radius: 4px;
  padding: 2px 8px; color: #e6edf3; font-size: 12px;
}
.proxy-toggle {
  background: #161b22; border: 1px solid #30363d; color: #e6edf3;
  border-radius: 6px; padding: 5px 12px; font: 11px ui-monospace, monospace;
  cursor: pointer; min-width: 140px; text-align: center;
}
.proxy-toggle-on {
  background: rgba(57, 255, 20, 0.12); border-color: #39ff14; color: #39ff14;
}
.proxy-toggle-off {
  background: #161b22; border-color: #f85149; color: #f85149;
}
.proxy-toggle:hover { filter: brightness(1.2); }
.proxy-stats-col, .proxy-stats {
  font-size: 11px; color: #7d8590; padding: 8px 10px;
}
.proxy-stats b { color: #c9d1d9; }
.proxy-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  padding-top: 12px; border-top: 1px solid #21262d;
}
.proxy-saved-flash { color: #39ff14; font-size: 12px; }

/* ReasoningCaptureSection */
.capture-meter {
  background: #0d1117; border: 1px solid #21262d; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 16px; text-align: center;
}
.capture-meter-big {
  font-size: 32px; font-weight: 600; color: #39ff14;
  font-family: ui-monospace, monospace;
}
.capture-meter-sub {
  font-size: 11px; color: #7d8590; margin-top: 4px;
}
.capture-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px; margin-bottom: 14px;
}
.capture-toggle, .capture-pii .capture-toggle {
  display: flex; flex-direction: column; gap: 4px;
  background: #161b22; border: 1px solid #21262d; border-radius: 8px;
  padding: 10px 12px; cursor: pointer;
}
.capture-toggle:hover { border-color: #58a6ff; }
.capture-toggle-on { background: rgba(57, 255, 20, 0.06); border-color: #39ff14; }
.capture-toggle input { margin: 0 0 4px 0; width: auto; max-width: none; }
.capture-toggle-label { font-size: 13px; color: #e6edf3; font-weight: 500; }
.capture-toggle-hint  { font-size: 10px; color: #7d8590; }
.capture-pii {
  margin-bottom: 14px; padding: 10px;
  background: rgba(248, 81, 73, 0.04); border: 1px dashed #f85149;
  border-radius: 8px;
}
.capture-target { margin-bottom: 14px; }
.capture-target-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: #7d8590; margin-bottom: 6px;
}
.capture-target-row {
  display: flex; gap: 8px; align-items: center;
}
.capture-target-row select { max-width: 200px; margin: 0; }
.capture-target-row input  { flex: 1; margin: 0; }
.capture-actions { margin-top: 8px; }

/* MarketplaceSection */
.marketplace-controls {
  display: flex; gap: 10px; align-items: center; margin-bottom: 10px;
}
.marketplace-search { flex: 1; margin: 0; max-width: none; }
.marketplace-chips {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px;
}
.marketplace-chip {
  font-size: 11px; padding: 4px 10px; border-radius: 11px;
  border: 1px solid #30363d; background: #161b22; color: #7d8590;
  cursor: pointer; user-select: none;
}
.marketplace-chip:hover { border-color: #58a6ff; color: #c9d1d9; }
.marketplace-chip.on {
  background: #39ff14; color: #0b0e14; border-color: #39ff14; font-weight: 600;
}
.marketplace-section { margin-bottom: 18px; }
.marketplace-section-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: #7d8590; margin-bottom: 8px;
}
.marketplace-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.marketplace-empty {
  font-size: 12px; color: #7d8590; font-style: italic;
  padding: 18px; text-align: center;
  border: 1px dashed #30363d; border-radius: 8px;
}
.marketplace-card {
  background: #161b22; border: 1px solid #21262d; border-radius: 8px;
  padding: 12px; display: flex; flex-direction: column; gap: 4px;
  transition: border-color .15s, transform .08s;
}
.marketplace-card:hover { border-color: #58a6ff; }
.marketplace-card-featured {
  border-color: #d264ff; background: rgba(210, 100, 255, 0.04);
}
.marketplace-card-head {
  display: flex; justify-content: space-between; align-items: center;
}
.marketplace-card-kind {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: #7d8590;
}
.marketplace-card-star { color: #d264ff; font-size: 14px; }
.marketplace-card-name {
  font-size: 14px; font-weight: 600; color: #e6edf3;
}
.marketplace-card-id {
  font-size: 11px; color: #58a6ff; font-family: ui-monospace, monospace;
}
.marketplace-card-desc {
  font-size: 12px; color: #c9d1d9; min-height: 32px;
  margin-top: 4px; line-height: 1.4;
}
.marketplace-card-meta, .marketplace-card-stats {
  font-size: 11px; color: #7d8590;
}
.marketplace-card-actions {
  display: flex; gap: 6px; margin-top: 8px;
}
.marketplace-card-actions .go { flex: 1; }
.marketplace-btn-stats {
  background: #0d1117; border: 1px solid #30363d; color: #7d8590;
  border-radius: 6px; padding: 5px 10px; font: 11px ui-monospace, monospace;
  cursor: pointer;
}
.marketplace-btn-stats:hover { border-color: #58a6ff; color: #58a6ff; }
.marketplace-modal {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.marketplace-modal-inner {
  background: #0d1117; border: 1px solid #30363d; border-radius: 12px;
  padding: 18px; min-width: 360px; max-width: 480px;
}
.marketplace-modal-head {
  font-size: 14px; font-weight: 600; color: #e6edf3;
  margin-bottom: 14px;
}
.marketplace-modal-body label {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: 1px; color: #7d8590; margin: 8px 0 4px;
}
.marketplace-modal-note {
  font-size: 11px; color: #7d8590; margin-top: 10px; line-height: 1.4;
}
.marketplace-modal-note code {
  background: #161b22; border: 1px solid #21262d; border-radius: 4px;
  padding: 1px 6px; font-size: 10px;
}
.marketplace-modal-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px;
}
.marketplace-modal-actions button {
  background: #161b22; border: 1px solid #30363d; color: #c9d1d9;
  border-radius: 6px; padding: 6px 14px;
  font: 12px ui-monospace, monospace; cursor: pointer;
}
.marketplace-modal-actions button:hover { border-color: #58a6ff; }
.marketplace-modal-actions .go { background: #238636; color: #fff; border-color: #238636; }


/* ─── PHASE_13B_CSS_INSTALLED · Operations Sections styling ─────────────── */

/* Common: .notif-* .team-* .health-* .voice-* .webhook-* */

/* NotificationsSection */
.notif-section h2 { margin: 0 0 4px 0; font-size: 18px; }
.notif-section .settings-sub { color: #7d8590; font-size: 12px; margin: 0 0 12px 0; }
.notif-quiet { margin: 8px 0; padding: 8px; background: #11161c; border: 1px solid #1f2933; border-radius: 6px; }
.notif-quiet label { color: #a4afb8; font-size: 12px; margin-right: 6px; }
.notif-time { background: #0d1117; color: #d4d4d4; border: 1px solid #2d3744; border-radius: 4px; padding: 2px 6px; font-family: inherit; }
.notif-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.notif-table th, .notif-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #1f2933; }
.notif-table th { color: #7d8590; font-weight: 500; font-size: 11px; text-transform: uppercase; }
.notif-row:hover { background: #11161c; }
.notif-empty { color: #5a6470; font-style: italic; text-align: center; padding: 16px !important; }
.notif-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.notif-add, .notif-save { background: #1f2933; color: #39ff14; border: 1px solid #39ff14; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-family: inherit; }
.notif-add:hover, .notif-save:hover { background: #39ff14; color: #0d1117; }
.notif-save:disabled { opacity: 0.5; cursor: not-allowed; }
.notif-del { background: transparent; color: #ff6b6b; border: none; cursor: pointer; padding: 0 6px; }
.notif-msg { color: #7d8590; font-size: 12px; }
.notif-modal { min-width: 420px; }
.notif-label { display: block; color: #a4afb8; font-size: 12px; margin: 10px 0 4px 0; }
.notif-input { width: 100%; box-sizing: border-box; background: #0d1117; color: #d4d4d4; border: 1px solid #2d3744; border-radius: 4px; padding: 6px 8px; font-family: inherit; }
.notif-chans { display: flex; gap: 6px; flex-wrap: wrap; }
.notif-chan-pill { background: #11161c; border: 1px solid #2d3744; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; }
.notif-chan-pill input { margin-right: 4px; }
.notif-quiet-row { display: flex; gap: 6px; align-items: center; }
.notif-modal-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }

/* TeamSection */
.team-section h2 { margin: 0 0 4px 0; font-size: 18px; }
.team-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.team-table th, .team-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #1f2933; }
.team-table th { color: #7d8590; font-weight: 500; font-size: 11px; text-transform: uppercase; }
.team-row:hover { background: #11161c; }
.team-status-invited { color: #d4b941; }
.team-wallet { font-family: monospace; font-size: 12px; }
.team-role { background: #11161c; border: 1px solid #2d3744; border-radius: 3px; padding: 1px 6px; font-size: 11px; }
.team-empty { color: #5a6470; font-style: italic; text-align: center; padding: 16px !important; }
.team-actions { margin-top: 12px; }
.team-invite-btn { background: #1f2933; color: #39ff14; border: 1px solid #39ff14; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-family: inherit; }
.team-invite-btn:hover { background: #39ff14; color: #0d1117; }
.team-revoke { background: transparent; color: #ff6b6b; border: 1px solid #ff6b6b; border-radius: 3px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.team-revoke:hover { background: #ff6b6b; color: #0d1117; }
.team-invite-result { margin-top: 10px; padding: 8px; background: #0f1f12; border: 1px solid #2f5f3f; border-radius: 4px; font-size: 12px; color: #a4d6b4; }
.team-invite-result code { background: #11161c; padding: 1px 4px; border-radius: 3px; }
.team-modal { min-width: 380px; }
.team-label { display: block; color: #a4afb8; font-size: 12px; margin: 10px 0 4px 0; }
.team-input { width: 100%; box-sizing: border-box; background: #0d1117; color: #d4d4d4; border: 1px solid #2d3744; border-radius: 4px; padding: 6px 8px; font-family: inherit; }
.team-msg { color: #ff6b6b; font-size: 12px; margin-top: 6px; }
.team-modal-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }

/* HealthSection */
.health-section h2 { margin: 0 0 4px 0; font-size: 18px; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.health-empty { grid-column: 1 / -1; color: #5a6470; font-style: italic; text-align: center; padding: 20px; }
.health-card { background: #11161c; border: 1px solid #1f2933; border-radius: 6px; padding: 10px; }
.health-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.health-dot { font-size: 14px; }
.health-dot-green { color: #39ff14; }
.health-dot-yellow { color: #d4b941; }
.health-dot-red { color: #ff4444; animation: health-pulse 1.4s infinite; }
@keyframes health-pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }
.health-name { color: #d4d4d4; font-weight: 500; flex: 1; text-transform: capitalize; }
.health-ping { background: transparent; color: #7d8590; border: 1px solid #2d3744; border-radius: 3px; padding: 1px 8px; cursor: pointer; font-family: inherit; }
.health-ping:hover { background: #1f2933; color: #d4d4d4; }
.health-ping:disabled { opacity: 0.5; }
.health-msg { color: #a4afb8; font-size: 12px; margin: 4px 0; min-height: 14px; word-break: break-word; }
.health-meta { display: flex; justify-content: space-between; color: #5a6470; font-size: 11px; }
.health-status-green { border-left: 3px solid #39ff14; }
.health-status-yellow { border-left: 3px solid #d4b941; }
.health-status-red { border-left: 3px solid #ff4444; }

/* VoiceSection */
.voice-section h2 { margin: 0 0 4px 0; font-size: 18px; }
.voice-provider-pick { display: flex; gap: 8px; margin: 10px 0; }
.voice-provider-pill { background: #11161c; border: 1px solid #2d3744; border-radius: 4px; padding: 6px 12px; cursor: pointer; font-size: 12px; }
.voice-provider-pill input { margin-right: 4px; }
.voice-active { background: #1f3329; border-color: #39ff14; color: #39ff14; }
.voice-label { display: block; color: #a4afb8; font-size: 12px; margin: 10px 0 4px 0; }
.voice-input { width: 100%; box-sizing: border-box; background: #0d1117; color: #d4d4d4; border: 1px solid #2d3744; border-radius: 4px; padding: 6px 8px; font-family: inherit; }
.voice-sliders { margin: 12px 0; padding: 10px; background: #0d1117; border: 1px solid #1f2933; border-radius: 6px; }
.voice-slider-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.voice-slider-row label { width: 130px; font-size: 12px; color: #a4afb8; }
.voice-slider-row input[type=range] { flex: 1; }
.voice-slider-val { width: 40px; font-family: monospace; font-size: 12px; color: #7d8590; text-align: right; }
.voice-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.voice-save { background: #1f2933; color: #39ff14; border: 1px solid #39ff14; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-family: inherit; }
.voice-save:hover { background: #39ff14; color: #0d1117; }
.voice-msg { color: #7d8590; font-size: 12px; }
.voice-clone { margin-top: 20px; padding-top: 14px; border-top: 1px dashed #1f2933; }
.voice-clone h3 { margin: 0 0 4px 0; font-size: 14px; color: #a4afb8; }
.voice-file { margin: 8px 0; color: #d4d4d4; }
.voice-clone-btn { background: #1f2933; color: #39ff14; border: 1px solid #39ff14; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-family: inherit; }
.voice-clone-result { margin-top: 10px; padding: 8px; border-radius: 4px; font-size: 12px; }
.voice-clone-ok { background: #0f1f12; border: 1px solid #2f5f3f; color: #a4d6b4; }
.voice-clone-err { background: #1f0f0f; border: 1px solid #5f2f2f; color: #ff9999; }
.voice-clone-result code { background: #11161c; padding: 1px 4px; border-radius: 3px; }

/* WebhooksSection */
.webhook-section h2 { margin: 0 0 4px 0; font-size: 18px; }
.webhook-block { margin: 14px 0; }
.webhook-block h3 { margin: 0 0 8px 0; font-size: 14px; color: #a4afb8; }
.webhook-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.webhook-table th, .webhook-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid #1f2933; }
.webhook-table th { color: #7d8590; font-weight: 500; font-size: 11px; text-transform: uppercase; }
.webhook-row:hover { background: #11161c; }
.webhook-url { font-family: monospace; font-size: 11px; max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webhook-empty { color: #5a6470; font-style: italic; text-align: center; padding: 12px !important; }
.webhook-add { background: #1f2933; color: #39ff14; border: 1px solid #39ff14; border-radius: 4px; padding: 4px 12px; cursor: pointer; font-family: inherit; margin-top: 6px; }
.webhook-add:hover { background: #39ff14; color: #0d1117; }
.webhook-del { background: transparent; color: #ff6b6b; border: none; cursor: pointer; padding: 0 6px; }
.webhook-test { background: #11161c; color: #d4d4d4; border: 1px solid #2d3744; border-radius: 3px; padding: 1px 8px; font-size: 11px; cursor: pointer; }
.webhook-test:hover { background: #1f2933; }
.webhook-test-result { font-size: 11px; font-family: monospace; margin-left: 4px; }
.webhook-test-ok { color: #39ff14; }
.webhook-test-err { color: #ff6b6b; }
.webhook-msg { margin-top: 8px; color: #7d8590; font-size: 12px; }
.webhook-modal { min-width: 420px; }
.webhook-label { display: block; color: #a4afb8; font-size: 12px; margin: 10px 0 4px 0; }
.webhook-input { width: 100%; box-sizing: border-box; background: #0d1117; color: #d4d4d4; border: 1px solid #2d3744; border-radius: 4px; padding: 6px 8px; font-family: inherit; }
.webhook-events { display: flex; gap: 6px; flex-wrap: wrap; }
.webhook-event-pill { background: #11161c; border: 1px solid #2d3744; border-radius: 4px; padding: 4px 8px; font-size: 11px; cursor: pointer; }
.webhook-event-pill input { margin-right: 4px; }
.webhook-modal-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Phase 13e: Identity & Auth + Usage & Tokens ─────────────────────── */
.identity-section h2 { margin: 0 0 12px; font-size: 16px; color: var(--fg); }
.identity-tabs { display: flex; gap: 6px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line2); }
.identity-tab { background: transparent; color: var(--fg2); border: 0;
  padding: 8px 14px; cursor: pointer; font-size: 13px;
  border-bottom: 2px solid transparent; }
.identity-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.identity-pane { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.identity-row { font-size: 13px; color: var(--fg2); }
.identity-row b { color: var(--fg); }
.identity-row code { background: var(--panel2); padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: var(--fg); }
.identity-form-row { display: flex; flex-direction: column; gap: 6px; }
.identity-form-row label { font-size: 12px; color: var(--fg2); }
.identity-form-row input { background: var(--panel2); color: var(--fg);
  border: 1px solid var(--line2); border-radius: 6px; padding: 8px 10px;
  font-size: 13px; }
.identity-section button { background: #238636; color: #fff;
  border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 13px; }
.identity-section button:disabled { opacity: 0.5; cursor: not-allowed; }
.identity-section button.identity-danger { background: #c33; }
.identity-msg { padding: 6px 10px; border-radius: 4px; font-size: 12px; }
.identity-msg.ok { background: rgba(57,255,20,0.08); color: var(--accent);
  border: 1px solid rgba(57,255,20,0.3); }
.identity-msg.err { background: rgba(255,80,80,0.08); color: #ffb4b4;
  border: 1px solid rgba(255,80,80,0.3); }
.identity-empty { color: var(--fg2); font-style: italic; padding: 14px;
  text-align: center; }
.identity-hint { font-size: 11px; color: var(--fg2); margin-top: 4px; }
.identity-fresh-key { background: rgba(57,255,20,0.05);
  border: 1px solid rgba(57,255,20,0.4); border-radius: 6px; padding: 10px;
  display: flex; flex-direction: column; gap: 4px; }
.identity-fresh-key code { background: var(--panel); color: var(--accent);
  padding: 6px 8px; border-radius: 4px; font-size: 12px; word-break: break-all; }
.identity-keys-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.identity-keys-table th, .identity-keys-table td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.identity-keys-table th { color: var(--fg2); font-weight: normal; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; }

.usage-section h2 { margin: 0 0 12px; font-size: 16px; color: var(--fg); }
.usage-section h3.usage-h3 { margin: 16px 0 8px; font-size: 14px; color: var(--fg); }
.usage-tabs { display: flex; gap: 6px; margin-bottom: 12px; align-items: center;
  border-bottom: 1px solid var(--line2); padding-bottom: 8px; }
.usage-tab { background: transparent; color: var(--fg2); border: 0;
  padding: 6px 12px; cursor: pointer; font-size: 12px;
  border-bottom: 2px solid transparent; }
.usage-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.usage-tab-spacer { flex: 1; }
.usage-export-btn { color: var(--accent); border: 1px solid var(--accent);
  border-radius: 4px; padding: 4px 10px; text-decoration: none; font-size: 12px; }
.usage-total-cost { display: flex; justify-content: space-between;
  background: var(--panel2); padding: 10px 14px; border-radius: 6px;
  margin-bottom: 12px; }
.usage-total-label { color: var(--fg2); font-size: 12px; }
.usage-total-value { color: var(--accent); font-weight: 600; font-size: 14px; }
.usage-providers-table { width: 100%; border-collapse: collapse; font-size: 12px;
  margin-bottom: 8px; }
.usage-providers-table th, .usage-providers-table td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.usage-providers-table th { color: var(--fg2); font-weight: normal; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.5px; }
.usage-section button { background: #238636; color: #fff;
  border: 0; border-radius: 6px; padding: 6px 12px; cursor: pointer;
  font-size: 12px; }
.usage-empty { color: var(--fg2); font-style: italic; padding: 10px;
  text-align: center; }

.token-chart-cap { width: 70px; background: var(--panel2); color: var(--fg);
  border: 1px solid var(--line2); border-radius: 4px; padding: 4px 6px;
  font-size: 12px; text-align: right; }
.token-chart-leaderboard { width: 100%; border-collapse: collapse;
  font-size: 12px; }
.token-chart-leaderboard th, .token-chart-leaderboard td {
  text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line2); }
.token-chart-leaderboard th { color: var(--fg2); font-weight: normal;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; }
