/* CAMUS — Componentes. */

/* ─── Encabezado de página ────────────────── */
.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--s-4); flex-wrap: wrap;
    margin: var(--s-4) 0 var(--s-6);
}
.page-head-text { min-width: 0; }
.page-title {
    font-size: var(--fs-2xl);
    font-weight: 780;
    font-variation-settings: 'wdth' var(--wdth-tight);
    letter-spacing: -0.01em;
    line-height: 1.1;
}
.page-sub { margin-top: var(--s-1); color: var(--ink-3); font-size: var(--fs-md); }
.page-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }

.ref {
    font-weight: 700;
    font-variation-settings: 'wdth' var(--wdth-tight);
    letter-spacing: 0.01em;
    color: var(--ink);
    text-decoration: none;
    white-space: nowrap;
}
a.ref:hover { color: var(--brand-ink); text-decoration: underline; }

/* ─── Botones ─────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
    min-height: 38px;
    padding: 8px 14px;
    border-radius: var(--r-md);
    border: 1px solid transparent;
    font-size: var(--fs-md); font-weight: 600; line-height: 1.2;
    text-decoration: none; white-space: nowrap;
    background: var(--ink); color: #fff;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.btn:hover { background: #2A2E36; color: #fff; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn[disabled], .btn.is-disabled { opacity: 0.5; pointer-events: none; }
.btn.is-loading { pointer-events: none; opacity: 0.7; }

.btn-primary, .btn-brand { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover, .btn-brand:hover { background: color-mix(in srgb, var(--brand) 88%, #000); color: var(--on-brand); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline, .btn-secondary {
    background: var(--paper); color: var(--ink); border-color: var(--rule-strong);
}
.btn-outline:hover, .btn-secondary:hover { background: var(--sunken); color: var(--ink); border-color: var(--ink-4); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--sunken); color: var(--ink); }
.btn-danger { background: var(--paper); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, #fff); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-success { background: var(--ok); color: #fff; }
.btn-success:hover { background: #165a2c; color: #fff; }
.btn-warning { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, #fff); }
.btn-warning:hover { background: #ffe8bd; color: var(--warn); }

.btn-sm { min-height: 32px; padding: 5px 10px; font-size: var(--fs-sm); }
.btn-xs { min-height: 28px; padding: 3px 8px; font-size: var(--fs-xs); border-radius: var(--r-sm); }
.btn-lg { min-height: 46px; padding: 10px 20px; font-size: var(--fs-base); }
.btn-block { width: 100%; }
.btn-icon { min-height: 36px; width: 36px; padding: 0; background: transparent; color: var(--ink-2); border-color: transparent; }
.btn-icon:hover { background: var(--sunken); color: var(--ink); }
.btn-group { display: flex; gap: var(--s-2); flex-wrap: wrap; }

/* ─── Paneles ─────────────────────────────── */
.card {
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    min-width: 0;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: var(--s-3) var(--s-5);
    border-bottom: 1px solid var(--rule);
    min-height: 52px;
}
.card-header h2, .card-header h3 {
    font-size: var(--fs-base); font-weight: 700;
    display: flex; align-items: center; gap: var(--s-2);
}
.card-header h2 .icon, .card-header h3 .icon { color: var(--ink-3); }
.card-header .count { font-size: var(--fs-sm); color: var(--ink-3); font-weight: 500; }
.card-body { padding: var(--s-5); }
.card-body.flush, .card-body.p-0 { padding: 0; }
.card-foot {
    padding: var(--s-3) var(--s-5);
    border-top: 1px solid var(--rule);
    background: var(--sunken);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.card + .card, .stack > * + * { margin-top: var(--s-5); }
.card.is-brand { border-color: color-mix(in srgb, var(--brand) 55%, var(--rule)); }
.card.is-brand .card-header { background: var(--brand-wash); border-radius: var(--r-lg) var(--r-lg) 0 0; }

.section-title {
    font-size: var(--fs-base); font-weight: 700;
    margin: var(--s-8) 0 var(--s-3);
    display: flex; align-items: center; gap: var(--s-2);
}

/* ─── Tablas ──────────────────────────────── */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; font-size: var(--fs-md); }
.table th {
    font-size: 11px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--ink-3); text-align: left;
    padding: 10px var(--s-4);
    border-bottom: 1px solid var(--rule);
    background: var(--paper);
    white-space: nowrap;
}
.table td {
    padding: 11px var(--s-4);
    border-bottom: 1px solid var(--rule);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--brand-wash); }
.table th:first-child, .table td:first-child { padding-left: var(--s-5); }
.table th:last-child, .table td:last-child { padding-right: var(--s-5); }
.table .num, .table .text-right { text-align: right; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn + .btn, .table .actions form + .btn, .table .actions .btn + form { margin-left: 4px; }
.cell-stack { display: flex; flex-direction: column; line-height: 1.3; }
.cell-stack small, .cell-sub { font-size: var(--fs-xs); color: var(--ink-3); }

/* ─── Placa ───────────────────────────────── */
.placa, .badge-placa {
    display: inline-block;
    background: var(--placa); color: var(--placa-ink);
    border: 1.5px solid var(--placa-ink);
    border-radius: 4px;
    padding: 1px 7px;
    font-weight: 750; font-size: var(--fs-sm);
    font-variation-settings: 'wdth' 72;
    letter-spacing: 0.06em; text-transform: uppercase;
    line-height: 1.35; white-space: nowrap;
}
.placa-lg { font-size: var(--fs-xl); padding: 2px 12px; border-width: 2px; border-radius: 6px; }

/* ─── Estado de orden ─────────────────────── */
.estado, .tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 9px;
    border-radius: var(--r-pill);
    font-size: var(--fs-xs); font-weight: 650;
    white-space: nowrap; line-height: 1.6;
    background: var(--idle-bg); color: var(--idle);
}
.estado::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.estado-recibido { background: var(--info-bg); color: var(--info); }
.estado-en_diagnostico, .estado-cotizado { background: var(--warn-bg); color: var(--warn); }
.estado-aprobado { background: var(--appr-bg); color: var(--appr); }
.estado-en_proceso { background: var(--work-bg); color: var(--work); }
.estado-control_calidad { background: var(--qa-bg); color: var(--qa); }
.estado-listo { background: var(--ok-bg); color: var(--ok); }
.estado-entregado { background: var(--idle-bg); color: var(--idle); }
.estado-cancelado { background: var(--bad-bg); color: var(--bad); }
/* Estados de línea de servicio */
.estado-pendiente { background: var(--idle-bg); color: var(--idle); }
.estado-completado { background: var(--ok-bg); color: var(--ok); }

.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-bad { background: var(--bad-bg); color: var(--bad); }
.tag-info { background: var(--info-bg); color: var(--info); }
.tag-brand { background: var(--brand-tint); color: var(--brand-ink); }
.tag .icon { width: 13px; height: 13px; }

/* ─── Firma: tira de etapas (llamadas de despiece) ─── */
.stage-strip {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(8, minmax(96px, 1fr));
    background: var(--paper);
    border: 1px solid var(--rule);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-1);
    overflow-x: auto;
    scroll-snap-type: x proximity;
}
.stage { position: relative; scroll-snap-align: start; min-width: 0; }
.stage + .stage { border-left: 1px solid var(--rule); }
.stage-hit {
    display: flex; flex-direction: column; gap: 6px;
    height: 100%;
    padding: var(--s-4) var(--s-4) var(--s-4);
    color: inherit; text-decoration: none;
    position: relative;
}
a.stage-hit:hover { background: var(--brand-wash); color: inherit; }
/* Línea guía: de la llamada hacia la siguiente etapa */
.stage:not(:last-child) .stage-hit::after {
    content: '';
    position: absolute;
    left: calc(var(--s-4) + 30px); right: 0; top: calc(var(--s-4) + 14px);
    height: 1px;
    background: var(--rule-strong);
}
.callout {
    position: relative; z-index: 1;
    width: 28px; height: 28px; flex: none;
    border-radius: 50%;
    border: 1.5px solid var(--ink-4);
    background: var(--paper);
    display: grid; place-items: center;
    font-weight: 750; font-size: var(--fs-sm);
    font-variation-settings: 'wdth' var(--wdth-tight);
    color: var(--ink-3);
}
.callout .icon { width: 14px; height: 14px; stroke-width: 2.25; }
.stage-count {
    font-size: var(--fs-3xl); font-weight: 760; line-height: 1;
    font-variation-settings: 'wdth' 70;
    color: var(--ink-4);
}
.stage-label { font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.25; }

/* Tablero: etapas con órdenes se encienden en tinta */
.stage-strip--board .stage.has-items .callout { border-color: var(--ink); color: var(--ink); }
.stage-strip--board .stage.has-items .stage-count { color: var(--ink); }
.stage-strip--board .stage.has-items .stage-label { color: var(--ink-2); }
.stage-strip--board .stage.is-focus .callout { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

/* Progreso de una orden */
.stage-strip--progress .stage.is-done .callout { background: var(--ink); border-color: var(--ink); color: #fff; }
.stage-strip--progress .stage.is-done .stage-hit::after { background: var(--ink); height: 1.5px; }
.stage-strip--progress .stage.is-done .stage-label { color: var(--ink-2); }
.stage-strip--progress .stage.is-current { background: var(--brand-wash); }
.stage-strip--progress .stage.is-current .callout {
    background: var(--brand); border-color: var(--brand); color: var(--on-brand);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent);
}
.stage-strip--progress .stage.is-current .stage-label { color: var(--ink); font-weight: 700; }
.stage-strip.is-cancelled { opacity: 0.6; }

.stage-strip--compact { grid-template-columns: repeat(8, minmax(72px, 1fr)); }
.stage-strip--compact .stage-hit { padding: var(--s-3); gap: 4px; }
.stage-strip--compact .stage:not(:last-child) .stage-hit::after { left: calc(var(--s-3) + 30px); top: calc(var(--s-3) + 14px); }
.stage-strip--compact .stage-label { font-size: var(--fs-xs); }

/* ─── Alertas / mensajes flash ────────────── */
.flash-stack { display: flex; flex-direction: column; gap: var(--s-2); margin: var(--s-4) 0 0; }
.flash-alert, .alert {
    display: flex; align-items: flex-start; gap: var(--s-3);
    padding: var(--s-3) var(--s-4);
    border-radius: var(--r-md);
    border: 1px solid var(--rule);
    background: var(--paper);
    font-size: var(--fs-md);
    animation: flash-in var(--t-med) var(--ease-out);
}
.flash-alert .icon, .alert .icon { margin-top: 1px; }
.alert-content { flex: 1; min-width: 0; }
.alert-close-btn {
    background: none; border: 0; padding: 2px; color: inherit; opacity: 0.6;
    display: grid; place-items: center; border-radius: var(--r-sm);
}
.alert-close-btn:hover { opacity: 1; }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, #fff); }
.alert-danger, .alert-error { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, #fff); }
.alert-warning { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, #fff); }
.alert-info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, #fff); }
@keyframes flash-in { from { opacity: 0; transform: translateY(-4px); } }

/* ─── Estado vacío ────────────────────────── */
.empty-state {
    padding: var(--s-8) var(--s-5);
    text-align: center;
    color: var(--ink-3);
    font-size: var(--fs-md);
}
.empty-state .icon { width: 28px; height: 28px; margin: 0 auto var(--s-3); color: var(--ink-4); stroke-width: 1.5; }
.empty-state strong { display: block; color: var(--ink); font-size: var(--fs-base); margin-bottom: 2px; }
.empty-state .btn { margin-top: var(--s-4); }

/* ─── Lista de datos (ficha técnica) ──────── */
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s-4); font-size: var(--fs-md); margin: 0; }
.spec dt { color: var(--ink-3); }
.spec dd { margin: 0; color: var(--ink); font-weight: 550; min-width: 0; overflow-wrap: anywhere; }
.spec-title {
    font-size: var(--fs-sm); font-weight: 700; color: var(--ink);
    display: flex; align-items: center; gap: var(--s-2);
    margin-bottom: var(--s-3);
}
.spec-title .icon { color: var(--ink-3); width: 16px; height: 16px; }
.note-box {
    background: var(--sunken); border: 1px solid var(--rule);
    border-radius: var(--r-md); padding: var(--s-3) var(--s-4);
    font-size: var(--fs-md); color: var(--ink-2); white-space: pre-line;
}

/* ─── Lista rápida ────────────────────────── */
.quick-list { list-style: none; margin: 0; padding: 0; }
.quick-list li {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: 10px var(--s-5);
    border-bottom: 1px solid var(--rule);
}
.quick-list li:last-child { border-bottom: 0; }
.quick-list a.row-link { color: var(--ink); text-decoration: none; font-weight: 600; }
.quick-list a.row-link:hover { color: var(--brand-ink); text-decoration: underline; }

/* ─── Bitácora ────────────────────────────── */
.log { list-style: none; margin: 0; padding: var(--s-4) var(--s-5); }
.log li { position: relative; padding: 0 0 var(--s-4) var(--s-6); }
.log li:last-child { padding-bottom: 0; }
.log li::before {
    content: ''; position: absolute; left: 5px; top: 8px; bottom: -4px; width: 1px; background: var(--rule-strong);
}
.log li:last-child::before { display: none; }
.log li::after {
    content: ''; position: absolute; left: 0; top: 4px; width: 11px; height: 11px;
    border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink-3);
}
.log li:first-child::after { background: var(--brand); border-color: var(--brand); }
.log-head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; flex-wrap: wrap; }
.log-title { font-weight: 650; font-size: var(--fs-md); }
.log-time { font-size: var(--fs-xs); color: var(--ink-3); }
.log-note { font-size: var(--fs-md); color: var(--ink-2); margin-top: 2px; }
.log-by { font-size: var(--fs-xs); color: var(--ink-3); }

/* ─── Totales ─────────────────────────────── */
.totals { display: flex; flex-direction: column; gap: 4px; margin-left: auto; width: min(340px, 100%); font-size: var(--fs-md); }
.totals-row { display: flex; justify-content: space-between; gap: var(--s-4); color: var(--ink-2); }
.totals-row.grand {
    color: var(--ink); font-weight: 760; font-size: var(--fs-lg);
    border-top: 1px solid var(--ink); padding-top: var(--s-2); margin-top: var(--s-1);
    font-variation-settings: 'wdth' var(--wdth-narrow);
}

/* ─── Pestañas ────────────────────────────── */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--rule); padding: 0 var(--s-4); }
.tab {
    background: none; border: 0; border-bottom: 2px solid transparent;
    padding: 10px var(--s-3); margin-bottom: -1px;
    font-size: var(--fs-md); font-weight: 600; color: var(--ink-3);
    display: inline-flex; align-items: center; gap: var(--s-2);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected='true'], .tab.active { color: var(--ink); border-bottom-color: var(--brand); }

/* ─── Diálogo ─────────────────────────────── */
.dialog {
    border: 0; padding: 0;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-3);
    width: min(580px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    color: var(--ink);
    background: var(--paper);
}
.dialog::backdrop { background: rgba(21, 23, 28, 0.45); backdrop-filter: blur(2px); }
.dialog[open] { animation: dialog-in var(--t-med) var(--ease-out); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(0.985); } }
.dialog-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--rule);
}
.dialog-head h2 { font-size: var(--fs-lg); }
.dialog-body { padding: var(--s-5); }
.dialog-foot { display: flex; justify-content: flex-end; gap: var(--s-2); margin-top: var(--s-5); }

/* ─── Paginación ──────────────────────────── */
.pagination-nav { display: flex; justify-content: center; padding: var(--s-4); }
.pagination { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 34px; height: 34px; padding: 0 10px;
    border-radius: var(--r-md); border: 1px solid var(--rule);
    background: var(--paper); color: var(--ink-2);
    text-decoration: none; font-size: var(--fs-md); font-weight: 550;
}
.page-link:hover { border-color: var(--ink-4); color: var(--ink); }
.page-item.active .page-link, .page-link.active, .page-link[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.page-item.disabled .page-link { opacity: 0.45; pointer-events: none; }

/* ─── Barra de filtros ────────────────────── */
.toolbar {
    display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap;
    padding: var(--s-3) var(--s-5);
    border-bottom: 1px solid var(--rule);
}
.toolbar .search-field { flex: 1 1 260px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--rule); }
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--r-pill);
    border: 1px solid var(--rule); background: var(--paper);
    font-size: var(--fs-sm); color: var(--ink-2); text-decoration: none; font-weight: 550;
}
.chip:hover { border-color: var(--ink-4); color: var(--ink); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .chip-n { color: inherit; opacity: 0.65; }

/* ─── Estadística en línea (sin tarjetas de KPI) ─── */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.ledger-item { padding: var(--s-4) var(--s-5); }
.ledger-item + .ledger-item { border-left: 1px solid var(--rule); }
.ledger-label { font-size: var(--fs-sm); color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.ledger-label .icon { width: 15px; height: 15px; }
.ledger-value {
    font-size: var(--fs-2xl); font-weight: 760; line-height: 1.1; margin-top: 4px;
    font-variation-settings: 'wdth' 74;
}
.ledger-sub { font-size: var(--fs-xs); color: var(--ink-3); }

/* ─── Barra de carga (mecánicos, stock) ───── */
.meter { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; border: 1px solid var(--rule); }
.meter > span { display: block; height: 100%; background: var(--ink); border-radius: 6px; }
.meter.is-brand > span { background: var(--brand); }

/* ─── Galería de evidencias ───────────────── */
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s-3); }
.evidence {
    border: 1px solid var(--rule); border-radius: var(--r-md); overflow: hidden;
    background: var(--paper); display: flex; flex-direction: column;
}
.evidence-media { aspect-ratio: 4 / 3; background: var(--sunken); display: grid; place-items: center; color: var(--ink-3); }
.evidence-media img { width: 100%; height: 100%; object-fit: cover; }
.evidence-media .icon { width: 28px; height: 28px; }
.evidence-meta { padding: 6px var(--s-2); font-size: var(--fs-xs); color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.evidence-meta form { margin: 0; }
.evidence-group + .evidence-group { margin-top: var(--s-5); }
.evidence-group h4 { font-size: var(--fs-sm); margin-bottom: var(--s-2); color: var(--ink-2); }

/* ─── Autocompletado ──────────────────────── */
.autocomplete-wrapper { position: relative; }
.autocomplete-results {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
    background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md);
    box-shadow: var(--shadow-2); max-height: 260px; overflow-y: auto;
}
.autocomplete-results:empty { display: none; }
.autocomplete-item { padding: 9px var(--s-3); cursor: pointer; font-size: var(--fs-md); border-bottom: 1px solid var(--rule); }
.autocomplete-item:last-child { border-bottom: 0; }
.autocomplete-item:hover, .autocomplete-item.is-active { background: var(--brand-wash); }
.autocomplete-item small { display: block; color: var(--ink-3); font-size: var(--fs-xs); }

/* Entidad seleccionada */
.selected-entity-badge {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
    padding: var(--s-2) var(--s-3); margin-top: var(--s-2);
    background: var(--brand-wash); border: 1px solid color-mix(in srgb, var(--brand) 40%, var(--rule));
    border-radius: var(--r-md); font-size: var(--fs-md);
}
.btn-remove-badge { background: none; border: 0; color: var(--ink-3); display: grid; place-items: center; padding: 2px; border-radius: var(--r-sm); }
.btn-remove-badge:hover { color: var(--bad); }

/* Tira de etapas en celular: el progreso de una orden se lee como lista vertical */
@media (max-width: 640px) {
    .stage-strip--progress { grid-template-columns: 1fr; overflow: visible; }
    .stage-strip--progress .stage + .stage { border-left: 0; border-top: 1px solid var(--rule); }
    .stage-strip--progress .stage-hit { flex-direction: row; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); }
    .stage-strip--progress .stage:not(:last-child) .stage-hit::after { display: none; }
    .stage-strip--progress .stage.is-todo { display: none; }
    .stage-strip--progress .stage.is-current + .stage.is-todo { display: block; }
    .stage-strip--board { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
    .stage-strip--board .stage + .stage { border-left: 0; }
    .stage-strip--board .stage:not(:nth-child(4n + 1)) { border-left: 1px solid var(--rule); }
    .stage-strip--board .stage:nth-child(n + 5) { border-top: 1px solid var(--rule); }
    .stage-strip--board .stage-hit { padding: var(--s-3); gap: 4px; }
    .stage-strip--board .stage:not(:last-child) .stage-hit::after { left: calc(var(--s-3) + 30px); top: calc(var(--s-3) + 14px); }
    .stage-strip--board .stage:nth-child(4n) .stage-hit::after { display: none; }
    .stage-strip--board .stage-count { font-size: var(--fs-2xl); }
    .stage-strip--board .stage-label { font-size: var(--fs-xs); }
}
@media (max-width: 640px) {
    body:not(.public) .stage-strip--progress .stage.is-done { display: none; }
    body:not(.public) .stage-strip--progress .stage.is-done:has(+ .stage.is-current) { display: block; }
}

/* Momento de movimiento: las etapas completadas se llenan en orden sobre la línea guía */
@keyframes callout-fill { from { background: var(--paper); border-color: var(--ink-4); color: var(--ink-3); transform: scale(0.85); } }
.stage-strip--progress .stage.is-done .callout,
.stage-strip--progress .stage.is-current .callout { animation: callout-fill 320ms var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); }
