/* Autorregistro de frecuencia: una rejilla de palotes por conducta (7 días × 3 franjas). Tinta = ejemplo; azul = lo de la persona. */
.rg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 44px; }
.rg > section, .rg-lienzo { min-width: 0; }
.rg-cab { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; margin-bottom: 14px; }
.rg-cab h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.1; text-wrap: balance; }
.rg-cab h2 em { color: var(--azul); }
.rg-nota { margin: 0; font-size: 13.5px; color: var(--nota); }
.rg-chip { min-height: 42px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--linea); background: #fff; font-size: 15px; cursor: pointer; }
.rg-icono { width: 42px; padding: 0; font-size: 18px; }
.rg-texto { margin: 14px 0 0; min-height: 2.8em; font-family: var(--display); font-style: italic; font-size: clamp(19px, 2.3vw, 24px); color: var(--azul); max-width: 56ch; }
.rg-mio { padding-top: 34px; border-top: 1px solid var(--linea); display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.rg-ej-nombre, .rg-fin-nombre { margin: 0 0 12px; font-family: var(--display); font-style: italic; font-size: 21px; color: var(--tinta); }
.rg-fin-nombre { color: var(--azul); }

/* ---------- la rejilla ---------- */
.rg-svg { width: 100%; height: auto; display: block; overflow: visible; }
.rg-celda { fill: #fff; stroke: var(--linea); stroke-width: 1; }
.rg-marco { fill: none; stroke: var(--tinta); stroke-width: 1.2; }
.rg-dia { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; fill: var(--nota); }
.rg-franja { font-family: var(--display); font-style: italic; font-size: 17px; fill: var(--tinta); }
.rg-svg.estrecho .rg-franja { font-size: 15px; }
.rg-svg.estrecho .rg-dia { font-size: 11px; letter-spacing: .06em; }
.rg-palote { stroke: var(--azul); stroke-width: 2.4; stroke-linecap: round; transition: opacity .25s var(--ease); }
.rg-svg.modelo .rg-palote { stroke: var(--tinta); }
.rg-palote.pre { opacity: 0; }
.rg-int { fill: #fff; stroke: var(--azul); stroke-width: 1.3; }
.rg-int.vacio { stroke: #8A969E; stroke-dasharray: 2 2; stroke-width: 1; }
.rg-int-t { font-family: var(--mono); font-size: 11px; fill: var(--azul); }
.rg-aldia { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; fill: var(--nota); }
.rg-aldia.n.cero { fill: #75828B; }
.rg-aldia.n { font-size: 12px; letter-spacing: 0; fill: var(--cuerpo); }
.rg-pista { font-family: var(--display); font-style: italic; font-size: 19px; fill: var(--azul); pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; }
.rg-renglon { stroke: #C9D0D4; stroke-width: 1; }
.rg-svg.a4 .rg-franja { font-size: 14px; }
.rg-svg.a4 .rg-dia, .rg-svg.a4 .rg-aldia { font-size: 10px; }
.rg-svg.a4 .rg-palote { stroke-width: 2; }

/* interacción: tocar suma; mantener pulsado quita */
.rg-pad { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.rg-pad .rg-casilla { cursor: pointer; outline: none; }
.rg-pad .rg-casilla:hover .rg-celda { fill: var(--azul-claro); }
.rg-pad .rg-casilla:focus-visible .rg-celda, .rg-casilla.sel .rg-celda { stroke: var(--azul); stroke-width: 2.2; stroke-dasharray: 5 4; fill: var(--azul-claro); }

/* pasos */
.rg-pasos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 28px; }
.rg-pasos li { display: flex; gap: 12px; align-items: flex-start; }
.rg-pasos b { display: block; font-family: var(--display); font-weight: 400; font-size: 19px; line-height: 1.25; }
.rg-pasos span:not(.rg-num) { display: block; font-size: 14px; color: var(--nota); margin-top: 2px; }
.rg-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tinta); color: var(--papel); font-family: var(--mono); font-size: 13px; flex: none; }

/* cada conducta */
.rg-conductas { display: grid; gap: 30px; }
.rg-cond { display: grid; gap: 10px; min-width: 0; }
.rg-cond-cab { display: flex; align-items: flex-end; gap: 10px; }
.rg-nombre { flex: 1; min-width: 0; display: grid; gap: 2px; }
.rg-nombre textarea { display: block; width: 100%; resize: none; overflow: hidden; height: 46px; line-height: 1.3; font-family: var(--display); font-style: italic; font-size: 22px; color: var(--azul); padding: 6px 0; outline: none; border: 0; border-bottom: 1.5px solid var(--tinta); background: transparent; }
.rg-nombre textarea:focus { border-bottom-color: var(--azul); }
.rg-nombre input { width: 100%; border: 0; border-bottom: 1.5px solid var(--tinta); background: transparent; font-family: var(--display); font-style: italic; font-size: 22px; color: var(--azul); padding: 6px 0; outline: none; }
.rg-nombre input:focus { border-bottom-color: var(--azul); }
.rg-quitar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--papel-2); font-size: 18px; cursor: pointer; flex: none; }
.rg-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 12px 16px; background: #fff; border: 1.5px solid var(--azul); border-radius: 14px; }
.rg-barra-a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.rg-cuando { font-family: var(--display); font-size: 19px; }
.rg-cuando em { color: var(--azul); }
.rg-mm { display: flex; align-items: center; gap: 6px; font-size: 14.5px; color: var(--cuerpo); }
.rg-mm span { min-width: 6ch; text-align: center; }
.rg-mm b { font-family: var(--mono); font-weight: 500; color: var(--tinta); }
.rg-mm button { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--papel-2); font-size: 20px; cursor: pointer; }
.rg-mm button:disabled { opacity: .4; cursor: default; }
.rg-lab { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--nota); margin-bottom: 6px; }
.rg-lab small { margin-left: 6px; text-transform: none; letter-spacing: 0; font-family: var(--texto); font-size: 12.5px; }
.rg-int-b [role=radiogroup] { display: flex; flex-wrap: wrap; gap: 4px; }
.rg-int-b button { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--linea); background: #fff; font-family: var(--mono); font-size: 13px; cursor: pointer; }
.rg-int-b button[aria-checked="true"] { background: var(--azul); border-color: var(--azul); color: #fff; }
.rg-aviso { margin: -4px 0 0; min-height: 1.4em; font-family: var(--display); font-style: italic; font-size: 16px; color: var(--azul); opacity: 0; transition: opacity .3s var(--ease); }
.rg-aviso.on { opacity: 1; }
.rg-otra { justify-self: start; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px dashed var(--azul); background: var(--azul-claro); color: var(--azul); font-size: 15px; cursor: pointer; }

.rg-cautela { margin: 0; padding: 10px 14px; background: #FBF0DD; border-radius: 10px; font-size: 14.5px; color: #6B4A12; max-width: 72ch; }
.rg-hecho { justify-self: start; min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--tinta); color: var(--papel); font-size: 16px; cursor: pointer; }
.rg-final { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.rg-final-h { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(30px, 4vw, 44px); line-height: 1.05; }
.rg-final-h em { color: var(--azul); }
.rg-casa { display: grid; gap: 2px; padding: 14px 18px; background: var(--azul-claro); border-radius: 12px; max-width: 760px; font-size: 14.5px; color: var(--cuerpo); }
.rg-casa b { font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--tinta); }

@media (max-width: 760px) {
  .rg-pasos { grid-template-columns: 1fr; }
  .rg-nombre textarea { height: 70px; font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .rg-palote { transition: none !important; }
}
.rg-acc #rg-editar { background: var(--papel-2); color: var(--tinta); }
