/* Krondi · decisions.css
   Decisiones (SPEC §81.4): la pestaña (decisions/decisions-view.js), la línea del tiempo con sus hilos
   (decisions/decision-timeline.js), el diálogo «Llevar a Decisiones…» / «Nueva decisión» (decision-dialog.js), la
   ficha (decision-card.js) y la marca bajo el mensaje del chat. Todo con los tokens de base.css (claro, oscuro y el
   acento) más la paleta suave de los temas (--dec-c0…7) y su gris de «Sin tema». */

/* --------------------------------------------------------------------------
   Paleta de los temas (índice 0–7): verde azulado, coral, violeta, rosa, azul, ámbar, verde y gris. Suaves sobre el
   blanco; algo más claros en oscuro para que se vean sobre el gris carbón. --dec-none: el hilo «Sin tema».
   -------------------------------------------------------------------------- */
:root {
  --dec-c0: #1d9e75;
  --dec-c1: #d85a30;
  --dec-c2: #7f77dd;
  --dec-c3: #d4537e;
  --dec-c4: #378add;
  --dec-c5: #ba7517;
  --dec-c6: #639922;
  --dec-c7: #888780;
  --dec-none: color-mix(in srgb, var(--text-subtle) 52%, var(--surface));
  --dec-amber: #d4900f;
  --dec-bg: var(--surface);
}
:root[data-theme="dark"] {
  --dec-c0: #3dbb92;
  --dec-c1: #ec7c55;
  --dec-c2: #a19aee;
  --dec-c3: #e6779c;
  --dec-c4: #62a6ee;
  --dec-c5: #d89a3a;
  --dec-c6: #86b94a;
  --dec-c7: #a6a59e;
  --dec-none: color-mix(in srgb, var(--text-subtle) 55%, var(--surface));
  --dec-amber: #f0b44c;
}

/* --------------------------------------------------------------------------
   Vista
   -------------------------------------------------------------------------- */
.dec-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: var(--surface);
  container-type: inline-size;
  container-name: decisions;
}
.dec-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}
.dec-toolbar-row { display: flex; align-items: center; gap: 0.5rem 0.75rem; min-width: 0; }
.dec-toolbar-spacer { flex: 1; }
.dec-current {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.dec-current .switch { width: 2.2rem; height: 1.3rem; }
.dec-current .switch::before { width: 0.95rem; height: 0.95rem; }
.dec-current .switch:checked::before { transform: translateX(0.9rem); }
.dec-search { position: relative; display: flex; align-items: center; gap: 0.35rem; }
.dec-search[hidden] { display: none; }
.dec-search-icon { position: absolute; left: 0.65rem; color: var(--text-subtle); pointer-events: none; }
.dec-search-input { flex: 1; min-width: 0; height: 2.1rem; padding-left: 2.1rem; }
@container decisions (max-width: 340px) {
  .dec-new-btn .btn-label { display: none; }
  .dec-new-btn { width: var(--btn-h); padding: 0; }
}

.dec-scroll { flex: 1; min-height: 0; padding: 0.75rem 0.9rem 2.5rem; }
.dec-body { display: flex; flex-direction: column; gap: 0.75rem; max-width: 46rem; margin: 0 auto; }
.dec-loading { min-height: 10rem; }
.dec-note {
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-subtle);
  font-size: 0.875rem;
  text-align: center;
}
.dec-more { display: flex; justify-content: center; }
.dec-more[hidden] { display: none; }
.dec-state-slot:empty { display: none; }

/* --- Chips de los temas (filtro) ------------------------------------------------ */
.dec-topics { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dec-topics[hidden] { display: none; }
.dec-fchip {
  --tc: var(--dec-none);
  display: inline-flex;
  align-items: stretch;
  max-width: 100%;
  height: 1.85rem;
  border: 1px solid color-mix(in srgb, var(--tc) 28%, var(--border));
  border-radius: var(--radius-full);
  background: var(--surface);
  overflow: hidden;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.dec-fchip-main, .dec-fchip-more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  line-height: 1;
  cursor: pointer;
}
.dec-fchip-main { padding: 0 0.7rem 0 0.6rem; }
.dec-fchip-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dec-fchip-hint { color: var(--text-subtle); font-weight: 450; }
.dec-fchip-more { display: none; padding: 0 0.45rem 0 0.15rem; color: var(--text-subtle); }
.dec-fchip-main:focus-visible, .dec-fchip-more:focus-visible { outline: none; box-shadow: inset var(--focus-ring); }
.dec-fchip:hover { background: var(--surface-2); }
.dec-fchip:hover .dec-fchip-main { color: var(--text); }
.dec-fchip.is-on {
  border-color: color-mix(in srgb, var(--tc) 45%, transparent);
  background: color-mix(in srgb, var(--tc) 13%, var(--surface));
}
.dec-fchip.is-on .dec-fchip-main { color: color-mix(in srgb, var(--tc) 62%, var(--text)); }
/* El «⋯»: siempre en el elegido; con ratón, también al pasar por encima */
.dec-fchip.is-on .dec-fchip-more, .dec-fchip:focus-within .dec-fchip-more { display: inline-flex; }
@media (hover: hover) { .dec-fchip:hover .dec-fchip-more { display: inline-flex; } }
.dec-fchip.is-closed { opacity: 0.75; border-style: dashed; }
.dec-menu-color { display: inline-flex; align-items: center; gap: 0.55rem; }
.dec-menu-swatch { width: 0.85rem; height: 0.85rem; border-radius: 50%; background: var(--tc); flex-shrink: 0; }

/* --- Sugerencia por palabras (discontinua: pendiente) ---------------------------- */
.dec-hint-slot:empty { display: none; }
.dec-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.85rem;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  animation: cp-soft-in var(--dur-in) var(--ease) both;
}
.dec-hint-dots { display: inline-flex; gap: 0.2rem; }
.dec-hint-text { flex: 1 1 14rem; margin: 0; color: var(--text); font-size: 0.875rem; line-height: 1.45; }
.dec-hint-actions { display: flex; gap: 0.35rem; margin-left: auto; }

/* --- «Ver un ejemplo» ------------------------------------------------------------- */
.dec-sample-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.dec-sample-bar[hidden] { display: none; }
.dec-sample-tag {
  display: inline-flex;
  align-items: center;
  height: 1.6rem;
  padding: 0 0.7rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.dec-sample-bar ~ .dec-tl { opacity: 0.92; }

/* --- Primer uso ------------------------------------------------------------------- */
.dec-first {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 0.5rem 1rem;
  text-align: center;
  animation: cp-soft-in var(--dur-in) var(--ease) both;
}
.dec-ghost { display: flex; gap: 0.6rem; width: min(17rem, 100%); margin-bottom: 0.5rem; text-align: left; }
.dec-ghost-svg { flex-shrink: 0; overflow: visible; }
.dec-ghost-line { stroke: var(--dec-none); stroke-width: 2; stroke-dasharray: 4 4; fill: none; }
.dec-ghost-dot { fill: var(--dec-bg); stroke: var(--dec-none); stroke-width: 1.5; stroke-dasharray: 2.5 2; }
.dec-ghost-rows { display: flex; flex-direction: column; justify-content: space-between; flex: 1; padding: 0.35rem 0 0.1rem; }
.dec-ghost-row { display: flex; flex-direction: column; gap: 0.35rem; }
.dec-ghost-bar { display: block; height: 0.6rem; border-radius: var(--radius-full); background: var(--surface-2); }
.dec-ghost-bar.is-thin { height: 0.4rem; background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.dec-first-title { margin: 0; color: var(--text); font-size: 1.1rem; font-weight: 650; }
.dec-first-text { max-width: 28rem; margin: 0; color: var(--text-muted); font-size: 0.9rem; line-height: 1.55; }
.dec-first-ways {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: left;
}
.dec-first-ways li { display: flex; align-items: center; gap: 0.5rem; }
.dec-first-ways svg { color: var(--text-subtle); flex-shrink: 0; }
.dec-first-ways strong { color: var(--text); font-weight: 600; }
.dec-first-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }

/* --------------------------------------------------------------------------
   La línea del tiempo (decision-timeline.js)
   -------------------------------------------------------------------------- */
.dec-tl { position: relative; --dec-gutter: 40px; }
.dec-tl[hidden] { display: none; }
.dec-tl-svg { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.dec-tl-list { position: relative; margin: 0; padding: 0 0 0 var(--dec-gutter); list-style: none; }
.dec-day { padding: 0.85rem 0 0.25rem 0.45rem; }
.dec-day:first-child { padding-top: 0.1rem; }
.dec-day-label { margin: 0; color: var(--text-subtle); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.01em; }
.dec-row { position: relative; padding: 0.1rem 0; }
.dec-row-main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.4rem 0.55rem 0.45rem 0.45rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  transition: background-color var(--dur) var(--ease);
}
button.dec-row-main { cursor: pointer; }
button.dec-row-main:hover { background: var(--surface-2); }
button.dec-row-main:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dec-row-title {
  color: var(--text);
  font-size: 0.9333rem;
  font-weight: 450;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.dec-row.is-current .dec-row-title { font-weight: 600; }
.dec-row.is-gone .dec-row-title {
  color: var(--text-subtle);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-subtle) 70%, transparent);
}
.dec-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.1rem 0.75rem;
  color: var(--text-subtle);
  font-size: 0.75rem;
  line-height: 1.35;
}
.dec-meta-item { display: inline-flex; align-items: center; gap: 0.3rem; min-width: 0; }
.dec-meta-item svg { flex-shrink: 0; }
.dec-meta-topic { color: color-mix(in srgb, var(--tc) 70%, var(--text)); font-weight: 600; }
.dec-meta-review.is-due { color: color-mix(in srgb, var(--dec-amber) 70%, var(--text)); font-weight: 600; }
.dec-meta-new { color: var(--accent-text); font-weight: 600; }
.dec-meta-item.is-all-done { color: var(--success-text); }
.dec-row.is-highlight .dec-row-main { animation: dec-flash 2.4s var(--ease) both; }
@keyframes dec-flash {
  0%, 35% { background: var(--accent-soft); }
  100% { background: transparent; }
}
.dec-tl.is-compact .dec-row-main { padding: 0.25rem 0.4rem; }
.dec-tl.is-compact .dec-row-title { font-size: 0.875rem; }
.dec-tl.is-compact .dec-row.is-new .dec-row-title { color: var(--text); }

/* --------------------------------------------------------------------------
   Diálogo y ficha (comparten .dec-modal)
   -------------------------------------------------------------------------- */
.dec-dlg { display: flex; flex-direction: column; gap: 0.9rem; }
.dec-dlg-section { display: flex; flex-direction: column; gap: 0.4rem; }
.dec-dlg-section[hidden] { display: none; }
.dec-dlg-label, .dec-card-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.dec-dlg-text { min-height: 3.4rem; font-weight: 550; }
.dec-dlg-count { color: var(--text-subtle); font-weight: 450; }
.dec-dlg-why-wrap { display: flex; flex-direction: column; gap: 0.4rem; margin-top: -0.4rem; }
.dec-dlg-why-wrap .field[hidden] { display: none; }
.dec-dlg-reveal { align-self: flex-start; margin-left: -0.5rem; }
.dec-dlg-reveal[hidden] { display: none; }

.dec-quote {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid var(--border-strong);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
}
.dec-quote-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; color: var(--text-muted); font-size: 0.78rem; }
.dec-quote-head strong { color: var(--text); font-weight: 600; }
.dec-quote-text {
  display: -webkit-box;
  margin: 0.25rem 0 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
}
.dec-poll { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.45rem 0 0; padding: 0; list-style: none; }
.dec-poll-opt {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.8rem;
}
.dec-poll-bar { position: absolute; inset: 0 auto 0 0; width: var(--w); background: color-mix(in srgb, var(--text-subtle) 14%, transparent); }
.dec-poll-opt.is-top .dec-poll-bar { background: var(--accent-soft); }
.dec-poll-label, .dec-poll-votes { position: relative; }
.dec-poll-opt.is-top .dec-poll-label { font-weight: 600; }
.dec-poll-votes { color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Chips de tema (diálogo y ficha) */
.dec-topic-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.dec-tchip {
  --tc: var(--dec-none);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  height: 1.85rem;
  padding: 0 0.7rem 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.dec-tchip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dec-tchip:hover { background: var(--surface-2); color: var(--text); }
.dec-tchip:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dec-tchip.is-on {
  border-color: color-mix(in srgb, var(--tc) 50%, transparent);
  background: color-mix(in srgb, var(--tc) 13%, var(--surface));
  color: color-mix(in srgb, var(--tc) 62%, var(--text));
}
.dec-tchip.is-new { border-style: dashed; }
.dec-tchip.is-new.is-on { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.dec-tchip-hint { color: var(--text-subtle); font-weight: 450; }
.dec-new-topic {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.7rem 0.8rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.dec-new-topic[hidden] { display: none; }
.dec-swatches { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.dec-swatch {
  width: 1.6rem;
  height: 1.6rem;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--tc);
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease), transform 90ms var(--ease);
}
.dec-swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--tc); }
.dec-swatch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--tc), var(--focus-ring); }

.dec-replace-list { display: flex; flex-direction: column; gap: 0.35rem; }
.dec-replace {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.dec-replace:hover { background: var(--surface-2); }
.dec-replace.is-on { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }
.dec-replace .checkbox { margin-top: 0.1rem; flex-shrink: 0; }
.dec-replace-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.dec-replace-text { color: var(--text); font-size: 0.875rem; line-height: 1.4; overflow-wrap: anywhere; }
.dec-replace-meta { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--text-subtle); font-size: 0.75rem; }

.dec-preview-box {
  --dec-bg: var(--surface-2);
  padding: 0.55rem 0.5rem 0.5rem 0.3rem;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.dec-preview-box .dec-row-main { cursor: default; }

.dec-dlg-date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.dec-dlg-date-row .input { width: auto; flex: 0 1 11rem; }
.dec-dlg-quicks { display: flex; flex-wrap: wrap; gap: 0.15rem; }
.dec-dlg-more { display: flex; flex-direction: column; gap: 0.5rem; }
.dec-dlg-more-toggle {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.35rem;
  padding: 0.2rem 0.3rem 0.2rem 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.dec-dlg-more-toggle:hover { color: var(--text); }
.dec-dlg-more-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dec-dlg-more-chevron { transition: transform var(--dur) var(--ease); }
.dec-dlg-more-toggle[aria-expanded="true"] .dec-dlg-more-chevron { transform: rotate(90deg); }
.dec-dlg-more-body[hidden] { display: none; }

/* --- La ficha ---------------------------------------------------------------------- */
.dec-card { display: flex; flex-direction: column; gap: 1rem; min-height: 8rem; }
.dec-card-loading { min-height: 10rem; }
.dec-card-head { display: flex; flex-direction: column; gap: 0.5rem; }
.dec-card-title { margin: 0; color: var(--text); font-size: 1.12rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.dec-card-head.is-gone .dec-card-title { color: var(--text-muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--text-subtle) 70%, transparent); }
.dec-card-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.dec-state {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 1.85rem;
  padding: 0 0.7rem 0 0.6rem;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.dec-state.is-current { background: var(--success-soft); color: var(--success-text); }
.dec-state.is-review { background: color-mix(in srgb, var(--dec-amber) 15%, transparent); color: color-mix(in srgb, var(--dec-amber) 60%, var(--text)); }
.dec-card-who { display: flex; flex-wrap: wrap; gap: 0.1rem 0.55rem; margin: 0; color: var(--text-subtle); font-size: 0.8rem; }
.dec-card-who > * + *::before { content: "·"; margin-right: 0.55rem; }
.dec-card-gone { display: flex; align-items: center; gap: 0.45rem; margin: 0; color: var(--text-muted); font-size: 0.85rem; }
.dec-card-section { display: flex; flex-direction: column; gap: 0.4rem; }
.dec-card-why { margin: 0; color: var(--text); font-size: 0.9rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.dec-card-origin { display: flex; align-items: center; gap: 0.45rem; margin: 0; color: var(--text-muted); font-size: 0.875rem; }
.dec-card-see { align-self: flex-start; margin-left: -0.4rem; }
.dec-card-chain { display: flex; flex-direction: column; gap: 0.3rem; }
.dec-card-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}
.dec-card-link:hover { background: var(--surface-2); }
.dec-card-link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dec-card-link-label { flex-shrink: 0; color: var(--text-muted); font-weight: 600; }
.dec-card-link-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dec-card-link.is-gone .dec-card-link-text { color: var(--text-subtle); text-decoration: line-through; }
.dec-card-link > svg:last-child { color: var(--text-subtle); flex-shrink: 0; }
.dec-card-hint { margin: 0; color: var(--text-subtle); font-size: 0.78rem; line-height: 1.45; }
.dec-card-branch { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; margin: 0.15rem 0 0; color: var(--text-muted); font-size: 0.85rem; }
.dec-card-branch > svg { color: var(--text-subtle); }
.dec-card-branch-topic { display: inline-flex; align-items: center; gap: 0.3rem; color: color-mix(in srgb, var(--tc) 65%, var(--text)); font-weight: 600; }
.dec-card-edited > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.dec-card-edited > summary::-webkit-details-marker { display: none; }
.dec-card-edits { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.35rem 0 0; padding: 0; list-style: none; }
.dec-card-edits li { padding-left: 0.7rem; border-left: 2px solid var(--border); }
.dec-card-old { margin: 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.45; overflow-wrap: anywhere; }
.dec-card-tasks { display: flex; flex-direction: column; gap: 0.2rem; margin: 0; padding: 0; list-style: none; }
.dec-card-task {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}
.dec-card-task:hover { background: var(--surface-2); }
.dec-card-task > span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.dec-card-task > svg { color: var(--accent-text); flex-shrink: 0; }
.dec-card-task.is-done > span:first-of-type { color: var(--text-subtle); text-decoration: line-through; }
.dec-card-alldone { display: flex; align-items: center; gap: 0.45rem; margin: 0; color: var(--success-text); font-size: 0.875rem; font-weight: 600; }
.dec-card-section > .btn-ghost { align-self: flex-start; margin-left: -0.4rem; }
.dec-card-review { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; color: var(--text); font-size: 0.875rem; }
.dec-card-review > svg { color: var(--text-subtle); }
.dec-card-review.is-due { color: color-mix(in srgb, var(--dec-amber) 65%, var(--text)); font-weight: 600; }
.dec-card-review.is-due > svg { color: var(--dec-amber); }
.dec-card-actions-left { display: flex; gap: 0.25rem; }
.dec-card-modal .modal-footer .spacer { flex: 1; }
.dec-correct { display: flex; flex-direction: column; gap: 0.75rem; }
.dec-card-error { padding: 1.5rem 0.5rem; }

/* En el móvil, el diálogo y la ficha a pantalla completa, con los botones abajo (SPEC §81.4) */
@media (max-width: 640px) {
  .modal-backdrop:has(> .dec-dlg-modal), .modal-backdrop:has(> .dec-card-modal) { padding: 0; align-items: stretch; }
  .dec-dlg-modal, .dec-card-modal {
    max-width: none;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }
  .dec-dlg-modal .modal-body, .dec-card-modal .modal-body { flex: 1; min-height: 0; }
  .dec-dlg-modal .modal-footer, .dec-card-modal .modal-footer {
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
  }
  .dec-dlg-modal .modal-footer > .btn-primary { flex: 1; justify-content: center; }
  .dec-card-modal .modal-footer { flex-wrap: wrap; }
  .dec-card-modal .modal-footer .spacer { display: none; }
  .dec-card-modal .modal-footer > .btn:not(.btn-icon) { flex: 1; justify-content: center; }
}

/* --------------------------------------------------------------------------
   La marca bajo el mensaje del chat y su línea de sistema (chat/message-render.js)
   -------------------------------------------------------------------------- */
.msg-decision-row { display: flex; max-width: 100%; margin-top: 0.3rem; }
.msg.is-own .msg-decision-row { justify-content: flex-end; }
.msg-task-row + .msg-decision-row { margin-top: 0.25rem; }
.msg-decision {
  --tc: var(--dec-none);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  max-width: 100%;
  height: 1.6rem;
  padding: 0 0.65rem 0 0.5rem;
  border: 1px solid color-mix(in srgb, var(--tc) 30%, var(--border));
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 550;
  line-height: 1;
  cursor: pointer;
  animation: cp-soft-in var(--dur-in) var(--ease) both;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.msg-decision-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-decision:hover { background: color-mix(in srgb, var(--tc) 10%, var(--surface)); color: var(--text); }
.msg-decision:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.msg-decision.is-gone { border-style: dashed; color: var(--text-subtle); }
.msg-system-decision {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.msg-system-decision:hover { background: var(--surface-3); color: var(--text); }
.msg-system-decision:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.msg-system-decision .dec-dot { flex-shrink: 0; }
