/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   semana.css — «La semana se propone sola; quien dirige la corrige y la publica» (round 36, 2026-10-23; audits/2026-10-23-horario-ia
   CONTRATO §4.3, hora-diseno). Jorge, 2026-10-23: «no hay roles no hay sugerencia, esto así como está no es una herramienta moderna».
   The week as a paper calendar (components/kit/Semana.tsx): the roles as rows, the days as columns (Friday to Sunday warmer), each shift a
   chip in the light of its franja — comida's sun, tarde's terracotta, cena's dusk — written by one of three hands: proposed from a fact
   (pencil, a turning arrow), hers (ink, a pen), no pattern yet (dashed, a question). Decisions in the kit's «por revisar» terracotta, never
   red; «Publicada» is a green seal. The round's only new sheet: tokens --sm-* over equipo.css's (a raw colour lives only in :root); the
   grid scrolls sideways at 390 with the names pinned, and fits the computer's 760 px. Only transform and opacity move; text ≥ 16 px;
   targets ≥ 44 px; no glass, no dark mode; prefers-reduced-motion stops it all. Kill = this file's link in app/layout.tsx.
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

:root {
  /* ---- the room: a paper wall calendar on the crema ---- */
  --sm-papel: var(--hoja);
  --sm-borde: var(--linea);
  --sm-tinta: var(--tinta);
  --sm-titulo: var(--vino);
  --sm-apoyo: var(--gris);
  --sm-radio: var(--r-grande);
  --sm-sombra: 0 1px 2px rgba(43, 27, 32, .06), 0 16px 32px -26px rgba(43, 27, 32, .6);
  --sm-hueco: 14px;
  --sm-orilla: 18px;
  /* ---- the type: a card's one line in Eighties; the first decision in Quicksand, a size up, so it is read first ---- */
  --sm-t-titulo: 28px;
  --sm-t-decision: 20px;
  --sm-t-lead: 18px;
  --sm-t-cifra: 32px;
  --sm-t-dia: 20px;
  --sm-t-cuenta: 22px;
  /* ---- «Proponer la semana»: a calendar page — the wine binding, its two rings, the seven days on papel ---- */
  --sm-lomo: var(--vino);
  --sm-anillo: var(--crema);
  --sm-hoja-dia: var(--papel);
  --sm-hoja-fin: var(--s-terracota-tarjeta);
  /* ---- the day's light by franja (the meter's cuts: comida until 16:00, tarde until 19:00, then cena) ---- */
  --sm-luz-comida: #FBEBB8;
  --sm-luz-tarde: #F6D3BC;
  --sm-luz-cena: #E7D2E2;
  /* ---- the hands: pencil (proposed), ink (hers), dashed (no pattern yet) ---- */
  --sm-lapiz: rgba(96, 52, 64, .26);
  --sm-lapiz-glifo: var(--gris-medio);
  --sm-suya: var(--vino);
  --sm-sin-patron: var(--gris-medio);
  /* ---- a decision: the kit's «por revisar» terracotta, never red ---- */
  --sm-revisar: var(--espera);
  --sm-revisar-claro: var(--espera-claro);
  --sm-revisar-tinta: var(--espera-tinta);
  --sm-revisar-luz: var(--s-terracota-luz);
  --sm-revisar-linea: var(--s-terracota-linea);
  /* ---- published: the kit's green, as a seal ---- */
  --sm-listo: var(--verde);
  --sm-listo-claro: var(--verde-claro);
  --sm-listo-tinta: var(--verde-tinta);
  /* ---- the grid: names pinned at the left, days of 84 px at 390 («Descanso» whole; the week fits 760 px on a computer) ---- */
  --sm-col-quien: 92px;
  --sm-col-dia: 84px;
  --sm-celda-alto: 48px;
  --sm-fin: rgba(245, 224, 208, .45);
  --sm-pegado: var(--crema);
  --sm-pegado-sombra: 8px 0 10px -10px rgba(43, 27, 32, .45);
  /* ---- coverage: a person is a dot; the plantilla's missing one is hollow ---- */
  --sm-punto: 10px;
  /* ---- round 38: an absence's own light — a calm blue, hatched like a blocked day on a paper calendar (never the rest's empty paper) ---- */
  --sm-luz-ausencia: #DDE7EF;
  --sm-ausencia-raya: rgba(47, 76, 99, .13);
  --sm-ausencia-tinta: #2F4C63;
  --sm-ausencia-borde: rgba(47, 76, 99, .34);
  /* «sombra»: the shift's light under a veil of paper */
  --sm-velo: rgba(255, 252, 247, .62);
  /* ---- the brush: a marked cell fills in ink; the bar is the painter's tray, the act in gold ---- */
  --sm-marcada: var(--vino);
  --sm-marcada-tinta: var(--crema);
  --sm-vacia: rgba(96, 52, 64, .3);
  --sm-bandeja: var(--ciruela);
  --sm-bandeja-tinta: var(--sobre-vino);
  --sm-bandeja-apoyo: var(--sobre-vino-2);
  --sm-bandeja-borde: rgba(250, 242, 231, .26);
  --sm-pintar: var(--oro);
  --sm-pintar-tinta: var(--ciruela);
  --sm-pintar-canto: #9C6F10;
  /* ---- the plantilla's two marks, drawn by the sheet once (a mask: only its shape counts), never one SVG per field ---- */
  --sm-glifo-reloj: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17zM12 7.5V12l3 2'/%3E%3C/svg%3E");
  --sm-glifo-sello: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM9.3 10.1l1.9 1.9 3.6-3.7M8.6 15.6 7.2 21l4.8-2.3 4.8 2.3-1.4-5.4'/%3E%3C/svg%3E");
}

/* ---------------- the cards ---------------- */
.sm-tarjeta { position: relative; isolation: isolate; overflow: hidden; display: grid; gap: 10px; min-width: 0; padding: var(--sm-orilla);
  background: var(--sm-papel); color: var(--sm-tinta); border: 1px solid var(--sm-borde); border-radius: var(--sm-radio); box-shadow: var(--sm-sombra);
  font: 500 var(--t-cuerpo)/1.45 var(--f-texto); }
.sm-tarjeta :is(p, h3, h4, ol, ul) { margin: 0; }
.sm-k { display: flex; align-items: center; gap: 8px; font-size: var(--t-apoyo); font-weight: 700; line-height: 1.3; color: var(--sm-apoyo); }
.sm-k .ico { width: 20px; height: 20px; flex: none; }
.sm-titulo { font: 500 var(--sm-t-titulo)/1.08 var(--f-display); color: var(--sm-titulo); text-wrap: balance; }
.sm-linea { font-weight: 600; line-height: 1.4; color: var(--sm-tinta); text-wrap: pretty; }
.sm-nota { margin: 0; font-size: var(--t-nota); font-weight: 600; line-height: 1.4; color: var(--sm-apoyo); }
.sm-fuente { font-size: var(--t-apoyo); font-weight: 600; color: var(--sm-apoyo); }
.sm-forma { margin: 4px 0 0; }
.sm-forma .mo-acto { width: 100%; min-height: 56px; font-size: 17px; }
.sm-actos { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; margin-top: 4px; }
.sm-actos .mo-no-es-asi { margin-left: auto; }

/* «Proponer la semana»: the calendar page */
.sm-proponer { padding-top: 0; }
.sm-tarjeta .sm-hoja { position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin: 0 calc(var(--sm-orilla) * -1) 6px;
  padding: 30px var(--sm-orilla) 14px; list-style: none; background: linear-gradient(180deg, var(--sm-lomo) 0 14px, transparent 14px); }
.sm-hoja::before, .sm-hoja::after { content: ""; position: absolute; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--sm-anillo);
  box-shadow: inset 0 0 0 3px var(--sm-lomo); }
.sm-hoja::before { left: 26%; }
.sm-hoja::after { right: 26%; }
.sm-hoja li { display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 10px 0 8px; border-radius: 12px; background: var(--sm-hoja-dia); }
.sm-hoja li[data-fin] { background: var(--sm-hoja-fin); }
.sm-hoja li b { font: 500 var(--sm-t-cuenta)/1.05 var(--f-display); color: var(--sm-titulo); font-variant-numeric: tabular-nums; }
.sm-proponer > .sm-nota { text-align: center; }

/* the first decision: terracotta paper with its edge, the line big; «Ver» is the act */
.sm-decision-ahora { background: var(--sm-revisar-luz); border-color: var(--sm-revisar-linea); padding-left: calc(var(--sm-orilla) + 4px); }
.sm-decision-ahora::before { content: ""; position: absolute; top: 18px; bottom: 18px; left: 0; width: 6px; border-radius: 0 6px 6px 0; background: var(--sm-revisar); }
.sm-decision-ahora .sm-k { color: var(--sm-revisar-tinta); }
.sm-decision-texto { font: 700 var(--sm-t-decision)/1.3 var(--f-texto); color: var(--sm-tinta); text-wrap: pretty; }

/* «Publicar»: one tap, full width; a warning under it never blocks */
.sm-publicar[data-cambios] { border-color: var(--sm-revisar-linea); }
/* under a decision card: the act and its line, no card around them (the week is already on the screen) */
.sm-publicar-compacta { display: grid; gap: 6px; min-width: 0; }
.sm-publicar-compacta > .sm-forma { margin: 0; }
.sm-publicar-compacta > .sm-nota { text-align: center; }
/* «Publicada»: the green seal, slightly turned like a stamp */
.sm-publicada { padding-right: 88px; background: var(--sm-listo-claro); border-color: transparent; }
.sm-publicada .sm-titulo { color: var(--sm-listo-tinta); }
.sm-publicada .sm-k, .sm-publicada .sm-nota { color: var(--sm-listo-tinta); }
.sm-sello { position: absolute; top: 18px; right: 18px; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: var(--sm-listo); color: var(--sm-listo-claro); box-shadow: 0 0 0 4px var(--sm-listo-claro), 0 0 0 6px var(--sm-listo); transform: rotate(-10deg); }
.sm-sello .ico { width: 30px; height: 30px; stroke-width: 2.6; }

/* ---------------- TUYO ≤ 3 ---------------- */
.sm-cifras { display: grid; grid-template-columns: repeat(var(--sm-cifras-n, 3), minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; overflow: hidden;
  background: var(--sm-papel); border: 1px solid var(--sm-borde); border-radius: var(--r-tarjeta); }
.sm-cifras[data-n="1"] { --sm-cifras-n: 1; }
.sm-cifras[data-n="2"] { --sm-cifras-n: 2; }
.sm-cifras > li { display: grid; min-width: 0; }
.sm-cifras > li + li { border-left: 1px solid var(--sm-borde); }
.sm-cifra { display: grid; align-content: start; gap: 4px; min-width: 0; min-height: 96px; padding: 12px 12px 10px; color: var(--sm-titulo); text-decoration: none; }
a.sm-cifra:active { background: var(--papel); }
.sm-cifra b { font: 500 var(--sm-t-cifra)/1 var(--f-display); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-cifra span { font-size: var(--t-apoyo); font-weight: 600; line-height: 1.25; color: var(--sm-apoyo); }
/* compact (the first screen with decisions): one row, each number with its short label beside it */
.sm-cifras[data-compacta] .sm-cifra { min-height: 0; padding: 10px 10px 8px; gap: 0; }
.sm-cifras[data-compacta] .sm-cifra b { font-size: var(--sm-t-cuenta); }

/* ---------------- the decisions ---------------- */
.sm-decisiones { display: grid; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--sm-borde); }
.sm-decisiones > li { border-bottom: 1px solid var(--sm-borde); }
.sm-decision { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 10px 0; }
.sm-decision-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sm-revisar-claro); color: var(--sm-revisar-tinta); }
.sm-decision-ico .ico { width: 20px; height: 20px; }
.sm-decision-txt { display: grid; gap: 2px; min-width: 0; }
.sm-decision-txt b { font-weight: 700; line-height: 1.35; color: var(--sm-tinta); text-wrap: pretty; }
.sm-decision-txt small { font-size: var(--t-apoyo); font-weight: 600; line-height: 1.3; color: var(--sm-apoyo); }
.sm-ver { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; min-width: 44px; min-height: 44px; padding-left: 6px;
  font-weight: 700; color: var(--vino); text-decoration: none; }
.sm-ver .ico { width: 18px; height: 18px; }
.sm-decision > .mo-no-es-asi { grid-column: 2 / -1; justify-content: flex-start; margin-top: -6px; }
.sm-plegado > summary, .sm-reglas > summary { gap: 6px; }
.sm-plegado > summary .ico, .sm-reglas > summary .ico { width: 18px; height: 18px; transition: transform var(--d-2) var(--suave); }
.sm-plegado[open] > summary .ico, .sm-reglas[open] > summary .ico { transform: rotate(180deg); }
.sm-plegado[open] > .sm-decisiones { border-top: 0; }
.sm-reglas > ul { display: grid; gap: 10px; margin: 6px 0 4px; padding: 0; list-style: none; }
.sm-reglas li { display: grid; gap: 2px; padding-left: 14px; border-left: 3px solid var(--sm-borde); }
.sm-reglas li b { font-weight: 700; color: var(--sm-tinta); }
.sm-reglas li small { font-size: var(--t-apoyo); font-weight: 600; color: var(--sm-apoyo); }

/* ---------------- the week by role and hour ---------------- */
.sm-semana { display: grid; gap: 10px; min-width: 0; }
.sm-leyenda { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 16px; font-weight: 600; color: var(--sm-apoyo); }
.sm-leyenda li { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
.sm-leyenda .sm-mano { width: 18px; height: 18px; }
.sm-luz { display: inline-block; flex: none; width: 20px; height: 14px; border-radius: 5px; background: var(--sm-luz-comida); box-shadow: inset 0 0 0 1px var(--sm-lapiz); }
.sm-luz[data-luz="tarde"] { background: var(--sm-luz-tarde); }
.sm-luz[data-luz="cena"] { background: var(--sm-luz-cena); }

/* a piece placed straight in a screen (no `.pad` around it) keeps the screen's side margin itself, so its frame bleeds exactly to the edges */
[data-pantalla] > :is(.sm-semana, .sm-plantilla-dias, .sm-consolidado) { padding-inline: var(--orilla); }
/* the frame bleeds to the screen's edges on a phone: the names pin at the left, the days scroll under them — freely: no snap (2026-10-28, a
   snap carried every sideways touch past the finger) */
.sm-rejilla { min-width: 0; }
.sm-marco { overflow-x: auto; overscroll-behavior-x: contain; margin-inline: calc(var(--orilla) * -1); scroll-padding-left: calc(var(--sm-col-quien) + var(--orilla)); }
.sm-marco:focus-visible { outline: 3px solid var(--oro); outline-offset: -3px; }
.sm-tabla { width: max(100%, calc(var(--sm-col-quien) + 2 * var(--orilla) + 7 * var(--sm-col-dia))); table-layout: fixed; border-collapse: separate; border-spacing: 0;
  font: 500 var(--t-cuerpo)/1.3 var(--f-texto); color: var(--sm-tinta); }
.sm-col-quien { width: calc(var(--sm-col-quien) + var(--orilla)); }
.sm-tabla :is(th, td) { padding: 3px; }
.sm-tabla tr > :last-child { padding-right: var(--orilla); }
.sm-tabla thead th { padding: 4px 3px 8px; text-align: center; vertical-align: bottom; font-weight: 600; color: var(--sm-apoyo); }
.sm-tabla thead th span { display: block; font-size: 16px; line-height: 1.15; }
.sm-tabla thead th b { display: block; font: 500 var(--sm-t-dia)/1.1 var(--f-display); color: var(--sm-titulo); font-variant-numeric: tabular-nums; }
.sm-tabla thead th[data-fin] { border-radius: 14px 14px 0 0; }
.sm-tabla :is(thead th, td)[data-fin] { background: var(--sm-fin); }
.sm-tabla thead th[aria-current="date"] b { color: var(--sm-revisar-tinta); text-decoration: underline 3px var(--sm-revisar); text-underline-offset: 5px; }
/* pinned: the corner, each person's name and the role's label */
.sm-tabla :is(.sm-esquina, .sm-quien) { position: sticky; left: 0; z-index: 2; background: var(--sm-pegado); box-shadow: var(--sm-pegado-sombra); }
.sm-tabla .sm-quien { padding-left: var(--orilla); text-align: left; vertical-align: middle; }
.sm-quien b { display: block; overflow: hidden; font-weight: 700; color: var(--sm-tinta); text-overflow: ellipsis; white-space: nowrap; }
.sm-quien small { display: block; font-size: 16px; font-weight: 600; color: var(--sm-apoyo); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-quien small[data-pasa] { font-weight: 700; color: var(--sm-revisar-tinta); }
.sm-rol > th { padding: 16px 0 4px; text-align: left; }
tbody + tbody .sm-rol > th { border-top: 1px solid var(--sm-borde); }
.sm-rol > th > span { position: sticky; left: 0; display: inline-flex; align-items: baseline; gap: 8px; padding: 0 12px 0 var(--orilla);
  background: var(--sm-pegado); font-weight: 700; color: var(--sm-titulo); }
.sm-rol small { font-size: 16px; font-weight: 600; color: var(--sm-apoyo); }

/* a cell: the chip in its franja's light, the hand in its corner */
.sm-celda { position: relative; display: grid; place-items: center; min-height: var(--sm-celda-alto); padding: 4px 3px; border-radius: 12px;
  background: var(--sm-papel); color: var(--sm-tinta); text-decoration: none; box-shadow: inset 0 0 0 1px var(--sm-lapiz);
  font-weight: 700; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; transition: transform var(--d-1) var(--suave); }
.sm-celda:active { transform: scale(.95); }
.sm-celda:focus-visible { outline: 3px solid var(--oro); outline-offset: 1px; }
.sm-celda[data-de] { background: linear-gradient(90deg, var(--sm-de, var(--sm-papel)) 18%, var(--sm-a, var(--sm-de, var(--sm-papel))) 82%); }
.sm-celda[data-de="comida"] { --sm-de: var(--sm-luz-comida); }
.sm-celda[data-de="tarde"] { --sm-de: var(--sm-luz-tarde); }
.sm-celda[data-de="cena"] { --sm-de: var(--sm-luz-cena); }
.sm-celda[data-a="comida"] { --sm-a: var(--sm-luz-comida); }
.sm-celda[data-a="tarde"] { --sm-a: var(--sm-luz-tarde); }
.sm-celda[data-a="cena"] { --sm-a: var(--sm-luz-cena); }
/* the hours stay whole; a range wider than the day («14:30–22:30» at 390) parts after its dash onto two lines (round 38b, D38-32) */
.sm-celda-h { font-size: 16px; line-height: 1.1; white-space: normal; text-align: center; }
.sm-celda .sm-mano { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; stroke-width: 2.3; color: var(--sm-lapiz-glifo); }
.sm-celda[data-mano="suya"] { color: var(--sm-suya); box-shadow: inset 0 0 0 2px var(--sm-suya); }
.sm-celda[data-mano="suya"] .sm-mano { color: var(--sm-suya); }
.sm-celda[data-mano="sin_patron"] { box-shadow: none; outline: 2px dashed var(--sm-sin-patron); outline-offset: -2px; }
.sm-celda[data-mano="sin_patron"]:focus-visible { outline: 3px solid var(--oro); outline-offset: 1px; }
.sm-celda[data-descanso] { background: transparent; box-shadow: inset 0 0 0 1px var(--sm-borde); color: var(--sm-apoyo); font-weight: 600; }
.sm-celda[data-descanso][data-mano="suya"] { color: var(--sm-suya); box-shadow: inset 0 0 0 2px var(--sm-suya); }
.sm-celda[data-descanso][data-mano="sin_patron"] { outline-color: var(--sm-borde); }
.sm-celda[data-aviso]::before { content: ""; position: absolute; top: 5px; left: 5px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--sm-revisar); box-shadow: 0 0 0 2px var(--sm-papel); }
.sm-leyenda [data-mano="suya"] .sm-mano { color: var(--sm-suya); }

/* over the editor: who wrote the cell, and its «No es así» */
.sm-origen { display: grid; gap: 0; }
.sm-origen p { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; color: var(--sm-apoyo); }
.sm-origen p b { color: var(--sm-tinta); }
.sm-origen .sm-mano { width: 20px; height: 20px; color: var(--sm-lapiz-glifo); }
.sm-origen[data-mano="suya"] .sm-mano { color: var(--sm-suya); }
.sm-origen > .mo-no-es-asi { justify-content: flex-start; }

/* ---------------- «Qué cambió» ---------------- */
.sm-lead { font: 700 var(--sm-t-lead)/1.4 var(--f-texto); color: var(--sm-tinta); text-wrap: pretty; }
.sm-cambio-grupo { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--sm-borde); }
.sm-cambio-grupo h4 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; font-size: 16px; font-weight: 700; color: var(--sm-titulo); }
.sm-cambio-grupo h4 small { font-size: 16px; font-weight: 600; color: var(--sm-apoyo); }
.sm-cambio-grupo ul { display: grid; gap: 8px; padding: 0; list-style: none; }
.sm-cambio-grupo li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.sm-cambio-quien { display: inline-flex; flex-wrap: wrap; gap: 0 6px; }
.sm-cambio-quien span { font-weight: 600; color: var(--sm-apoyo); }
.sm-cambio-de { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-cambio-de s { font-weight: 600; color: var(--sm-apoyo); text-decoration-thickness: 2px; }
.sm-cambio-de b { color: var(--sm-titulo); }
.sm-cambio-de .ico { width: 16px; height: 16px; color: var(--sm-lapiz-glifo); }
.sm-nuevo { font-weight: 600; color: var(--sm-apoyo); }

/* ---------------- H2 · coverage and the plantilla ---------------- */
.sm-cobertura { display: grid; gap: 8px; min-width: 0; padding: var(--sm-orilla); background: var(--sm-papel); border: 1px solid var(--sm-borde); border-radius: var(--sm-radio); }
.sm-cobertura h3 { margin: 0; font: 500 var(--sm-t-cuenta)/1.1 var(--f-display); color: var(--sm-titulo); }
:is(.sm-cobertura, .sm-plantilla) table { width: 100%; table-layout: fixed; border-collapse: collapse; font: 500 var(--t-cuerpo)/1.3 var(--f-texto); }
/* the franjas as columns, each under its light; each role a band with its three numbers under it */
:is(.sm-cobertura, .sm-plantilla) thead th { padding: 0 4px 2px; text-align: left; font-weight: 600; color: var(--sm-apoyo); }
:is(.sm-cobertura, .sm-plantilla) thead th .sm-luz { display: block; width: 100%; height: 8px; margin-bottom: 6px; border-radius: 4px; }
:is(.sm-cobertura, .sm-plantilla) .sm-banda > th { padding: 12px 4px 2px; text-align: left; font-weight: 700; color: var(--sm-titulo); hyphens: auto; }
:is(.sm-cobertura, .sm-plantilla) tbody + tbody .sm-banda > th { border-top: 1px solid var(--sm-borde); }
.sm-cobertura td { padding: 2px 4px 8px; vertical-align: top; }
.sm-barra { display: grid; gap: 4px; }
.sm-barra b { font-weight: 700; color: var(--sm-tinta); font-variant-numeric: tabular-nums; }
.sm-puntos { display: flex; flex-wrap: wrap; gap: 3px; }
.sm-puntos i { width: var(--sm-punto); height: var(--sm-punto); border-radius: 50%; box-shadow: inset 0 0 0 2px var(--sm-revisar); }
.sm-puntos i[data-lleno] { background: var(--sm-titulo); box-shadow: none; }
.sm-barra small { font-size: 16px; font-weight: 700; line-height: 1.2; color: var(--sm-revisar-tinta); }
.sm-barra:not([data-falta]) small { font-weight: 600; color: var(--sm-apoyo); }

.sm-plantilla { display: grid; gap: 14px; min-width: 0; margin: 0; }
.sm-plantilla > .sm-linea { margin: 0; }
.sm-plantilla fieldset { min-width: 0; margin: 0; padding: 8px 12px 12px; background: var(--sm-papel); border: 1px solid var(--sm-borde); border-radius: var(--sm-radio); }
.sm-plantilla legend { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 0 6px; }
.sm-plantilla legend b { font: 500 var(--sm-t-cuenta)/1.1 var(--f-display); color: var(--sm-titulo); }
.sm-plantilla legend small { font-size: 16px; font-weight: 600; color: var(--sm-apoyo); }
/* dense for a real sucursal (≈ 21 puestos): one row per puesto, the franja heads pinned under the app's bar, the areas as headings */
.sm-plantilla table { border-collapse: separate; border-spacing: 0; }
.sm-plantilla thead th { position: sticky; top: var(--alto-barra); z-index: 1; padding: 8px 4px 6px; background: var(--sm-papel); }
.eq-lienzo:not(:has(> .eq-barra)) .sm-plantilla thead th { top: 0; }
.sm-plantilla thead th:first-child { width: 34%; }
.sm-plantilla tbody th[scope="row"] { padding: 6px 6px 6px 2px; text-align: left; vertical-align: middle; font-weight: 700; line-height: 1.2; color: var(--sm-tinta);
  hyphens: auto; overflow-wrap: break-word; }
.sm-plantilla .sm-grupo > th { padding: 16px 2px 4px; text-align: left; font-weight: 700; color: var(--sm-titulo); }
.sm-plantilla tbody + tbody .sm-grupo > th { border-top: 1px solid var(--sm-borde); }
.sm-plantilla td { padding: 4px 3px; text-align: left; vertical-align: middle; }
.sm-plantilla td label { display: block; }
.sm-plantilla input[type="number"] { box-sizing: border-box; width: 100%; max-width: 64px; min-height: 44px; padding: 0 4px; border: 1.5px solid var(--sm-borde); border-radius: 12px;
  background: var(--hoja); color: var(--sm-titulo); font: 500 var(--sm-t-cuenta)/1 var(--f-display); text-align: center; font-variant-numeric: tabular-nums; }
.sm-plantilla input[type="number"]:focus-visible { outline: 3px solid var(--oro); outline-offset: 1px; }
.sm-plantilla input[type="number"]:disabled { background: var(--papel); color: var(--sm-apoyo); }
/* her own number where it differs from «así ha sido»: in ink, like her cells on the week */
.sm-plantilla td[data-suyo] input[type="number"] { border: 2px solid var(--sm-suya); }
.sm-plantilla td small { display: block; margin-top: 4px; font-size: 16px; font-weight: 600; line-height: 1.2; color: var(--sm-apoyo); }
/* «Así lo quiero» stays within reach: pinned to the bottom of the screen while the grid scrolls (above the phone's tab bar), resting at the
   form's end — it is on the first screen and never 5,000 px down */
.sm-plantilla > .mo-acto { position: sticky; bottom: calc(var(--abajo, env(safe-area-inset-bottom, 0px)) + var(--alto-pestanas) + 12px); z-index: 2; justify-self: stretch;
  min-height: 56px; box-shadow: 0 var(--canto, 3px) 0 var(--ciruela), var(--sombra-flota); }
.eq-app:not(:has(> .eq-pestanas)) .sm-plantilla > .mo-acto { bottom: calc(var(--abajo, env(safe-area-inset-bottom, 0px)) + 12px); }
@media (min-width: 900px) { .sm-plantilla > .mo-acto { bottom: 16px; justify-self: start; } }
/* «Lunes a jueves» | «Viernes a domingo»: two tabs, no script — both blocks still post; where :has is missing they stack */
.sm-vistas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: var(--r-pastilla); background: var(--papel); }
.sm-vistas label { position: relative; display: grid; place-items: center; min-height: 44px; padding: 0 8px; border-radius: var(--r-pastilla); font-weight: 700;
  color: var(--sm-apoyo); text-align: center; cursor: pointer; }
.sm-vistas input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sm-vistas label:has(input:checked) { background: var(--vino); color: var(--crema); }
.sm-vistas label:has(input:focus-visible) { outline: 3px solid var(--oro); outline-offset: 2px; }
.sm-plantilla:has(.sm-vistas input[value="entre_semana"]:checked) fieldset[data-dia-tipo="fin_de_semana"],
.sm-plantilla:has(.sm-vistas input[value="fin_de_semana"]:checked) fieldset[data-dia-tipo="entre_semana"] { display: none; }
/* with the tabs the legend is for a screen reader only */
.sm-plantilla:has(.sm-vistas) legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sm-plantilla:has(.sm-vistas) fieldset { padding-top: 4px; }

/* ---------------- the person's week ---------------- */
.sm-mi-semana { display: grid; gap: 14px; min-width: 0; }
.sm-mi-semana > .section-head { margin: 10px 0 0; }

/* ---------------- «Dilo» on the week (round 35's builder and outcome card, two additions) ---------------- */
.sm-a-las { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
/* «descansa» has no hour: the slot steps out (it still posts; the lane ignores it) */
.sm-constructor:has(select[name="verbo"] option[value="descansa"]:checked) .sm-a-las { display: none; }
.sm-resultado-detalle { display: grid; gap: 4px; margin: 0; padding: 0 0 0 20px; font-weight: 600; line-height: 1.35; color: var(--sm-tinta); font-variant-numeric: tabular-nums; }
.sm-resultado-detalle li::marker { color: var(--sm-lapiz-glifo); }

/* ---------------- the kitchen tablet: «El equipo de hoy» (round 36, D36-17) — the board's first card, 2 × 2 ---------------- */
.mo-tablero-tarjeta[data-clase="equipo"] { grid-column: span 2; grid-row: span 2; align-content: start; gap: 8px; }
.sm-equipo-bloque { display: grid; gap: 6px; min-width: 0; }
.sm-equipo-k { display: flex; align-items: baseline; gap: 10px; margin: 0; font-size: 22px; font-weight: 700; color: var(--gris); }
.sm-equipo-k b { font: 500 34px/1 var(--f-display); color: var(--vino); }
.sm-equipo-grupos, .sm-equipo-lista { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
/* «Están»: the puestos in ONE left column as wide as the widest label (capped; a longer one wraps), the first names beside them */
.sm-equipo-grupos { grid-template-columns: fit-content(170px) minmax(0, 1fr); align-items: baseline; gap: 2px 14px; }
.sm-equipo-grupos li { display: contents; font-size: 24px; line-height: 1.25; }
.sm-equipo-grupos li > b { font-size: 22px; line-height: 1.25; }
.sm-equipo-grupos li > b:only-child { grid-column: 1 / -1; }
.sm-equipo-grupos b { font-weight: 700; color: var(--tinta); }
.sm-equipo-puesto { font-size: 20px; font-weight: 600; color: var(--gris); }
.sm-equipo-lista { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 18px; }
/* «Falta» on one line with its people */
.sm-equipo-bloque[data-bloque="falta"] { grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: 16px; }
.sm-equipo-bloque[data-bloque="falta"] .sm-equipo-lista { display: flex; flex-wrap: wrap; gap: 2px 24px; }
/* a small crew (≤ 8 people named) takes one row of the board, not two */
.mo-tablero-tarjeta[data-clase="equipo"][data-tam="chico"] { grid-row: span 1; }
.sm-equipo-lista li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: 22px; line-height: 1.25; }
.sm-equipo-lista b { font-weight: 700; color: var(--tinta); }
.sm-equipo-lista span, .sm-equipo-mas { font-size: 20px; font-weight: 600; color: var(--gris); }
.sm-equipo-bloque[data-bloque="falta"] :is(.sm-equipo-k, b, span) { color: var(--sm-revisar-tinta); }
.sm-equipo-horas { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; height: 68px; margin: 2px 0 0; padding: 0; list-style: none; }
.sm-equipo-horas li { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; align-items: end; min-width: 0; }
.sm-equipo-horas b { font-size: 18px; font-weight: 700; line-height: 1.1; color: var(--gris); }
.sm-equipo-horas i { display: block; align-self: end; width: 100%; height: calc(var(--sm-alto, 0) * 100%); min-height: 4px; border-radius: 6px 6px 2px 2px; background: var(--papel-2); }
.sm-equipo-horas span { font-size: 18px; font-weight: 600; line-height: 1.2; color: var(--gris); }
.sm-equipo-horas li[data-ahora] i { background: var(--vino); }
.sm-equipo-horas li[data-ahora] :is(b, span) { color: var(--vino); }
@container (max-width: 1100px) {
  .sm-equipo-grupos { grid-template-columns: fit-content(140px) minmax(0, 1fr); column-gap: 12px; }
  .sm-equipo-grupos li > b { font-size: 20px; }
  .sm-equipo-lista li { font-size: 18px; }
  .sm-equipo-k b { font-size: 28px; }
  .sm-equipo-k, .sm-equipo-puesto, .sm-equipo-lista span, .sm-equipo-mas { font-size: 18px; }
  .sm-equipo-horas { height: 60px; }
  .sm-equipo-horas :is(b, span) { font-size: 16px; }
}

/* ---------------- a computer: the whole week inside the 760 px column ---------------- */
@media (min-width: 900px) {
  .sm-marco { margin-inline: 0; }
  .sm-tabla { width: 100%; }
  .sm-col-quien { width: 132px; }
  .sm-tabla tr > :last-child { padding-right: 3px; }
  .sm-tabla .sm-quien, .sm-rol > th > span { padding-left: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .sm-celda, .sm-plegado > summary .ico, .sm-reglas > summary .ico { transition: none; }
  .sm-celda:active { transform: none; }
}

/* ---------------- «Ver» lands here (2026-10-27, SemanaPorRol `anclas`) ----------------
   A day, a row or a cell reached by its anchor clears the sticky back bar and, sideways, the pinned names column; the cell a «Ver» was sent to wears
   the «por revisar» ring (a jump inside the page: :target). */
.sm-semana[id], .sm-tabla :is(th, tr, td)[id] { scroll-margin-top: calc(var(--arriba, env(safe-area-inset-top, 0px)) + 64px); }
.sm-tabla :is(th, td)[id] { scroll-margin-left: var(--sm-col-quien); }
.sm-tabla td:target .sm-celda { box-shadow: inset 0 0 0 3px var(--sm-revisar); }

/* ---------------- the day names stay on top (2026-10-28, Jorge on a phone: «no entiendo cómo hacerlo en el móvil») ----------------
   A copy of the head (SemanaPorRol's `.sm-dias-fijos`, aria-hidden) pinned under the back bar while the week scrolls down. It is 0 px tall in
   the flow: at rest it lies exactly over the table's head; stuck, it covers the rows passing under it (opaque). Sideways it follows the grid's
   own scroll — entra.js sets its transform from the frame's scrollLeft (a scroll timeline left WebKit's copy on Monday over Wednesday's column).
   Drawn only once the script has placed it (`data-vivo`): without it, the head scrolls away with the week, as before — never a day over the
   wrong column. */
.sm-dias-fijos { display: none; }
.sm-dias-fijos[data-vivo] { position: sticky; z-index: 3; top: calc(var(--arriba, env(safe-area-inset-top, 0px)) + 56px); display: block; height: 0;
  margin-inline: calc(var(--orilla) * -1); overflow-x: clip; overflow-y: visible; }
.sm-dias-fijos thead th { background: var(--sm-pegado); box-shadow: 0 1px 0 var(--sm-borde); }
.sm-dias-fijos thead th[data-fin] { background: linear-gradient(var(--sm-fin), var(--sm-fin)), var(--sm-pegado); }
.sm-dias-fijos .sm-esquina { box-shadow: var(--sm-pegado-sombra), 0 1px 0 var(--sm-borde); }
/* a row or a cell reached by its anchor clears the pinned names of the days too */
.sm-rejilla:has(> .sm-dias-fijos[data-vivo]) .sm-tabla :is(tr, td)[id] { scroll-margin-top: calc(var(--arriba, env(safe-area-inset-top, 0px)) + 116px); }
.sm-tabla tr:target .sm-quien b, .sm-tabla th:target b { color: var(--sm-revisar-tinta); }

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   Round 38 «Horarios: la semana en Equipo con el vocabulario de Buk» (2026-10-27; audits/2026-10-27-turnos-ctrlit CONTRATO §4.4–§4.6,
   turno-diseno). A cell's three new states; the brush (the grid's `seleccionable` mode + the painter's tray); the plantilla by weekday ×
   AM/PM. Same tokens, same grid; nothing moves but transform.
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

/* an absence: its word in its own light, no hand */
.sm-celda[data-ausencia] { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--sm-ausencia-raya) 7px 9px), var(--sm-luz-ausencia);
  box-shadow: inset 0 0 0 1px var(--sm-ausencia-borde); color: var(--sm-ausencia-tinta); }
/* «Vacaciones» and «Incapacidad» are wider than a day: they break once at the syllable their soft hyphen marks («Vaca-ciones») — never cut */
.sm-celda[data-ausencia] .sm-celda-h { white-space: normal; -webkit-hyphens: manual; hyphens: manual; text-align: center; line-height: 1.05; letter-spacing: -.01em; }
/* «sombra»: the light veiled, the hours in the support grey, the tag under them */
.sm-celda[data-sombra] { color: var(--sm-apoyo); box-shadow: inset 0 0 0 1px var(--sm-borde); }
.sm-celda[data-sombra][data-de] { background: linear-gradient(var(--sm-velo), var(--sm-velo)), linear-gradient(90deg, var(--sm-de, var(--sm-papel)) 18%, var(--sm-a, var(--sm-de, var(--sm-papel))) 82%); }
.sm-celda-tag { display: block; max-width: 100%; overflow: hidden; font-size: 16px; font-weight: 700; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.sm-celda-tag[data-tag="sombra"] { color: var(--sm-apoyo); }
/* «cubre»: two arrows passing, the covered puesto in ink */
.sm-celda-tag[data-tag="cubre"] { color: var(--sm-titulo); }
.sm-cubre { display: inline-block; width: 14px; height: 14px; margin-right: 2px; vertical-align: -1px; stroke-width: 2.4; }
.sm-leyenda [data-estado] .sm-cubre { width: 18px; height: 18px; color: var(--sm-titulo); }
.sm-luz[data-luz="sombra"] { background: linear-gradient(var(--sm-velo), var(--sm-velo)), var(--sm-luz-comida); box-shadow: inset 0 0 0 1px var(--sm-borde); }

/* ---------------- the brush (D38-3): every day a target; marked = ink with a check ---------------- */
.sm-celda[data-marcable] { cursor: pointer; -webkit-user-select: none; user-select: none; }
.sm-celda[data-marcable] > input { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; margin: 0; border-radius: inherit;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; }
.sm-celda[data-marcable] > :is(.sm-celda-h, .sm-celda-tag) { position: relative; z-index: 1; }
.sm-celda[data-marcable] > .ico { z-index: 1; }
.sm-celda[data-marcable] > input:focus-visible { outline: 3px solid var(--oro); outline-offset: 1px; }
.sm-celda[data-marcable] > input:checked { background: var(--sm-marcada); }
.sm-celda[data-marcable] > input:checked ~ :is(.sm-celda-h, .sm-celda-tag) { color: var(--sm-marcada-tinta); }
.sm-celda[data-marcable] > input:checked ~ .sm-mano { display: none; }
.sm-celda .sm-marca { display: none; }
.sm-celda[data-marcable] > input:checked ~ .sm-marca { display: block; position: absolute; top: 4px; right: 4px; width: 16px; height: 16px; stroke-width: 3; color: var(--sm-marcada-tinta); }
/* an empty day: a blank slot to tap — dotted, lighter than «sin patrón»'s dashes */
.sm-celda[data-vacia] { background: transparent; box-shadow: none; outline: 2px dotted var(--sm-vacia); outline-offset: -3px; }
.sm-celda[data-vacia] > input:checked ~ .sm-marca { top: 50%; right: 50%; width: 22px; height: 22px; transform: translate(50%, -50%); }
/* an absence in the brush: drawn, never marked */
.sm-celda[data-fija] { cursor: not-allowed; }

/* how many are marked, on the act (where the browser can count them; nothing drawn at zero) */
form:has(.sm-semana[data-seleccionable]) { counter-reset: sm-marcadas; }
.sm-semana[data-seleccionable] input[name="celda"]:checked { counter-increment: sm-marcadas; }
.sm-pincel-n { display: none; }
/* a count on the act's corner (it keeps «Pintar las marcadas» on one line beside «Salir del pincel» at 390) */
form:has(.sm-semana[data-seleccionable] input[name="celda"]:checked) .sm-pincel-n { position: absolute; top: -11px; right: -6px; display: inline-grid; place-items: center;
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: var(--r-pastilla); background: var(--sm-bandeja-tinta); color: var(--sm-bandeja);
  box-shadow: 0 0 0 3px var(--sm-bandeja); font: 700 16px/1 var(--f-texto); font-variant-numeric: tabular-nums; }
.sm-pincel-n::before { content: counter(sm-marcadas); }

/* the painter's tray: the form's last child — sticky at the bottom while the week scrolls (above the phone's tab bar), resting under the
   week's last row at the end (it never covers it) */
.sm-pincel { position: sticky; bottom: calc(var(--abajo, env(safe-area-inset-bottom, 0px)) + var(--alto-pestanas) + 12px); z-index: 3; display: grid; gap: 8px; min-width: 0;
  margin-top: 14px; padding: 10px 14px 12px; border-radius: var(--sm-radio); background: var(--sm-bandeja); color: var(--sm-bandeja-tinta);
  box-shadow: inset 0 0 0 1px var(--sm-bandeja-borde), var(--sombra-flota); }
.eq-app:not(:has(> .eq-pestanas)) .sm-pincel { bottom: calc(var(--abajo, env(safe-area-inset-bottom, 0px)) + 12px); }
.sm-pincel-turnos { min-width: 0; margin: 0; padding: 0; border: 0; }
/* the tray's first line: the next step where her thumb is — «Toca los días…» until a day is marked, then «Elige el turno…»; a receipt or a
   refusal after a submit takes the first step's place (2026-10-28) */
.sm-pincel-linea { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; color: var(--sm-bandeja-tinta); }
.sm-pincel-linea [data-paso="pinta"] { display: none; }
form:has(.sm-semana[data-seleccionable] input[name="celda"]:checked) .sm-pincel-linea [data-paso="marca"] { display: none; }
form:has(.sm-semana[data-seleccionable] input[name="celda"]:checked) .sm-pincel-linea [data-paso="pinta"] { display: inline; }
/* nothing marked yet: the act waits, quieter */
form:has(.sm-semana[data-seleccionable]):not(:has(input[name="celda"]:checked)) .sm-pincel-acto { opacity: .55; }
/* «Pinta con» names the strip for a screen reader; on the screen the shifts say it themselves (the tray stays two rows high) */
.sm-pincel-turnos legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the shifts in one row that scrolls inside the tray (never the page), each in its franja's light, like the cell it paints */
.sm-pincel-tira { display: flex; gap: 8px; margin: 0 -14px; padding: 5px 14px 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  scroll-padding-inline: 14px; scrollbar-width: none; }
.sm-pincel-tira::-webkit-scrollbar { display: none; }
.sm-pincel-turno { position: relative; flex: none; display: grid; align-content: center; gap: 1px; min-width: 92px; min-height: 52px; padding: 6px 14px;
  border-radius: 16px; background: linear-gradient(90deg, var(--sm-de, var(--sm-papel)) 18%, var(--sm-a, var(--sm-de, var(--sm-papel))) 82%); color: var(--sm-tinta);
  cursor: pointer; scroll-snap-align: start; -webkit-tap-highlight-color: transparent; transition: transform var(--d-1) var(--suave); }
.sm-pincel-turno[data-de="comida"] { --sm-de: var(--sm-luz-comida); }
.sm-pincel-turno[data-de="tarde"] { --sm-de: var(--sm-luz-tarde); }
.sm-pincel-turno[data-de="cena"] { --sm-de: var(--sm-luz-cena); }
.sm-pincel-turno[data-a="comida"] { --sm-a: var(--sm-luz-comida); }
.sm-pincel-turno[data-a="tarde"] { --sm-a: var(--sm-luz-tarde); }
.sm-pincel-turno[data-a="cena"] { --sm-a: var(--sm-luz-cena); }
.sm-pincel-turno > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; border-radius: inherit; -webkit-appearance: none; appearance: none;
  background: transparent; cursor: pointer; }
.sm-pincel-turno b { font-weight: 700; line-height: 1.15; white-space: nowrap; }
.sm-pincel-turno small { font-size: 16px; font-weight: 600; line-height: 1.15; color: var(--sm-apoyo); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sm-pincel-turno[data-descanso] { background: transparent; color: var(--sm-bandeja-tinta); box-shadow: inset 0 0 0 1.5px var(--sm-bandeja-borde); }
/* the picked shift: a gold ring and a small lift */
.sm-pincel-turno > input:checked { box-shadow: 0 0 0 3px var(--sm-pintar); }
.sm-pincel-turno:has(> input:checked) { transform: translateY(-2px); }
.sm-pincel-turno > input:focus-visible { outline: 3px solid var(--sm-bandeja-tinta); outline-offset: 5px; }
.sm-pincel-turno:active { transform: scale(.97); }
.sm-pincel-pie { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 4px; }
.sm-pincel .sm-pincel-acto { position: relative; flex: 1 1 180px; padding-inline: 14px; white-space: nowrap; margin-bottom: var(--canto, 3px); min-height: 52px; background: var(--sm-pintar); color: var(--sm-pintar-tinta); box-shadow: 0 var(--canto, 3px) 0 var(--sm-pintar-canto); }
.sm-pincel-salir { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; font-weight: 700; color: var(--sm-bandeja-tinta);
  text-decoration: underline 2px var(--sm-bandeja-borde); text-underline-offset: 5px; }
.sm-pincel-salir:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 6px; }

/* ---------------- the plantilla by weekday × AM/PM (D38-2): the week grid's frame, a puesto per band, two franjas under it ---------------- */
.sm-plantilla-dias { display: grid; gap: 12px; min-width: 0; margin: 0; }
.sm-plantilla-dias > :is(p, ul) { margin: 0; }
/* versions as tabs (links: one version on the screen) */
.sm-versiones { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 20px; background: var(--papel); }
.sm-version { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 4px 14px; border-radius: 16px;
  font-weight: 700; line-height: 1.2; color: var(--sm-apoyo); text-align: center; text-decoration: none; }
.sm-version[aria-current="page"] { background: var(--vino); color: var(--crema); }
.sm-version:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; }
.sm-marcas-leyenda li::before { width: 18px; height: 18px; }
.sm-marcas-leyenda [data-marca="autorizada"] { color: var(--sm-titulo); }
.sm-tabla-dias .sm-col-franja { width: calc(var(--sm-col-quien) + var(--orilla)); }
.sm-tabla .sm-franja { position: sticky; left: 0; z-index: 2; padding-left: var(--orilla); background: var(--sm-pegado); box-shadow: var(--sm-pegado-sombra);
  text-align: left; vertical-align: middle; }
.sm-franja b { display: block; font-weight: 700; line-height: 1.15; color: var(--sm-tinta); }
.sm-franja small { display: block; font-size: 16px; font-weight: 600; line-height: 1.15; color: var(--sm-apoyo); }
.sm-tabla-dias .sm-rol > th > span { flex-wrap: wrap; row-gap: 0; max-width: calc(100vw - 2 * var(--orilla)); }
.sm-tres { display: inline-flex; flex-wrap: wrap; gap: 0 6px; font-size: 16px; font-weight: 600; color: var(--sm-apoyo); }
.sm-tres b { font-weight: 700; color: var(--sm-tinta); font-variant-numeric: tabular-nums; }
.sm-tres em { font-style: normal; font-weight: 700; color: var(--sm-revisar-tinta); }
/* on a phone the áreas fold — one open, the rest a tap away; every field stays in the ONE form (a closed área's numbers still post) */
.sm-area { min-width: 0; }
.sm-area > summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 2px; border-top: 1px solid var(--sm-borde); list-style: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
.sm-area > summary::-webkit-details-marker { display: none; }
.sm-area > summary b { font: 500 var(--sm-t-cuenta)/1.1 var(--f-display); color: var(--sm-titulo); }
.sm-area > summary small { font-size: 16px; font-weight: 600; color: var(--sm-apoyo); }
.sm-area > summary .ico { width: 22px; height: 22px; margin-left: auto; color: var(--sm-apoyo); transition: transform var(--d-2) var(--suave); }
.sm-area[open] > summary .ico { transform: rotate(180deg); }
.sm-area > summary:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 12px; }
.sm-tabla-dias td { padding: 4px 3px; text-align: center; vertical-align: top; }
/* a field is named by its own aria-label (no hidden text box: 308 fields stay light, and nothing escapes the scrolling frame) */
.sm-tabla-dias td { position: relative; }
.sm-tabla-dias input[type="number"] { box-sizing: border-box; width: 100%; max-width: 64px; min-height: 44px; padding: 0 4px; border: 1.5px solid var(--sm-borde);
  border-radius: 12px; background: var(--hoja); color: var(--sm-titulo); font: 500 var(--sm-t-cuenta)/1 var(--f-display); text-align: center;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.sm-tabla-dias input[type="number"]::-webkit-inner-spin-button, .sm-tabla-dias input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sm-tabla-dias input[type="number"]:focus-visible { outline: 3px solid var(--oro); outline-offset: 1px; }
.sm-tabla-dias input[type="number"]:disabled { background: var(--papel); color: var(--sm-apoyo); }
/* her number where it differs from «así ha sido»: in ink, like her cells on the week */
.sm-tabla-dias td[data-suyo] input[type="number"] { border: 2px solid var(--sm-suya); }
/* under a field, only where they differ from it: the clock's mark (grey) and RH's autorizada (wine) */
.sm-marcas { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 6px; margin-top: 3px; }
.sm-marcas small { display: inline-flex; align-items: center; gap: 1px; font-size: 16px; font-weight: 700; line-height: 1.2; color: var(--sm-apoyo); font-variant-numeric: tabular-nums; }
.sm-marcas small[data-marca="autorizada"] { color: var(--sm-titulo); }
.sm-marcas small::before, .sm-marcas-leyenda li::before { content: ""; flex: none; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--sm-glifo) center / contain no-repeat; mask: var(--sm-glifo) center / contain no-repeat; }
[data-marca="asi"] { --sm-glifo: var(--sm-glifo-reloj); }
[data-marca="autorizada"] { --sm-glifo: var(--sm-glifo-sello); }
/* the two acts stay within reach while the grid scrolls (above the phone's tab bar), resting at the form's end */
.sm-plantilla-actos { position: sticky; bottom: calc(var(--abajo, env(safe-area-inset-bottom, 0px)) + var(--alto-pestanas) + 12px); z-index: 2; display: flex; flex-wrap: wrap; gap: 10px; }
.eq-app:not(:has(> .eq-pestanas)) .sm-plantilla-actos { bottom: calc(var(--abajo, env(safe-area-inset-bottom, 0px)) + 12px); }
.sm-plantilla-actos > .mo-acto { flex: 1 1 160px; min-height: 56px; box-shadow: 0 var(--canto, 3px) 0 var(--ciruela), var(--sombra-flota); }
.sm-plantilla-actos > .mo-acto.suave { background: var(--hoja); box-shadow: inset 0 0 0 2px var(--mo-acto), var(--sombra-flota); }

/* the coverage card on the plantilla's unit: the morning in comida's sun, the afternoon from tarde's terracotta to cena's dusk */
.sm-luz[data-luz="am"] { background: var(--sm-luz-comida); }
.sm-luz[data-luz="pm"] { background: linear-gradient(90deg, var(--sm-luz-tarde), var(--sm-luz-cena)); }

/* ---------------- a past week, real vs planned (D38-9): the week's frame, each day what the clock said ---------------- */
.sm-real { position: relative; display: grid; place-items: center; align-content: center; gap: 1px; min-height: var(--sm-celda-alto); padding: 4px 3px;
  border-radius: 12px; background: var(--sm-papel); color: var(--sm-tinta); box-shadow: inset 0 0 0 1px var(--sm-borde); font-weight: 700; line-height: 1.05;
  text-align: center; font-variant-numeric: tabular-nums; }
.sm-real .sm-celda-h { font-size: 16px; white-space: normal; }
.sm-real .sm-celda-tag { color: inherit; font-weight: 600; white-space: normal; }
.sm-real .sm-bien { width: 24px; height: 24px; stroke-width: 3; }
.sm-real[data-estado="a_tiempo"] { background: var(--sm-listo-claro); box-shadow: none; color: var(--sm-listo-tinta); }
.sm-real:is([data-estado="retardo"], [data-estado="salida_temprana"]) { background: var(--sm-revisar-luz); box-shadow: inset 0 0 0 1px var(--sm-revisar-linea); color: var(--sm-revisar-tinta); }
.sm-real[data-estado="falta"] { background: var(--sm-revisar-claro); box-shadow: inset 0 0 0 2px var(--sm-revisar); color: var(--sm-revisar-tinta); }
.sm-real[data-estado="sin_marca"] { background: transparent; box-shadow: none; outline: 2px dashed var(--sm-sin-patron); outline-offset: -2px; color: var(--sm-apoyo); font-weight: 600; }
.sm-real[data-estado="descanso"] { background: transparent; color: var(--sm-apoyo); font-weight: 600; }
.sm-real[data-estado="ausencia"] { background: repeating-linear-gradient(135deg, transparent 0 7px, var(--sm-ausencia-raya) 7px 9px), var(--sm-luz-ausencia);
  box-shadow: inset 0 0 0 1px var(--sm-ausencia-borde); color: var(--sm-ausencia-tinta); }
.sm-real[data-estado="ausencia"] .sm-celda-h { -webkit-hyphens: manual; hyphens: manual; letter-spacing: -.01em; }
.sm-real[data-estado="extra"] { box-shadow: inset 0 0 0 1.5px var(--sm-suya); color: var(--sm-suya); }
.sm-luz[data-luz="real-a_tiempo"] { background: var(--sm-listo-claro); box-shadow: inset 0 0 0 1px var(--sm-listo); }
.sm-luz:is([data-luz="real-retardo"], [data-luz="real-salida_temprana"]) { background: var(--sm-revisar-luz); box-shadow: inset 0 0 0 1px var(--sm-revisar-linea); }
.sm-luz[data-luz="real-falta"] { background: var(--sm-revisar-claro); box-shadow: inset 0 0 0 2px var(--sm-revisar); }
.sm-luz[data-luz="real-sin_marca"] { background: transparent; box-shadow: none; outline: 2px dashed var(--sm-sin-patron); outline-offset: -2px; }
.sm-luz[data-luz="real-extra"] { background: var(--sm-papel); box-shadow: inset 0 0 0 1.5px var(--sm-suya); }
.sm-real-totales { display: grid; gap: 6px; min-width: 0; }
.sm-real-totales > .sm-linea { margin: 0; }
.sm-cifras[data-n="4"] { --sm-cifras-n: 4; }
/* four counts on a phone: two by two, so «salidas tempranas» is never squeezed */
@media (max-width: 599px) {
  .sm-cifras[data-n="4"] { --sm-cifras-n: 2; }
  .sm-cifras[data-n="4"] > li:nth-child(3) { border-left: 0; }
  .sm-cifras[data-n="4"] > li:nth-child(n + 3) { border-top: 1px solid var(--sm-borde); }
  .sm-real-totales .sm-cifra { min-height: 0; }
}
.sm-real-totales .sm-cifra:is([data-n="retardos"], [data-n="salidas_tempranas"], [data-n="faltas"]) b { color: var(--sm-revisar-tinta); }

/* ---------------- the six sucursales (D38-4): Operaciones' desk, one table at 1440, a card per sucursal under 900 px ---------------- */
.sm-consolidado { display: grid; gap: 10px; min-width: 0; }
/* a desk column narrower than the table: the table scrolls inside its frame, never the page */
.sm-consolidado-marco { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
.sm-consolidado-tabla { width: 100%; border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--sm-papel); border: 1px solid var(--sm-borde);
  border-radius: var(--sm-radio); color: var(--sm-tinta); font: 500 var(--t-cuerpo)/1.3 var(--f-texto); }
.sm-consolidado-tabla caption { caption-side: top; padding: 0 2px 10px; text-align: left; font: 500 var(--sm-t-cuenta)/1.1 var(--f-display); color: var(--sm-titulo); }
.sm-consolidado-tabla :is(th, td) { padding: 8px 5px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--sm-borde); }
.sm-consolidado-tabla :is(th, td):first-child { padding-left: 8px; }
.sm-consolidado-tabla :is(th, td):last-child { padding-right: 8px; }
/* the app's desk column is 760 px: at a desk the chevron and the stamp's glyph step out (the cards keep them) and the coverage note may wrap */
@media (min-width: 900px) {
  .sm-consolidado-ir .ico, .sm-sello-sucursal .ico { display: none; }
  .sm-sello-sucursal { padding: 0 7px; font-weight: 600; letter-spacing: -.005em; }
}
.sm-consolidado-tabla td[data-num] { white-space: nowrap; }
.sm-consolidado-tabla thead th { background: var(--papel); font-size: 16px; font-weight: 600; line-height: 1.2; color: var(--sm-apoyo); vertical-align: bottom; }
.sm-consolidado-tabla thead th small { display: block; font-size: 16px; font-weight: 600; }
.sm-consolidado-tabla [data-num] { text-align: right; font-variant-numeric: tabular-nums; }
.sm-consolidado-tabla tbody tr:last-child > * { border-bottom: 0; }
.sm-consolidado-tabla tfoot :is(th, td) { border-top: 2px solid var(--sm-borde); border-bottom: 0; background: var(--papel); font-weight: 700; }
.sm-consolidado-tabla b { font-weight: 700; }
.sm-consolidado-tabla b[data-cero] { font-weight: 600; color: var(--sm-apoyo); }
.sm-consolidado-tabla b[data-atencion] { color: var(--sm-revisar-tinta); }
.sm-consolidado-ir { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; color: var(--vino); text-decoration: none; }
.sm-consolidado-ir .ico { width: 18px; height: 18px; flex: none; }
.sm-consolidado-ir:focus-visible { outline: 3px solid var(--oro); outline-offset: 2px; border-radius: 8px; }
.sm-cubierto { display: grid; gap: 0; }
.sm-cubierto b { font: 500 var(--sm-t-cuenta)/1.05 var(--f-display); color: var(--sm-titulo); font-variant-numeric: tabular-nums; }
.sm-cubierto small { font-size: 16px; font-weight: 600; line-height: 1.2; color: var(--sm-apoyo); }
.sm-cubierto small[data-falta] { font-weight: 700; color: var(--sm-revisar-tinta); }
/* a sucursal's state as a small stamp: published green, «con cambios» terracotta, a draft in ink, «sin escribir» dashed */
.sm-sello-sucursal { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: var(--r-pastilla); white-space: nowrap;
  background: transparent; color: var(--sm-apoyo); box-shadow: inset 0 0 0 1.5px var(--sm-borde); font-weight: 700; }
.sm-sello-sucursal .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.sm-sello-sucursal[data-estado="publicado"] { background: var(--sm-listo-claro); color: var(--sm-listo-tinta); box-shadow: none; }
.sm-sello-sucursal[data-estado="con_cambios"] { background: var(--sm-revisar-luz); color: var(--sm-revisar-tinta); box-shadow: inset 0 0 0 1.5px var(--sm-revisar-linea); }
.sm-sello-sucursal[data-estado="borrador"] { color: var(--sm-suya); box-shadow: inset 0 0 0 1.5px var(--sm-suya); }
.sm-sello-sucursal[data-estado="sin_escribir"] { box-shadow: none; outline: 2px dashed var(--sm-borde); outline-offset: -2px; }
.sm-total-estado { font-weight: 700; color: var(--sm-apoyo); }
@media (max-width: 899px) {
  .sm-consolidado-marco { overflow: visible; }
  .sm-consolidado-tabla, .sm-consolidado-tabla :is(tbody, tfoot, tr, th, td) { display: block; }
  .sm-consolidado-tabla :is(th, td):is(:first-child, :last-child) { padding-inline: 0; }
  .sm-consolidado-tabla { overflow: visible; background: transparent; border: 0; border-radius: 0; }
  .sm-consolidado-tabla caption { display: block; }
  /* the heads stay for a screen reader; every value carries its column's name */
  .sm-consolidado-tabla thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .sm-consolidado-tabla tbody { display: grid; gap: 10px; }
  .sm-consolidado-tabla tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; padding: 8px 14px 12px; background: var(--sm-papel);
    border: 1px solid var(--sm-borde); border-radius: var(--sm-radio); }
  .sm-consolidado-tabla tr > * { padding: 4px 0; border: 0; }
  .sm-consolidado-tabla tr > :is(th[data-col="sucursal"], td[data-col="estado"], td[data-col="plantilla"]) { grid-column: 1 / -1; }
  .sm-consolidado-tabla tr > td[data-col="estado"] { padding-top: 0; }
  .sm-consolidado-ir { font: 500 var(--sm-t-cuenta)/1.1 var(--f-display); }
  .sm-consolidado-tabla td::before { content: attr(data-k); display: block; font-size: 16px; font-weight: 600; color: var(--sm-apoyo); }
  .sm-consolidado-tabla td[data-col="estado"]::before { content: none; }
  .sm-consolidado-tabla td[data-vacia] { display: none; }
  .sm-consolidado-tabla [data-num] { text-align: left; }
  .sm-consolidado-tabla tfoot { margin-top: 10px; }
  .sm-consolidado-tabla tfoot tr { background: var(--papel); }
  .sm-consolidado-tabla tfoot :is(th, td) { border-top: 0; background: transparent; }
}

@media (min-width: 900px) {
  .sm-pincel, .sm-plantilla-actos { bottom: 16px; }
  .sm-plantilla-actos > .mo-acto { flex: 0 0 auto; }
  .sm-tabla-dias .sm-col-franja { width: 112px; }
  .sm-tabla .sm-franja { padding-left: 4px; }
  /* a computer opens every área: the summary is its heading (browsers without ::details-content keep the fold) */
  .sm-area > summary { min-height: 0; padding: 18px 2px 4px; border-top: 0; pointer-events: none; cursor: default; }
  .sm-area > summary .ico { display: none; }
  @supports selector(::details-content) {
    .sm-area::details-content { content-visibility: visible; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .sm-pincel-turno, .sm-area > summary .ico { transition: none; }
  .sm-pincel-turno:active, .sm-pincel-turno:has(> input:checked) { transform: none; }
}
