/* Generador de rótulos. Usa tokens de site.css y bloques de herramientas.css (.calc, .calc-cab, .tot-*). */
.rot-cuerpo { display: grid; }
@media (min-width: 960px) { .rot-cuerpo { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.rot-form { padding: clamp(18px, 3vw, 32px); display: grid; gap: 14px; align-content: start; }
.rot-form .calc-cab { margin-bottom: 2px; }

.rot-bloque { margin: 0; padding: 16px; border: 2px solid var(--borde); border-radius: var(--r); background: #fff; min-width: 0; transition: border-color .2s, box-shadow .2s; }
@media (min-width: 640px) { .rot-bloque { padding: 18px 20px 20px; } }
.rot-bloque:focus-within { border-color: #9ED7F0; box-shadow: 0 0 0 4px rgba(12, 157, 217, .1); }
.rot-bloque legend { display: flex; align-items: center; gap: 10px; padding: 0 6px; margin-left: -6px; font: italic 800 1.25rem/1 var(--f-titulo); text-transform: uppercase; color: var(--azul); }
.rot-bloque legend small { font: 600 var(--t-xs)/1 var(--f-texto); text-transform: none; color: var(--tx-3); }
.rot-num { display: grid; place-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--azul); color: #fff; font: 800 .8125rem/1 var(--f-texto); font-style: normal; }
.rot-bloque .filas { gap: 12px; margin-top: 8px; }
.rot-bloque .control { min-height: 48px; }

.rot-cant { display: grid; grid-template-columns: 48px 1fr 48px; }
.rot-cant .control { border: 0; border-radius: 0; min-height: 45px; padding: 8px 4px; text-align: center; font-weight: 700; box-shadow: none; -moz-appearance: textfield; }
.rot-cant .control::-webkit-inner-spin-button, .rot-cant .control::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.rot-cant:has([aria-invalid="true"]) { border-color: var(--rojo-2); }

/* Marcas de manipulación */
.rot-marcas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
@media (min-width: 640px) { .rot-marcas { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rot-marca { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px 12px; border: 2px solid var(--borde); border-radius: 14px; background: var(--fondo); cursor: pointer; text-align: center; font-size: var(--t-xs); font-weight: 700; line-height: 1.25; color: var(--tx-2); transition: .15s; }
.rot-marca:hover { border-color: var(--borde-2); background: #fff; transform: translateY(-2px); }
.rot-marca input { position: absolute; opacity: 0; pointer-events: none; }
.rot-marca .picto { width: 48px; height: 48px; fill: none; stroke: var(--azul); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s var(--curva); }
.rot-marca .picto .p-roja { stroke: #D7141B; }
.rot-marca .marca-ok { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--borde-2); background: #fff; display: grid; place-content: center; color: #fff; transition: .15s; }
.rot-marca .marca-ok .ic { width: 13px; height: 13px; stroke-width: 3; opacity: 0; }
.rot-marca:has(input:checked) { border-color: var(--verde); background: #EBF8F0; color: var(--verde-2); }
.rot-marca:has(input:checked) .picto { transform: scale(1.08); }
.rot-marca:has(input:checked) .marca-ok { background: var(--verde); border-color: var(--verde); }
.rot-marca:has(input:checked) .marca-ok .ic { opacity: 1; }
.rot-marca:has(input:focus-visible) { box-shadow: var(--foco); }

/* Vista previa */
.rot-prev { border-top: 1px solid var(--borde); background: linear-gradient(180deg, #F3F6FC, #fff); }
@media (min-width: 960px) { .rot-prev { border-top: 0; border-left: 1px solid var(--borde); } .rot-prev-fija { position: sticky; top: calc(var(--barra-h) + 8px); } }
.rot-prev-fija { padding: clamp(16px, 2.6vw, 28px); background-image: radial-gradient(circle, rgba(26, 30, 74, .09) 1px, transparent 1.4px); background-size: 18px 18px; }
.rot-prev-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.rot-prev-tit { margin: 0; font: 700 var(--t-lg)/1.2 var(--f-texto); color: var(--azul); }
.rot-nav { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border: 1.5px solid var(--borde); border-radius: 99px; background: #fff; }
.rot-nav span { min-width: 64px; text-align: center; font-size: var(--t-xs); font-weight: 700; color: var(--azul); white-space: nowrap; }
.rot-nav button { width: 34px; height: 34px; display: grid; place-content: center; border: 0; border-radius: 50%; background: var(--fondo); color: var(--azul); cursor: pointer; transition: .15s; }
.rot-nav button:hover:not(:disabled) { background: var(--azul); color: #fff; }
.rot-nav button:disabled { opacity: .35; cursor: default; }
.rot-nav .ic { width: 16px; height: 16px; }
.rot-lienzo { display: grid; place-items: center; }
.rot-lienzo canvas { display: block; width: 100%; max-width: 380px; height: auto; border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(21, 25, 53, .45), 0 2px 6px rgba(21, 25, 53, .08); background: #fff; }
.rot-hor .rot-lienzo canvas { max-width: 560px; }
.rot-priv { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; }
.rot-priv .ic { width: 15px; height: 15px; margin-top: 1px; flex: none; color: var(--verde-2); }

/* Banda inferior */
.rot-formatos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rot-fmt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 6px; border: 1.5px solid rgba(255, 255, 255, .2); border-radius: 14px; background: rgba(255, 255, 255, .04); cursor: pointer; text-align: center; transition: .15s; }
.rot-fmt:hover { border-color: rgba(255, 255, 255, .45); }
.rot-fmt input { position: absolute; opacity: 0; pointer-events: none; }
.rot-fmt svg { width: 34px; height: 47px; }
.rot-fmt .hoja { fill: rgba(255, 255, 255, .92); }
.rot-fmt .r { fill: none; stroke: #8A93B0; stroke-width: 1.6; stroke-dasharray: 3 2; }
.rot-fmt span { display: grid; gap: 2px; font-size: var(--t-xs); font-weight: 700; color: #fff; line-height: 1.2; }
.rot-fmt b { font: italic 800 1.5rem/1 var(--f-titulo); color: var(--verde-luz); }
.rot-fmt small { font-weight: 500; font-size: .6875rem; color: rgba(255, 255, 255, .62); }
.rot-fmt:has(input:checked) { border-color: var(--verde-luz); background: rgba(59, 214, 116, .12); box-shadow: 0 0 0 3px rgba(59, 214, 116, .18); }
.rot-fmt:has(input:checked) .r { fill: rgba(21, 156, 70, .28); stroke: var(--verde); stroke-dasharray: none; }
.rot-fmt:has(input:focus-visible) { box-shadow: var(--foco); }
.rot-hojas { margin: 0; font-size: var(--t-sm); font-weight: 600; color: rgba(255, 255, 255, .8); }
.rot-total .tot-sec { width: 100%; }

/* Contenido */
.rot-ic { background: #E9ECFB; color: #2B3A9E; }
.rot-ic .ic { width: 28px; height: 28px; }
.rot-txt { margin-top: 0 !important; font-size: var(--t-sm) !important; color: var(--tx-2) !important; }

@media (max-width: 400px) {
  .rot-form { padding: 14px 12px; }
  .rot-bloque { padding: 12px; }
  .rot-fmt small { display: none; }
  .rot-prev-fija { padding: 14px 12px; }
}
