/* Herramientas (carril F6): Modo parto (pt-), Patadas (pk-), Plan de parto (pp-) y Permisos (pm-), con piezas comunes
   (hr-). Solo tokens de base.css: claro y Noche salen solos. Móvil primero, objetivos ≥44 px, números tabulares. */

/* =========================================================================================== Común */
.hr-lead { font-size: 15px; line-height: 1.5; color: var(--ink-2); margin: -6px 0 16px; max-width: 62ch; }
.hr-p { font-size: 15px; line-height: 1.5; color: var(--ink); }
.hr-p + .hr-p { margin-top: 10px; }
.hr-fine { font-size: 13px; line-height: 1.45; color: var(--ink-2); font-weight: 600; margin-top: 10px; }
.hr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.hr-actions .btn { flex: 0 1 auto; }
.hr-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; padding: 0 8px 0 0; border-radius: 12px; color: var(--sage-ink); font-size: 14px; font-weight: 800; text-decoration: none; text-align: left; }
.hr-link > span { flex: 1; min-width: 0; }
.hr-link:hover > span { text-decoration: underline; text-underline-offset: 3px; }
.hr-offline { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 14px; border-radius: 14px; background: var(--now-bg); color: var(--now-ink); font-size: 14px; font-weight: 700; line-height: 1.4; }
.hr-offline .ico { flex: none; margin-top: 1px; }
.hr-source { margin: 22px 0 8px; font-size: 13px; color: var(--ink-2); font-weight: 600; line-height: 1.6; }
.hr-source ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hr-src-link { display: inline-flex; align-items: center; gap: 3px; min-height: 44px; color: var(--sage-ink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.hr-src-link .ico { display: inline-block; }

/* Avisos con icono (Plan de parto, Permisos) */
.hr-info, .hr-callout { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; padding: 14px 16px; margin: 14px 0; border-radius: var(--radius); background: var(--sage-wash); color: var(--ink); font-size: 15px; line-height: 1.5; }
.hr-info-ico, .hr-callout-ico { color: var(--sage-ink); margin-top: 2px; }
.hr-callout { background: var(--now-bg); }
.hr-callout-ico { color: var(--now-ink); }
.hr-callout .hr-actions { margin-top: 10px; }

/* Nota de contexto (Patadas: según la semana) */
.hr-note { margin: 22px 0 0; }
.hr-note p { font-size: 15px; line-height: 1.55; color: var(--ink); }
.hr-note p + p { margin-top: 8px; }
.hr-note.is-now { background: var(--sage-wash); border-color: transparent; }

/* «Si se mueve menos…»: la llamada de atención de Patadas, serena (ámbar, como los criterios del SOS) */
.hr-warn { margin-top: 24px; padding: 16px; border-radius: var(--radius); background: var(--now-bg); color: var(--ink); }
.hr-warn h2 { font-size: 17px; font-weight: 800; color: var(--now-ink); margin-bottom: 6px; letter-spacing: -.01em; }
.hr-warn p { font-size: 15px; line-height: 1.5; }
.hr-warn .hr-fine { color: var(--ink-2); }

/* Botón redondo enorme (Modo parto y Patadas) */
.hr-big {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: clamp(200px, 62vw, 248px); aspect-ratio: 1; margin: 0 auto; border-radius: 50%;
  background: var(--sage-ink); color: var(--on-sage); box-shadow: 0 14px 34px color-mix(in srgb, var(--sage-ink) 30%, transparent), inset 0 -6px 0 rgba(0, 0, 0, .08);
  transition: transform .16s var(--ease), background .3s var(--ease), box-shadow .3s; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}
.hr-big::before { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--sage-ink) 28%, transparent); opacity: 0; pointer-events: none; }
.hr-big:active { transform: scale(.965); }
.hr-big:focus-visible { outline-offset: 6px; border-radius: 50%; }
.hr-big-label { font-size: 34px; font-weight: 900; letter-spacing: -.02em; line-height: 1.05; }
.hr-big-sub { font-size: 14px; font-weight: 700; opacity: .9; }
.hr-big-timer { font-size: 44px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.hr-big.is-on { background: var(--peach-ink); color: var(--surface); box-shadow: 0 14px 34px color-mix(in srgb, var(--peach-ink) 30%, transparent), inset 0 -6px 0 rgba(0, 0, 0, .08); }
.hr-big.is-on::before { border-color: color-mix(in srgb, var(--peach-ink) 35%, transparent); animation: hrBreathe 4s ease-in-out infinite; }
html[data-theme="noche"] .hr-big.is-on { color: var(--bg); }
@keyframes hrBreathe { 0%, 100% { opacity: .15; transform: scale(.97); } 50% { opacity: .9; transform: scale(1.04); } }
.hr-big.flash-start, .hr-big.flash-end, .hr-big.flash-tap { animation: hrPop .36s var(--spring); }
@keyframes hrPop { 0% { transform: scale(.94); } 100% { transform: scale(1); } }

/* =========================================================================================== Modo parto */
html[data-route="parto"] .view { max-width: calc(1040px + 2 * var(--gutter)); padding-top: calc(4px + var(--safe-t)); }
html[data-bare] { --toast-bottom: calc(16px + var(--safe-b)); }
html[data-bare] .toast { left: 50%; }
.pt { padding-bottom: 8px; }
.pt-head { margin-bottom: 14px; }
.pt-bar { display: flex; align-items: center; gap: 4px; min-height: 52px; margin: 0 -6px 4px; }
.pt-bar-gap { flex: 1; }
.pt-exit { padding: 0 14px 0 10px; }
.pt-theme { color: var(--ink-2); }
.pt-title { font-size: 28px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.pt-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.pt-sub > span { display: inline-flex; align-items: center; gap: 6px; }
.pt-sub.is-off { color: var(--now-ink); }
.pt-sub .ico { flex: none; }
.pt-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage-strong); box-shadow: 0 0 0 0 color-mix(in srgb, var(--sage-strong) 50%, transparent); animation: ptLive 2.4s ease-out infinite; }
@keyframes ptLive { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sage-strong) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.pt-lock[hidden] { display: none !important; }

.pt-grid { display: flex; flex-direction: column; gap: 18px; }
.pt-main, .pt-side { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.pt-timer { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 2px; }
.pt-big { margin-bottom: 18px; }
.pt-lines { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 420px; }
.pt-line { font-size: 15px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pt-last { font-size: 18px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pt-last strong { font-weight: 900; }
.pt-who { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ink-2); margin-top: 2px; }
.pt-discard { margin-top: 2px; color: var(--ink-2); }
.pt-long { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; margin-top: 6px; padding: 8px 8px 8px 14px; border-radius: 14px; background: var(--now-bg); color: var(--now-ink); font-size: 14px; font-weight: 800; }
.pt-hour { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; padding: 10px 16px; border-radius: 16px; background: var(--sunk); font-variant-numeric: tabular-nums; }
.pt-hour-k { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.pt-hour-v { font-size: 16px; font-weight: 800; color: var(--ink); }

/* Antes de la semana 37: la salvedad va primero (ámbar); con contracciones que se repiten, «llamad ya» (tono SOS) */
.pt-pre37 { padding: 16px; border-radius: var(--radius); background: var(--now-bg); color: var(--ink); }
.pt-pre-title { font-size: 17px; line-height: 1.35; font-weight: 800; color: var(--now-ink); letter-spacing: -.01em; }
.pt-pre37.is-go { background: var(--sage-wash); }
.pt-pre37.is-go .pt-pre-title { font-size: 19px; color: var(--sage-ink); }
.pt-pre-list { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 8px; }
.pt-pre-list li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.4; }
.pt-pre-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--now-dot); }
.pt-pre-dest { margin-top: 12px; font-size: 15px; line-height: 1.4; }
.pt-pre-dest strong { font-weight: 800; }
.pt-pre-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pt-pre-actions .btn { flex: 1 1 140px; font-variant-numeric: tabular-nums; }
.pt-pre37.is-call .pt-pre-title { color: var(--now-ink); }
.pt-pre-lead { margin-top: 10px; font-size: 15px; font-weight: 800; color: var(--ink); }
.pt-pre-call { margin-top: 10px; font-size: 14px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.pt-pre-foot { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.pt-pre-foot .hr-link { margin-top: 0; }
.pt-pre-src { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }

/* Se cumple el criterio: la única llamada de atención, serena */
.pt-go { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; padding: 16px; border-radius: var(--radius); background: var(--sage-soft); color: var(--ink); animation: ptGo .5s var(--ease) both; }
.pt-go-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--sage-ink); }
.pt-go-text h2 { font-size: 18px; line-height: 1.3; font-weight: 800; color: var(--sage-ink); letter-spacing: -.01em; }
.pt-go-text p { font-size: 15px; line-height: 1.45; margin-top: 4px; }
.pt-go-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 8px; }
.pt-go-actions .btn { flex: 1 1 0; min-height: 52px; }
@keyframes ptGo { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Accesos a un toque (secundarios: el botón grande manda) */
.pt-acc-wrap { display: flex; flex-direction: column; gap: 10px; }
.pt-acc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pt-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; min-height: 92px; padding: 12px 6px 10px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--ink); text-align: center; text-decoration: none; transition: transform .14s var(--ease), border-color .2s; }
.pt-tile:hover { border-color: var(--line-2); }
.pt-tile:active { transform: scale(.97); }
.pt-tile-ico { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--sage-soft); color: var(--sage-ink); }
.pt-acc .pt-tile:first-child .pt-tile-ico { background: var(--peach-soft); color: var(--peach-ink); }
.pt-tile-label { font-size: 14px; font-weight: 800; line-height: 1.2; }
.pt-tile-sub { font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pt-links { display: flex; gap: 8px; }
.pt-link { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 12px; border-radius: 14px; background: var(--sunk); color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none; }
.pt-link .ico { flex: none; color: var(--sage-ink); }
.pt-link-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pt-link-sub { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pt-link:hover { box-shadow: inset 0 0 0 1.5px var(--line-2); }
/* Si algo va mal: el hospital de urgencias con ruta (discreto, sin alarma) */
.pt-paz { padding: 12px 14px; border-radius: 16px; border: 1.5px dashed var(--line-2); }
.pt-paz-lead { font-size: 14px; font-weight: 700; color: var(--ink-2); line-height: 1.4; }
.pt-paz-name { margin-top: 2px; font-size: 15px; font-weight: 800; color: var(--ink); }
.pt-paz-min { font-weight: 600; color: var(--ink-2); }
.pt-paz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.pt-paz-actions .btn { font-variant-numeric: tabular-nums; }
.pt-tbc { margin-left: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; }
/* Teléfonos: el número entero en una línea; «a confirmar», si lo es, debajo */
.pt-num { display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: left; }
.pt-num-n { white-space: nowrap; }
.pt-num .pt-tbc { margin-left: 0; }

   WhatsApp con su icono */

/* Cuándo ir al hospital */
.pt-crit.is-met { border-color: var(--sage-strong); }
.pt-crit-lead { font-size: 15px; line-height: 1.5; color: var(--ink); }
.pt-crit-list { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.pt-crit-item { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.pt-crit-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-2); color: var(--on-sage); margin-top: 1px; }
.pt-crit-item.ok .pt-crit-mark { background: var(--sage-ink); border-color: var(--sage-ink); }
.pt-crit-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pt-crit-label { font-size: 15px; font-weight: 800; color: var(--ink); }
.pt-crit-value { font-size: 14px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pt-crit-item.ok .pt-crit-value { color: var(--sage-ink); }
.pt-crit-text .bar { margin-top: 4px; max-width: 280px; }
.pt-crit-note { margin-top: 12px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.pt-crit-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.pt-crit-more-t { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.pt-crit-more ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pt-crit-more li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.4; }
.pt-crit-more li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--now-dot); }
.pt-crit-host { margin-left: 6px; font-weight: 500; }
.pt-crit-src { margin-top: 12px; font-size: 13px; color: var(--ink-2); font-weight: 600; line-height: 1.45; }

/* Las últimas */
.pt-list .sec-head { margin-top: 4px; }
.pt-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pt-table th { padding: 6px 6px 8px; font-size: 13px; font-weight: 800; color: var(--ink-2); text-align: left; border-bottom: 1px solid var(--line); }
.pt-table td { padding: 11px 6px; font-size: 15px; font-weight: 700; color: var(--ink); border-bottom: 1px solid var(--line); vertical-align: middle; }
.pt-table th:first-child, .pt-table td:first-child { padding-left: 2px; }
.pt-table td.pt-t-time { font-weight: 800; white-space: nowrap; }
.pt-table td.pt-t-who, .pt-table th:last-child { width: 36px; text-align: right; padding-right: 2px; }
.pt-table tr.is-live td { color: var(--peach-ink); }
.pt-table tbody tr:last-child td { border-bottom: 0; }
.pt-rest { margin-top: 4px; }
.pt-list-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.pt-clear { color: var(--ink-2); }

@media (min-width: 900px) {
  .pt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .pt-timer { padding-top: 24px; }
  .hr-big.pt-big { width: 280px; }
}

/* =========================================================================================== Patadas */
.pk-counter { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 0 4px; }
.pk-big.is-off .hr-big-label { font-size: 72px; line-height: 1; }
.pk-big.is-on .hr-big-label { font-size: 22px; opacity: .92; }
.pk-count { font-size: 64px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pk-count.bump { animation: pkBump .24s var(--spring); }
@keyframes pkBump { 0% { transform: scale(1.22); } 100% { transform: scale(1); } }
.pk-elapsed { margin-top: 16px; font-size: 16px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pk-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; }
.pk-actions .btn-text { color: var(--ink-2); }
.pk-summary { display: flex; flex-direction: column; gap: 4px; margin-top: 22px; padding: 12px 16px; border-radius: 16px; background: var(--sunk); font-size: 15px; color: var(--ink); line-height: 1.45; font-variant-numeric: tabular-nums; }
.pk-summary strong { font-weight: 800; }
.pk-list { list-style: none; display: flex; flex-direction: column; }
.pk-row { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 4px 0 4px 2px; border-bottom: 1px solid var(--line); }
.pk-list > .pk-row:last-child { border-bottom: 0; }
.pk-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pk-row-what { font-size: 16px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.pk-row-when { font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pk-row-del { color: var(--ink-3); }

/* =========================================================================================== Plan de parto */
.pp-progress { display: flex; flex-direction: column; gap: 10px; }
.pp-progress-big { font-size: 16px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pp-aviso { margin-top: 0; }
.pp-updated { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.pp-ask { margin-top: 12px; }
.pp-sections .fold + .fold { margin-top: 10px; }
.pp-sec > .fold-head .fold-sum { color: var(--sage-ink); }
.pp-sec.has > .fold-head .fold-title::after { content: ""; display: inline-block; width: 8px; height: 8px; margin-left: 8px; border-radius: 50%; background: var(--sage-strong); vertical-align: 2px; }
.pp-help { margin: 0 8px 6px; font-size: 14px; line-height: 1.45; color: var(--ink-2); font-weight: 600; }
.pp-items { list-style: none; display: flex; flex-direction: column; }
.pp-item { display: flex; align-items: flex-start; gap: 2px; padding-right: 8px; }
.pp-item .check { margin-top: -2px; }
.pp-item-text { flex: 1; min-width: 0; padding: 12px 0 10px; font-size: 15px; line-height: 1.45; color: var(--ink); cursor: pointer; -webkit-user-select: none; user-select: none; }
.pp-note { margin: 10px 8px 4px; }
.pp-note .field-label { font-size: 13px; color: var(--ink-2); }
.pp-print-only { display: none; }

/* Documento (pantalla #planparto/imprimir y papel) */
.pp-doc-actions { margin: 0 0 18px; }
.pp-doc { max-width: 680px; padding: 28px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); color: var(--ink); }
.pp-doc-head { padding-bottom: 16px; margin-bottom: 8px; border-bottom: 2px solid var(--line-2); }
.pp-doc-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--sage-ink); }
.pp-doc-names { margin-top: 4px; font-size: 17px; font-weight: 800; }
.pp-doc-meta { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-top: 10px; }
.pp-doc-meta dt { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.pp-doc-meta dd { font-size: 15px; font-weight: 700; }
.pp-doc-sec { padding: 14px 0 4px; break-inside: avoid; page-break-inside: avoid; }
.pp-doc-sec h2 { font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.pp-doc-sec ul { list-style: none; display: flex; flex-direction: column; gap: 5px; }
.pp-doc-sec li { position: relative; padding-left: 22px; font-size: 15px; line-height: 1.45; }
.pp-doc-sec li::before { content: "✓"; position: absolute; left: 2px; top: 0; font-weight: 900; color: var(--sage-ink); }
.pp-doc-note { margin-top: 6px; font-size: 15px; line-height: 1.5; white-space: pre-line; }
.pp-doc-empty { padding: 18px 0; color: var(--ink-2); }
.pp-doc-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.pp-doc-foot p + p { margin-top: 4px; }
@media (max-width: 480px) { .pp-doc { padding: 20px 16px; } }

@media print {
  html[data-route="planparto"] .pp-screen, html[data-route="planparto"] .pp-noprint, html[data-route="planparto"] .sheet-layer { display: none !important; }
  html[data-route="planparto"] .pp-print-only { display: block !important; }
  html[data-route="planparto"] .view { max-width: none; padding: 0; animation: none; }
  .pp-doc { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; color: #000; font-size: 11pt; }
  .pp-doc-title { color: #000; font-size: 20pt; }
  .pp-doc-head { border-bottom-color: #999; }
  .pp-doc-meta dt, .pp-doc-foot { color: #444; }
  .pp-doc-sec li::before { color: #000; }
  .pp-doc-sec h2 { font-size: 13pt; }
  .pp-doc-sec li, .pp-doc-note, .pp-doc-meta dd { font-size: 11pt; }
}

/* =========================================================================================== Permisos */
.pm-c-salvia { --pc: var(--av-salvia-ink); --pc-bg: var(--av-salvia-bg); }
.pm-c-melocoton { --pc: var(--av-melocoton-ink); --pc-bg: var(--av-melocoton-bg); }
.pm-c-arena { --pc: var(--av-arena-ink); --pc-bg: var(--av-arena-bg); }
.pm-c-cielo { --pc: var(--av-cielo-ink); --pc-bg: var(--av-cielo-bg); }
.pm-c-lavanda { --pc: var(--av-lavanda-ink); --pc-bg: var(--av-lavanda-bg); }

.pm-base { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; font-size: 14px; font-weight: 700; color: var(--ink-2); line-height: 1.45; }
.pm-base .ico { flex: none; margin-top: 1px; color: var(--sage-ink); }

.pm-summary { margin-bottom: 14px; }
.pm-summary-big { font-size: 20px; line-height: 1.3; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.pm-summary-sub { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--sage-ink); }
.pm-summary-later { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); }

/* Línea de tiempo del primer año */
.pm-tl { margin: 0 0 16px; padding: 14px 14px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.pm-proposal .pm-tl { margin: 14px 0 4px; box-shadow: none; background: var(--bg); }
.pm-tl-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 13px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pm-tl-body { --who: 30px; }
.pm-tl-months { position: relative; height: 20px; margin-left: calc(var(--who) + 6px); }
.pm-tl-m { position: absolute; left: var(--l); top: 0; transform: translateX(-50%); font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.pm-tl-rows { position: relative; display: flex; flex-direction: column; gap: 8px; }
.pm-tl-grid { position: absolute; top: 0; bottom: 0; left: calc(var(--who) + 6px); right: 0; pointer-events: none; }
.pm-tl-tick { position: absolute; left: var(--l); top: -2px; bottom: -2px; width: 1px; background: var(--line); }
.pm-tl-row { display: flex; align-items: center; gap: 6px; }
.pm-tl-who { width: var(--who); flex: none; display: grid; place-items: center; color: var(--ink-2); }
.pm-tl-track { position: relative; flex: 1; height: 26px; border-radius: 8px; background: color-mix(in srgb, var(--sunk) 70%, transparent); }
.pm-tl-cov .pm-tl-track { height: 12px; border-radius: 6px; }
.pm-blk { position: absolute; top: 0; bottom: 0; left: var(--l); width: var(--w); min-width: 3px; border-radius: 6px; }
.pm-blk.t-obligatorio, .pm-sw.t-obligatorio, .pm-lg-sw.t-obligatorio { background: var(--pc); }
/* Flexibles: el color de la persona, más claro (≥3:1 contra el carril en los dos temas) */
.pm-blk.t-flexible, .pm-sw.t-flexible, .pm-lg-sw.t-flexible { background: color-mix(in srgb, var(--pc) 72%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--pc); }
.pm-blk.t-adicional, .pm-sw.t-adicional, .pm-lg-sw.t-adicional { background: repeating-linear-gradient(135deg, var(--pc) 0 2.5px, var(--pc-bg) 2.5px 6px); box-shadow: inset 0 0 0 1.5px var(--pc); }
.pm-blk.t-obligatorio + .pm-blk { box-shadow: inset 0 0 0 1.5px var(--pc), -1.5px 0 0 var(--surface); }
.pm-blk.t-cov, .pm-lg-sw.t-cov { background: color-mix(in srgb, var(--ink) 62%, var(--surface)); }
.pm-tl.is-ghost .pm-blk { opacity: .9; }
.pm-tl-legend { --pc: var(--ink-2); --pc-bg: var(--sunk); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pm-lg { display: inline-flex; align-items: center; gap: 6px; }
.pm-lg-sw { width: 16px; height: 12px; border-radius: 4px; flex: none; }
.pm-tl-out { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); line-height: 1.45; }
@media (max-width: 459.98px) { .pm-tl-m.odd { visibility: hidden; } }

/* Tarjeta de cada persona */
.pm-person { margin-top: 12px; }
.pm-person-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.pm-person-name { flex: 1; min-width: 0; }
.pm-person-name h2 { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }
.pm-person-name p { font-size: 14px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pm-rows { list-style: none; display: flex; flex-direction: column; margin: 4px -6px 0; }
.pm-rows > li + li { border-top: 1px solid var(--line); }
.pm-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 6px; border-radius: 14px; text-align: left; color: var(--ink); }
button.pm-row:hover { background: var(--sunk); }
.pm-sw { width: 14px; align-self: stretch; min-height: 34px; border-radius: 6px; flex: none; }
.pm-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-row-title { font-size: 16px; font-weight: 800; }
.pm-row-dates { font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pm-row-end { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.pm-row.is-fixed .pm-row-end { color: var(--ink-2); }
@media (max-width: 399.98px) { .pm-row-endtxt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.pm-msgs { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.pm-msgs:empty { display: none; }
.pm-err, .pm-aviso { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; font-weight: 700; line-height: 1.4; }
.pm-err { color: var(--late-ink); }
.pm-aviso { color: var(--ink-2); font-weight: 600; }
.pm-err .ico, .pm-aviso .ico { flex: none; margin-top: 2px; }
.pm-row-text .pm-err { margin-top: 4px; }

/* Hoja de un periodo */
.pm-step { display: flex; align-items: center; gap: 6px; }
.pm-step-btn { width: 48px; height: 48px; border-radius: 14px; background: var(--sunk); color: var(--sage-ink); }
.pm-step-btn:hover:not(:disabled) { background: var(--sage-soft); color: var(--sage-ink); }
.pm-step-val { flex: 1; min-width: 0; text-align: center; font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.pm-quicks { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 16px; }
.pm-quick { min-height: 44px; padding: 0 14px; border-radius: 999px; background: var(--sunk); color: var(--ink); font-size: 14px; font-weight: 700; }
.pm-quick:hover { box-shadow: inset 0 0 0 1.5px var(--line-2); }
.pm-quick[aria-pressed="true"] { background: var(--sage-soft); color: var(--sage-ink); box-shadow: inset 0 0 0 1.5px var(--sage-strong); font-weight: 800; }
.pm-outcome { padding: 12px 14px; border-radius: 14px; background: var(--sage-wash); }
.pm-result { font-size: 16px; font-weight: 800; color: var(--ink); }
.pm-notice { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.pm-notice:empty { display: none; }
.sheet .field-hint + .field, .sheet .field-hint + .pm-outcome { margin-top: 12px; }
.sheet .field + .pm-outcome { margin-top: 4px; }

/* Tareas del permiso */
.pm-tasks { margin-top: 16px; }
.pm-tg + .pm-tg { margin-top: 16px; }
.pm-tg { margin-top: 14px; }
.pm-tg-t { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.pm-tis { list-style: none; display: flex; flex-direction: column; }
.pm-ti { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pm-tis > .pm-ti:last-child { border-bottom: 0; }
.pm-ti-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-ti-title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.pm-ti-when { font-size: 14px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pm-notes { list-style: none; display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding: 14px; border-radius: 16px; background: var(--sunk); }
.pm-notes li { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.pm-notes .ico { flex: none; margin-top: 2px; color: var(--sage-ink); }

.pm-foot { margin-top: 18px; }
.pm-rules-list { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 0 6px 6px; }
.pm-rules-list li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.45; color: var(--ink); font-weight: 600; }
.pm-rules-list li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--sage-strong); }
