/* ============================================================================
   DevTrack Hub · mobile.css — adaptación a teléfono (DEV0169)

   Diseño: «Diseño E1» de Design (documentos 213 a 219 del request DEV0169).
   Regla de la hoja: TODO vive dentro de @media (max-width: 767.98px). En
   escritorio no pinta nada; tests/mobile lo vigila a 1280 px. La carga
   base.html detrás de los kits y de extra_css.

   Si una pantalla nueva desborda a 375 px, se arregla aquí o en su kit con la
   misma media query, y se añade a tests/mobile/test_ancho_375.py.
   ============================================================================ */

/* El botón × del cajón sólo existe en el teléfono (clase nueva, no afecta a nada). */
.m-drawer-close { display: none; }

/* DEV0169 (sub-lote 2): lo que sólo existe en el teléfono. Son clases NUEVAS: fuera de la media query no
   pintan nada, y el escritorio mide lo mismo que antes (tests/mobile/test_ancho_escritorio.py). */
.m-decide, .m-status, .m-more-toggle, .m-more-label, .m-skel, .m-lf-error, .m-form-alert,
.m-step-count, .m-stepbar, .m-sheet, .m-scrim, .m-sheet__chrome { display: none; }
/* El envoltorio de «More filters» no es una caja en escritorio: los selects siguen siendo hijos directos
   (a efectos de layout) de su formulario flexible, como antes de envolverlos. */
.m-more { display: contents; }
/* La última fila de Approvals no llevaba borde por ser el último hijo de la lista; ahora la sigue su
   bloque de decisión (oculto aquí), así que el borde se le quita por su nombre. */
.pm-lrow.m-has-decide:nth-last-child(2) { border-bottom: 0; }

@media (max-width: 767.98px) {
  :root {
    --m-drawer-w: min(300px, 85vw);
    --m-topbar-h: 56px;
    --m-hit: 44px;
    --m-input-fs: 16px;
    --m-card-gap: 10px;
    --m-card-pad: 14px 16px;
    --m-action-h: 40px;
  }

  /* ── 0 · Palabras sin espacios ─────────────────────────────────────────── */
  /* Una palabra sin espacios (un nombre de clase, una URL) parte antes de
     empujar su caja fuera de la pantalla. SÓLO en los elementos de las
     pantallas tratadas aquí: puesto en .main-content lo heredaban todas las
     tablas de la aplicación, que se encogían y apilaban el texto letra a
     letra en vez de desplazarse dentro de su caja (revisión del PR #579).
     Regla: una pantalla que esta hoja no ha rediseñado no puede quedar peor
     que antes; scripts/barrido_movil.py lo compara contra dev. */
  .rd-hero-band__title, .tk-hero__title, .tk-hero__req, .rd-hero-band__id, .rd-hero-band__id a,
  .m-cards td[data-m="title"], .m-cards td[data-m="meta"],
  .mt-row__title, .mt-row__sub,
  .tk-card__title, .tk-card__desc,
  .rd-work-task__name, .rd-work-deliv__title,
  .rd-checklist__item > :not(.rd-checklist__mark):not(form):not(a) {
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .rd-hero-band__id, .rd-hero-band__id a { white-space: normal; }
  .main-content .tk-card__details { min-height: var(--m-hit); display: inline-flex; align-items: center; white-space: nowrap; }

  /* ── 1 · Cajón del menú (diseño 1A, 1B) ────────────────────────────────── */
  .sidebar,
  .sidebar.sb-v2 {
    width: var(--m-drawer-w) !important;
    max-width: var(--m-drawer-w) !important;
    height: 100dvh;
    z-index: 1045;
    overscroll-behavior: contain;
  }
  .sidebar.show { animation: m-drawer-in .3s ease-out; }
  /* Bootstrap anima la altura antes de enseñarlo: aquí estaría fuera de pantalla esos 0,35 s. */
  .sidebar.collapsing { transition: none !important; }
  @keyframes m-drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
  .sidebar-overlay { z-index: 1040; }
  /* Con el cajón abierto la página de detrás no se desplaza. */
  html.m-drawer-open, html.m-drawer-open body { overflow: hidden; }

  .m-drawer-close {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 6px; right: 6px; z-index: 2;
    width: var(--m-hit); height: var(--m-hit); padding: 0;
    border: 0; border-radius: 8px; background: transparent; color: #e6e4de; cursor: pointer;
  }
  .m-drawer-close:focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
  /* Cada destino del menú es un objetivo de 44 px. */
  .sidebar .sb__item, .sidebar .sb__logout, .sidebar .nav-link { min-height: var(--m-hit); }

  /* ── 2 · Barra superior (diseño 1A): 56 px, objetivos de 44 ────────────── */
  .rd-tb { height: var(--m-topbar-h); gap: 8px; padding: 0 8px; }
  .rd-tb__burger { width: var(--m-hit); height: var(--m-hit); }
  .rd-tb__user { min-width: var(--m-hit); min-height: var(--m-hit); justify-content: center; padding: 4px; border-color: transparent; }
  .rd-tb__user-av { width: 30px; height: 30px; font-size: 12px; }
  .rd-tb__icon { width: var(--m-hit); height: var(--m-hit); }
  /* La salida no va en la barra del teléfono (diseño 1A): está al pie del
     cajón. Con el timer en marcha, sus 44 px son los que dejan sitio a las migas. */
  .rd-tb__logout { display: none; }
  /* Migas: en 56 px caben el nivel de encima y la página actual; los
     anteriores se quitan (siguen en el menú). El de encima no se encoge; la
     página actual se corta con puntos suspensivos. */
  .rd-tb__crumb { max-width: none; flex: 1 1 0; overflow: hidden; }
  .rd-tb__crumb > :nth-last-child(n+4) { display: none; }
  .rd-tb__crumb a { display: inline-flex; align-items: center; min-height: var(--m-hit); flex: 0 0 auto; }
  .rd-tb__crumb > :last-child { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .rd-tb__spacer { display: none; }
  /* Timer de la barra: con uno en marcha la píldora (tarea, actividad, reloj y
     botones) medía 440 px y sacaba el avatar y la salida de la pantalla en
     TODAS las páginas. En el teléfono quedan el reloj y los botones; la tarea
     y la actividad se leen en la tarjeta del timer de la propia tarea. */
  .rd-tb__timer { flex: 0 0 auto; min-width: 0; }
  .rd-tb__timer .tt-pill__task, .rd-tb__timer .tt-pill__act, .rd-tb__timer .tt-pill__sep { display: none !important; }
  .rd-tb__timer .tt-state-c.tt-pill { padding: 2px 6px; gap: 4px; min-width: 0; }
  .rd-tb__timer .tt-pill__btn { min-width: 40px; min-height: 40px; }

  /* ── 3 · Lo que se toca mide 44 px; lo que se escribe, 16 px ───────────── */
  .main-content .btn,
  .main-content .rd-btn,
  .main-content button:not(.m-plain),
  .main-content input[type="submit"],
  .main-content input[type="button"],
  .main-content .rd-hero-band__btn,
  .main-content .page-link {
    min-height: var(--m-hit);
  }
  /* custom.css deja los .btn en 38 px y los .btn-sm en 34 px con !important
     por debajo de 576 px: sin el mismo peso aquí, se quedan cortos. */
  .main-content .btn, .main-content .btn-sm { min-height: var(--m-hit) !important; }
  .main-content .rd-btn, .main-content .rd-hero-band__btn, .main-content .page-link {
    display: inline-flex; align-items: center; justify-content: center;
  }
  /* iOS amplía la página al enfocar un campo de menos de 16 px. */
  .main-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]),
  .main-content select,
  .main-content textarea,
  .modal input:not([type="checkbox"]):not([type="radio"]),
  .modal select,
  .modal textarea {
    font-size: var(--m-input-fs) !important;
    min-height: var(--m-hit);
  }
  .main-content select, .main-content .form-select { max-width: 100% !important; }
  /* Un campo a 16 px pide más ancho que a 13: dentro de una fila flexible tiene
     que poder encogerse, o saca de la pantalla al botón de al lado (buscador
     de documentos, visto en el barrido contra dev). */
  .us-form .us-field { flex: 1 1 0; min-width: 0; }
  .us-form .us-field input { min-width: 0; width: 100%; }

  /* ── 4 · Tabla → tarjeta (diseño 2A): la misma tabla, otra forma ───────── */
  .m-cards, .m-cards tbody, .m-cards tr, .m-cards td { display: block; }
  .m-cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .m-cards { border: 0; background: transparent; }
  .rl-tablewrap:has(> .m-cards) { border: 0; background: transparent; border-radius: 0; overflow: visible; }

  .m-cards tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px; row-gap: 6px;
    padding: var(--m-card-pad);
    margin-bottom: var(--m-card-gap);
    background: #fff;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 12px;
  }
  .m-cards tbody tr:hover { background: #fff; }
  .m-cards tbody td { padding: 0 !important; border: 0 !important; min-width: 0; }
  .m-cards td[data-m="id"]    { grid-column: 1; grid-row: 1; font-family: var(--font-mono, monospace); font-weight: 600; }
  .m-cards td[data-m="badge"] { grid-column: 2; grid-row: 1; justify-self: end; }
  .m-cards td[data-m="title"] {
    grid-column: 1 / -1; grid-row: 2;
    font-size: 15px; font-weight: 600; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .m-cards td[data-m="sub"]   { grid-column: 1 / -1; grid-row: 3; }
  .m-cards td[data-m="meta"]  { font-size: 13px; color: var(--ink-2, #334155); }
  .m-cards td[data-m="meta"]::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted, #64748b);
  }
  .m-cards td[data-m="hide"] { display: none; }
  /* Toda la tarjeta lleva al detalle: el enlace del número se estira sobre ella. */
  .m-cards td[data-m="id"] a { display: inline-flex; align-items: center; min-height: 28px; }
  .m-cards td[data-m="id"] a::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
  .m-cards td[data-m="id"] a:focus-visible::after { outline: 2px solid var(--accent, #5b5bd6); outline-offset: 2px; }
  .m-cards tr.m-cards__empty { display: block; text-align: center; }

  /* ── 5 · Requests (lista) ───────────────────────────────────────────────── */
  .rl-page .rl-head, .rl-head { flex-wrap: wrap; gap: 10px; }

  /* ── 6 · Ficha de request (diseño 3A) ──────────────────────────────────── */
  .rd-hero-band { padding: 20px 16px; }
  .rd-hero-band__title { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
  .rd-hero-band__row { gap: 8px; }
  .rd-hero-band__actions { margin-left: 0; flex-wrap: wrap; width: 100%; }
  .rd-hero-band__actions .rd-hero-band__btn { flex: 1 1 auto; }

  /* Las pestañas se desplazan de lado dentro de su barra, con degradado en el
     borde, en vez de ensanchar la página. */
  .rd-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start; /* centradas, las primeras quedarían fuera sin poder llegar a ellas */
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  .rd-tabs::-webkit-scrollbar { display: none; }
  .rd-tabs li { flex: 0 0 auto; min-height: var(--m-hit); padding: 10px 14px; white-space: nowrap; }

  /* Comentarios (Overview y Discussion): la columna del texto se encoge a su
     sitio y una palabra sin espacios se parte en vez de ensanchar la página. */
  .rd-comment { grid-template-columns: 32px minmax(0, 1fr); }
  .rd-comment__text { overflow-wrap: anywhere; }
  .rd-comment__acts { margin-left: 0; }

  /* Lista de control de la pestaña Work: el texto arriba y las acciones debajo. */
  .rd-checklist__item { flex-wrap: wrap; }
  .rd-checklist__item > :not(.rd-checklist__mark) { min-width: 0; }
  .rd-checklist__item .rd-json-form { flex: 1 1 100%; flex-wrap: wrap; }
  .rd-checklist__item .rd-json-form input { flex: 1 1 140px; min-width: 0; }
  .rd-checklist__fix { margin-left: 0; }

  /* Campos en línea de la ficha: dos columnas que no pasan de su mitad. */
  .rd-fields, .rd-fields--3, .rd-fields--4, .rd-inline-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .rd-fields > *, .rd-inline-grid > * { min-width: 0; }
  .rd-fields .form-control, .rd-fields .form-select { width: 100%; min-width: 0; }

  /* Cabecera de cada entregable de la pestaña Work: los botones bajan de línea. */
  .rd-work-deliv__head { flex-wrap: wrap; }
  .rd-work-deliv__add { margin-left: 0; }
  .rd-work-task { grid-template-columns: minmax(0, 1fr) auto auto; }
  .rd-work-task > :nth-child(n+4) { grid-column: 1 / -1; justify-self: start; }

  .rd-kpis { grid-template-columns: 1fr 1fr; }
  .rd-split, .rd-dash-grid { grid-template-columns: minmax(0, 1fr); }
  .rd-split__main, .rd-rail { min-width: 0; }

  /* ── 7 · Tasks y My tasks (diseño 3B) ──────────────────────────────────── */
  .tk-metrics { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .tk-metric { padding: 12px !important; gap: 10px !important; min-width: 0; }
  .tk-metric__icon { display: none !important; }
  .tk-metric__lbl { overflow-wrap: normal; }

  .mt-filter > * { flex: 1 1 100%; }
  .mt-filter .mt-search { min-width: 0; }
  .mt-filter .rd-btn { flex: 1 1 0; }
  .mt-filter__spacer { display: none; }

  /* La fila de «My tasks» era una rejilla de seis columnas: en 375 px dejaba al
     título una columna de una palabra por línea. Pasa a tarjeta: la casilla y
     el título arriba, y debajo el tipo, la prioridad, la fecha y las acciones. */
  .mt-row {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 8px 10px;
    padding: var(--m-card-pad);
    margin-bottom: var(--m-card-gap);
  }
  .mt-row__main { flex: 1 1 calc(100% - 40px); }
  .mt-row__title { font-size: 15px; }
  .mt-row__sub { flex-wrap: wrap; }
  .mt-row > :last-child { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

  /* ── 7b · Approvals (diseño 3C): cada fila es una tarjeta ─────────────── */
  /* Por debajo de 900 px la fila era una rejilla «1fr 30px» con seis hijos: el
     título caía en la columna de 30 px, una sílaba por línea. */
  .pg-row, .ap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: var(--m-hit); }
  .pg-row > div, .ap-row > div { flex: 1 1 100%; min-width: 0; }
  .pg-row .pm-lrow__title, .ap-row .pm-lrow__title { overflow-wrap: anywhere; font-size: 15px; }
  .pg-row > :last-child, .ap-row > :last-child { margin-left: auto; }

  /* ── 7c · Hoja de tipo de la tarea (la SQL medida; el armazón es común) ── */
  /* El resplandor del encabezado se sale de su caja si no se recorta. */
  .dtx-wrap .rd-hero-band { overflow: hidden; }

  /* ── 8 · Formularios (diseño 4A): una columna, etiquetas encima ────────── */
  .cr-grid--2, .cr-grid--3, .cr-grid--4 { grid-template-columns: minmax(0, 1fr); }
  .cr-layout { grid-template-columns: minmax(0, 1fr); }

  /* ══ SUB-LOTE 2 (DEV0169): acciones diarias. Diseño E1, documentos 215, 217, 218 y 219. ══ */

  /* ── 10 · Botones y rótulos de las piezas nuevas ───────────────────────── */
  .m-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: var(--m-hit); padding: 0 16px;
    border: 1px solid var(--line, #d7dde4); border-radius: 10px;
    background: #fff; color: var(--ink, #16182c);
    font: 600 14px/1.2 "Inter", sans-serif; text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-btn:focus-visible, .m-status:focus-visible, .m-more-label:focus-visible, .m-sheet__x:focus-visible {
    outline: 2px solid var(--accent, #5b5bd6); outline-offset: 2px;
  }
  .m-btn--pri { background: var(--accent, #5b5bd6); border-color: transparent; color: #fff; }
  .m-btn--ok { background: var(--rd-ok, #1f8a4c); border-color: transparent; color: #fff; }
  .m-btn--danger { color: var(--rd-coral-ink, #9b2c1f); }
  .m-btn--danger-solid { background: var(--rd-coral-ink, #b3372f); border-color: transparent; color: #fff; }
  .m-btn[disabled] { opacity: .55; cursor: default; }
  .m-label { display: block; font: 600 12.5px/1.3 "Inter", sans-serif; color: var(--ink, #16182c); margin: 0 0 4px; }
  .m-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .m-hide-phone { display: none !important; }

  /* ── 11 · Approvals: la decisión en la tarjeta (diseño 3C y 4D) ────────── */
  .pm-lrow.m-has-decide { border-bottom: 0; padding-bottom: 8px; }
  .m-decide {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 0 18px 14px; border-bottom: 1px solid var(--line-2, #eef0f3);
  }
  .m-decide:last-child { border-bottom: 0; }
  .m-decide > .m-btn, .m-decide__reject, .m-decide__approve { flex: 1 1 0; min-width: 0; margin: 0; }
  .m-decide__reject > summary { list-style: none; width: 100%; }
  .m-decide__reject > summary::-webkit-details-marker { display: none; }
  .m-decide__approve .m-btn { width: 100%; }
  .m-decide .m-btn { padding: 0 10px; }
  /* Sin JavaScript el motivo se escribe aquí mismo: el formulario se abre debajo, a todo el ancho. */
  .m-decide__reject[open] { flex: 1 1 100%; order: 5; }
  .m-decide__form { display: grid; gap: 8px; margin-top: 10px; }
  .m-decide__form textarea { width: 100%; border: 1px solid var(--line, #d7dde4); border-radius: 10px; padding: 10px 12px; }
  .m-decide__why { flex: 1 1 100%; margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted, #64748b); }

  /* ── 12 · Hoja inferior (diseño 3B; componente 3 del documento 215) ────── */
  html.m-sheet-open, html.m-sheet-open body { overflow: hidden; }
  .m-scrim { display: block; position: fixed; inset: 0; z-index: 1060; background: rgba(20, 22, 40, .45); }
  .m-sheet:not([hidden]), .m-more.is-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: var(--m-kb, 0px); z-index: 1061;
    max-height: 82dvh; overflow-y: auto; overscroll-behavior: contain;
    margin: 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    background: #fff; color: var(--ink, #16182c);
    border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .2);
    animation: m-sheet-in .26s ease-out;
  }
  @keyframes m-sheet-in { from { transform: translateY(100%); } to { transform: none; } }
  .m-sheet__grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line, #d7dde4); margin: 4px auto 6px; }
  .m-sheet__head { display: flex; align-items: center; gap: 8px; }
  .m-sheet__title { flex: 1; margin: 0; font: 600 17px/1.3 "Inter Tight", "Inter", sans-serif; }
  .m-sheet__x {
    display: inline-flex; align-items: center; justify-content: center;
    width: var(--m-hit); height: var(--m-hit); margin-right: -8px; padding: 0;
    border: 0; border-radius: 10px; background: transparent; color: var(--muted, #64748b);
    font-size: 26px; line-height: 1; cursor: pointer;
  }
  .m-sheet__sub { margin: 0 0 8px; font-size: 13px; line-height: 1.4; color: var(--muted, #64748b); overflow-wrap: anywhere; }
  .m-sheet__sub:empty { display: none; }
  .m-sheet__banner { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.4;
    background: var(--rd-coral-soft, #fde9e6); color: var(--rd-coral-ink, #9b2c1f); }
  .m-radios { border: 0; padding: 0; margin: 0; min-width: 0; }
  .m-radio { display: flex; align-items: center; gap: 12px; min-height: 48px; margin: 0; padding: 0 4px;
    border-bottom: 1px solid var(--line-2, #eef0f3); font-size: 15px; cursor: pointer; }
  .m-radio input { width: 20px; height: 20px; margin: 0; flex: 0 0 auto; accent-color: var(--accent, #5b5bd6); }
  .m-radio__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
  .m-radio__cur { font: 600 10px/1 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #64748b); }
  .m-sheet .m-field { margin-top: 12px; }
  .m-sheet .m-field textarea { width: 100%; border: 1px solid var(--line, #d7dde4); border-radius: 10px; padding: 10px 12px; font-size: var(--m-input-fs); }
  .m-sheet__foot, .m-more.is-sheet > .m-sheet__chrome--foot {
    display: flex; gap: 8px; position: sticky; bottom: 0; margin-top: 12px; padding-top: 4px; background: #fff;
  }
  .m-sheet__foot .m-btn, .m-sheet__chrome--foot .m-btn { flex: 1 1 0; }
  .m-more.is-sheet > .m-sheet__chrome--head { display: block; }

  /* ── 13 · Chips, «More filters» y esqueletos (diseño 2A) ───────────────── */
  /* Los chips de la barra de filtros se desplazan de lado en una sola fila. */
  .tk-presets {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
    padding-right: 24px;
  }
  .tk-presets::-webkit-scrollbar { display: none; }
  .tk-presets > * { flex: 0 0 auto; }
  .tk-presets .tk-preset, .m-more-label.tk-preset { min-height: var(--m-hit); }
  .m-more-label { display: inline-flex; align-self: flex-start; margin: 0; white-space: nowrap; }
  .m-more-label[aria-expanded="true"] { background: var(--ink, #16182c); border-color: var(--ink, #16182c); color: #fff; }
  /* Sin JavaScript: la casilla (invisible, pero con foco) abre los selects en su sitio. */
  .m-more-toggle { display: block; position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
  .m-more-toggle:focus-visible ~ form .m-more-label { outline: 2px solid var(--accent, #5b5bd6); outline-offset: 2px; }
  .m-more { display: none; }
  .m-more-toggle:checked ~ form .m-more { display: flex; flex-wrap: wrap; gap: 10px; flex: 1 1 100%; align-items: flex-end; }
  /* Con mobile-kit.js la casilla sobra: el rótulo es un botón que abre la hoja. */
  html.m-kit .m-more-toggle { display: none; }
  html.m-kit .m-more-toggle:checked ~ form .m-more:not(.is-sheet) { display: none; }
  .m-more.is-sheet > .form-select, .m-more.is-sheet > .tk-fld, .m-more.is-sheet > .rd-btn {
    display: flex; width: 100% !important; max-width: none !important; margin: 0 0 10px;
  }
  .m-more.is-sheet .tk-fld .form-select { width: 100%; }
  .rl-filters .rl-search { flex: 1 1 100%; min-width: 0; }

  .m-skel__card { display: grid; gap: 10px; padding: var(--m-card-pad); background: #fff;
    border: 1px solid var(--line, #e2e8f0); border-radius: 12px; }
  .m-skel__card i { display: block; height: 12px; border-radius: 6px;
    background: linear-gradient(90deg, #eef0f3 25%, #f7f8fa 37%, #eef0f3 63%); background-size: 400% 100%;
    animation: m-skel 1.2s ease infinite; }
  .m-skel__card i:nth-child(1) { width: 35%; }
  .m-skel__card i:nth-child(2) { width: 90%; height: 16px; }
  .m-skel__card i:nth-child(3) { width: 60%; }
  @keyframes m-skel { from { background-position: 100% 50%; } to { background-position: 0 50%; } }
  [data-listfilter].lf-loading .m-skel { display: grid; gap: var(--m-card-gap); }
  [data-listfilter].lf-loading #lf-results { display: none; }
  .m-lf-error:not([hidden]) { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 10px 12px;
    border-radius: 10px; font-size: 13.5px; background: var(--rd-coral-soft, #fde9e6); color: var(--rd-coral-ink, #9b2c1f); }
  .m-lf-error > span { flex: 1; }

  /* El estado de una tarea, tocable (abre la hoja de la sección 12). */
  .m-status { display: inline-flex; align-items: center; gap: 2px; min-height: var(--m-hit); min-width: var(--m-hit);
    justify-content: flex-end; text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }
  .m-status::after { content: ""; width: 0; height: 0; margin-left: 4px;
    border: 4px solid transparent; border-top-color: var(--muted, #64748b); border-bottom-width: 0; }

  /* ── 14 · Alta de request en pasos (diseño 4A y 4B) ────────────────────── */
  .m-form-alert:not([hidden]) { display: block; margin: 0 0 12px; padding: 12px 14px; border-radius: 10px;
    font: 600 14px/1.4 "Inter", sans-serif; background: var(--rd-coral-soft, #fde9e6); color: var(--rd-coral-ink, #9b2c1f);
    border: 1px solid currentColor; }
  html.m-kit .m-step-count:not([hidden]) { display: block; margin: 0 0 6px;
    font: 600 11px/1.2 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #64748b); }
  .cr-tabs li.m-step--err { color: var(--rd-coral-ink, #9b2c1f); }
  .cr-tabs li.m-step--err::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px;
    border-radius: 50%; background: currentColor; vertical-align: middle; }
  html.m-kit .m-stepbar {
    display: flex; gap: 8px; position: fixed; left: 0; right: 0; bottom: var(--m-kb, 0px); z-index: 1030;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line, #e2e8f0);
  }
  .m-stepbar .m-btn { white-space: nowrap; }
  .m-stepbar__back { flex: 0 0 var(--m-hit); padding: 0; }
  .m-stepbar__back[hidden] { display: none; }
  .m-stepbar__next { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  /* Lo último del formulario no queda debajo de la barra. */
  html.m-kit .cr-layout { padding-bottom: 76px; }
  .cr-field .cr-err.m-err { display: block; }

  /* ── 15 · Composer de comentario (diseño 4C) ───────────────────────────── */
  .rd-disc__compose { position: sticky; bottom: var(--m-kb, 0px); z-index: 5; box-shadow: 0 -8px 18px rgba(20, 22, 40, .08); }
  .rd-disc__compose textarea { resize: none; max-height: 136px; }
  .rd-disc__compose button[type="submit"][disabled] { opacity: .55; }

  /* ── 16 · La confirmación de la aplicación, como hoja inferior (documento 213) ── */
  .cfm { align-items: flex-end; padding: 0 0 var(--m-kb, 0px); }
  .cfm__dialog { max-width: none; max-height: 88dvh; overflow-y: auto; border-radius: 20px 20px 0 0; border-bottom: 0;
    padding: 20px 16px calc(16px + env(safe-area-inset-bottom, 0px)); animation: m-sheet-in .2s ease-out; }
  .cfm__actions { gap: 8px; }
  .cfm__btn { min-height: var(--m-hit); flex: 1 1 0; }
  /* QCK0129 (548, revisión de #587): con tres salidas (AppConfirm.choose) los botones se apilan, la principal arriba;
     en fila a 375 px la tercera se salía de la hoja. */
  .cfm__actions--choose { flex-direction: column-reverse; }
  .cfm__actions--choose .cfm__btn { flex: 0 0 auto; width: 100%; }
  .cfm__input { font-size: var(--m-input-fs); }

  /* ── 9 · Movimiento ────────────────────────────────────────────────────── */
  @media (prefers-reduced-motion: reduce) {
    .sidebar.show { animation: none; }
    .sidebar { transition: none !important; }
    .m-sheet, .m-more.is-sheet, .cfm__dialog, .m-skel__card i { animation: none; }
  }
}
