:root {
  /* NovaSetters brand (same values as novasetters.com styles.css) */
  --bg: #f6f6f3;            /* papel */
  --surface: #ffffff;       /* tarjeta */
  --surface-2: #eef1ec;     /* between papel and linea */
  --border: #e0e2dc;        /* linea */
  --text: #21363a;          /* tinta */
  --muted: #5a6b6c;         /* tinta-suave */
  --accent: #3d6b6c;        /* acento (teal) */
  --accent-strong: #2b5052; /* acento-fuerte */
  --accent-2: #a2763a;      /* dorado (ocre) */
  --accent-soft: #e3ecea;   /* acento-claro */
  --on-accent: #ffffff;
  --ok: #4e8b5f;            /* verde */
  --warn: #a2763a;          /* dorado */
  --danger: #bf5a5a;        /* rojo */
  --radius: 18px;
  --shadow: 0 1px 2px rgb(33 54 58 / 5%), 0 18px 36px -24px rgb(33 54 58 / 30%);
  --font: "Figtree", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101a19;
    --surface: #182827;
    --surface-2: #1f302e;
    --border: #263836;
    --text: #eef2ef;
    --muted: #9aaba8;
    --accent: #7fb3b0;
    --accent-strong: #9dc8c4;
    --accent-2: #d0a05e;
    --accent-soft: #1d3436;
    --on-accent: #101a19;
    --ok: #6fb37f;
    --warn: #d0a05e;
    --danger: #e08585;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 18px 36px -24px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
h3 { font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; letter-spacing: -.03em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hidden { display: none !important; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 500; font-size: .9rem; margin-bottom: .35rem; }
input, textarea, select {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: .65rem .85rem; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.field { margin-bottom: 1rem; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; cursor: pointer; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 600 .92rem var(--font); border-radius: 999px; padding: .6rem 1.15rem; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform .15s, background .15s, opacity .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary { box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .35rem .8rem; font-size: .82rem; }
.btn-block { width: 100%; }

.alert { padding: .75rem 1rem; border-radius: 14px; font-size: .9rem; margin-bottom: 1rem; }
.alert-error { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.alert-ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.alert-info { background: var(--accent-soft); color: var(--text); }

/* ---------- Brand ---------- */
.logo { display: inline-flex; align-items: center; gap: .55rem; font: 700 1.3rem/1 var(--font-display); color: var(--text); letter-spacing: -.03em; }
.logo-text span { color: var(--accent); }
.logo:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; flex: none; border-radius: 9px; object-fit: cover; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100%; display: flex; flex-direction: column; }
.auth-header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem clamp(16px, 4vw, 40px); }
.auth-main { flex: 1; display: grid; place-items: center; padding: 1rem 16px 3rem; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 2rem clamp(1.25rem, 5vw, 2.25rem); box-shadow: var(--shadow); }
.auth-card .logo-mark { width: 52px; height: 52px; margin-bottom: 1rem; border-radius: 14px; }
.auth-card h1 { font-size: 1.5rem; }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .82rem; margin: 1.25rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-bg { position: fixed; inset: 0; z-index: -1; background:
  radial-gradient(60% 60% at 70% 0%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
  radial-gradient(500px 400px at -10% 110%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent), var(--bg); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100%; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 1.1rem .8rem; display: flex; flex-direction: column; gap: .25rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .logo { padding: .2rem .6rem 1.1rem; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav-link svg { width: 18px; height: 18px; flex: none; }
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .9rem .7rem .3rem; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem clamp(16px, 3vw, 32px); border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.topbar .menu-btn { display: none; }
.content { padding: clamp(16px, 3vw, 32px); max-width: 1280px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head p { margin: 0; }

.pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill-accent { color: var(--accent); background: var(--accent-soft); }

/* lead state colours */
.st-OPEN_CONVERSATION { color: var(--muted); }
.st-IN_PROGRESS { color: #3b82f6; background: color-mix(in srgb, #3b82f6 12%, transparent); }
.st-QUALIFYING { color: #0ea5a4; background: color-mix(in srgb, #0ea5a4 12%, transparent); }
.st-LEAD { color: #8b5cf6; background: color-mix(in srgb, #8b5cf6 12%, transparent); }
.st-BOOKED { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.st-CLIENT { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.st-POSTPONED { color: #db2777; background: color-mix(in srgb, #db2777 10%, transparent); }
.st-NO_QUALIFY { color: var(--muted); }
.st-LOST { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .8rem; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
th, td { padding: .7rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.truncate { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tabs ---------- */
.tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.tab { border: 0; background: transparent; font: 600 .85rem var(--font); color: var(--muted); padding: .4rem .9rem; border-radius: 999px; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Funnel / bars ---------- */
.funnel-row { display: grid; grid-template-columns: 130px 1fr 56px; gap: .75rem; align-items: center; margin-bottom: .6rem; font-size: .9rem; }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: .5rem; }
.chart .col { flex: 1; background: var(--accent-soft); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.chart .col > span { position: absolute; inset: auto 0 0; background: var(--accent); border-radius: 4px 4px 0 0; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.kcol { background: var(--surface-2); border-radius: var(--radius); padding: .75rem; min-height: 200px; }
.kcol.drop { outline: 2px dashed var(--accent); }
.kcol h3 { display: flex; justify-content: space-between; font-size: .85rem; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .65rem .75rem; margin-top: .5rem; cursor: grab; font-size: .88rem; }
.kcard .muted { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Inbox / chat ---------- */
.inbox { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 210px); min-height: 480px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.inbox-list { border-right: 1px solid var(--border); overflow-y: auto; }
.inbox-item { padding: .8rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-item.active { background: var(--accent-soft); }
.inbox-item .muted { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { padding: .75rem 1rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .45rem; background: var(--bg); }
.bubble { max-width: min(75%, 520px); padding: .6rem .95rem; border-radius: 20px; white-space: pre-wrap; word-wrap: break-word; font-size: .92rem; }
.bubble.lead { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.bubble.out { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 6px; }
.bubble.human { background: color-mix(in srgb, var(--accent) 70%, var(--text)); }
.bubble.followup { background: color-mix(in srgb, var(--accent) 70%, var(--accent-2)); }
.bubble .meta { display: block; font-size: .7rem; opacity: .75; margin-top: .2rem; }
.sys { align-self: center; font-size: .78rem; color: var(--muted); background: var(--surface-2); padding: .25rem .7rem; border-radius: 99px; text-align: center; max-width: 90%; }
.chat-input { display: flex; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border); background: var(--surface); }
.chat-input textarea { min-height: 44px; height: 44px; }
.typing { align-self: flex-start; color: var(--muted); font-size: .85rem; font-style: italic; }

/* ---------- Quality meter ---------- */
.meter { height: 12px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; transition: width .4s; }
.score-big { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; letter-spacing: -.03em; }

/* ---------- Modal & toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgb(16 26 25 / 55%); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: var(--surface); border-radius: 22px; padding: 1.5rem; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.25rem; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: .65rem 1.2rem; border-radius: 999px; font-size: .9rem; z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
.toast.error { background: var(--danger); color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.nav-open .sidebar { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-body { min-height: 360px; }
  .funnel-row { grid-template-columns: 100px 1fr 44px; }
}
@media (max-width: 520px) {
  .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: .6rem 12px; gap: .4rem; }
  .topbar #palette-btn { font-size: 0; padding: .4rem .55rem; }
  .topbar #palette-btn::before { content: "🔍"; font-size: 1rem; }
  .topbar #topbar-right .pill { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .topbar #biz-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
}
.topbar { min-width: 0; }
.topbar > * { min-width: 0; }

/* ---------- Toggles ---------- */
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem 0; border-top: 1px solid var(--border); cursor: pointer; font-weight: 400; margin: 0; }
.toggle-row:first-child { border-top: 0; }
.toggle-row > span { display: flex; flex-direction: column; gap: .15rem; }
.switch { appearance: none; -webkit-appearance: none; width: 42px !important; height: 24px; border-radius: 99px; background: var(--border); position: relative; cursor: pointer; flex: none; transition: background .15s; padding: 0; border: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgb(0 0 0 / 20%); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Section nav (Configuración) ---------- */
.settings { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; align-items: start; }
.section-nav { display: flex; flex-direction: column; gap: .25rem; position: sticky; top: 76px; }
.section-nav button { text-align: left; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: .65rem .8rem; cursor: pointer; font: inherit; color: var(--text); }
.section-nav button strong { display: block; font-size: .92rem; }
.section-nav button span { display: block; font-size: .78rem; color: var(--muted); }
.section-nav button:hover { background: var(--surface-2); }
.section-nav button.active { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .6rem; border-radius: 99px; background: var(--surface-2); font-size: .82rem; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: .9rem; line-height: 1; }
.check-grid { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.hint { font-size: .8rem; color: var(--muted); margin-top: .35rem; }
.warn-box { background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--text); border-radius: 12px; padding: .6rem .8rem; font-size: .85rem; }

/* ---------- Prompts screen ---------- */
.prompts { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 1rem; align-items: start; }
.agent-tabs { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.agent-tab { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .7rem .35rem .4rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; font: 600 .85rem var(--font); color: var(--text); }
.agent-tab .avatar { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: .75rem; }
.agent-tab.active { border-color: var(--accent); background: var(--accent-soft); }
.prompt-view { white-space: pre-wrap; font-size: .9rem; line-height: 1.55; max-height: 520px; overflow-y: auto; padding: .25rem; cursor: text; }
.counter { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.near { color: var(--warn); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.diff pre { white-space: pre-wrap; font: .82rem/1.5 var(--font); background: var(--surface-2); border-radius: 10px; padding: .75rem; max-height: 360px; overflow: auto; margin: 0; }
.sim { position: sticky; top: 76px; display: flex; flex-direction: column; height: calc(100vh - 110px); min-height: 520px; padding: 0; overflow: hidden; }
.sim .chat-body { flex: 1; }
.transition-mark { align-self: center; font-size: .78rem; background: var(--accent-soft); color: var(--accent); padding: .3rem .75rem; border-radius: 99px; max-width: 92%; text-align: center; }
.rewind { opacity: 0; border: 0; background: none; cursor: pointer; font-size: .75rem; color: var(--muted); }
.bubble:hover .rewind { opacity: 1; }
.bubble.out .rewind { color: rgb(255 255 255 / 75%); }

/* ---------- Chats (3 panels) ---------- */
.chats { display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; height: calc(100vh - 64px); margin: calc(-1 * clamp(16px, 3vw, 32px)); border-top: 0; background: var(--surface); }
.chats .inbox-list { border-right: 1px solid var(--border); overflow-y: auto; }
.chats .chat { border-right: 1px solid var(--border); }
.lead-panel { overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; background: var(--bg); }
.lead-panel .card { padding: .9rem; box-shadow: none; }
.lead-panel h3 { font-size: .85rem; margin-bottom: .6rem; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .3rem .75rem; font-size: .85rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .82rem; }
.timeline li { padding: .4rem 0; border-top: 1px solid var(--border); }
.timeline li:first-child { border-top: 0; }
.score-dots { display: inline-flex; gap: 3px; }
.score-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.score-dots i.on { background: var(--accent); }
.bubble .brain { cursor: help; margin-left: .35rem; }
.bubble.failed { opacity: .6; outline: 1px dashed var(--danger); }
.composer-tools { display: flex; gap: .35rem; flex-wrap: wrap; padding: 0 .75rem .6rem; background: var(--surface); }
.window-warn { margin: .5rem .75rem 0; }

@media (max-width: 1180px) {
  .chats { grid-template-columns: 260px minmax(0, 1fr); }
  .lead-panel { display: none; }
  .chats.show-panel .lead-panel { display: flex; position: fixed; inset: 64px 0 0 auto; width: min(360px, 100%); z-index: 30; box-shadow: var(--shadow); }
  .prompts { grid-template-columns: 1fr; }
  .sim { position: static; height: 600px; }
}
@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; }
  .section-nav { position: static; flex-direction: row; overflow-x: auto; }
  .section-nav button { min-width: 200px; }
  .chats { grid-template-columns: 1fr; height: auto; margin: 0 -16px; }
  .chats .inbox-list { max-height: 240px; }
  .diff { grid-template-columns: 1fr; }
}

/* Manual dark theme (toggle in the top bar) */
:root[data-theme="dark"] {
    --bg: #101a19;
    --surface: #182827;
    --surface-2: #1f302e;
    --border: #263836;
    --text: #eef2ef;
    --muted: #9aaba8;
    --accent: #7fb3b0;
    --accent-strong: #9dc8c4;
    --accent-2: #d0a05e;
    --accent-soft: #1d3436;
    --on-accent: #101a19;
    --ok: #6fb37f;
    --warn: #d0a05e;
    --danger: #e08585;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 18px 36px -24px rgb(0 0 0 / 60%);
    color-scheme: dark;
  }
