/* Componentes compartidos. Las vistas los combinan; no redefinen su aspecto. */

/* ── Iconos ── */
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.icon-fill { fill: currentColor; stroke: none; }

/* ── Botones ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 36px; padding: 0 var(--s4); border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-size: var(--fs-md); font-weight: 550; line-height: 1; white-space: nowrap; user-select: none;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.08s;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn[aria-busy="true"] .icon { animation: spin 0.9s linear infinite; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-danger { background: transparent; border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(1.08); background: var(--danger); }
.btn-success { background: var(--success); border-color: var(--success); color: #04140d; }
.btn-success:hover { filter: brightness(1.08); background: var(--success); }
.btn-sm { min-height: 30px; padding: 0 var(--s3); font-size: var(--fs-sm); gap: 6px; }
.btn-sm .icon { width: 15px; height: 15px; }
.btn-lg { min-height: 44px; padding: 0 var(--s5); font-size: var(--fs-lg); }
.btn-block { width: 100%; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-group { display: inline-flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }

/* Botón de icono sin borde (cerrar, menús) */
.iconbtn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm);
  border: 0; background: transparent; color: var(--text-2);
}
.iconbtn:hover { background: var(--surface-2); color: var(--text); }

/* ── Insignias ── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2); border: 1px solid transparent;
}
.badge .icon { width: 13px; height: 13px; }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }
.badge-accent { background: var(--accent-soft); color: var(--accent-text); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-ai { background: var(--ai-soft); color: var(--ai); }
.badge-outline { background: transparent; border-color: var(--border-strong); color: var(--text-2); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pulse::before { animation: pulse 1.6s ease-in-out infinite; }

/* Idioma: ES / EN */
.lang { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 6px; border-radius: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; line-height: 1; }
.lang-es { background: var(--lang-es-soft); color: var(--lang-es); }
.lang-en { background: var(--lang-en-soft); color: var(--lang-en); }

/* Punto de estado */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot-success { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot-warning { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }
.dot-danger { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.dot-info { background: var(--info); box-shadow: 0 0 0 3px var(--info-soft); }
.dot-ai { background: var(--ai); box-shadow: 0 0 0 3px var(--ai-soft); }
.dot-neutral { background: var(--text-3); }
.dot-pulse { animation: pulse 1.6s ease-in-out infinite; }

/* ── Tarjetas y paneles ── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.card-pad { padding: var(--s5); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { font-size: var(--fs-lg); }
.card-body { padding: var(--s5); }
.card-foot { display: flex; align-items: center; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-interactive { cursor: pointer; transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.card-interactive:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-interactive:focus-visible { box-shadow: var(--focus); border-radius: var(--r-lg); }

/* Sección con título (ajustes, formularios largos) */
.section { display: grid; grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: var(--s8); padding: var(--s6) 0; border-top: 1px solid var(--border); }
.section:first-child { border-top: 0; padding-top: 0; }
.section-intro h2 { font-size: var(--fs-lg); margin-bottom: var(--s2); }
.section-intro p { color: var(--text-2); font-size: var(--fs-sm); }
@media (max-width: 960px) { .section { grid-template-columns: 1fr; gap: var(--s4); } }

/* ── Cabecera de página ── */
.page { padding: var(--s8) var(--s8) var(--s12); max-width: 1440px; margin: 0 auto; width: 100%; min-width: 0; }
.page-narrow { max-width: 980px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s6); flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-2xl); }
.page-sub { color: var(--text-2); margin-top: var(--s1); max-width: 70ch; }
.page-actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
@media (max-width: 720px) {
  .page { padding: var(--s5) var(--s4) calc(var(--s12) + 64px); }
  .page-head { margin-bottom: var(--s4); }
  .page-head h1 { font-size: var(--fs-xl); }
}

/* Barra de herramientas (filtros, búsqueda) */
.toolbar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.toolbar .search { flex: 1 1 220px; max-width: 360px; }

/* ── Formularios ── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field .hint, .hint { font-size: var(--fs-xs); color: var(--text-3); }
.field .error-text { font-size: var(--fs-xs); color: var(--danger); }
.field-row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.field-row > .field { flex: 1 1 200px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); }
.counter { font-size: var(--fs-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.counter.is-over { color: var(--danger); font-weight: 600; }
.input, .select, .textarea,
input[type="text"], input[type="password"], input[type="url"], input[type="email"], input[type="number"], input[type="search"], input[type="datetime-local"], input[type="time"], input[type="date"], select, textarea {
  width: 100%; min-height: 38px; padding: 8px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--border-strong); background: var(--bg-sunken); color: var(--text);
  font-size: var(--fs-md); line-height: 1.4; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea, .textarea { min-height: 96px; resize: vertical; line-height: var(--lh); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input[readonly], textarea[readonly] { background: var(--surface-2); color: var(--text-2); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.6; cursor: not-allowed; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
input[type="file"] { font-size: var(--fs-sm); color: var(--text-2); }
input[type="file"]::file-selector-button { margin-right: var(--s3); padding: 6px 12px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: var(--fs-md); }

/* Buscador con icono */
.search { position: relative; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 34px; }

/* Interruptor */
.switch { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s4); cursor: pointer; }
.switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-text strong { font-weight: 600; }
.switch-text span { font-size: var(--fs-sm); color: var(--text-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; flex: none; width: 40px; height: 22px; border-radius: var(--r-full); background: var(--surface-3); border: 1px solid var(--border-strong); transition: background 0.15s; margin-top: 1px; }
.switch-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform 0.18s var(--ease), background 0.15s; }
.switch input:checked + .switch-track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .switch-track { box-shadow: var(--focus); }
.switch input:disabled + .switch-track { opacity: 0.5; }

/* ── Control segmentado / pestañas ── */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r); background: var(--bg-sunken); border: 1px solid var(--border); }
.segmented button { border: 0; background: transparent; color: var(--text-2); padding: 0 var(--s3); min-height: 30px; border-radius: 7px; font-size: var(--fs-sm); font-weight: 550; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .count { font-size: 11px; color: var(--text-3); font-weight: 600; }

.tabs { display: flex; gap: var(--s1); border-bottom: 1px solid var(--border); margin-bottom: var(--s5); overflow-x: auto; }
.tabs button { border: 0; background: transparent; color: var(--text-2); padding: var(--s3) var(--s3); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* Chips de filtro */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 var(--s3); border-radius: var(--r-full); border: 1px solid var(--border-strong); background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 550; }
.chip:hover { color: var(--text); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent-text); }
.chip .icon { width: 14px; height: 14px; }
.chip-x { border: 0; background: transparent; color: inherit; padding: 0; display: inline-grid; }

/* ── Tablas ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th { text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Lista de filas (alternativa ligera a tabla) */
.list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--border); min-width: 0; }
.list-item:first-child { border-top: 0; }
button.list-item, a.list-item { width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-bottom: 0; color: inherit; }
button.list-item:hover, a.list-item:hover { background: var(--surface-2); text-decoration: none; }

/* ── Estadísticas ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s4); }
.stat { padding: var(--s4) var(--s5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-label { font-size: var(--fs-sm); color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-hint { font-size: var(--fs-xs); color: var(--text-3); }
.stat-success .stat-value { color: var(--success); }
.stat-warning .stat-value { color: var(--warning); }
.stat-danger .stat-value { color: var(--danger); }

/* ── Estado vacío ── */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s3); padding: var(--s10) var(--s6); color: var(--text-2); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-lg); background: var(--surface-2); color: var(--text-3); }
.empty-icon .icon { width: 24px; height: 24px; }
.empty h3 { color: var(--text); font-size: var(--fs-lg); }
.empty p { max-width: 46ch; font-size: var(--fs-sm); }
.empty-sm { padding: var(--s6) var(--s4); }

/* ── Avisos en línea (callouts) ── */
.callout { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); font-size: var(--fs-sm); color: var(--text); }
.callout > .icon { margin-top: 1px; }
.callout-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.callout-body strong { font-weight: 600; }
.callout-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s2); }
.callout-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.callout-info > .icon { color: var(--info); }
.callout-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.callout-warning > .icon { color: var(--warning); }
.callout-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.callout-danger > .icon { color: var(--danger); }
.callout-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.callout-success > .icon { color: var(--success); }
.callout-ai { background: var(--ai-soft); border-color: color-mix(in srgb, var(--ai) 30%, transparent); }
.callout-ai > .icon { color: var(--ai); }

/* ── Progreso ── */
.progress { height: 6px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width 0.25s var(--ease); }
.progress-success > span { background: var(--success); }
.progress-warning > span { background: var(--warning); }
.progress-danger > span { background: var(--danger); }

/* Esqueleto de carga */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent); animation: shimmer 1.3s infinite; }
.skeleton-card { height: 120px; border-radius: var(--r-lg); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; display: inline-block; }

/* ── Diálogos ── */
dialog.dlg {
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--border-strong);
  border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
  display: none; flex-direction: column;
}
dialog.dlg[open] { display: flex; animation: dlg-in 0.18s var(--ease); }
dialog.dlg::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.dlg-small { width: min(440px, calc(100vw - 32px)) !important; }
.dlg-wide { width: min(1080px, calc(100vw - 32px)) !important; }
.dlg-full { width: min(1280px, calc(100vw - 32px)) !important; height: calc(100vh - 48px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); flex: none; }
.dlg-title { font-size: var(--fs-lg); font-weight: 650; min-width: 0; }
.dlg-body { padding: var(--s5); overflow: auto; flex: 1 1 auto; min-height: 0; }
.dlg-text { color: var(--text-2); }
.dlg-actions, .dlg-foot { display: flex; justify-content: flex-end; gap: var(--s2); flex-wrap: wrap; }
.dlg-actions { margin-top: var(--s5); }
.dlg-foot { padding: var(--s3) var(--s5); border-top: 1px solid var(--border); background: var(--surface-2); flex: none; }
@media (max-width: 720px) {
  dialog.dlg, .dlg-wide, .dlg-full, .dlg-small { width: 100vw !important; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; margin: 0; }
  .dlg-small { height: auto; max-height: 100dvh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0 !important; }
}

/* ── Menú desplegable ── */
.menu { position: fixed; z-index: 60; min-width: 220px; padding: var(--s1); border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-lg); animation: dlg-in 0.12s var(--ease); }
.menu-item { display: flex; align-items: center; gap: var(--s2); width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text); font-size: var(--fs-md); text-align: left; }
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); text-decoration: none; }
.menu-item.is-danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: var(--s1) 0; }
.menu-label { padding: 6px 10px; font-size: var(--fs-xs); color: var(--text-3); }

/* ── Avisos flotantes (toasts) ── */
.toasts { position: fixed; z-index: 80; right: var(--s5); bottom: var(--s5); display: flex; flex-direction: column; gap: var(--s2); width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s3) var(--s3) var(--s3) var(--s4); border-radius: var(--r); background: var(--surface-3); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); color: var(--text); font-size: var(--fs-md); animation: toast-in 0.2s var(--ease); }
.toast > .icon { margin-top: 1px; }
.toast-ok > .icon { color: var(--success); }
.toast-error { border-color: color-mix(in srgb, var(--danger) 50%, var(--border-strong)); }
.toast-error > .icon { color: var(--danger); }
.toast-info > .icon { color: var(--info); }
.toast-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.toast-x { border: 0; background: transparent; color: var(--text-3); padding: 0; display: inline-grid; }
.toast-x:hover { color: var(--text); }
@media (max-width: 720px) { .toasts { left: 16px; right: 16px; width: auto; bottom: 80px; } }
dialog .toasts { position: fixed; }

/* ── Bloque de texto copiable / código ── */
.codebox { display: flex; align-items: center; gap: var(--s2); padding: 6px 6px 6px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-sunken); font-family: var(--font-mono); font-size: var(--fs-sm); min-width: 0; }
.codebox > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }

/* Fila de definición clave: valor */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--s4); font-size: var(--fs-sm); }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

/* Desplegable nativo con estilo */
details.fold { border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: var(--s2); padding: var(--s3) var(--s4); font-weight: 600; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--text-3); border-bottom: 2px solid var(--text-3); transform: rotate(45deg); transition: transform 0.15s; }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold > .fold-body { padding: 0 var(--s4) var(--s4); }

/* Avatar con iniciales */
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); font-size: 12px; font-weight: 700; flex: none; text-transform: uppercase; }

/* Miniatura vertical (9:16) */
.thumb { position: relative; aspect-ratio: 9 / 16; border-radius: var(--r); overflow: hidden; background: var(--bg-sunken); border: 1px solid var(--border); flex: none; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: grid; place-items: center; color: var(--text-3); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes dlg-in { from { opacity: 0; transform: translateY(6px) scale(0.99); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
