@layer tn.components {
/* ==========================================================================
   TIAMAT · components.css
   Componentes atómicos reutilizables. Cada bloque documenta su contrato en
   docs/03-componentes.md. Nombres: bloque, bloque__elemento, bloque--variante.
   ========================================================================== */

/* ---------- Botón ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--tn-control-h-md); padding: 0 16px;
  border-radius: var(--tn-r-md); border: 1px solid transparent;
  font-size: 14px; font-weight: var(--tn-fw-medium); line-height: 1; white-space: nowrap;
  text-decoration: none; cursor: pointer;
  transition: background var(--tn-dur-1) var(--tn-ease), border-color var(--tn-dur-1) var(--tn-ease), box-shadow var(--tn-dur-1) var(--tn-ease), transform var(--tn-dur-1) var(--tn-ease);
}
.btn .ico { width: 16px; height: 16px; }
.btn:active:not([disabled]) { transform: translateY(1px); }
.btn--primary { background: var(--tn-ink); color: #fff; }
.btn--primary:hover { background: var(--tn-ink-700); color: #fff; }
.btn--signal { background: var(--tn-signal); color: var(--tn-signal-ink); font-weight: var(--tn-fw-semibold); }
.btn--signal:hover { background: var(--tn-signal-500); color: var(--tn-signal-ink); }
.btn--secondary { background: var(--tn-surface); color: var(--tn-text); border-color: var(--tn-line-strong); box-shadow: var(--tn-sh-1); }
.btn--secondary:hover { border-color: #B9C1B9; color: var(--tn-text); }
.btn--ghost { background: transparent; color: var(--tn-text-2); }
.btn--ghost:hover { background: var(--tn-sunken); color: var(--tn-text); }
.btn--danger { background: var(--tn-surface); color: var(--tn-critical-fg); border-color: var(--tn-critical-line); }
.btn--danger:hover { background: var(--tn-critical-bg); color: var(--tn-critical-fg); }
.btn--danger-solid { background: var(--tn-critical-fg); color: #fff; }
.btn--danger-solid:hover { background: #82141D; color: #fff; }
.btn--on-ink { background: rgba(255,255,255,.08); color: var(--tn-on-ink); border-color: rgba(255,255,255,.14); }
.btn--on-ink:hover { background: rgba(255,255,255,.14); color: #fff; }
.btn--sm { height: var(--tn-control-h-sm); padding: 0 12px; font-size: 13px; border-radius: var(--tn-r-sm); }
.btn--lg { height: var(--tn-control-h-lg); padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn--block { width: 100%; }
.btn--icon { width: var(--tn-control-h-md); padding: 0; }
.btn--sm.btn--icon { width: var(--tn-control-h-sm); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }

.icon-btn { position: relative; width: 38px; height: 38px; border-radius: var(--tn-r-md); border: 1px solid var(--tn-line); background: var(--tn-surface); color: var(--tn-text-2); display: grid; place-items: center; flex: none; }
.icon-btn:hover { color: var(--tn-text); border-color: var(--tn-line-strong); }
.icon-btn__pip { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--tn-observed-fg); box-shadow: 0 0 0 2px var(--tn-surface); }

.link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: var(--tn-fw-medium); color: var(--tn-brand); }
.link .ico { width: 15px; height: 15px; transition: transform var(--tn-dur-2) var(--tn-ease); }
.link:hover .ico { transform: translateX(2px); }

/* ---------- Chip de estado (color + icono + texto, nunca sólo color) ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px 0 7px; border-radius: var(--tn-r-xs);
  font-size: 12.5px; font-weight: var(--tn-fw-medium); line-height: 1; white-space: nowrap;
  vertical-align: middle;
  /* Un estado mide lo que su texto: no se estira dentro de stacks flex ni celdas grid. */
  width: fit-content; max-width: 100%;
}
.chip .ico { width: 13px; height: 13px; stroke-width: 2.1; }
.chip--lg { height: 28px; padding: 0 11px 0 9px; font-size: 13px; }
.chip--neutral  { background: var(--tn-neutral-bg);  color: var(--tn-neutral-fg); }
.chip--review   { background: var(--tn-review-bg);   color: var(--tn-review-fg); }
.chip--action   { background: var(--tn-action-bg);   color: var(--tn-action-fg); }
.chip--observed { background: var(--tn-observed-bg); color: var(--tn-observed-fg); }
.chip--critical { background: var(--tn-critical-bg); color: var(--tn-critical-fg); }
.chip--approved { background: var(--tn-approved-bg); color: var(--tn-approved-fg); }
.chip--certified{ background: var(--tn-ink);         color: var(--tn-signal); }
.chip--complete { background: var(--tn-signal);      color: var(--tn-signal-ink); }
.chip--history  { background: transparent;           color: var(--tn-text-3); box-shadow: inset 0 0 0 1px var(--tn-line-strong); }
.chip--free     { background: var(--tn-surface);     color: var(--tn-approved-fg); box-shadow: inset 0 0 0 1px #A9D7B6; }
.chip--locked   { background: var(--tn-sunken);      color: var(--tn-text-3); }
.chip--readonly { background: var(--tn-readonly-bg); color: var(--tn-readonly-fg); }
.chip--closed   { background: var(--tn-closed-bg);   color: var(--tn-closed-fg); }

.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: var(--tn-r-xs); font-size: 12px; font-weight: var(--tn-fw-medium); color: var(--tn-text-2); background: var(--tn-surface); box-shadow: inset 0 0 0 1px var(--tn-line); white-space: nowrap; }
.tag--ink { background: var(--tn-ink); color: var(--tn-signal); box-shadow: none; }
.count { font-family: var(--tn-font-sans); font-variant-numeric: tabular-nums; font-size: 11.5px; font-weight: var(--tn-fw-medium); min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--tn-r-xs); display: inline-grid; place-items: center; background: var(--tn-sunken); color: var(--tn-text-2); }
.count--hot { background: var(--tn-observed-bg); color: var(--tn-observed-fg); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--tn-text-3); }
.kbd { font-family: var(--tn-font-mono); font-size: 11px; color: var(--tn-text-3); border: 1px solid var(--tn-line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; background: var(--tn-surface-2); }

.avatar { width: 34px; height: 34px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; font-size: 12.5px; font-weight: var(--tn-fw-semibold); background: var(--tn-sunken); color: var(--tn-text-2); }
.avatar--sm { width: 26px; height: 26px; border-radius: 7px; font-size: 11px; }
.avatar--lg { width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.avatar--ink { background: var(--tn-ink); color: var(--tn-signal); }

/* ---------- Panel ---------- */
.panel { background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: var(--tn-r-lg); box-shadow: var(--tn-sh-1); min-width: 0; }
.panel--focus { border-color: var(--tn-observed-line); box-shadow: 0 0 0 4px rgba(160,52,14,.06), var(--tn-sh-2); }
.panel--selected { border-color: var(--tn-ink); box-shadow: 0 0 0 1px var(--tn-ink), var(--tn-sh-2); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.panel__head--bordered { border-bottom: 1px solid var(--tn-line); }
.panel__titles { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.panel__body { padding: 0 22px 22px; }
.panel__body--pad { padding: 22px; }
.panel__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--tn-line); }

.card-link { transition: transform var(--tn-dur-2) var(--tn-ease), box-shadow var(--tn-dur-2) var(--tn-ease), border-color var(--tn-dur-2) var(--tn-ease); }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--tn-sh-2); border-color: var(--tn-line-strong); }

/* ---------- Lista ---------- */
.list { display: flex; flex-direction: column; }
.list__item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: var(--tn-row-py, 14px) 22px; border-top: 1px solid var(--tn-line); }
.list__item:first-child { border-top: 0; }
.list__item--plain { grid-template-columns: minmax(0, 1fr) auto; }
a.list__item { color: var(--tn-text); }
a.list__item:hover { background: var(--tn-surface-2); text-decoration: none; }
.list__icon { width: 28px; height: 28px; border-radius: var(--tn-r-sm); display: grid; place-items: center; background: var(--tn-sunken); color: var(--tn-text-2); }
.list__title { font-size: 14px; font-weight: var(--tn-fw-medium); color: var(--tn-text); }
.list__meta { margin-top: 2px; font-size: 12.5px; color: var(--tn-text-3); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.list__meta { column-gap: 14px; clip-path: inset(-6px 0 -6px 0); }
.list__meta > * { position: relative; }
.list__meta > * + *::before { content: "·"; position: absolute; left: -9px; color: var(--tn-line-strong); }

/* ---------- Tabla ---------- */
/* Contenedor de la tabla (auditoría 2026-10-28): lo oculto para lectores de pantalla no estira la página. Si la tabla
   no entra en su espacio, tanatos.js la compacta (is-compact) y, si igual no entra, la apila (is-stacked). */
.table-wrap { overflow-x: auto; position: relative; }
.table { width: 100%; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: var(--tn-fw-medium); color: var(--tn-text-3); padding: 10px 16px; background: var(--tn-surface-2); border-bottom: 1px solid var(--tn-line); white-space: nowrap; }
.table td { padding: var(--tn-row-py, 13px) 16px; border-bottom: 1px solid var(--tn-line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table .is-end { text-align: right; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #FAFBF9; }
.table tr.is-selected td { background: var(--tn-signal-soft); }
.table tr.is-group td { background: var(--tn-surface-2); font-weight: var(--tn-fw-semibold); font-size: 13px; padding-top: 10px; padding-bottom: 10px; }
.cell-title { display: block; font-weight: var(--tn-fw-medium); color: var(--tn-text); }
.cell-sub { display: block; margin-top: 1px; font-size: 12.5px; color: var(--tn-text-3); }
/* Revisión visual (2026-11-06): un código o CUIT dentro del subtítulo de una celda no se parte en el guion. */
.cell-sub > .mono { white-space: nowrap; }
.cell-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
/* Tabla que no entra (is-compact): celdas más compactas. */
.table-wrap.is-compact:not(.is-stacked) .table th, .table-wrap.is-compact:not(.is-stacked) .table td { padding-inline: 10px; }
.table-wrap.is-compact:not(.is-stacked) .table th:first-child, .table-wrap.is-compact:not(.is-stacked) .table td:first-child { padding-left: 16px; }
.table-wrap.is-compact:not(.is-stacked) .table th:last-child, .table-wrap.is-compact:not(.is-stacked) .table td:last-child { padding-right: 16px; }
/* Dueño (2026-11-07: «esa separación con la sombra no me gusta»): la columna de acciones queda fija sólo si la tabla
   compacta igual se desborda (is-overflowing, tanatos.js tableFit) y sin sombra: una línea fina como las de la tabla. */
.table-wrap.is-overflowing .table td.is-end { position: sticky; right: 0; z-index: 1; background: var(--tn-surface); box-shadow: inset 1px 0 0 var(--tn-line); }

.prio { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: var(--tn-fw-medium); color: var(--tn-text-2); white-space: nowrap; }
.prio::before { content: ""; width: 3px; height: 16px; border-radius: 2px; background: var(--tn-prio-low); }
.prio--critical::before { background: var(--tn-prio-critical); }
.prio--high::before { background: var(--tn-prio-high); }
.prio--normal::before { background: var(--tn-prio-normal); }

/* Tabla apilada en móvil: cada fila pasa a ser una tarjeta. Requiere data-label en cada <td>. */
@media (max-width: 760px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack, .table--stack tbody, .table--stack td { display: block; width: 100%; }
  .table--stack tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--tn-line); }
  .table--stack td { flex: 1 1 100%; }
  .table--stack td.is-primary { order: -1; }
  .table--stack td.is-meta { flex: 0 1 auto; width: auto; display: inline-flex; gap: 6px; align-items: baseline; }
  .table--stack td.is-meta[data-label]::before { display: inline; margin: 0; }
  .table--stack td:not([data-label]):not(.is-end) { padding-top: 2px; }
  .table--stack tr.is-group { padding: 8px 16px; }
  .table--stack td, .table--stack td:first-child, .table--stack td:last-child { padding: 4px 0; border: 0; text-align: left; }
  .table--stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--tn-text-3); margin-bottom: 2px; }
  .table--stack td.is-primary::before { display: none; }
  .table--stack td.is-primary { font-size: 15px; }
  .table--stack .cell-actions { justify-content: flex-start; padding-top: 8px; }
  .table--stack .cell-actions .btn { height: var(--tn-control-h); flex: 1; }
  .table--stack td.is-end[data-label]::before { display: none; }
  .table--stack tbody tr:hover td { background: transparent; }
}
.table-wrap.is-stacked .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.table-wrap.is-stacked .table--stack, .table-wrap.is-stacked .table--stack tbody, .table-wrap.is-stacked .table--stack td { display: block; width: 100%; }
.table-wrap.is-stacked .table--stack tr { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--tn-line); }
.table-wrap.is-stacked .table--stack td { flex: 1 1 100%; }
.table-wrap.is-stacked .table--stack td.is-primary { order: -1; }
.table-wrap.is-stacked .table--stack td.is-meta { flex: 0 1 auto; width: auto; display: inline-flex; gap: 6px; align-items: baseline; }
.table-wrap.is-stacked .table--stack td.is-meta[data-label]::before { display: inline; margin: 0; }
.table-wrap.is-stacked .table--stack td:not([data-label]):not(.is-end) { padding-top: 2px; }
.table-wrap.is-stacked .table--stack tr.is-group { padding: 8px 16px; }
.table-wrap.is-stacked .table--stack td, .table-wrap.is-stacked .table--stack td:first-child, .table-wrap.is-stacked .table--stack td:last-child { padding: 4px 0; border: 0; text-align: left; }
.table-wrap.is-stacked .table--stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--tn-text-3); margin-bottom: 2px; }
.table-wrap.is-stacked .table--stack td.is-primary::before { display: none; }
.table-wrap.is-stacked .table--stack td.is-primary { font-size: 15px; }
.table-wrap.is-stacked .table--stack .cell-actions { justify-content: flex-start; padding-top: 8px; }
.table-wrap.is-stacked .table--stack .cell-actions .btn { height: var(--tn-control-h); flex: 1; }
.table-wrap.is-stacked .table--stack td.is-end[data-label]::before { display: none; }
.table-wrap.is-stacked .table--stack tbody tr:hover td { background: transparent; }

/* ---------- Formulario ---------- */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field__label { font-size: 13px; font-weight: var(--tn-fw-medium); color: var(--tn-text); display: flex; align-items: center; gap: 8px; }
/* Ayuda breve junto a la etiqueta (dueño, 2026-10-30: «un pequeño ícono informativo que al hacer hover diga…»). */
/* El texto se alinea con el borde derecho del campo (no se corta contra la pantalla) y baja de renglón si hace falta. */
/* Ayuda flotante con detalle (dueño, 2026-10-30: quién valida cada pendiente; controls.js la ubica sobre la página). */
.tn-float-tip { position: fixed; z-index: 80; display: grid; gap: 8px; width: max-content; min-width: 210px;
  max-width: min(300px, calc(100vw - 24px)); padding: 10px 12px; border-radius: var(--tn-r-sm); background: var(--tn-ink-950);
  color: #fff; font-size: 12.5px; line-height: 1.35; box-shadow: var(--tn-sh-3); pointer-events: none; }
.tn-float-tip[hidden] { display: none; }
.tn-float-tip__title { font-size: 12px; font-weight: var(--tn-fw-medium); color: rgba(255, 255, 255, .7); }
.tn-float-tip__row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.tn-float-tip__row + .tn-float-tip__row { padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .12); }
.tn-float-tip__dot { width: 8px; height: 8px; border-radius: 50%; background: #F2B04D; }
.tn-float-tip__row.is-notary .tn-float-tip__dot { background: #8FB0FF; }
.tn-float-tip__who { display: grid; gap: 1px; min-width: 0; }
.tn-float-tip__who b { font-weight: 700; }
.tn-float-tip__who small { font-size: 11.5px; color: rgba(255, 255, 255, .66); }
.tn-float-tip__n { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tn-float-tip__line { display: block; color: rgba(255, 255, 255, .88); }
.tn-float-tip:has(.tn-float-tip__line) { max-width: min(360px, calc(100vw - 24px)); gap: 6px; }
@keyframes tn-float-tip-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) { .tn-float-tip:not([hidden]) { animation: tn-float-tip-in .12s ease-out both; } }
.field:has(> .field__label .tn-field-tip) { position: relative; }
.tn-field-tip { display: inline-grid; place-items: center; color: var(--tn-text-3); cursor: help; border-radius: 50%; }
.tn-field-tip .ico { width: 14px; height: 14px; }
.tn-field-tip:hover, .tn-field-tip:focus-visible { color: var(--tn-text); }
.tn-field-tip::after {
  content: attr(data-tip); position: absolute; right: 0; bottom: calc(100% + 4px); width: max-content; max-width: 12em;
  padding: 6px 10px; border-radius: var(--tn-r-sm); background: var(--tn-ink-950); color: #fff; text-align: left;
  font-size: 12.5px; font-weight: var(--tn-fw-medium); line-height: 1.35; box-shadow: var(--tn-sh-2); pointer-events: none; z-index: 5;
  opacity: 0; visibility: hidden; transition: opacity .12s ease;
}
.tn-field-tip:hover::after, .tn-field-tip:focus-visible::after { opacity: 1; visibility: visible; }
.field__req { color: var(--tn-observed-fg); font-weight: var(--tn-fw-semibold); }
.field__opt { color: var(--tn-text-3); font-weight: var(--tn-fw-regular); font-size: 12.5px; }
.field__help { font-size: 12.5px; color: var(--tn-text-3); line-height: 1.45; }
.field__error, .field__ok, .field__observed { font-size: 12.5px; font-weight: var(--tn-fw-medium); display: flex; align-items: flex-start; gap: 6px; }
.field__error { color: var(--tn-critical-fg); }
.field__ok { color: var(--tn-approved-fg); }
.field__observed { color: var(--tn-observed-fg); }
.field__error .ico, .field__ok .ico, .field__observed .ico { width: 14px; height: 14px; margin-top: 1px; }

.input, .select, .textarea {
  width: 100%; min-height: var(--tn-control-h);
  border: 1px solid var(--tn-field-line); border-radius: var(--tn-r-md);
  background: var(--tn-surface); color: var(--tn-text);
  padding: 0 13px; font-size: 14.5px;
  transition: border-color var(--tn-dur-1) var(--tn-ease), box-shadow var(--tn-dur-1) var(--tn-ease);
}
.textarea { padding: 11px 13px; line-height: 1.5; resize: vertical; min-height: 96px; }
.select { appearance: none; padding-right: 38px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23626D69' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; cursor: pointer; }
.input::placeholder, .textarea::placeholder { color: #8A948F; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--tn-field-line-hover); }
.input:focus, .select:focus, .textarea:focus, .input-group:focus-within { outline: none; border-color: var(--tn-brand); box-shadow: var(--tn-ring); }
.input[readonly], .input:disabled, .select:disabled, .textarea:disabled { background: var(--tn-surface-2); color: var(--tn-text-2); cursor: default; }
.is-observed .input, .is-observed .select, .is-observed .textarea, .is-observed .input-group { border-color: #E29B78; box-shadow: 0 0 0 3px rgba(160,52,14,.08); }
.is-invalid .input, .is-invalid .select, .is-invalid .textarea, .is-invalid .input-group, .input[aria-invalid="true"] { border-color: var(--tn-critical-fg); box-shadow: 0 0 0 3px rgba(158,27,37,.08); }
.is-valid .input, .is-valid .input-group { border-color: #7FB894; }

.input-group { display: flex; align-items: center; gap: 10px; min-height: var(--tn-control-h); padding: 0 6px 0 13px; border: 1px solid var(--tn-field-line); border-radius: var(--tn-r-md); background: var(--tn-surface); color: var(--tn-text-3); }
.input-group > input { flex: 1; min-width: 0; height: calc(var(--tn-control-h) - 2px); border: 0; outline: 0; background: transparent; color: var(--tn-text); font-size: 14.5px; padding: 0; }
/* The group owns focus/error rings; the nested input must not draw a second one. */
.input-group > input.input { border: 0; border-radius: 0; box-shadow: none; height: calc(var(--tn-control-h) - 2px); min-height: 0; }
/* Keep the portal's right-hand reveal button as the only eye in Edge.
   Standalone password fields retain their native control. Separate rules keep
   browsers that do not recognize a pseudo-element from dropping both. */
.input-group:has([data-tn-password-toggle]) input::-ms-reveal { display: none; }
.input-group:has([data-tn-password-toggle]) input::-ms-clear { display: none; }
.input-group--locked { background: var(--tn-surface-2); }
.input-group__end { display: flex; align-items: center; gap: 4px; color: var(--tn-text-3); padding-right: 6px; }

.form-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px 16px; }
.col-1 { grid-column: span 1; } .col-2 { grid-column: span 2; } .col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; } .col-6 { grid-column: 1 / -1; }
@media (max-width: 760px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-grid > * { grid-column: auto; } }

/* Selector segmentado: radios reales */
.seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 11px; background: var(--tn-sunken); border: 0; margin: 0; min-width: 0; }
.seg__option { position: relative; }
.seg__option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__option span { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 8px; color: var(--tn-text-2); font-size: 13.5px; font-weight: var(--tn-fw-medium); white-space: nowrap; transition: background var(--tn-dur-1) var(--tn-ease); }
.seg__option:hover span { color: var(--tn-text); }
.seg__option input:checked + span { background: var(--tn-surface); color: var(--tn-text); box-shadow: 0 1px 2px rgba(10,31,29,.08), 0 0 0 1px var(--tn-line); }
.seg__option input:focus-visible + span { outline: 2px solid var(--tn-brand); outline-offset: 1px; }
.seg__count { font-family: var(--tn-font-sans); font-variant-numeric: tabular-nums; font-size: 11.5px; color: var(--tn-text-3); }
.field > .seg { align-self: flex-start; }

/* Interruptor: checkbox real con role="switch" */
.switch { position: relative; display: inline-flex; flex: none; }
.switch input { appearance: none; margin: 0; width: 42px; height: 24px; border-radius: var(--tn-r-full); background: var(--tn-line-strong); cursor: pointer; transition: background var(--tn-dur-2) var(--tn-ease); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform var(--tn-dur-2) var(--tn-ease-out-expo); }
.switch input:checked { background: var(--tn-brand); }
.switch input:checked::after { transform: translateX(18px); }

/* Opción tipo tarjeta: radio o checkbox real */
.choice { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--tn-line-strong); background: var(--tn-surface); cursor: pointer; transition: border-color var(--tn-dur-1) var(--tn-ease), box-shadow var(--tn-dur-1) var(--tn-ease); }
.choice:hover { border-color: #B9C1B9; }
.choice input { appearance: none; margin: 1px 0 0; width: 18px; height: 18px; flex: none; border: 1.5px solid var(--tn-field-line); background: #fff; display: grid; place-items: center; cursor: pointer; }
.choice input[type="radio"] { border-radius: 50%; }
.choice input[type="checkbox"] { border-radius: 5px; }
/* Casillas sueltas (p. ej., «Sólo no leídos» en Mensajes): el color del portal, no el azul del navegador (pasada final, 2026-11-04). */
input.checkbox[type="checkbox"] { accent-color: var(--tn-ink); }
.choice input:checked { border-color: var(--tn-ink); }
.choice input[type="radio"]:checked::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--tn-ink); }
.choice input[type="checkbox"]:checked { background: var(--tn-ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat; }
.choice input:disabled { opacity: .6; cursor: not-allowed; }
.choice:has(input:checked) { border-color: var(--tn-ink); box-shadow: 0 0 0 1px var(--tn-ink); }
.choice:has(input:disabled) { cursor: not-allowed; background: var(--tn-surface-2); }
/* Elegida y fija (p. ej., firmantes con el turno sacado): se ve tomada, no como una opción para tocar (batería RC128). */
.choice:has(input:disabled:checked) { border-color: var(--tn-line-strong); box-shadow: none; }
.choice:has(input:focus-visible) { outline: 2px solid var(--tn-brand); outline-offset: 2px; }
.choice__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choice__title { font-size: 14px; font-weight: var(--tn-fw-semibold); }
.choice__desc { font-size: 12.5px; color: var(--tn-text-3); }
.choice--compact { padding: 11px 14px; }

/* ---------- Combobox buscable (mejora progresiva de un <select>) ---------- */
.combobox { position: relative; }
.combobox__control { display: flex; align-items: center; gap: 10px; min-height: var(--tn-control-h); padding: 0 6px 0 13px; border: 1px solid var(--tn-field-line); border-radius: var(--tn-r-md); background: var(--tn-surface); color: var(--tn-text-3); }
.combobox__control:focus-within { border-color: var(--tn-brand); box-shadow: var(--tn-ring); }
.combobox__input { flex: 1; min-width: 0; height: calc(var(--tn-control-h) - 2px); border: 0; outline: 0; background: transparent; color: var(--tn-text); font-size: 14.5px; }
.combobox__toggle { width: 32px; height: 32px; border-radius: var(--tn-r-sm); border: 0; background: transparent; color: var(--tn-text-3); display: grid; place-items: center; }
.combobox__toggle:hover { background: var(--tn-sunken); color: var(--tn-text); }
.combobox__panel { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: 12px; box-shadow: var(--tn-sh-3); overflow: hidden; }
.combobox__panel[hidden] { display: none; }
.combobox__status { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 14px; font-size: 12px; color: var(--tn-text-3); border-bottom: 1px solid var(--tn-line); }
.combobox__list { list-style: none; margin: 0; padding: 4px; max-height: 280px; overflow-y: auto; }
.combobox__option { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 10px; border-radius: var(--tn-r-sm); font-size: 13.5px; line-height: 1.45; cursor: pointer; }
.combobox__option[aria-selected="true"] .combobox__check { visibility: visible; }
.combobox__option.is-active { background: var(--tn-signal-soft); }
.combobox__code { font-family: var(--tn-font-mono); font-weight: var(--tn-fw-semibold); }
.combobox__check { visibility: hidden; color: var(--tn-brand); }
.combobox__option mark { background: transparent; color: inherit; font-weight: var(--tn-fw-semibold); text-decoration: underline; text-decoration-color: var(--tn-signal-500); text-decoration-thickness: 2px; text-underline-offset: 2px; }
.combobox__empty { padding: 16px 14px; font-size: 13.5px; color: var(--tn-text-2); }
.combobox__foot { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--tn-line); background: var(--tn-surface-2); font-size: 13px; }
.combobox__native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ---------- Archivos ---------- */
.dropzone { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1.5px dashed var(--tn-line-strong); border-radius: 12px; background: var(--tn-surface); transition: border-color var(--tn-dur-2) var(--tn-ease), background var(--tn-dur-2) var(--tn-ease); }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--tn-brand); background: var(--tn-brand-soft); }
.dropzone:focus-within { border-color: var(--tn-brand); box-shadow: var(--tn-ring); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone--large { flex-direction: column; text-align: center; padding: 32px 20px; background: var(--tn-surface-2); }
.dropzone__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--tn-surface); box-shadow: inset 0 0 0 1px var(--tn-line); color: var(--tn-text-2); flex: none; }
.dropzone__title { font-size: 13.5px; font-weight: var(--tn-fw-medium); }
.dropzone__hint { font-size: 12.5px; color: var(--tn-text-3); }
.dropzone__fake-link { color: var(--tn-brand); text-decoration: underline; text-underline-offset: 3px; }

.file { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 11px; background: var(--tn-surface-2); box-shadow: inset 0 0 0 1px var(--tn-line); min-width: 0; }
.file--staged { background: var(--tn-signal-soft); box-shadow: inset 0 0 0 1px #CFE59B; }
.file__type { width: 34px; height: 40px; border-radius: 6px; background: #fff; box-shadow: inset 0 0 0 1px var(--tn-line-strong); display: grid; place-items: center; font-family: var(--tn-font-mono); font-size: 9.5px; font-weight: var(--tn-fw-semibold); color: var(--tn-text-2); flex: none; }
.file__body { flex: 1; min-width: 0; }
.file__name { font-weight: var(--tn-fw-medium); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Navegación secundaria (índice de secciones, configuración) ---------- */
.subnav { display: flex; flex-direction: column; gap: 2px; }
.subnav__item { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 9px; color: var(--tn-text-2); font-size: 13.5px; font-weight: var(--tn-fw-medium); }
.subnav__item:hover { background: var(--tn-sunken); color: var(--tn-text); text-decoration: none; }
.subnav__item > .ico { color: var(--tn-text-3); width: 16px; height: 16px; }
.subnav__item[aria-current="page"], .subnav__item[aria-current="true"] { background: var(--tn-surface); color: var(--tn-text); box-shadow: 0 1px 2px rgba(10,31,29,.06), 0 0 0 1px var(--tn-line); }
.subnav__item[aria-current="page"] > .ico { color: var(--tn-brand); }
.subnav__text { flex: 1; min-width: 0; }

/* ---------- Pestañas (navegación server-side) ---------- */
.tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--tn-line); overflow-x: auto; scrollbar-width: none; }
.tabs__item { display: inline-flex; align-items: center; gap: 8px; padding: 12px 0; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--tn-text-3); font-weight: var(--tn-fw-medium); font-size: 14px; white-space: nowrap; }
.tabs__item:hover { color: var(--tn-text); }
.tabs__item[aria-current="page"] { color: var(--tn-text); border-bottom-color: var(--tn-ink); }

/* ---------- Avisos ---------- */
.note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; font-size: 13.5px; line-height: 1.5; }
.note > .ico { margin-top: 1px; }
.note strong { font-weight: var(--tn-fw-semibold); }
.note__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.note--observed { background: var(--tn-observed-bg); color: #5E230C; }
.note--observed > .ico { color: var(--tn-observed-fg); }
.note--review { background: var(--tn-review-bg); color: #1A2F66; }
.note--review > .ico { color: var(--tn-review-fg); }
.note--action { background: var(--tn-action-bg); color: #57300A; }
.note--action > .ico { color: var(--tn-action-fg); }
.note--critical { background: var(--tn-critical-bg); color: #5C1016; }
.note--critical > .ico { color: var(--tn-critical-fg); }
.note--approved { background: var(--tn-approved-bg); color: #0F3D20; }
.note--approved > .ico { color: var(--tn-approved-fg); }
.note--readonly { background: var(--tn-readonly-bg); color: #2E3160; }
.note--neutral { background: var(--tn-surface-2); color: var(--tn-text-2); box-shadow: inset 0 0 0 1px var(--tn-line); }
.note--lg { padding: 18px 20px; align-items: center; }

.flash-stack { display: flex; flex-direction: column; gap: 8px; }
.flash { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: 12px; background: var(--tn-ink); color: var(--tn-on-ink); box-shadow: var(--tn-sh-2); font-size: 13.5px; animation: tn-rise var(--tn-dur-4) var(--tn-ease-out-expo) both; }
.flash > .ico { color: var(--tn-signal); }
.flash--error { background: var(--tn-critical-fg); color: #fff; }
.flash--error > .ico { color: #fff; }
.flash--warning { background: var(--tn-action-bg); color: var(--tn-action-fg); }
.flash--warning > .ico { color: var(--tn-action-fg); }
.flash__text { flex: 1 1 auto; min-width: 0; }
.flash > .ico { flex: none; }
.flash__close { margin-left: auto; width: 28px; height: 28px; border-radius: var(--tn-r-sm); border: 0; background: transparent; color: inherit; opacity: .7; display: grid; place-items: center; }
.flash__close:hover { opacity: 1; background: rgba(255,255,255,.1); }

.quote { border-radius: 12px; padding: 14px 16px; background: var(--tn-surface-2); box-shadow: inset 0 0 0 1px var(--tn-line); font-size: 14px; line-height: 1.55; }
.quote__by { display: block; margin-top: 8px; font-size: 12.5px; color: var(--tn-text-3); }

/* ---------- Estado vacío ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 24px; }
.empty__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--tn-sunken); color: var(--tn-text-2); margin-bottom: 4px; }
.empty__title { font-size: 15px; font-weight: var(--tn-fw-semibold); }
.empty__text { font-size: 13.5px; color: var(--tn-text-2); max-width: 44ch; }
/* Compacto: ícono a la izquierda; título y texto apilados, con o sin contenedor intermedio. */
.empty--compact { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px; padding: 18px 16px; text-align: left; }
.empty--compact .empty__icon { width: 36px; height: 36px; border-radius: 10px; margin: 0; grid-row: span 2; }
.empty--compact > :not(.empty__icon) { grid-column: 2; }
.empty--compact .empty__title { font-size: 14px; }

/* ---------- Datos ---------- */
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--tn-text-3); }
.kv dd { margin: 0; color: var(--tn-text); font-weight: var(--tn-fw-medium); min-width: 0; }
.kv--stacked { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.kv--stacked dt { font-size: 12px; margin-bottom: -10px; }
.kv--split { grid-template-columns: minmax(7rem, auto) minmax(0, 1fr); max-width: 560px; }
.kv--split dd { text-align: right; overflow-wrap: anywhere; }
.kv dt { overflow-wrap: normal; word-break: normal; }
@media (max-width: 480px) { .kv--split { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv--split dd { text-align: left; margin-bottom: 8px; } }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline__item { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; padding-bottom: 16px; }
.timeline__item::before { content: ""; position: absolute; left: 8.5px; top: 19px; bottom: 0; width: 1px; background: var(--tn-line); }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__item:last-child::before { display: none; }
.timeline__dot { width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--tn-surface); box-shadow: inset 0 0 0 1.5px var(--tn-line-strong); }
.timeline__dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tn-text-3); }
.timeline__item--observed .timeline__dot::after { background: var(--tn-observed-fg); }
.timeline__item--approved .timeline__dot::after { background: var(--tn-approved-fg); }
.timeline__item--pending .timeline__dot::after { background: var(--tn-line-strong); }
.timeline__title { font-size: 13.5px; font-weight: var(--tn-fw-medium); }
.timeline__meta { font-size: 12.5px; color: var(--tn-text-3); margin-top: 1px; }

.meter { display: flex; gap: 2px; height: 8px; border-radius: var(--tn-r-full); background: var(--tn-sunken); overflow: hidden; }
.meter__seg { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--tn-text-2); }
.legend__item { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Paginación ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; border-top: 1px solid var(--tn-line); font-size: 13px; color: var(--tn-text-3); }
.pagination__pages { display: flex; align-items: center; gap: 4px; }
.pagination__page { min-width: 32px; height: 32px; padding: 0 8px; border-radius: var(--tn-r-sm); display: inline-grid; place-items: center; color: var(--tn-text-2); font-family: var(--tn-font-sans); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.pagination__page:hover { background: var(--tn-sunken); text-decoration: none; color: var(--tn-text); }
.pagination__page[aria-current="page"] { background: var(--tn-ink); color: #fff; }

/* ---------- Menú contextual (<details>) ---------- */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.panel:has(details.menu[open]) { position: relative; z-index: 3; } /* el menú abierto queda sobre el panel siguiente */
.menu__panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; padding: 6px; background: var(--tn-surface); border: 1px solid var(--tn-line); border-radius: 12px; box-shadow: var(--tn-sh-3); display: flex; flex-direction: column; gap: 2px; animation: tn-pop var(--tn-dur-2) var(--tn-ease-out-expo) both; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--tn-r-sm); border: 0; background: transparent; font-size: 13.5px; color: var(--tn-text); text-align: left; }
.menu__item:hover { background: var(--tn-sunken); text-decoration: none; color: var(--tn-text); }
.menu__item--danger { color: var(--tn-critical-fg); }
.menu__item--danger:hover { background: var(--tn-critical-bg); color: var(--tn-critical-fg); }
.menu__sep { height: 1px; background: var(--tn-line); margin: 4px 6px; }

/* ---------- Diálogo de confirmación (<dialog>) ---------- */
.dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--tn-surface); color: var(--tn-text); box-shadow: var(--tn-sh-3); }
.dialog::backdrop { background: rgba(6, 18, 16, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog[open] { animation: tn-pop var(--tn-dur-3) var(--tn-ease-out-expo) both; }
.dialog__head { display: flex; gap: 14px; align-items: flex-start; padding: 24px 24px 0; }
.dialog__icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--tn-critical-bg); color: var(--tn-critical-fg); }
.dialog__body { padding: 16px 24px 0; display: flex; flex-direction: column; gap: 14px; }
.dialog__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 20px 24px 24px; }

/* ---------- Esqueleto de carga ---------- */
.skeleton { border-radius: var(--tn-r-sm); background: linear-gradient(90deg, var(--tn-sunken) 25%, #F6F8F5 37%, var(--tn-sunken) 63%); background-size: 400% 100%; animation: tn-shimmer 1.4s ease infinite; }

/* ---------- Animaciones compartidas ---------- */
@keyframes tn-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes tn-pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes tn-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
/* Móvil: después de las reglas base para que gane la cascada (paneles y filas alineados a 16px). */
@media (max-width: 760px) { .panel__head { flex-wrap: wrap; padding: 16px; } .panel__body { padding: 0 16px 16px; } .panel__body--pad { padding: 16px; } .list__item, .req-row { padding-left: 16px; padding-right: 16px; } }
/* Ficha presentada / versión: bloques en dos columnas, etiqueta cerca del valor. */
.tn-profile-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; }
.tn-profile-summary__block { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tn-profile-summary__block--wide { grid-column: 1 / -1; }
.tn-profile-summary .kv { grid-template-columns: 150px minmax(0, 1fr); }
.tn-profile-summary .kv dd { overflow-wrap: anywhere; }
.tn-profile-summary .kv dd .tag { margin-right: 6px; }
/* Consulta ARCA (constancia + A13): tantas columnas como entren sin aplastar los datos. */
.tn-profile-summary.tn-arca-summary { grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); }
.tn-arca-summary .kv dd .cell-sub { font-weight: var(--tn-fw-regular); }
.tn-arca-summary .tn-profile-summary__block > h4 { display: flex; align-items: center; gap: 8px; margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--tn-line); }
.tn-arca-summary .tn-profile-summary__block > h4 > .ico { color: var(--tn-brand); flex: none; }
.tn-person { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--tn-line); border-radius: var(--tn-r-md); background: var(--tn-surface-2); }
.tn-person__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.tn-person .tag { margin-left: auto; }
@media (max-width: 900px) { .tn-profile-summary { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .tn-profile-summary .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .tn-profile-summary .kv dd { margin-bottom: 10px; }  }
/* Móvil: la columna de estado/acción de una fila pasa debajo del contenido (sin columnas aplastadas). */
@media (max-width: 560px) {
  .list__item:not(.list__item--plain) { grid-template-columns: 28px minmax(0, 1fr); align-items: start; }
  .list__item:not(.list__item--plain) > :nth-child(3) { grid-column: 2; justify-self: start; }
  .list__item--plain { grid-template-columns: minmax(0, 1fr); }
  .list__item--plain > :nth-child(2) { justify-self: start; }
}
}
@layer tn.components {
/* Desplegables nativos con el mismo efecto que los de la ficha (dueño, 2026-10-19): la opción elegida
   en verde con tilde y un recuadro al recorrer con teclado o mouse. Mejora progresiva sólo con CSS:
   Edge/Chrome usan el select personalizable; los demás navegadores conservan el desplegable nativo.
   Mismo <select>, mismo valor y mismo envío. */
@supports (appearance: base-select) {
  select.select:not([multiple]):not([size]),
  select.select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
  /* Un texto largo (p. ej., el proceso a consultar en el celular) se recorta dentro del campo, sin ensanchar la página. */
  select.select:not([multiple]):not([size]) { display: flex; align-items: center; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; }
  /* Pasada final (2026-11-04): el recorte va en el borde del contenido, no del relleno, para que el texto no pase por
     debajo de la flecha. */
  select.select:not([multiple]):not([size]) { overflow: clip; overflow-clip-margin: content-box; }
  select.select:not([multiple]):not([size])::picker-icon { display: none; }
  select.select::picker(select) {
    margin-block: 6px; padding: 4px; max-height: min(340px, 60vh);
    border: 1px solid var(--tn-line); border-radius: 12px;
    background: var(--tn-surface); color: var(--tn-text); box-shadow: var(--tn-sh-3);
  }
  select.select option {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 9px 10px;
    border-radius: var(--tn-r-sm); font-size: 13.5px; line-height: 1.45; cursor: pointer;
  }
  select.select option::checkmark { order: 1; margin-left: auto; color: var(--tn-brand); font-weight: var(--tn-fw-semibold); }
  select.select option:hover:not(:checked) { background: var(--tn-surface-2); }
  select.select option:focus-visible { outline: 2px solid var(--tn-brand); outline-offset: -2px; }
  select.select option:checked { background: var(--tn-signal-soft); font-weight: var(--tn-fw-medium); }
  /* «Sin elegir» (valor vacío) nunca parece una elección. */
  select.select option[value='']:checked { background: transparent; font-weight: inherit; color: var(--tn-text-3); }
  select.select option[value='']::checkmark { visibility: hidden; }
  select.select option:disabled { color: var(--tn-text-3); cursor: default; }
  select.select optgroup { padding: 4px 0; font-size: 12px; font-weight: var(--tn-fw-semibold); color: var(--tn-text-3); }
}
}
/* Razón social: se escribe y se guarda en mayúsculas (dueño, 2026-10-22). */
.tn-uppercase { text-transform: uppercase; }
.tn-uppercase::placeholder { text-transform: none; }

@layer tn.components {
  /* Destino de un pendiente: borde verde breve, estable también con movimiento reducido. */
  [id^="requisito-"].tn-requirement-arrival {
    outline: 2px solid var(--tn-signal);
    outline-offset: -2px;
  }
  .tn-fix-steps--row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
  .tn-fix-steps--row > li { font-size: 13px; }
  @media (max-width: 760px) { .tn-fix-steps--row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
  .conversation__older { margin: 0 0 8px; text-align: center; }
  /* Aviso de documentación observada al ingresar (dueño, 2026-11-10): marca, qué pasa y cómo subsanarlo. */
  .dialog.tn-obs-notice { width: min(520px, calc(100vw - 32px)); }
  .tn-obs-notice__head { display: flex; align-items: center; gap: 12px; }
  .tn-obs-notice__mark { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    color: var(--tn-observed-fg); background: var(--tn-observed-bg); box-shadow: inset 0 0 0 1px var(--tn-observed-line); }
  .tn-obs-notice__mark .ico { width: 20px; height: 20px; }
  .tn-obs-notice__body { display: grid; gap: 16px; }
  .tn-obs-notice__steps { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--tn-r-md); background: var(--tn-sunken); }
  .tn-obs-notice__steps .tn-fix-steps > li::before { background: var(--tn-surface); box-shadow: inset 0 0 0 1px var(--tn-line); }
  .tn-obs-notice__foot { display: flex; justify-content: flex-end; gap: 8px; }
  @media (max-width: 480px) {
    .tn-obs-notice__foot { flex-direction: column-reverse; align-items: stretch; }
    .tn-obs-notice__foot > .btn { justify-content: center; }
  }
  /* Pasos numerados para corregir lo observado (dueño, 2026-11-10): ventana de la observación, aviso al ingresar y
     «Requisitos para corregir». */
  .tn-fix-steps { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: tn-fix; }
  .tn-fix-steps > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; align-items: start; counter-increment: tn-fix;
    font-size: 13.5px; line-height: 1.5; color: var(--tn-text-2); }
  .tn-fix-steps > li::before { content: counter(tn-fix); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    background: var(--tn-brand-soft, var(--tn-sunken)); color: var(--tn-brand); font-size: 12px; font-weight: 700; }
}
