*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Luminous design tokens (mirror v1-frontend/src/v2/styles/var) ─────────── */
:root {
  /* Brand purple */
  --lum-primary: #602ee7; --lum-primary-hover: #4c0ebc; --lum-primary-active: #37008a;
  --lum-primary-bg: #f3efff; --lum-primary-bg-2: #d5c2ff;
  /* Cool "Cloud" neutrals */
  --lum-text: #12131a; --lum-text-2: #464649; --lum-muted: #8b879f;
  --lum-border: #e9e9eb; --lum-border-subtle: #efebf5;
  --lum-bg: #f7f6fb; --lum-surface: #ffffff; --lum-sidebar: #efebf5;
  /* Semantic */
  --lum-success: #1f9d57; --lum-success-bg: #e9f7ee; --lum-success-border: #c7e9d3;
  --lum-warning: #f5c000; --lum-danger: #e0384f; --lum-info: #0072e8;
  /* Radii */
  --lum-radius: 4px; --lum-radius-input: 8px; --lum-radius-bubble: 8px; --lum-radius-pill: 999px;
  /* Shadows (purple-tinted) + focus ring */
  --lum-shadow: 0 0 1rem 0 rgba(55,0,138,.05);
  --lum-shadow-strong: 0 0 1rem 0 rgba(55,0,138,.10);
  --lum-shadow-modal: 0 12px 48px rgba(55,0,138,.18);
  --lum-ring: 0 0 0 3px rgba(96,46,231,.18);
  --lum-font: 'Manrope', 'Helvetica Neue', 'Helvetica', Arial, sans-serif;
  /* legacy alias used by a couple of rules */
  --border: var(--lum-border);
}

body {
  font-family: var(--lum-font);
  background: var(--lum-bg);
  color: var(--lum-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d7d3e0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #c3bdd2; }

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--lum-bg);
}
.login-card {
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius);
  padding: 40px 48px;
  width: 380px;
  box-shadow: var(--lum-shadow-strong);
}
.login-card h1 { font-size: 20px; font-weight: 700; margin-bottom: 4px; color: var(--lum-text); }
.login-logo { height: 28px; width: auto; display: block; margin-bottom: 10px; }
.login-card p { font-size: 13px; color: var(--lum-muted); margin-bottom: 28px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--lum-text-2); }
.field input {
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  color: var(--lum-text);
  font-size: 14px;
  font-family: inherit;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus { border-color: var(--lum-primary); box-shadow: var(--lum-ring); }
.btn-primary {
  width: 100%;
  background: var(--lum-primary);
  color: #fff;
  border: none;
  border-radius: var(--lum-radius-input);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 11px;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s, opacity .15s;
}
.btn-primary:hover { background: var(--lum-primary-hover); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.error-msg { font-size: 13px; color: var(--lum-danger); margin-top: 10px; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  background: var(--lum-sidebar);
  border-right: 1px solid var(--lum-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .18s ease, border-color .18s ease;
}
/* Collapsed: slide the whole panel away. Contents are width-clamped so they don't
   reflow/wrap during the transition, and the floating ☰ button brings it back. */
.sidebar.collapsed {
  width: 0;
  border-right-color: transparent;
}
.sidebar.collapsed > * { visibility: hidden; }
.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--lum-border);
}
/* Top row: New-conversation button + inline collapse toggle (no wasted header band) */
.sidebar-top { display: flex; align-items: stretch; gap: 6px; }
.sidebar-top .btn-new { flex: 1; margin-top: 0; }
.sidebar-collapse {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  color: var(--lum-muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--lum-radius-input);
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.sidebar-collapse:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }
.sidebar-reopen {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  width: 32px;
  height: 32px;
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  color: var(--lum-text-2);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  box-shadow: var(--lum-shadow);
  transition: background .15s, border-color .15s, color .15s;
}
.sidebar-reopen:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }
.btn-new {
  width: 100%;
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  color: var(--lum-text-2);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
  margin-top: 10px;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-new:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }
.session-list { flex: 1; overflow-y: auto; padding: 8px; }
.session-item {
  padding: 10px 12px;
  border-radius: var(--lum-radius-input);
  cursor: pointer;
  transition: background .15s;
  margin-bottom: 2px;
}
.session-item:hover { background: #e5dff2; }
.session-item.active { background: var(--lum-primary-bg); box-shadow: inset 0 0 0 1px var(--lum-primary-bg-2); }
.session-title-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.session-title { font-size: 13px; color: var(--lum-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.session-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.session-dot-thinking { background: var(--lum-primary); animation: pulse 1.4s ease-in-out infinite; }
.session-dot-unread { background: var(--lum-success); }
.session-meta { font-size: 11px; color: var(--lum-muted); margin-top: 3px; }
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--lum-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tenant-label { font-size: 12px; color: var(--lum-muted); }
.billing-chip { font-size: 11px; color: var(--lum-text-2); background: var(--lum-surface); border: 1px solid var(--lum-border); border-radius: var(--lum-radius); padding: 2px 6px; margin-top: 2px; }
.btn-logout { font-size: 12px; color: var(--lum-muted); background: none; border: none; cursor: pointer; font-family: inherit; transition: color .15s; }
.btn-logout:hover { color: var(--lum-primary); }

/* ── Chat ───────────────────────────────────────────────────────────────── */
.chat-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--lum-bg);
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 32px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Empty state ─────────────────────────────────────────────────────────── */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  width: 100%;
  padding: 0 24px;
}
.empty-state h2 { font-size: 24px; color: var(--lum-text); font-weight: 700; letter-spacing: -.01em; text-align: center; }
.empty-state p { font-size: 14px; color: var(--lum-muted); text-align: center; }
.suggested-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
}
.suggested-chip {
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .06s;
  font-family: inherit;
}
.suggested-chip:hover {
  background: var(--lum-primary-bg);
  border-color: var(--lum-primary-bg-2);
  box-shadow: var(--lum-shadow);
  transform: translateY(-1px);
}
.chip-icon { font-size: 18px; flex-shrink: 0; line-height: 1.3; }
.chip-text { font-size: 13px; color: var(--lum-text-2); line-height: 1.4; }

/* ── Messages ────────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.message {
  display: flex;
  gap: 12px;
  max-width: 800px;
  animation: fadeIn 0.2s ease-out;
}
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }
.message.human { align-self: flex-start; }

/* ── Avatars ─────────────────────────────────────────────────────────────── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}
.avatar.user { background: var(--lum-success-bg); color: var(--lum-success); }
.avatar.assistant { background: var(--lum-primary-bg); color: var(--lum-primary); }
.avatar.human { background: var(--lum-success-bg); }
/* AI avatar carries the current Luminous mark on a clean white circle so the brand logo reads clearly. */
.avatar.assistant { background: #fff; box-shadow: inset 0 0 0 1px var(--lum-border); }
.avatar-symbol { font-size: 14px; }
.avatar-photo { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar-mark { width: 66%; height: 66%; object-fit: contain; }
/* Human support agent (unified handoff feed) — a small "Support" label above the reply. */
.human-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--lum-success);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
/* Escalated-to-human badge on a conversation-list item (Pylon ticket # + live status). */
.session-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--lum-primary);
}
/* Read-only past support conversation — shown instead of the composer. */
.readonly-note {
  padding: 12px 16px;
  font-size: 12px;
  color: #666;
  text-align: center;
}
.readonly-note a { color: var(--lum-primary); font-weight: 600; }

/* ── Bubble ──────────────────────────────────────────────────────────────── */
.bubble {
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-bubble);
  padding: 13px 17px;
  font-size: 14px;
  line-height: 1.65;
  max-width: 680px;
  color: var(--lum-text);
  box-shadow: var(--lum-shadow);
  overflow-wrap: anywhere;   /* long tokens (ids, URLs) wrap instead of overflowing the narrow panel */
}
.message.user .bubble { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); }

/* ── Edit-and-resend affordance on user messages ─────────────────────────── */
.message { align-items: flex-start; }
.msg-edit-btn {
  align-self: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: var(--lum-radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--lum-muted);
  font-size: 13px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .12s ease, background .12s ease;
}
.message.user:hover .msg-edit-btn { opacity: 1; }
.msg-edit-btn:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }
.msg-edit-btn:disabled { cursor: default; opacity: 0 !important; }
.user-edit { display: flex; flex-direction: column; gap: 8px; min-width: 320px; }
.user-edit-input {
  width: 100%;
  box-sizing: border-box;
  resize: none;
  border: 1px solid var(--lum-primary-bg-2);
  border-radius: var(--lum-radius-input);
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  color: var(--lum-text);
  background: var(--lum-surface);
}
.user-edit-input:focus { outline: none; border-color: var(--lum-primary); box-shadow: var(--lum-ring); }
.user-edit-actions { display: flex; gap: 8px; justify-content: flex-end; }
.bubble p { margin: 0 0 .75em; }
.bubble p:last-child { margin-bottom: 0; }

/* Links */
.bubble a { color: var(--lum-primary); text-decoration: none; }
.bubble a:hover { text-decoration: underline; }

/* Headings */
.bubble h1, .bubble h2, .bubble h3 { margin: .8em 0 .4em; font-size: 15px; font-weight: 700; color: var(--lum-text); }
.bubble h1 { font-size: 17px; }

/* Lists */
.bubble ul, .bubble ol { padding-left: 20px; margin: .5em 0; }
.bubble li { margin-bottom: .3em; }

/* Tables — a wide table would overflow the narrow embed, so let it scroll horizontally (display:block
   turns the table into a scroll container) and keep cells on one line instead of mangling the columns. */
.bubble table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; margin: .75em 0; font-size: 13px; }
.bubble th, .bubble td { border: 1px solid #e5e5e5; padding: 6px 10px; text-align: left; white-space: nowrap; }
.bubble th { background: var(--lum-primary-bg); font-weight: 700; color: var(--lum-text); border-bottom: 1px solid var(--lum-border); }
.bubble tbody tr:nth-child(even) { background: #faf9fd; }
.bubble tbody tr:hover { background: var(--lum-primary-bg); }

/* Inline code */
.bubble :not(pre) > code {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: #1f2937;
}

/* Code blocks */
.bubble pre {
  position: relative;
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 36px 14px 14px;
  overflow-x: auto;
  margin: .75em 0;
}
.bubble pre code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 13px;
  background: none;
  border: none;
  padding: 0;
  color: #24292e;
}
.bubble pre .hljs { background: transparent; padding: 0; }

/* Language tag on code blocks */
.code-lang-tag {
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 11px;
  color: #999;
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  text-transform: lowercase;
  pointer-events: none;
  user-select: none;
}

/* Copy button */
.copy-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #6b7280;
  font-size: 11px;
  font-family: inherit;
  padding: 3px 8px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.4;
}
.copy-btn:hover { background: #f3f4f6; border-color: #9ca3af; color: #374151; }

/* Thinking quip — shown in bubble before text arrives */
.thinking-quip {
  color: #999;
  font-style: italic;
  font-size: 13px;
  line-height: 1.55;
}

/* Collapsed working/thinking — separates the agent's reasoning from its answer */
.thinking-block { margin-bottom: 8px; }
.thinking-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 2px 0;
  cursor: pointer;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.thinking-toggle:hover { color: #6b7280; }
.thinking-caret { font-size: 10px; }
.thinking-body {
  margin-top: 6px;
  padding: 8px 12px;
  border-left: 2px solid #e5e7eb;
  background: #fafafa;
  border-radius: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.55;
}
.thinking-body p:first-child { margin-top: 0; }
.thinking-body p:last-child { margin-bottom: 0; }

/* Cursor */
.cursor::after { content: '▋'; animation: blink 1s step-end infinite; opacity: .6; }
@keyframes blink { 50% { opacity: 0; } }

/* ── Tool status ─────────────────────────────────────────────────────────── */
.tool-status {
  padding: 6px 24px;
  font-size: 12px;
  color: #999;
  display: flex;
  align-items: center;
  min-height: 30px;
}
.tool-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  color: #666;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.tool-dot {
  width: 6px;
  height: 6px;
  background: var(--lum-primary);
  border-radius: 50%;
  flex-shrink: 0;
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.85); }
}

/* ── System note (auto-compaction) ───────────────────────────────────────── */
.system-note {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin: 10px 0;
  font-style: italic;
}

/* ── Context "getting large" banner ──────────────────────────────────────── */
.context-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 24px;
  padding: 9px 14px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  font-size: 13px;
  color: #9a3412;
}
.context-banner-text { flex: 1; }
.context-banner-btn {
  flex-shrink: 0;
  background: #ea580c;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.context-banner-btn:hover { background: #c2410c; }
.context-banner-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #9a3412;
  cursor: pointer;
  font-size: 13px;
  opacity: .6;
  padding: 2px 4px;
}
.context-banner-dismiss:hover { opacity: 1; }

/* ── Context meter ───────────────────────────────────────────────────────── */
.context-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 8px;
}
.context-meter-track {
  flex: 1;
  height: 4px;
  background: #ececec;
  border-radius: 2px;
  overflow: hidden;
}
.context-meter-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s ease, background .3s ease;
}
.context-meter-fill.low  { background: #9ca3af; }
.context-meter-fill.mid  { background: #f59e0b; }
.context-meter-fill.high { background: #dc2626; }
.context-meter-label {
  flex-shrink: 0;
  font-size: 11px;
  color: #aaa;
  font-variant-numeric: tabular-nums;
}

/* ── Input area ──────────────────────────────────────────────────────────── */
.input-area {
  padding: 12px 24px 24px;
  border-top: 1px solid var(--lum-border);
  background: var(--lum-bg);
}
.input-wrap {
  display: flex;
  gap: 10px;
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  padding: 14px 14px 14px 18px;
  align-items: flex-end;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--lum-shadow);
}
.input-wrap:focus-within {
  border-color: var(--lum-primary);
  box-shadow: var(--lum-ring);
}
textarea {
  flex: 1;
  background: none;
  border: none;
  color: var(--lum-text);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  max-height: 160px;
  line-height: 1.55;
}
textarea::placeholder { color: var(--lum-muted); }

/* Send / stop button */
.btn-send {
  background: var(--lum-primary);
  color: #fff;
  border: none;
  border-radius: var(--lum-radius-input);
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, opacity .15s;
  font-family: inherit;
}
.btn-send:hover { background: var(--lum-primary-hover); }
.btn-send:disabled { opacity: .25; cursor: not-allowed; }
.btn-send.btn-stop {
  background: var(--lum-danger);
  color: #fff;
  font-size: 12px;
  opacity: 1;
}
.btn-send.btn-stop:hover { background: #c72d43; opacity: 1; }

.select-sm {
  background: var(--lum-bg);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  color: var(--lum-text-2);
  font-size: 12px;
  font-family: inherit;
  padding: 4px 6px;
  height: 34px;
  cursor: pointer;
  flex-shrink: 0;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.select-sm:disabled { opacity: .4; cursor: not-allowed; }
.select-sm:focus { border-color: var(--lum-primary); box-shadow: var(--lum-ring); }

/* ── Image previews (input area) ─────────────────────────────────────────── */
.image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 10px;
}
.image-preview-chip {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  flex-shrink: 0;
}
.preview-thumb {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: cover;
}
.remove-img {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(255,255,255,.85);
  border: none;
  border-radius: 50%;
  color: #555;
  font-size: 10px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.remove-img:hover { background: #dc2626; color: #fff; }
.img-optimized-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 9px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  pointer-events: none;
}

/* ── User message images ─────────────────────────────────────────────────── */
.user-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.user-image {
  max-width: 240px;
  max-height: 180px;
  border-radius: var(--lum-radius-input);
  border: 1px solid var(--lum-primary-bg-2);
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

/* Images inside rendered markdown bubbles (human/support screenshots, assistant images) — clickable. */
.bubble img { max-width: 100%; border-radius: var(--lum-radius-input); cursor: zoom-in; }

/* ── Image lightbox (click-to-zoom + true fullscreen) ─────────────────────── */
.lum-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 12, 24, 0.86);
  padding: 24px;
  cursor: zoom-out;
}
.lum-lightbox-img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
  cursor: default;
}
/* In true fullscreen the overlay IS the fullscreen surface — let the image use the whole screen. */
.lum-lightbox:fullscreen,
.lum-lightbox:-webkit-full-screen { background: #000; padding: 0; }
.lum-lightbox:fullscreen .lum-lightbox-img,
.lum-lightbox:-webkit-full-screen .lum-lightbox-img { max-width: 100vw; max-height: 100vh; border-radius: 0; }
.lum-lightbox-actions {
  position: absolute;
  top: 14px;
  right: 16px;
  display: flex;
  gap: 8px;
}
.lum-lightbox-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.lum-lightbox-btn:hover { background: rgba(255, 255, 255, 0.28); }

/* ── File attachments (CSV/Excel/PDF/text) ───────────────────────────────── */
.file-input-hidden { display: none; }
.btn-attach {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  background: var(--lum-surface);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: var(--lum-text-2);
}
.btn-attach:hover:not(:disabled) { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); }
.btn-attach:disabled { opacity: .4; cursor: not-allowed; }

.file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 0 10px;
}
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  padding: 6px 8px 6px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f7f7f7;
  font-size: 12px;
  color: #333;
}
.file-chip-icon { font-size: 14px; flex-shrink: 0; }
.file-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip-size { color: #999; flex-shrink: 0; }
.remove-file {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #999;
  font-size: 11px;
  cursor: pointer;
  padding: 0 0 0 2px;
  line-height: 1;
}
.remove-file:hover { color: #dc2626; }

/* Drag-over affordance on the composer */
.input-area.drag-active { outline: 2px dashed var(--lum-primary); outline-offset: 4px; border-radius: var(--lum-radius-input); }
.drop-hint {
  padding: 6px 0;
  font-size: 12px;
  color: var(--lum-primary);
  font-weight: 600;
}
.attach-error {
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
}

/* User-message file chips */
.user-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.user-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--lum-primary-bg-2);
  border-radius: var(--lum-radius);
  background: var(--lum-primary-bg);
  font-size: 12px;
  color: var(--lum-primary-active);
}
/* A downloadable attachment (sent to / received from the human specialist) — a chip that's a real link. */
.msg-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.msg-file-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid var(--lum-primary-bg-2);
  border-radius: var(--lum-radius);
  background: var(--lum-primary-bg);
  font-size: 12px;
  color: var(--lum-primary-active);
  text-decoration: none;
}
.msg-file-link:hover { text-decoration: underline; }

/* ── Conversation rating (thumbs) ────────────────────────────────────────── */
.chat-rating {
  position: relative;       /* anchor for the comment popover */
  display: flex;
  justify-content: flex-end; /* bottom-RIGHT, aligned with the composer's right edge */
  align-items: center;
  gap: 6px;
  padding: 6px 24px 4px;     /* match the input-area's horizontal padding */
  z-index: 5;
}
.chat-area { position: relative; }
.rating-btn {
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  font-size: 15px;
  padding: 5px 10px;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s, border-color .15s, background .15s;
  filter: grayscale(1);
}
.rating-btn:hover { opacity: 1; filter: none; }
.rating-btn.active { opacity: 1; filter: none; border-color: var(--lum-primary); background: var(--lum-primary-bg); }
/* "Talk to a human" lives in the same bar but reads as a labeled action, not a grayscale icon. */
.human-btn { opacity: .85; filter: none; font-size: 12px; font-weight: 600; color: var(--lum-primary); white-space: nowrap; }
.human-btn:hover { opacity: 1; border-color: var(--lum-primary-bg-2); background: var(--lum-primary-bg); }

/* Agent-offered handoff card, under the assistant message */
.escalation-card {
  display: flex;
  align-items: center;
  flex-wrap: wrap;               /* narrow: the action button drops to its own line instead of overflowing */
  gap: 8px 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--lum-primary-bg-2);
  border-radius: var(--lum-radius);
  background: var(--lum-primary-bg);
  font-size: 13px;
  color: var(--lum-primary-active);
}
/* Icon + prompt stay together as one block; the button/status is the card's other flex child. */
.escalation-head { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 150px; }
.escalation-icon { font-size: 16px; flex-shrink: 0; }
.escalation-text { flex: 1; }
.escalation-card .btn-sm { flex-shrink: 0; white-space: nowrap; }
/* Mini/compact embed: stack cleanly and make the action a full-width, unobstructed tap target. */
.compact .escalation-card { flex-direction: column; align-items: stretch; }
.compact .escalation-card .btn-sm { width: 100%; }
/* AI credits past the monthly budget (app.js buyChatCredits): the purchase options under the refusal. */
.credits-card {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--lum-primary-bg-2);
  border-radius: var(--lum-radius);
  background: var(--lum-primary-bg);
  font-size: 13px;
}
.credits-title { font-weight: 600; color: var(--lum-primary-active); margin-bottom: 4px; }
.credits-message { margin: 0 0 10px; color: var(--lum-text-2); line-height: 1.45; }
.credits-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.credits-human {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--lum-primary-bg-2); color: var(--lum-text-2);
}
.credits-human span { flex: 1 1 180px; }
.compact .credits-human { flex-direction: column; align-items: stretch; }
.compact .credits-human .btn-sm { width: 100% !important; }
.credits-note { margin: 0 0 8px; color: var(--lum-text-2); }
.credits-actions + .credits-note { margin: 8px 0 0; }
.compact .credits-actions { flex-direction: column; }
.compact .credits-actions .btn-sm { width: 100% !important; }
/* Clarifying-question option buttons (agent called ask_clarifying_question) */
.clarify-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.btn-clarify {
  padding: 7px 13px;
  border: 1px solid var(--lum-primary-bg-2);
  border-radius: var(--lum-radius-pill);
  background: var(--lum-primary-bg);
  color: var(--lum-primary-active);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.btn-clarify:hover { background: #e7dcff; border-color: var(--lum-primary); }
.btn-clarify-other { background: transparent; color: var(--lum-muted); border-style: dashed; }
.btn-clarify-other:hover { background: var(--lum-primary-bg); }
.rating-popover {
  position: absolute;
  top: 40px;
  right: 24px;
  width: 260px;
  background: var(--lum-surface);
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius);
  box-shadow: var(--lum-shadow-modal);
  padding: 12px;
}
/* Bar now sits above the composer, so the comment popover opens UPWARD, not into the input. */
.rating-popover--up {
  top: auto;
  bottom: 40px;
}
.rating-popover-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}
.rating-popover textarea {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  padding: 8px;
  resize: vertical;
  box-sizing: border-box;
}
.rating-popover-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.btn-sm {
  width: auto !important;
  padding: 6px 14px !important;
  margin-top: 0 !important;
  font-size: 13px !important;
}
.btn-plain {
  background: none;
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius-input);
  color: var(--lum-text-2);
  cursor: pointer;
  font-family: inherit;
}
.btn-plain:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }

/* ── Artifacts (inline charts / reports / exports) ───────────────────────── */
[x-cloak] { display: none !important; }

.artifacts { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.artifact-card {
  border: 1px solid var(--lum-border);
  border-radius: var(--lum-radius);
  overflow: hidden;
  background: var(--lum-surface);
  box-shadow: var(--lum-shadow);
}
.artifact-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--lum-border-subtle);
  background: var(--lum-surface);
}
.artifact-kind {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  background: var(--lum-primary);
  border-radius: var(--lum-radius);
  padding: 2px 6px;
  flex-shrink: 0;
}
.artifact-title { font-size: 13px; font-weight: 600; color: var(--lum-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-actions { display: flex; gap: 4px; flex-shrink: 0; }
.artifact-act {
  background: none; border: 1px solid var(--lum-border); border-radius: var(--lum-radius);
  width: 26px; height: 26px; cursor: pointer; color: var(--lum-text-2); font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.artifact-act:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }
.artifact-body { padding: 12px; }
.chart-wrap { position: relative; height: 320px; }
.artifact-iframe { width: 100%; min-height: 420px; border: 0; background: #fff; }
.artifact-filenote { font-size: 12px; color: #777; }

/* ── BI live dashboard (inline "watch it build" embed) — native-Luminous look ── */
.bi-live-card { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10); }
.bi-live-card-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #eef0f3; background: #fff; }
.bi-live-card-title { font-size: 13px; font-weight: 600; color: #111827; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-live-card-link { font-size: 12px; font-weight: 600; color: #374151; text-decoration: none; padding: 5px 11px; border: 1px solid #e5e7eb; border-radius: 999px; white-space: nowrap; transition: border-color .15s, color .15s, background .15s; }
.bi-live-card-link:hover { border-color: var(--lum-primary-bg-2); color: var(--lum-primary); background: var(--lum-primary-bg); }
.bi-live-card-frame { width: 100%; min-height: 520px; border: 0; background: #fff; display: block; }
.bi-live-card-sub { display: flex; align-items: center; gap: 8px; padding: 12px; font-size: 12px; color: var(--lum-muted); }
.bi-live-card-sub::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lum-primary); animation: bi-live-pulse 1.1s ease-in-out infinite; }
@keyframes bi-live-pulse { 0%,100% { opacity: .25; transform: scale(.9); } 50% { opacity: 1; transform: scale(1); } }

/* ── Dashboards (composite tile grid, client-rendered) ── */
.dash-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dash-refresh-btn {
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 4px 10px; cursor: pointer; color: #333; font-size: 12px; font-family: inherit;
}
.dash-refresh-btn:hover:not(:disabled) { background: #f0f0f0; }
.dash-refresh-btn:disabled { opacity: 0.6; cursor: default; }
.dash-refreshed-note { font-size: 11px; color: #999; }
.dash-refresh-err { font-size: 11px; color: #c0392b; }

/* ── Report: interactive grid (Tabulator) ─────────────────────────────────── */
.report-bar { flex-wrap: wrap; }
.report-search {
  flex: 1 1 180px; min-width: 140px; max-width: 320px;
  border: 1px solid #ddd; border-radius: 6px; padding: 4px 10px;
  font-size: 12px; font-family: inherit; color: #333;
}
.report-export-btn {
  background: #fff; border: 1px solid #ddd; border-radius: 6px;
  padding: 4px 10px; cursor: pointer; color: #333; font-size: 12px; font-family: inherit;
}
.report-export-btn:hover { background: #f0f0f0; }
.report-count { font-size: 11px; color: #999; }
.report-grid { width: 100%; font-size: 12px; }
.report-grid .tabulator { border: 1px solid #eee; background: #fff; }
.report-grid .tabulator .tabulator-header { font-weight: 600; }

/* ── Plan: reviewable bulk-action proposal (Rung 2) ───────────────────────── */
.plan-head { font-size: 12px; font-weight: 600; color: #333; margin-bottom: 6px; }
.plan-desc { font-size: 12px; color: #555; margin-bottom: 10px; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: plan; }
.plan-item {
  border: 1px solid #ececec; border-radius: 8px; background: #fff; padding: 10px 12px;
  counter-increment: plan; position: relative;
}
.plan-item-row { display: flex; align-items: baseline; gap: 10px; }
.plan-item-summary { flex: 1; font-size: 13px; color: #222; line-height: 1.4; }
.plan-item-summary::before { content: counter(plan) ". "; color: #999; font-variant-numeric: tabular-nums; }
.plan-tool-badge {
  flex: none; font-size: 11px; color: #555; background: #f3f4f6; border: 1px solid #e5e7eb;
  border-radius: 5px; padding: 1px 7px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap;
}
.plan-args { margin-top: 6px; }
.plan-args > summary { font-size: 11px; color: #888; cursor: pointer; user-select: none; }
.plan-args > summary:hover { color: #555; }
.plan-args pre {
  margin: 6px 0 0; padding: 8px 10px; background: #f7f7f8; border: 1px solid #eee; border-radius: 6px;
  font-size: 11px; color: #444; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre; overflow-x: auto; max-height: 220px;
}
.plan-bar { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.plan-approve-btn {
  background: var(--lum-primary); border: 1px solid var(--lum-primary); border-radius: var(--lum-radius-input);
  padding: 6px 14px; cursor: pointer; color: #fff; font-size: 12px; font-weight: 600; font-family: inherit;
}
.plan-approve-btn:hover:not(:disabled) { background: var(--lum-primary-hover); border-color: var(--lum-primary-hover); }
.plan-approve-btn:disabled { opacity: 0.6; cursor: default; }
.plan-cancel-btn {
  background: var(--lum-surface); border: 1px solid var(--lum-border); border-radius: var(--lum-radius-input);
  padding: 6px 12px; cursor: pointer; color: var(--lum-text-2); font-size: 12px; font-family: inherit;
}
.plan-cancel-btn:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }
.plan-note { font-size: 11px; color: var(--lum-muted); }
.plan-approved-note { font-size: 12px; color: var(--lum-success); font-weight: 600; }

/* Write-script plan: dry-run preview → one approval → server run with per-step progress */
.wplan-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.wplan-chip {
  font-size: 11px; color: var(--lum-text-2); background: var(--lum-primary-bg); border: 1px solid var(--lum-primary-bg-2);
  border-radius: 999px; padding: 1px 8px;
}
.wplan-list { max-height: 360px; overflow-y: auto; }
.wplan-mark { flex: none; width: 14px; font-size: 12px; color: var(--lum-muted); text-align: center; }
.wplan-ok .wplan-mark { color: var(--lum-success); }
.wplan-failed { border-color: #f1c4c4; background: #fff8f8; }
.wplan-failed .wplan-mark, .wplan-error, .wplan-failed-note { color: #b42318; }
.wplan-not_run { opacity: 0.6; }
.wplan-diff {
  margin: 4px 0 0 24px; font-size: 11px; color: #555; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow-wrap: anywhere;
}
.wplan-error { margin: 4px 0 0 24px; font-size: 11px; }
.wplan-failed-note { font-size: 12px; font-weight: 600; }
.wplan-skipped { margin-top: 10px; font-size: 12px; color: #555; }
.wplan-skipped > summary { cursor: pointer; color: #777; }
.wplan-skipped ul { margin: 6px 0 0; padding-left: 18px; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.dash-tile {
  border: 1px solid var(--lum-border); border-radius: var(--lum-radius); background: var(--lum-surface); padding: 12px;
  min-width: 0; overflow: hidden; box-shadow: var(--lum-shadow);
}
.dash-w-3 { grid-column: span 3; }
.dash-w-4 { grid-column: span 4; }
.dash-w-6 { grid-column: span 6; }
.dash-w-12 { grid-column: span 12; }
.dash-tile-title { font-size: 12px; font-weight: 600; color: #444; margin-bottom: 8px; }
.dash-metric-value { font-size: 28px; font-weight: 700; color: var(--lum-text); line-height: 1.1; }
.dash-metric-label { font-size: 12px; color: #777; margin-top: 4px; }
.dash-metric-delta { font-size: 12px; font-weight: 600; margin-top: 6px; }
.dash-metric-delta.up { color: #1e8e3e; }
.dash-metric-delta.down { color: #c0392b; }
.dash-metric-delta.flat { color: #888; }
.dash-tile .chart-wrap { height: 260px; }
.dash-table-scroll { overflow-x: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dash-table th, .dash-table td { border-bottom: 1px solid #eee; padding: 5px 8px; text-align: left; white-space: nowrap; }
.dash-table th { color: #555; font-weight: 600; }
.dash-table tfoot td { font-weight: 700; color: #222; border-top: 2px solid #ddd; border-bottom: none; background: #fafafa; }
/* Tabulator column-calc (totals) row: match the header weight so totals read as a summary line. */
.tabulator .tabulator-calcs-holder, .tabulator .tabulator-calcs-bottom { border-top: 2px solid #ddd; background: #fafafa; }
.tabulator .tabulator-calcs .tabulator-cell { font-weight: 700; color: #222; }
.dash-text { font-size: 13px; color: #333; line-height: 1.5; }
@media (max-width: 720px) {
  .dash-w-3, .dash-w-4, .dash-w-6, .dash-w-12 { grid-column: span 12; }
}

.btn-library {
  width: 100%; margin-top: 8px; padding: 8px 12px;
  background: none; border: 1px solid var(--lum-border); border-radius: var(--lum-radius-input);
  color: var(--lum-text-2); cursor: pointer; font-family: inherit; font-size: 13px; text-align: left;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-library:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); color: var(--lum-primary); }

/* Library overlay */
.library-overlay {
  position: fixed; inset: 0; background: rgba(18,19,26,0.35);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.library-panel {
  background: var(--lum-surface); border-radius: var(--lum-radius); width: min(880px, 92vw); max-height: 86vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--lum-shadow-modal);
}
.library-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--lum-border-subtle);
}
.library-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.library-close { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--lum-muted); }
.library-close:hover { color: var(--lum-primary); }
.library-empty { padding: 40px; text-align: center; color: var(--lum-muted); font-size: 14px; }

/* ── Reports page (shared tenant-wide report library) ─────────────────────── */
.reports-panel { width: min(1040px, 94vw); }
.reports-count {
  font-size: 12px; color: #888; background: #f0f0f0; border-radius: 10px;
  padding: 1px 8px; margin-left: 8px; font-weight: 500; vertical-align: middle;
}
.reports-err { margin: 10px 18px 0; font-size: 12px; color: #c0392b; }
/* Toolbar + search */
.reports-tabbody { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.reports-toolbar { padding: 10px 16px 4px; }
.reports-search {
  width: 100%; box-sizing: border-box; border: 1px solid var(--lum-border); border-radius: var(--lum-radius-input);
  padding: 8px 11px; font-size: 13px; font-family: inherit; color: var(--lum-text); outline: none; background: var(--lum-surface);
  transition: border-color .15s, box-shadow .15s;
}
.reports-search::placeholder { color: var(--lum-muted); }
.reports-search:focus { border-color: var(--lum-primary); box-shadow: var(--lum-ring); }

/* Card list (replaces the old fixed-column table) */
.reports-cards { overflow-y: auto; padding: 6px 10px 14px; }
.report-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 8px; border-bottom: 1px solid #f2f2f2;
}
.report-card:last-child { border-bottom: none; }
.report-card:hover { background: #fafafa; }
.report-card.editing { background: #f7f9ff; }
.report-card.paused { opacity: .6; }
.report-card-main { flex: 1; min-width: 0; }
.report-card-edit { display: flex; flex-direction: column; gap: 6px; }
.report-card-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.report-open-link {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 600; color: var(--lum-primary); text-align: left; line-height: 1.3;
  overflow-wrap: anywhere;
}
.report-open-link:hover { text-decoration: underline; }
.report-card-desc {
  color: #555; font-size: 13px; line-height: 1.4; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.report-origin {
  margin-top: 3px; font-size: 11px; color: #999;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.report-origin-label { color: #bbb; font-weight: 600; }
.report-card-meta {
  margin-top: 5px; font-size: 12px; color: #999;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px;
}
.report-card-meta .dot { color: #ccc; }
.report-card-actions { flex-shrink: 0; opacity: 0; transition: opacity .1s; padding-top: 1px; }
.report-card:hover .report-card-actions,
.report-card.editing .report-card-actions { opacity: 1; }
@media (hover: none), (max-width: 640px) {
  .report-card-actions { opacity: 1; }
}
.reprompt-lead { margin: 0; font-size: 13px; color: #444; line-height: 1.45; }
.reprompt-input {
  width: 100%; border: 1px solid var(--lum-border); border-radius: 8px; padding: 9px 11px; font-size: 13px;
  font-family: inherit; color: var(--lum-text); outline: none; resize: vertical; box-sizing: border-box;
}
.reprompt-input:focus { border-color: var(--lum-primary); }
.report-edit-input {
  width: 100%; border: 1px solid var(--lum-border); border-radius: 6px; padding: 5px 8px;
  font-size: 13px; font-family: inherit; color: var(--lum-text); outline: none;
}
.report-edit-input:focus { border-color: var(--lum-primary); }
.report-act-row { display: inline-flex; gap: 4px; }
.artifact-act.danger:hover { background: #fdecec; color: #c0392b; }

/* ── Scheduled reports (Reports overlay → Schedules tab) ──────────────────── */
.reports-tabs { display: inline-flex; gap: 4px; }
.reports-tab {
  background: none; border: none; cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 600;
  color: #999; padding: 2px 2px 6px; margin-right: 14px; border-bottom: 2px solid transparent;
}
.reports-tab.active { color: var(--lum-text); border-bottom-color: var(--lum-primary); }
.schedule-badge { font-size: 12px; line-height: 1; opacity: .8; }
.sched-email { display: inline-flex; align-items: center; gap: 4px; overflow-wrap: anywhere; }
.sched-email-edit { opacity: 0; transition: opacity .1s; }
.report-card:hover .sched-email-edit { opacity: .7; }
.sched-email-edit:hover { opacity: 1; }
.sched-email-editing { display: inline-flex; align-items: center; gap: 4px; }
.sched-email-input {
  border: 1px solid var(--lum-primary); border-radius: 6px; padding: 4px 7px; font-size: 12px;
  font-family: inherit; color: var(--lum-text); outline: none; min-width: 200px;
}
.sched-paused-tag {
  font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #b06a00;
  background: #fff3e0; border-radius: 8px; padding: 1px 6px; margin-left: 8px; font-weight: 600;
}
.run-glyph { font-weight: 700; }
/* status colouring: ✓ green, ✗ red, ⏭ amber — via adjacent title-free glyph text */
.run-glyph { color: #6b7280; }
.sched-when { color: #666; }
.sched-format { text-transform: uppercase; letter-spacing: .03em; }
.sched-runs { margin-top: 10px; padding: 8px 10px; background: #fafbff; border: 1px solid #eef; border-radius: 8px; }
.sched-runs-title { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #888; margin-bottom: 6px; }
.sched-runs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sched-runs-table td { padding: 4px 8px; color: #555; border-bottom: 1px solid #eef; white-space: nowrap; }
.sched-run-msg { color: #888; white-space: normal; }

/* ── Schedule create/edit form ───────────────────────────────────────────── */
.schedule-form-overlay { z-index: 120; }  /* above the Reports modal (100) so the edit form is usable */
.schedule-form-panel { width: min(460px, 92vw); }
.schedule-form { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.sched-field { display: flex; flex-direction: column; gap: 5px; }
.sched-field > span { font-size: 12px; font-weight: 600; color: #555; }
.sched-field select, .sched-field input {
  width: 100%; border: 1px solid var(--lum-border); border-radius: 6px; padding: 7px 9px;
  font-size: 13px; font-family: inherit; color: var(--lum-text); outline: none; background: #fff; box-sizing: border-box;
}
.sched-field select:focus, .sched-field input:focus { border-color: var(--lum-primary); }
.sched-field select:disabled { background: #f4f4f4; color: #777; }
.sched-field-row { display: flex; gap: 12px; }
.sched-field-row .sched-field { flex: 1; }
.sched-hint { font-size: 11px; color: #999; line-height: 1.4; }
.schedule-form-actions { display: flex; gap: 8px; margin-top: 2px; }
.library-grid {
  padding: 16px; display: grid; gap: 12px; overflow-y: auto;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.library-item {
  border: 1px solid var(--lum-border); border-radius: var(--lum-radius); padding: 12px; cursor: pointer; background: var(--lum-surface);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.library-item:hover { background: var(--lum-primary-bg); border-color: var(--lum-primary-bg-2); box-shadow: var(--lum-shadow); }
.library-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.library-item-title { font-size: 13px; font-weight: 600; color: var(--lum-text); margin: 8px 0 4px; }
.library-item-meta { font-size: 11px; color: var(--lum-muted); }

/* Tools / capabilities list (reuses .library-overlay/.library-panel/.library-header) */
.tools-list { padding: 10px 18px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.tool-row { display: flex; gap: 12px; padding: 12px; border-radius: 10px; }
.tool-row:hover { background: var(--lum-primary-bg); }
.tool-icon { font-size: 20px; line-height: 1.35; flex-shrink: 0; }
.tool-text { min-width: 0; }
.tool-name { font-size: 14px; font-weight: 600; color: var(--lum-text); display: flex; align-items: center; gap: 8px; }
.tool-desc { font-size: 13px; color: var(--lum-text-2); margin-top: 2px; line-height: 1.45; }
.tool-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--lum-primary); background: var(--lum-primary-bg); border: 1px solid var(--lum-primary-bg-2);
  padding: 1px 6px; border-radius: var(--lum-radius);
}

/* ── Staff: Tenant context panel (reuses .library-overlay/.library-panel/.library-header) ── */
.staff-panel { width: min(1160px, 96vw); max-height: 90vh; }
.staff-slug {
  font-size: 12px; font-weight: 500; color: #888; margin-left: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.staff-error { padding: 16px 18px; color: #b3261e; font-size: 13px; }
.staff-body { padding: 4px 22px 18px; overflow-y: auto; }
.staff-section { padding: 14px 0; border-top: 1px solid #f0f0f0; }
.staff-section:first-child { border-top: none; }
.staff-section h4 { margin: 0; font-size: 14px; color: #222; }
.staff-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.staff-meta { font-size: 11px; color: #999; }
.staff-hint { margin: 0 0 8px; font-size: 12px; color: #777; line-height: 1.45; }
.staff-notes {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 88px;
  border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px 12px;
  font-family: inherit; font-size: 13px; line-height: 1.5; color: #222;
}
.staff-notes:focus { outline: none; border-color: #b9a6dd; }
.staff-actions { display: flex; gap: 8px; margin-top: 8px; }
.staff-empty { font-size: 13px; color: #999; font-style: italic; padding: 6px 0; }

/* Collapsible section header (caret + title + meta), full-width clickable */
.staff-collapse {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; padding: 2px 0; cursor: pointer; text-align: left; color: inherit;
}
.staff-collapse:hover h4 { color: #6b4ea0; }
.staff-collapse .staff-meta { margin-left: auto; }
.staff-caret { font-size: 10px; color: #999; transition: transform .15s ease; flex-shrink: 0; }
.staff-caret.open { transform: rotate(90deg); }

/* Profile: TOC sidebar + scrollable content */
.staff-split { display: flex; gap: 16px; margin-top: 10px; align-items: flex-start; }
.staff-toc {
  flex: 0 0 232px; max-height: 56vh; overflow-y: auto; position: sticky; top: 0;
  border-right: 1px solid #eee; padding-right: 8px;
}
.staff-toc a {
  display: block; font-size: 12px; line-height: 1.4; color: #555; cursor: pointer;
  padding: 3px 6px; border-radius: 5px; text-decoration: none; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.staff-toc a:hover { background: #f3f1f8; color: #4a3a6b; }
.staff-toc a.lvl1 { font-weight: 600; color: #333; margin-top: 4px; }
.staff-toc a.lvl2 { padding-left: 12px; }
.staff-toc a.lvl3 { padding-left: 24px; color: #777; }
.staff-scroll { flex: 1 1 auto; min-width: 0; max-height: 56vh; overflow-y: auto; padding-right: 6px; }

/* Topology facts cards */
.staff-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.staff-fact {
  display: flex; flex-direction: column; gap: 3px; min-width: 96px;
  background: #f7f5fb; border: 1px solid #ece6f6; border-radius: 10px; padding: 10px 14px;
}
.staff-fact.warn { background: #fdf3e7; border-color: #f6dcb8; }
.staff-fact.ok { background: #eef7ee; border-color: #cfe8cf; }
.staff-fact-val { font-size: 20px; font-weight: 700; color: #4a3a6b; line-height: 1.1; text-transform: capitalize; }
.staff-fact.warn .staff-fact-val { color: #9a5b16; }
.staff-fact.ok .staff-fact-val { color: #2f7a3a; }
.staff-fact-label { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: .03em; }

/* Rendered markdown (profile + topology) */
.staff-md { font-size: 13px; color: #333; line-height: 1.6; overflow-wrap: anywhere; }
.staff-md > :first-child { margin-top: 0; }
.staff-md h1 { font-size: 17px; margin: 4px 0 10px; }
.staff-md h2 {
  font-size: 14px; margin: 18px 0 8px; padding-bottom: 4px;
  border-bottom: 1px solid #eee; color: #2a2350; scroll-margin-top: 6px;
}
.staff-md h3 { font-size: 13px; margin: 12px 0 6px; color: #444; scroll-margin-top: 6px; }
.staff-md ul, .staff-md ol { padding-left: 20px; margin: 6px 0; }
.staff-md li { margin: 2px 0; }
.staff-md p { margin: 6px 0; }
.staff-md code {
  background: #f3f1f8; padding: 1px 5px; border-radius: 4px; font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.staff-md table {
  border-collapse: collapse; font-size: 12px; margin: 10px 0; width: 100%;
  border: 1px solid #e6e6e6; border-radius: 6px; overflow: hidden;
}
.staff-md thead th { background: #f5f3fa; color: #3a3160; font-weight: 600; }
.staff-md th, .staff-md td { border-bottom: 1px solid #eee; border-right: 1px solid #f0f0f0; padding: 6px 10px; text-align: left; }
.staff-md tbody tr:nth-child(even) { background: #fafafa; }
.staff-md blockquote { margin: 8px 0; padding: 4px 12px; border-left: 3px solid #ddd0ee; color: #555; }

.library-viewer { padding: 16px; overflow-y: auto; }
.library-viewer-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.library-viewer-head .artifact-title { flex: 1; }
.library-viewer-body { min-height: 320px; }

/* ── Expanded single-artifact overlay (bigger in-app view) ── */
.artifact-overlay {
  position: fixed; inset: 0; background: rgba(18,19,26,0.35);
  display: flex; align-items: center; justify-content: center; z-index: 110;
}
.artifact-overlay-panel {
  background: var(--lum-surface); border-radius: var(--lum-radius); width: min(1100px, 95vw); max-height: 92vh;
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--lum-shadow-modal);
}
.artifact-overlay-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--lum-border-subtle);
}
.artifact-overlay-head .artifact-title { flex: 1; }
.artifact-overlay-body { padding: 18px; overflow: auto; }
.artifact-overlay-body > .chart-wrap { height: min(60vh, 620px); }

/* ── Standalone full-page artifact view (artifact.html) ── */
body.standalone { height: 100vh; display: flex; flex-direction: column; background: #f7f7f8; }
.standalone-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-bottom: 1px solid #e6e6e6; background: #fff; flex-shrink: 0;
}
.standalone-head .artifact-title { flex: 1; font-size: 15px; }
.standalone-actions { display: flex; gap: 8px; flex-shrink: 0; }
.standalone-body { flex: 1; overflow: auto; padding: 24px; }
.standalone-body > .chart-wrap { height: 72vh; }
.standalone-body > .artifact-iframe { min-height: 80vh; }
.standalone-notice { color: #777; font-size: 14px; text-align: center; padding: 64px 24px; }

/* "View all knowledge base articles" CTA, shown below the artifacts library grid. */
.library-kb-cta { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border, #e4e7ec); text-align: center; }
.library-kb-cta .btn-primary { display: inline-block; text-decoration: none; }

/* Staff → customer conversation-share dialog (reuses .library-overlay / .library-panel chrome). */
.share-body { padding: 4px 2px 2px; }
.share-intro { font-size: 13px; color: #555; line-height: 1.55; margin: 0 0 16px; }
.share-label { display: block; font-size: 12px; font-weight: 600; color: #333; margin: 0 0 6px; }
.share-textarea {
  flex: none; display: block; width: 100%; box-sizing: border-box;
  border: 1px solid var(--border, #e4e7ec); border-radius: 8px; padding: 10px 12px;
  max-height: none; background: #fff; font-size: 14px; line-height: 1.55; resize: vertical;
}
.share-error { color: #b42318; font-size: 13px; margin-top: 8px; }
.share-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.share-link-row { display: flex; gap: 8px; align-items: center; }
.share-link-input {
  flex: 1; border: 1px solid var(--border, #e4e7ec); border-radius: 8px; padding: 10px 12px;
  font-size: 13px; color: var(--lum-text); background: #f9fafb; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.share-hint { font-size: 12px; color: #777; margin: 10px 0 0; line-height: 1.5; }
.share-optional { color: #999; font-weight: 400; }

/* ── Branded boot / loading screen ──────────────────────────────────────────────
   Replaces the bare "Loading…" with an on-brand, AI-forward boot: the Luminous mark
   inside a rotating conic "halo" + a soft pulsing glow, cycling status lines, and a
   graceful slow/retry state. All motion is disabled under prefers-reduced-motion. */
.boot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(130% 100% at 50% 20%, #ffffff 0%, var(--lum-bg) 62%);
  overflow: hidden;
}
.boot-stage {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 14px;
  animation: boot-rise .55s cubic-bezier(.2,.7,.3,1) both;
}
.boot-orb { position: relative; width: 100px; height: 100px; display: grid; place-items: center; }
/* Rotating conic "AI" halo — the brand cool gradient sweeping around the mark. */
.boot-halo {
  position: absolute; inset: -8px; border-radius: 999px;
  background: conic-gradient(from 0deg, transparent 0deg, #621ff1 85deg, #0d2fd3 210deg, transparent 330deg);
  filter: blur(10px); opacity: .55;
  animation: boot-spin 2.6s linear infinite;
}
/* Soft pulsing purple glow directly behind the mark. */
.boot-glow {
  position: absolute; inset: 12px; border-radius: 24px;
  background: radial-gradient(circle at 50% 50%, rgba(96,46,231,.38), transparent 70%);
  animation: boot-pulse 2.2s ease-in-out infinite;
}
.boot-mark {
  position: relative; z-index: 1; width: 60px; height: 60px; border-radius: 17px;
  box-shadow: 0 12px 34px rgba(55,0,138,.30);
  animation: boot-breathe 2.4s ease-in-out infinite;
}
.boot-title { font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--lum-text); margin-top: 2px; }
.boot-status { display: inline-flex; align-items: center; font-size: 13px; color: var(--lum-muted); min-height: 18px; }
.boot-dots { display: inline-flex; gap: 3px; margin-left: 6px; }
.boot-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--lum-muted); opacity: .35; animation: boot-dot 1.2s ease-in-out infinite; }
.boot-dots i:nth-child(2) { animation-delay: .16s; }
.boot-dots i:nth-child(3) { animation-delay: .32s; }
.boot-slow { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--lum-text-2); margin-top: 6px; }
.boot-retry {
  font-family: inherit; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--lum-primary); border: 0; padding: 6px 15px; border-radius: var(--lum-radius-pill);
  cursor: pointer; transition: background .15s;
}
.boot-retry:hover { background: var(--lum-primary-hover); }
.boot-retry:focus-visible { outline: none; box-shadow: var(--lum-ring); }

@keyframes boot-spin { to { transform: rotate(360deg); } }
@keyframes boot-pulse { 0%,100% { opacity: .35; transform: scale(.9); } 50% { opacity: .7; transform: scale(1.08); } }
@keyframes boot-breathe { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.045); } }
@keyframes boot-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes boot-dot { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: .9; transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  .boot-halo, .boot-glow, .boot-mark, .boot-stage, .boot-dots i { animation: none !important; }
  .boot-halo { opacity: .4; }
}

/* ── Embed modes ──────────────────────────────────────────────────────────────
   Scoped under body.mode-*; 'full' is unaffected (no rules below apply to it). */

/* mode=chat — a compact chat-only popup: drop the model/effort/context chrome and land on a clean chat.
   The sidebar is collapsed by DEFAULT but stays reachable via the ☰ expander (opens as an overlay below),
   so past conversations are one tap away. */
.mode-chat .select-sm,
.mode-chat .context-meter { display: none !important; }
.mode-chat .chat-area { padding-left: 0; padding-right: 0; }
.mode-chat .input-area { padding: 10px 12px; }

/* body.compact — a NARROW-WIDTH auto layer (set by _applyCompact when innerWidth < COMPACT_MAX_WIDTH),
   independent of `mode`: a docked/tiny embed has no room for the sidebar, the suggested-prompt cards, or
   the model/effort chrome, so strip to a simple greeting + thread + composer. Same intent as mode=chat,
   applied by SIZE rather than by the host's ?mode=. */
.compact .select-sm,
.compact .context-meter { display: none !important; }
.compact .suggested-grid { display: none !important; }   /* the two-up card grid overflows a tiny window */
.compact .chat-area { padding-left: 0; padding-right: 0; }
.compact .input-area { padding: 10px 12px; }
.compact .empty-inner { padding: 0 16px; gap: 6px; }
.compact .empty-state h2 { font-size: 20px; }            /* fits without clipping the greeting */

/* Compact / chat-popup: the sidebar is collapsed by default (clean chat) but the ☰ expander stays, so
   past conversations are reachable. When opened there's no room beside the chat, so float it as a
   full-height overlay; picking a conversation drops back into it. */
.compact .sidebar:not(.collapsed),
.mode-chat .sidebar:not(.collapsed) {
  position: absolute; top: 0; left: 0; bottom: 0; z-index: 30;
  width: min(280px, 88%);
  box-shadow: var(--lum-shadow-modal);
}

/* mode=reports — the Reports/Schedules panel as full-bleed main content (no chat). The same
   overlay/panel DOM is repositioned from a centered modal into a flush, edge-to-edge surface. */
.mode-reports .layout { display: none !important; }
.mode-reports .reports-overlay {
  position: static; inset: auto; background: none; display: block; z-index: auto; padding: 0;
}
.mode-reports .reports-panel {
  width: 100%; max-width: none; height: 100vh; max-height: none;
  border-radius: 0; box-shadow: none;
}

/* Build-a-report bar (reports mode only) */
.report-build { padding: 12px 16px 4px; border-bottom: 1px solid #f0f0f0; }
.report-build-row { display: flex; gap: 8px; align-items: center; }
.report-build-input {
  flex: 1; box-sizing: border-box; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 9px 12px; font-size: 13px; font-family: inherit; color: var(--lum-text); outline: none; background: #fff;
}
.report-build-input::placeholder { color: #aaa; }
.report-build-input:focus { border-color: var(--lum-primary); }
.report-build-btn {
  background: var(--lum-primary); color: #fff; border: none; border-radius: var(--lum-radius-input);
  padding: 9px 16px; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap;
  transition: background .15s;
}
.report-build-btn:hover:not(:disabled) { background: var(--lum-primary-hover); }
.report-build-btn:disabled { opacity: 0.5; cursor: default; }
.report-build-status {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--lum-text-2);
}
.report-build-spinner {
  width: 12px; height: 12px; border: 2px solid var(--lum-border); border-top-color: var(--lum-primary);
  border-radius: 50%; display: inline-block; animation: report-build-spin 0.7s linear infinite;
}
@keyframes report-build-spin { to { transform: rotate(360deg); } }
.report-build-reply {
  margin-top: 8px; font-size: 13px; color: #333; line-height: 1.5;
  max-height: 160px; overflow-y: auto; background: #f9fafb; border-radius: 8px; padding: 10px 12px;
}
.report-build-reply :last-child { margin-bottom: 0; }

/* "Don't ask again for this kind of change" — confirm-card option + active-grant bar */
.auto-approve-opt { display: flex; align-items: flex-start; gap: 6px; margin: 2px 0 8px; font-size: 12px; color: var(--lum-text-2); cursor: pointer; }
.auto-approve-opt input { margin-top: 2px; }
.auto-approve-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 6px; padding: 4px 8px;
  font-size: 11px; color: var(--lum-text-2); background: var(--lum-primary-bg); border: 1px solid var(--lum-primary-bg-2); border-radius: 8px;
}
.auto-approve-chip { background: var(--lum-surface); border: 1px solid var(--lum-border); border-radius: 999px; padding: 0 7px; }
.auto-approve-stop {
  margin-left: auto; font-size: 11px; font-family: inherit; cursor: pointer; padding: 1px 8px;
  background: var(--lum-surface); border: 1px solid var(--lum-border); border-radius: 6px; color: var(--lum-text-2);
}
.auto-approve-stop:hover { color: var(--lum-primary); border-color: var(--lum-primary-bg-2); }

/* Connector calls on the approval card (src/connectors) */
.connector-call { flex: 1 1 100%; margin: 2px 0 4px; font-size: 12px; color: var(--lum-text-1, inherit); }
.connector-call-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.connector-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; background: var(--lum-bg); font-size: 11px; font-weight: 600; }
.connector-args { margin: 0; max-height: 180px; overflow: auto; padding: 6px 8px; border-radius: 6px; background: var(--lum-surface); border: 1px solid var(--lum-border); font-size: 11px; white-space: pre-wrap; word-break: break-word; }

/* Connectors panel (staff preview): the /connectors settings page, framed */
.connectors-panel { width: min(1000px, 94vw); height: 86vh; }
.connectors-panel .library-header { gap: 8px; }
.connectors-panel .btn-plain { text-decoration: none; }
.connectors-frame { flex: 1; width: 100%; border: 0; background: var(--lum-bg); }
