/* Content Intelligence — MVP stylesheet.
   CSS plano, sin dependencias externas, sin fuentes remotas. */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #16181d;
  --ink-soft: #5b6472;
  --line: #e2e5ea;
  --accent: #1f5f4b;
  --accent-ink: #ffffff;
  --accent-soft: #e8f2ee;
  --error: #9b2226;
  --error-soft: #fdecec;
  --warn: #8a5a00;
  --ok: #1f7a4d;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --panel: #1c1f25;
    --ink: #e9ecf1;
    --ink-soft: #9aa4b2;
    --line: #2c313a;
    --accent: #4fbf95;
    --accent-ink: #10221c;
    --accent-soft: #1d2b27;
    --error: #ff8f8f;
    --error-soft: #2a1b1c;
    --warn: #e0b062;
    --ok: #64d6a2;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

.wrap { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 20px; }

/* ---------- topbar ---------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
}
.brand__name { font-weight: 650; letter-spacing: -.01em; }
.badge {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
/* GENERADO POR IA vs EDITADO/FINAL DEL USUARIO (V2-06B) — no es sólo color,
   el texto en sí ya distingue los dos casos. */
.badge--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.badge--ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.topbar__meta { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ok); }
.dot--bad { background: var(--error); }
.dot--unknown { background: var(--ink-soft); }

/* ---------- layout ---------- */
.layout { display: flex; flex-direction: column; gap: 18px; padding-top: 24px; padding-bottom: 48px; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.panel--muted { background: transparent; }
.panel--error { border-color: var(--error); background: var(--error-soft); }
.panel__title { font-size: 20px; margin: 0 0 6px; letter-spacing: -.01em; }
.panel__title--sm { font-size: 16px; margin: 0; }
.panel__sub { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }

/* ---------- form ---------- */
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

input[type="text"], select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
input[type="text"]:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input[aria-invalid="true"] { border-color: var(--error); }

.field__error { color: var(--error); font-size: 13px; margin: 6px 0 0; }

.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--sm { font-size: 13px; padding: 6px 11px; font-weight: 500; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn__spinner { display: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: spin .7s linear infinite; }
.btn.is-busy .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn__spinner { animation: none; } }

/* Marca los botones que llaman a Claude y tienen costo real. Fondo amarillo
   sólido y opaco a propósito -no un tono derivado de --warn con transparencia-
   porque tiene que leerse igual sobre botón primario oscuro, ghost o
   secundario; no es sólo color, el texto "$$" se lee igual en cualquier caso. */
.btn__cost-badge {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 5px;
  color: #3d2e00;
  background: #ffd43b;
  border: 1px solid #b8860b;
}

/* ---------- loading ---------- */
.loading__bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.loading__bar span { display: block; height: 100%; width: 35%; background: var(--accent);
  animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .loading__bar span { animation: none; width: 100%; margin-left: 0; }
}
.loading p { margin: 0 0 4px; }

.empty { margin: 0; color: var(--ink-soft); text-align: center; padding: 18px 0; }

/* ---------- result ---------- */
.result__head { display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.result__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.banner { border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-bottom: 16px; }
.banner--ok { background: var(--accent-soft); color: var(--ok); }
.banner--warn { background: var(--error-soft); color: var(--warn); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .grid { grid-template-columns: 1fr; } }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--panel);
}
.grid .card { margin-bottom: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.card__tools { display: flex; align-items: center; gap: 8px; }
.card__title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); margin: 0 0 8px; font-weight: 650; }
.card__head .card__title { margin: 0; }

.value { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.value--lg { font-size: 19px; font-weight: 650; }
.value--body { color: var(--ink); line-height: 1.65; }

.pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}
.pill--over { color: var(--error); border-color: var(--error); }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; }
.chips li { background: var(--accent-soft); color: var(--ink); border-radius: 999px;
  padding: 4px 11px; font-size: 14px; }

.outline { margin: 0; padding-left: 20px; }
.outline > li { margin-bottom: 10px; font-weight: 600; }
.outline ul { margin: 5px 0 0; padding-left: 18px; font-weight: 400; color: var(--ink-soft); }
.outline ul li { margin-bottom: 3px; }

.faq { margin: 0; }
.faq dt { font-weight: 650; margin-top: 12px; }
.faq dt:first-child { margin-top: 0; }
.faq dd { margin: 4px 0 0; color: var(--ink-soft); }

.meta-line { margin: 14px 0 10px; font-size: 13px; }

.tech summary { cursor: pointer; font-size: 13px; color: var(--ink-soft); }
.tech pre, #error-detail {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  max-height: 420px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin-top: 10px;
}

.error-list { margin: 8px 0 0; padding-left: 20px; }
.error-list li { margin-bottom: 4px; }

/* ---------- usage ---------- */
/* Contador de operaciones por hora — visible de un vistazo, sin leer el
   mensaje de error. Tres estados por color y por texto (no sólo color). */
.rate-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  font-family: var(--mono);
  padding: 6px 12px;
  border-radius: 999px;
  margin: 4px 0 12px;
}
.rate-pill--ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); }
.rate-pill--warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.rate-pill--full { color: var(--error); background: var(--error-soft);
  border: 1px solid color-mix(in srgb, var(--error) 45%, transparent); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
@media (max-width: 620px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--panel); }
.stat dt { font-size: 12px; color: var(--ink-soft); margin: 0 0 3px; }
.stat dd { margin: 0; font-size: 18px; font-weight: 650; font-family: var(--mono); }

/* ---------- misc ---------- */
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .92em; }
.foot { text-align: center; padding-top: 8px; line-height: 1.7; }

/* ---------- accesibilidad ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- contexto de trabajo ---------- */
.panel--context { padding-bottom: 16px; }
.section-head--tight { margin-top: 0; }
.context__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.context { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 12px 0 10px; }
@media (max-width: 620px) { .context { grid-template-columns: 1fr; } }

.context__field label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }
.context__row { display: flex; gap: 8px; align-items: center; }
.context__row select { flex: 1 1 auto; min-width: 0; }
.context__row .btn { flex: none; }
.context__inline { display: flex; gap: 8px; margin-top: 8px; }
.context__inline input { flex: 1 1 auto; min-width: 0; }

.current-item {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin-top: 12px;
}
.current-item__tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); font-weight: 650;
}
.current-item__title { margin: 3px 0 4px; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.current-item p:last-child { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.state-badge {
  font-family: var(--mono); font-size: 11px;
  padding: 2px 8px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- estado de guardado ---------- */
.save-status { font-size: 13px; color: var(--ink-soft); min-height: 1em; }
.save-status.is-saving { color: var(--warn); }
.save-status.is-saved  { color: var(--ok); }
.save-status.is-error  { color: var(--error); }

/* ---------- lista de trabajos ---------- */
.table-wrap { overflow-x: auto; }
.worklist { width: 100%; border-collapse: collapse; font-size: 14px; }
.worklist th, .worklist td {
  text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line);
  vertical-align: middle; white-space: nowrap;
}
.worklist th { font-size: 12px; color: var(--ink-soft); font-weight: 650; }
.worklist td.worklist__title { white-space: normal; min-width: 200px; }
.worklist tbody tr:last-child td { border-bottom: 0; }
.worklist tbody tr.is-current { background: var(--accent-soft); }

/* ---------- stepper ---------- */
.stepper { margin-bottom: 4px; }
.stepper__list {
  list-style: none; display: flex; gap: 8px; margin: 0; padding: 0;
  counter-reset: step;
}
.step { flex: 1 1 0; min-width: 0; }
.step__btn {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px;
  font: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink-soft);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
}
.step__btn:disabled { cursor: not-allowed; opacity: .55; }
.step__num {
  flex: none;
  display: grid; place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 12px;
}
.step__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.is-active .step__btn {
  color: var(--ink); border-color: var(--accent); background: var(--accent-soft);
}
.step.is-active .step__num { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.step.is-done .step__btn { color: var(--ink); }
.step.is-done .step__num { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
@media (max-width: 560px) {
  .stepper__list { flex-direction: column; }
  .step__btn { padding: 9px 12px; }
}

/* ---------- cabeceras de sección ---------- */
.section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin: 22px 0 6px;
}
.actions--end { justify-content: flex-end; margin-top: 18px; }

/* ---------- tarjetas de alternativa ---------- */
.cards { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }

.card-option { margin: 0; }
.card-option__label {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}
.card-option__label:hover { border-color: var(--accent); }
.card-option__input { flex: none; margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); }
.card-option__input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-option__body { min-width: 0; }
.card-option__title { margin: 0 0 5px; font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.card-option__angle { margin: 0 0 5px; font-size: 14px; color: var(--accent); }
.card-option__rationale { margin: 0; font-size: 14px; }
.card-option.is-selected .card-option__label {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}

/* ---------- enfoque elegido ---------- */
.chosen {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.chosen__tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); font-weight: 650;
}
.chosen__title { margin: 4px 0 3px; font-size: 16px; font-weight: 650; }
.chosen__angle { margin: 0; font-size: 14px; }

/* ---------- selección de secciones ---------- */
.outline-select { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.outline-item { margin: 0; }
.outline-item__label {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  font-weight: 400;
  margin: 0;
}
.outline-item__label:hover { border-color: var(--accent); }
.outline-item__check { flex: none; margin-top: 3px; width: 17px; height: 17px; accent-color: var(--accent); }
.outline-item__check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.outline-item__body { min-width: 0; }
.outline-item__heading { margin: 0 0 3px; font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.outline-item__purpose { margin: 0; font-size: 13px; }
.outline-item__children { margin: 7px 0 0; padding-left: 18px; font-size: 13px; }
.outline-item__children li { margin-bottom: 2px; }
.outline-item.is-excluded .outline-item__label { opacity: .5; background: var(--bg); }
.outline-item.is-excluded .outline-item__heading { text-decoration: line-through; }

.card--h1 { margin-bottom: 0; }

/* ---------- resumen final ---------- */
.summary { margin: 0 0 18px; }
.summary__row {
  display: grid; grid-template-columns: 190px 1fr; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
}
.summary__row:last-child { border-bottom: 0; }
.summary dt { color: var(--ink-soft); font-size: 14px; margin: 0; }
.summary dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .summary__row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- login ---------- */
.login-body { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.login-shell { width: 100%; max-width: 400px; }
.login-card { padding: 28px 24px; }
.brand--stacked { flex-direction: column; gap: 8px; margin-bottom: 18px; text-align: center; }
.brand--stacked .brand__mark { width: 38px; height: 38px; font-size: 15px; }
.brand--stacked .brand__name { font-size: 18px; }
.login-card .panel__title { text-align: center; }
.login-card .panel__sub { text-align: center; }
.login-card .actions { margin-top: 18px; }
.login-card .btn--primary { width: 100%; justify-content: center; }
.login-foot { text-align: center; margin: 18px 0 0; line-height: 1.6; }

/* ---------- sesión ---------- */
.topbar__session { display: flex; align-items: center; gap: 10px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,.22);
  z-index: 50;
}

/* ------------------------------------------------------------------ */
/* editor del artículo                                                 */
/* ------------------------------------------------------------------ */

.rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0 22px; }

.hint { margin: 5px 0 0; font-size: 12px; color: var(--ink-soft); }
.hint.is-over { color: var(--warn); }

/* Una sección del artículo. El borde izquierdo codifica el estado: es la
   señal que permite ver de un vistazo qué tocó una persona y qué no. */
.section-edit {
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: var(--surface);
}
.section-edit.is-edited { border-left-color: var(--accent); }
.section-edit.is-approved { border-left-color: var(--ok); }
.section-edit.is-busy { opacity: .7; }

.section-edit__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.section-edit__heading { font-size: 15px; font-weight: 650; margin: 0; }

.section-edit__state {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); white-space: nowrap;
}
.section-edit.is-edited .section-edit__state { color: var(--accent); }
.section-edit.is-approved .section-edit__state { color: var(--ok); }

.section-edit textarea {
  width: 100%; min-height: 190px; line-height: 1.65; resize: vertical;
}

.section-edit__tools {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.section-edit__instruction { flex: 1 1 240px; min-width: 180px; }
.section-edit__instruction input { width: 100%; font-size: 13px; }

.revisions { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px;
  background: var(--accent-soft); font-size: 13px; }
.revisions ul { list-style: none; margin: 6px 0 0; padding: 0; }
.revisions li { display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; padding: 5px 0; border-top: 1px solid var(--line); }
.revisions li:first-child { border-top: 0; }
.revisions__excerpt { color: var(--ink-soft); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }

.faq-edit { margin-bottom: 14px; }
.faq-edit:last-child { margin-bottom: 0; }
.faq-edit input { width: 100%; font-weight: 600; margin-bottom: 6px; }
.faq-edit textarea { width: 100%; min-height: 80px; resize: vertical; }

/* ---------------------------------------------------------------- */
/* Investigación (008)                                              */
/* ---------------------------------------------------------------- */

.research-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.research-item {
  border: 1px solid var(--border, #d8dde3);
  border-left: 3px solid var(--border, #d8dde3);
  border-radius: 6px;
  padding: .6rem .75rem;
  background: #fff;
}

/* El estado de una afirmación se ve antes de leerla. El conflicto y la falta
   de respaldo son la información que no debe pasar desapercibida. */
.research-item--supported            { border-left-color: #2e7d32; }
.research-item--partially_supported  { border-left-color: #f9a825; }
.research-item--unsupported          { border-left-color: #c62828; }
.research-item--conflicting          { border-left-color: #6a1b9a; }

.research-item__title {
  margin: 0 0 .25rem;
  font-weight: 600;
  line-height: 1.35;
}

.research-item__meta {
  margin: 0;
  font-size: .82rem;
  color: var(--muted, #5b6672);
}

/* La cita es la procedencia: se distingue del texto propio del sistema. */
.research-item__quote {
  margin: .4rem 0 0;
  padding-left: .6rem;
  border-left: 2px solid var(--border, #d8dde3);
  font-size: .85rem;
  color: var(--muted, #5b6672);
  line-height: 1.4;
}

.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: .75rem 0 1rem;
}

.panel__title--xs {
  font-size: .9rem;
  margin: .75rem 0 .4rem;
}

/* ---------------------------------------------------------------- */
/* SEO / AEO (009)                                                  */
/* ---------------------------------------------------------------- */

/* La procedencia se ve de un vistazo: confundir un dato observado con una
   inferencia es el error que esta capa existe para evitar. */
.prov {
  display: inline-block;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .05rem .35rem;
  border-radius: 3px;
  margin-right: .25rem;
  border: 1px solid currentColor;
}
.prov--observed { color: #1b5e20; }
.prov--derived  { color: #0d47a1; }
.prov--inferred { color: #6a4b00; }

.seo-item--covered { border-left-color: #2e7d32; }
.seo-item--partial { border-left-color: #f9a825; }
.seo-item--absent  { border-left-color: #c62828; }

.notice {
  border-radius: 6px;
  padding: .6rem .75rem;
  margin: 0 0 1rem;
  font-size: .88rem;
  line-height: 1.45;
}
.notice--warn {
  background: #fff8e1;
  border: 1px solid #f0c36d;
  color: #6a4b00;
}

.seo-manual {
  margin: 0 0 1rem;
  font-size: .9rem;
}
.seo-manual summary {
  cursor: pointer;
  color: var(--muted, #5b6672);
}

.field--row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.field--row input { max-width: 8rem; }

/* Contexto de tenencia en la barra superior (V2-02). La agencia activa se
   muestra siempre; el selector sólo aparece si hay más de una. */
.topbar__agency {
  max-width: 14rem;
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ---------- QA / Early Access ---------- */
.badge--qa { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.topbar__qa-note {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px 8px;
}

/* ---------- inicio: "¿qué quieres hacer?" (QA-ENTRY-DASHBOARD-001) ---------- */
.home__title { font-size: 26px; margin: 0 0 4px; letter-spacing: -.01em; }
.home__subtitle { margin: 0 0 12px; font-size: 15px; }
#home-hint { margin: 0 0 18px; }
#home-brand-context { margin: -10px 0 18px; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.home-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-card h2 { margin: 0; font-size: 16px; }
.home-card p { margin: 0; color: var(--ink-soft); font-size: 14px; flex-grow: 1; }
.home-card .btn { align-self: flex-start; margin-top: 4px; }

.home-card--primary {
  grid-column: 1 / -1;
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.home-card--primary h2 { font-size: 19px; }

.home-card__formats {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}
.home-card__formats li {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--panel);
}

.home-card--secondary {
  grid-column: 1 / -1;
  background: transparent;
}
.home-card--secondary h2 { font-size: 14px; color: var(--ink-soft); }
.home-card--secondary p { font-size: 13px; }

@media (max-width: 640px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-card--primary, .home-card--secondary { grid-column: auto; }
}

/* ---------- área de trabajo (bajo el CTA elegido en inicio) ---------- */
/* Mismo flex/gap que .layout: sus hijos directos eran hijos de .layout antes
   de envolverlos en #workarea, y dependían de ese gap para su espaciado. */
#workarea { display: flex; flex-direction: column; gap: 18px; }
.workarea__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
