/* Brain · panel lateral. Claro, amable y con aire: referencia dust.tt, no la marca de Tres Puntos. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #17171a;
  --ink-2: #4a4a55;
  --muted: #8a8a96;
  --line: #ebe8e1;
  --line-strong: #dcd8ce;
  --blue: #2f6bff;
  --blue-soft: #e8efff;
  --sky: #dff1ff;
  --mint: #dcf5e7;
  --rose: #ffe4ea;
  --amber: #fff0cc;
  --green-ink: #12704a;
  --amber-ink: #8a5a00;
  --red: #c8324a;
  --red-soft: #ffeef1;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(23, 23, 26, .04), 0 6px 20px rgba(23, 23, 26, .06);
  font-family: "Geist", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--bg); }
button, input, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }

/* Marca: tres puntos de color que se tocan */
.mark { display: inline-flex; flex: none; }
.mark i { width: 12px; height: 12px; border-radius: 50%; margin-left: -4px; mix-blend-mode: multiply; }
.mark i:first-child { margin-left: 0; background: #7fb2ff; }
.mark i:nth-child(2) { background: #ffb3c4; }
.mark i:nth-child(3) { background: #ffd66b; }
.mark-lg i { width: 26px; height: 26px; margin-left: -9px; }

/* Botones */
.btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-weight: 550; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:hover { background: #f4f2ec; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2b2b31; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-block { width: 100%; padding: 11px 14px; }
.icon-btn { border: 0; background: transparent; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: #f1eee7; color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Acceso */
.login { min-height: 100%; padding: 56px 24px 24px; display: flex; flex-direction: column; gap: 6px; }
.login h1 { font-size: 28px; letter-spacing: -.02em; margin: 22px 0 0; }
.login form { margin-top: 22px; display: grid; gap: 14px; }
.login label { display: grid; gap: 6px; font-size: 13px; font-weight: 550; color: var(--ink-2); }
.login input { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 10px 12px; width: 100%; }
.login input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.advanced { font-size: 12px; color: var(--muted); }
.advanced summary { cursor: pointer; }
.advanced input { margin-top: 8px; font-size: 12px; }
.error { color: var(--red); background: var(--red-soft); border-radius: 10px; padding: 8px 10px; margin: 0; font-size: 13px; }

/* Estructura */
/* minmax(0, …): sin esto una fila con texto largo sin partir (el título de la página) ensancha todo el panel y se corta por la derecha */
.app { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.top { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 16px; }
.top-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.top-title strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-title span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 8px 16px 16px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }

/* Bienvenida */
.welcome { margin: auto 0; padding: 12px 0; }
.welcome h2 { font-size: 22px; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 4px; }
.welcome p { margin: 0 0 16px; color: var(--ink-2); }
.ideas { display: grid; gap: 8px; }
.idea { text-align: left; border: 0; border-radius: var(--radius); padding: 12px 14px; cursor: pointer; display: grid; gap: 2px; transition: transform .12s, box-shadow .15s; }
.idea:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.idea b { font-weight: 600; }
.idea span { font-size: 12.5px; color: var(--ink-2); }
.idea:nth-child(4n+1) { background: var(--sky); }
.idea:nth-child(4n+2) { background: var(--mint); }
.idea:nth-child(4n+3) { background: var(--rose); }
.idea:nth-child(4n+4) { background: var(--amber); }

/* Mensajes */
.msg { max-width: 100%; animation: rise .22s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.msg-user { align-self: flex-end; max-width: 88%; background: #f0ede6; border-radius: 18px 18px 6px 18px; padding: 9px 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-tag { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.msg-ai { align-self: stretch; overflow-wrap: anywhere; }
.msg-ai > :first-child { margin-top: 0; }
.msg-ai > :last-child { margin-bottom: 0; }
.msg-ai p { margin: 0 0 10px; }
.msg-ai h3, .msg-ai h4 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 16px 0 6px; }
.msg-ai blockquote { margin: 12px 0 6px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); font-size: 15px; font-weight: 550; line-height: 1.4; }
.msg-ai blockquote + p { color: var(--ink-2); font-size: 13px; margin: 0 2px 14px; }
.quote-actions { display: flex; gap: 6px; margin-top: 10px; }
.btn-small { padding: 4px 11px; font-size: 12px; font-weight: 550; }
.msg-ai ul, .msg-ai ol { margin: 0 0 10px; padding-left: 20px; }
.msg-ai li { margin: 2px 0; }
.msg-ai code { background: #f1eee7; border-radius: 6px; padding: 1px 5px; font-size: 12.5px; }
.msg-ai pre { background: #f1eee7; border-radius: 12px; padding: 10px 12px; overflow-x: auto; }
.msg-ai pre code { background: none; padding: 0; }
.msg-ai a { color: var(--blue); }
.sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.sources::before { content: "Consultado"; font-size: 12px; color: var(--muted); margin-right: 2px; }
.chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 10px; font-size: 12px; color: var(--ink-2); }
.chip-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status { display: flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; color: var(--muted); font-size: 13px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); animation: blink 1.1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .35; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }

/* Propuesta de cambio en WordPress */
.card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); display: grid; gap: 10px; margin-top: 10px; }
.card-title { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.change { display: grid; gap: 4px; }
.change-label { font-size: 12px; color: var(--muted); }
.before { color: var(--muted); text-decoration: line-through; text-decoration-color: #cfcabd; overflow-wrap: anywhere; }
.after { background: var(--mint); border-radius: 10px; padding: 6px 9px; overflow-wrap: anywhere; }
.before mark, .after mark { background: none; color: #d6402b; font-weight: 650; }
.before mark { color: inherit; font-weight: inherit; text-decoration: underline line-through; }
.note { border-radius: 10px; padding: 7px 10px; font-size: 13px; }
.note b { font-weight: 600; }
.note-warn { background: var(--amber); color: var(--amber-ink); }
.note-block { background: var(--red-soft); color: var(--red); }
.note-ok { background: var(--mint); color: var(--green-ink); }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.options { display: flex; flex-wrap: wrap; gap: 6px; }
.usage { font-size: 12px; margin-top: 10px; }

/* Novedades, propuestas y corrección */
.icon-btn { position: relative; }
.icon-btn.has-dot::after { content: ""; position: absolute; top: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: #e5484d; border: 2px solid var(--bg); }
.news-item { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; display: grid; gap: 4px; }
.news-item.unread { border-color: #c9d8ff; background: #f6f9ff; }
.news-item b { font-weight: 600; font-size: 13.5px; }
.news-item a { color: var(--blue); font-size: 12.5px; }
.news-item > .btn { justify-self: start; }
.news-item .muted { font-size: 12px; }
.news-body { font-size: 13px; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.tag { justify-self: start; border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 550; background: #f0ede6; color: var(--ink-2); }
.tag-mejora { background: var(--mint); color: var(--green-ink); }
.tag-empeora { background: var(--red-soft); color: var(--red); }
.tag-midiendo { background: var(--blue-soft); color: #1f47b8; }
details summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); }
.proposal-text { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); white-space: pre-line; background: #f7f5f0; border-radius: 10px; padding: 9px 11px; }
.feedback-open { display: grid; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; }
.feedback-open input, .feedback-open textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 7px 10px; font-size: 13px; background: var(--bg); resize: vertical; }
.feedback-open .btn { justify-self: start; }

.nudge { width: 100%; text-align: left; border: 1px dashed #c9d8ff; background: #f6f9ff; border-radius: var(--radius); padding: 11px 14px; margin-bottom: 12px; cursor: pointer; display: grid; gap: 2px; }
.nudge:hover { background: var(--blue-soft); }
.nudge b { font-weight: 600; color: #1f47b8; }
.nudge span { font-size: 12.5px; color: var(--ink-2); }
.note-preview { white-space: normal; max-height: 260px; overflow-y: auto; }
.note-preview > :first-child { margin-top: 0; }
.note-preview h3, .note-preview h4 { font-size: 13px; margin: 10px 0 4px; }
.note-preview p, .note-preview ul { margin: 0 0 8px; }
.setup-item .btn { grid-column: 1 / -1; justify-self: start; }
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.catalog-item { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 12px; display: grid; gap: 4px; align-content: start; }
.catalog-item b { font-weight: 600; }
.catalog-item .muted { font-size: 12px; }
.catalog-item .tag, .catalog-item .btn { justify-self: start; margin-top: 4px; }
.catalog-group { margin-top: -4px; }
.catalog-head { margin-top: 14px; }
.request-form input[type="url"], .request-form input[type="password"] { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 11px; background: var(--bg); }
.proposal-line { font-size: 13px; color: var(--ink-2); }
.proposal-line b { font-weight: 600; color: var(--ink); }
.setup-section { display: grid; gap: 6px; margin-top: 10px; }
.setup-intro { margin: -4px 0 2px; font-size: 12.5px; }
.setup-item { grid-template-columns: 1fr auto; }
.setup-item .news-body, .setup-item .muted { grid-column: 1 / -1; }
.setup-section > .btn { justify-self: start; }

/* Historial y encargo */
.history { display: grid; gap: 6px; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.history-item { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; transition: border-color .15s, box-shadow .15s; }
.history-item:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.history-item .muted { font-size: 12px; }
.history-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.request-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 12px; padding: 9px 11px; resize: vertical; background: var(--bg); }
.request-form textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* Barra inferior: una sola caja. Arriba lo adjunto, en medio el texto, abajo las herramientas. */
.dock { position: relative; min-width: 0; padding: 8px 12px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

.modebar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.segmented { display: inline-flex; flex: none; background: #f0ede6; border-radius: 999px; padding: 3px; }
.segmented button { border: 0; background: transparent; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.site { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.site::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #2fb37a; }
.site.limited::before { background: #e0a100; }
.site span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.composer { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 2px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; padding: 10px 10px 8px 14px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.composer:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft), var(--shadow); }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; background: transparent; padding: 4px 0 6px; max-height: 160px; line-height: 1.45; scrollbar-width: none; }
.composer textarea::-webkit-scrollbar { display: none; }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px -4px; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; background: #f4f2ec; border-radius: 10px; padding: 4px 6px 4px 8px; font-size: 12px; color: var(--ink-2); }
.pill svg { flex: none; color: var(--muted); }
.pill-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-x { flex: none; border: 0; background: transparent; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.pill-x:hover { background: #e7e3d9; color: var(--ink); }
.pill-active { background: var(--blue-soft); color: #1f47b8; }
.pill-active svg { color: #1f47b8; }
.pill-link { border: 0; background: transparent; color: inherit; font-weight: 600; cursor: pointer; padding: 0 4px; }

.toolbar { display: flex; align-items: center; gap: 8px; }
.tools { flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; margin-left: -6px; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-width: 0; border: 0; background: transparent; border-radius: 10px; padding: 6px 8px; font-size: 12.5px; font-weight: 550; color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s; }
.tool:hover, .tool[aria-expanded="true"] { background: #f1eee7; color: var(--ink); }
.tool svg { flex: none; }
.tool span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-on { color: #1f47b8; background: var(--blue-soft); }
.tool-on:hover, .tool-on[aria-expanded="true"] { background: #dbe6ff; color: #1f47b8; }
.tool-push { margin-left: auto; }
.send { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform .1s, opacity .15s; }
.send:active { transform: scale(.94); }
.send:disabled { opacity: .3; cursor: default; }

/* Menú que sale hacia arriba desde la barra de herramientas */
.menu { position: absolute; left: 12px; right: 12px; z-index: 5; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 6px rgba(23, 23, 26, .06), 0 16px 40px rgba(23, 23, 26, .14); padding: 6px; max-height: 60vh; overflow-y: auto; animation: rise .14s ease-out both; }
.menu-title { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); }
.menu-item { width: 100%; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: #f4f2ec; outline: none; }
.menu-item b { font-weight: 550; font-size: 13.5px; }
.menu-item small { grid-column: 1; font-size: 12px; color: var(--muted); line-height: 1.35; }
.menu-check { grid-row: 1 / span 2; grid-column: 2; color: var(--blue); visibility: hidden; }
.menu-item[aria-checked="true"] .menu-check { visibility: visible; }

.nav-label { display: none; }
.nav-only { display: none; }

/* Plataforma web: a partir de 900 px la cabecera pasa a ser barra lateral */
/* ---------- preguntas con opciones ---------- */
.ask { display: grid; gap: 6px; margin-top: 10px; }
.ask-option { display: grid; gap: 1px; text-align: left; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 9px 12px; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s; }
.ask-option:hover { border-color: var(--blue); background: #f6f9ff; }
.ask-option:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.ask-option[aria-pressed="true"] { border-color: var(--blue); background: var(--blue-soft); }
.ask-text { font-size: 13.5px; font-weight: 550; }
.ask-detail { font-size: 12px; color: var(--muted); }
.ask .card-actions { margin-top: 2px; }

/* ---------- probar antes de guardar ---------- */
.assumptions { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 2px; font-size: 13px; }
.spent-line { font-size: 12px; margin-top: 6px; }
.tryout:empty { display: none; }
.tryout { margin-top: 10px; }
.tryout-report { display: grid; gap: 8px; }
.tryout-case { border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; display: grid; gap: 4px; font-size: 13px; background: var(--bg); }
.tryout-case > .btn { justify-self: start; }
.tryout-head { display: flex; gap: 6px; }
.tryout-prompt { font-weight: 550; }
.tryout-answer { border-left: 2px solid var(--line-strong); padding-left: 10px; margin-top: 6px; font-size: 13px; }
.tryout-answer > :first-child { margin-top: 0; }
.tryout-banner { border: 1px dashed var(--blue); background: #f6f9ff; border-radius: 14px; padding: 11px 13px; display: grid; gap: 6px; font-size: 13px; }
.tryout-banner .chip-btn { text-transform: none; text-align: left; border-radius: 12px; }

/* ---------- ficha de un agente ---------- */
.sheet { display: grid; gap: 12px; }
.sheet-field { display: grid; gap: 4px; }
.sheet-field b { font-size: 13px; font-weight: 600; }
.sheet-field .muted { font-size: 12.5px; }
.sheet-field .field-wide { width: 100%; }
.sheet-votes { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; font-size: 13px; }
.sheet-votes ul { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 3px; }
.sheet-votes > .btn { justify-self: start; }
.agent-used { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------- guardar lo aprendido ---------- */
.keep-offer { margin-top: -8px; }

/* ---------- dar permiso ---------- */
.grant { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: 12.5px; }
.grant a { color: var(--blue); }

/* ---------- empezar por la web ---------- */
.gaps-head { margin-top: 10px; }
.gap-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.starter { display: grid; gap: 6px; border: 1px solid #c9d8ff; background: #f6f9ff; border-radius: 14px; padding: 12px; }
.starter b { font-weight: 600; font-size: 14px; }
.welcome .starter { margin-bottom: 12px; }
.starter .muted { font-size: 12.5px; }
.starter-compact { border-color: var(--line); background: var(--surface); }
.starter-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.starter-card { display: grid; gap: 8px; }
.starter-keep { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; cursor: pointer; }
.starter-keep input { margin: 0; align-self: center; }
.starter-keep .muted { font-size: 12.5px; }
.starter-text { width: 100%; min-width: 0; border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; background: var(--bg); font-size: 13px; line-height: 1.5; resize: vertical; }
.starter-text:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.starter-changes { background: var(--mint); color: var(--green-ink); border-radius: 12px; padding: 8px 12px; font-size: 13px; }
.starter-changes b { font-weight: 600; }
.starter-changes ul { margin: 4px 0 0; padding-left: 18px; }
.starter-doubts { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.starter-doubts > b { font-size: 13px; font-weight: 600; }
.starter-doubt { display: grid; gap: 4px; font-size: 13px; }
.starter-doubt .field-wide { width: 100%; }
.starter-sources { font-size: 12.5px; color: var(--ink-2); }
.starter-sources ul { margin: 6px 0 0; padding-left: 18px; }
.starter-sources a { color: var(--blue); overflow-wrap: anywhere; }

/* ---------- cambios: antes y después ---------- */
.diff { margin: 4px 0; padding: 7px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.diff del { background: var(--red-soft); color: var(--red); text-decoration: line-through; border-radius: 3px; padding: 0 2px; }
.diff ins { background: var(--mint); color: var(--green-ink); text-decoration: none; border-radius: 3px; padding: 0 2px; }

/* ---------- consumo y costes ---------- */
.consumo { gap: 4px; }
.big-number { font-size: 14px; color: var(--muted); margin: 2px 0 4px; }
.big-number b { font-size: 30px; font-weight: 650; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 6px 0; }
.stat { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-value { font-size: 18px; font-weight: 620; font-variant-numeric: tabular-nums; }
.stat .muted { font-size: 12px; }
.meter { height: 8px; border-radius: 999px; background: #efece4; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 999px; background: var(--blue); min-width: 2px; }
.meter-soft { height: 6px; }
.meter-soft i { background: #9db8ff; }
.meter-warn i { background: #d99a00; }
.meter-full i { background: var(--red); }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1.1fr) 2fr auto; gap: 4px 10px; align-items: center; font-size: 13px; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { font-variant-numeric: tabular-nums; font-weight: 550; text-align: right; white-space: nowrap; }
.bar-hint { grid-column: 1 / -1; font-size: 12px; margin-top: -2px; }
.columns { display: flex; align-items: flex-end; gap: 3px; height: 72px; padding: 6px 0 0; border-bottom: 1px solid var(--line-strong); }
.column { flex: 1; max-width: 22px; background: #9db8ff; border-radius: 4px 4px 0 0; }
.limit-field { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 13px; margin: 2px 0; }
.limit-field > .muted { flex: 1 1 160px; font-size: 12.5px; }
.field-small { width: 110px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 6px 9px; font: inherit; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.field-small:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.chip-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12.5px; color: var(--ink); cursor: pointer; text-transform: capitalize; }
.chip-btn.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.field-wide { flex: 1 1 180px; width: auto; }
select.field-small { width: auto; }
.check-line { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 6px 0; cursor: pointer; }
.check-line input { margin-top: 2px; accent-color: var(--blue); }
.link-line { word-break: break-all; font-size: 12px; margin: 4px 0; }
.audit-day { margin-top: 10px; }
.audit-day .muted::first-letter { text-transform: uppercase; }
.audit-day .muted { display: inline-block; }
.audit-row { display: grid; grid-template-columns: 46px 1fr; gap: 8px; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.audit-row b { font-weight: 600; }
.audit-time { font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .bar-row { grid-template-columns: 1fr auto; } .bar-row .meter { grid-column: 1 / -1; grid-row: 2; } }

@media (min-width: 900px) {
  .app { grid-template-columns: 252px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .top { grid-column: 1; grid-row: 1 / -1; flex-direction: column; align-items: stretch; gap: 2px; padding: 20px 12px 14px; background: #f5f3ec; border-right: 1px solid var(--line); }
  .top .mark { margin: 0 10px 10px; align-self: flex-start; }
  .top .mark i { width: 18px; height: 18px; margin-left: -6px; }
  .top .mark i:first-child { margin-left: 0; }
  .top-title { flex: none; padding: 0 10px 16px; }
  .top-title strong { font-size: 15px; }
  .icon-btn { width: 100%; height: 36px; display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding: 0 10px; font-size: 13.5px; font-weight: 550; }
  .icon-btn:hover { background: #ebe7dc; }
  .nav-label { display: inline; }
  #new-chat { order: 1; background: var(--surface); border: 1px solid var(--line-strong); margin-bottom: 10px; box-shadow: var(--shadow); }
  #history { order: 2; }
  #news { order: 3; }
  #setup { display: none; }
  .nav-only { display: flex; order: 4; }
  .nav-heading { order: 4; display: block; margin: 16px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  .icon-btn.current { background: #e6e1d4; color: var(--ink); }
  .wide-hidden { display: none; }
  #logout { order: 5; margin-top: auto; color: var(--muted); }
  .icon-btn.has-dot::after { top: 13px; right: 12px; border-color: #f5f3ec; }
  .thread, .dock { grid-column: 2; justify-self: center; width: min(100%, 800px); }
  .thread { padding: 36px 28px 16px; }
  .dock { padding: 8px 28px 26px; }
  .welcome h2 { font-size: 28px; }
  .welcome p { font-size: 15px; margin-bottom: 20px; }
  .ideas { grid-template-columns: 1fr 1fr; gap: 10px; }
  .msg-user { max-width: 70%; }
  .menu { left: 28px; right: auto; width: 380px; }
  .login { max-width: 420px; margin: 0 auto; padding-top: 14vh; }
  .history, .setup-section { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
