/* =============================================================================
   Maax Street v2 · premium-hojas
   Las hojas (bottom sheet en el teléfono, modal en la laptop), los formularios
   que viven dentro, los selectores de cuenta, el diálogo de borrado, los avisos
   (toasts) y las acciones de fila: lo que se ve al pulsar cualquier botón de
   las pantallas remasterizadas. Mismo lenguaje que el Mando.

   Alcance (estas piezas son GLOBALES, las usan todas las pantallas):
     - la hoja y todo lo de dentro cuelga de `.velo.hoja-premium` (hoja.js pone
       `premium hoja-premium` en el velo): fuera de una hoja nada cambia;
     - los avisos cuelgan de `.avisos .aviso`;
     - las acciones de fila, de `.acciones-premium` (acciones.js).
   Los estilos viejos (`.hoja`, `.velo`, `.campo`, `.entrada`, `.segmentado`,
   `.cuenta-chip`…, de piezas.css) no se tocan: se ganan por especificidad.

   Índice
     0  El grafito de la hoja: tinta, superficies y acentos (también en "Día")
     1  Velo y hoja: material, canto, trama, marca de agua, entrada y salida
     2  Cabecera: sello, rótulo, titular, línea de apoyo, cierre, asa
     3  Cuerpo y pie de botones
     4  Hoja inferior (teléfono)
     5  Formularios: campos, entradas, errores, ayudas, plegable
     6  Controles segmentados
     7  Paneles de lectura (riesgo, resumen, resultado en vivo)
     8  Selector de cuenta
     9  Diálogo de confirmación y botón de borrar
    10  Detalles dentro de la hoja (paneles, filas, pastillas)
    11  Avisos (toasts)
    12  Acciones de fila
    13  Tema "Día" y menos movimiento

   Compatibilidad iOS Safari 15.4+: cada superficie lleva su `background` y su
   `box-shadow` PLANOS primero; la versión con color-mix() va dentro de
   @supports (en iOS < 16.2 una declaración con color-mix()+var() no se
   descarta: queda en su valor inicial y la superficie quedaría transparente).
   ========================================================================== */


/* =============================================================================
   0 · EL GRAFITO DE LA HOJA
   La hoja es de grafito casi negro en los seis temas. Dentro se redeclaran la
   tinta y las superficies del tema oscuro: todo lo que ya existe en una hoja
   (paneles, filas, métricas, pastillas) las lee por token y se ve bien sin
   tocarlo. En "Día" también se reponen los acentos del tema oscuro.
   ========================================================================== */

.velo.hoja-premium .hoja {
  --tinta: #e9edf5;
  --tinta-media: #9aa5b8;
  --tinta-tenue: #8992a5;
  --panel: #121318;
  --panel-alto: #181a20;
  --panel-borde: #262830;
  --fondo-hondo: #0a0a0d;
  --canto: rgba(255, 255, 255, .08);
  --sheen: rgba(255, 255, 255, .04);
  --sombra-1: 0 1px 2px rgba(0, 0, 0, .5), 0 6px 14px -8px rgba(0, 0, 0, .7);
  --sombra-2: 0 2px 4px rgba(0, 0, 0, .4), 0 14px 30px -14px rgba(0, 0, 0, .75);
  --sombra-3: 0 2px 4px rgba(0, 0, 0, .45), 0 22px 44px -16px rgba(0, 0, 0, .8);
  /* El oro del texto pequeño SOBRE el grafito: claro (el del kit se oscurece en "Día"). */
  --pm-oro-texto: #ecd29a;
  color: var(--tinta);
  /* Los controles nativos (fecha, desplegable, barra de desplazamiento) en oscuro. */
  color-scheme: dark;
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .hoja { --pm-oro-texto: color-mix(in srgb, var(--oro) 76%, #fff); }
}
:root[data-theme="dia"] .velo.hoja-premium .hoja {
  --oro: #e3b35e;
  --oro-tenue: rgba(227, 179, 94, .13);
  --verde: #4fc98a;
  --verde-tenue: rgba(79, 201, 138, .13);
  --rojo: #e8695f;
  --rojo-tenue: rgba(232, 105, 95, .13);
  --azul: #6f9ae0;
  --azul-tenue: rgba(111, 154, 224, .13);
}

/* `hidden` tiene que esconder SIEMPRE. Las reglas de piezas.css que dan
   `display` a un grupo (`.form-grupo`, `.form-detalle`…) le ganan al atributo. */
.velo.hoja-premium [hidden] { display: none !important; }


/* =============================================================================
   1 · VELO Y HOJA
   ========================================================================== */

.velo.hoja-premium {
  background: rgba(2, 4, 9, .66);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
          backdrop-filter: blur(12px) saturate(120%);
  animation: hjVeloEntra 300ms var(--suave) backwards;
}
.velo.hoja-premium[data-estado="saliendo"] { animation: hjVeloSale 220ms var(--salida) both; }
@keyframes hjVeloEntra { from { opacity: 0; } to { opacity: 1; } }
@keyframes hjVeloSale  { from { opacity: 1; } to { opacity: 0; } }

.velo.hoja-premium .hoja {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(680px, 100%);
  max-height: min(88vh, 920px);
  border-radius: var(--r-l);
  /* Plano primero (iOS < 16.2). */
  background: linear-gradient(180deg, #17181d 0%, #0d0d10 46%, #070709 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 0 0 1px rgba(0, 0, 0, .6),
    0 2px 4px rgba(0, 0, 0, .45),
    0 40px 80px -24px rgba(0, 0, 0, .9),
    0 70px 120px -60px rgba(0, 0, 0, .8);
  /* `backwards`: acabada la entrada se suelta el `transform`, para que el
     arrastre del dedo pueda moverla. */
  animation: hjEntra 440ms var(--muelle) backwards;
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .hoja {
    background:
      var(--pm-grano) 0 0 / 160px 160px,
      radial-gradient(120% 60% at 12% -20%, color-mix(in srgb, var(--oro) 17%, transparent), transparent 62%),
      linear-gradient(180deg, #17181d 0%, #0d0d10 46%, #070709 100%);
    background-blend-mode: overlay, normal, normal;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .07),
      0 0 0 1px rgba(0, 0, 0, .6),
      0 2px 4px rgba(0, 0, 0, .45),
      0 40px 80px -24px rgba(0, 0, 0, .9),
      0 70px 120px -60px rgba(0, 0, 0, .8),
      0 50px 100px -60px color-mix(in srgb, var(--oro) 42%, transparent);
  }
}
.velo.hoja-premium[data-estado="saliendo"] .hoja { animation: hjSale 220ms var(--salida) both; }
@keyframes hjEntra { from { opacity: 0; transform: translateY(28px) scale(.965); } to { opacity: 1; transform: none; } }
@keyframes hjSale  { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(12px) scale(.985); } }

/* La trama de puntos: papel milimetrado que se desvanece hacia dentro. */
.velo.hoja-premium .hoja::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(rgba(233, 237, 245, .13) 1px, transparent 1.3px) 0 0 / 20px 20px;
  -webkit-mask-image: radial-gradient(62% 46% at 96% 0%, #000 0%, transparent 100%);
          mask-image: radial-gradient(62% 46% at 96% 0%, #000 0%, transparent 100%);
}
/* El canto: hilo de 1 px, dorado arriba a la izquierda y apagado abajo. */
.velo.hoja-premium .hoja::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  background: linear-gradient(155deg,
    rgba(246, 222, 170, .62) 0%,
    rgba(227, 179, 94, .22) 24%,
    rgba(255, 255, 255, .04) 54%,
    rgba(0, 0, 0, .55) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .hoja::after {
    background: linear-gradient(155deg,
      color-mix(in srgb, var(--oro) 70%, rgba(255, 255, 255, .4)) 0%,
      color-mix(in srgb, var(--oro) 24%, transparent) 24%,
      rgba(255, 255, 255, .04) 54%,
      rgba(0, 0, 0, .55) 100%);
  }
}

/* Nivel 3 del logo: la marca de agua de esquina, recortada por el borde. */
.velo.hoja-premium .hoja-agua {
  right: -48px;
  top: -38px;
  width: 156px;
  height: 156px;
  opacity: .11;
}


/* =============================================================================
   2 · CABECERA
   ========================================================================== */

.velo.hoja-premium .hoja-cabeza {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 22px 18px 24px;
  border-bottom: 0;
}
/* El filete de oro bajo la cabecera: nace del oro y se apaga. Con contenido
   desplazado por debajo (`.desplazada`) se enciende del todo. */
.velo.hoja-premium .hoja-cabeza::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(227, 179, 94, .85), rgba(255, 255, 255, .1) 42%, transparent);
  opacity: .22;
  transition: opacity 260ms var(--suave);
}
.velo.hoja-premium .hoja.desplazada .hoja-cabeza::after { opacity: 1; }

.velo.hoja-premium .hoja-titulos { flex: 1; min-width: 0; }
/* La moneda del sello se alinea con el rótulo y el titular, no con el centro del bloque. */
.velo.hoja-premium .hoja-sello { align-self: flex-start; margin-top: 3px; }

/* El rótulo sobre el titular: mayúsculas con tracking y el rombo de oro. */
.velo.hoja-premium .hoja-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: var(--letra);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--pm-oro-texto);
}
.velo.hoja-premium .hoja-kicker::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  border-radius: 1px;
  background: var(--oro);
  box-shadow: 0 0 8px var(--oro);
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .hoja-kicker::before {
    background: linear-gradient(135deg, var(--oro), color-mix(in srgb, var(--oro) 38%, #000));
    box-shadow: 0 0 8px color-mix(in srgb, var(--oro) 55%, transparent);
  }
}

/* El titular, en la serif de la casa. */
.velo.hoja-premium .hoja-cabeza h2 {
  margin: 5px 0 0;
  font-family: var(--letra-display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.012em;
  font-variant-numeric: lining-nums;
  color: var(--tinta);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
/* La línea de apoyo: la cursiva de la casa. */
.velo.hoja-premium .hoja-sub {
  margin: 6px 0 0;
  font-family: var(--letra-display);
  font-style: italic;
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1.35;
  font-variant-numeric: lining-nums;
  color: var(--tinta-media);
  overflow-wrap: anywhere;
}

/* El cierre: un disco de grafito con filete; al señalarlo se enciende en oro y gira. */
.velo.hoja-premium .hoja-cerrar {
  flex: none;
  display: grid;
  place-items: center;
  align-self: flex-start;
  width: 40px;
  height: 40px;
  margin-top: -2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  /* Opaco: la marca de agua pasa por detrás y no debe verse a través del botón. */
  background: #17181d;
  color: var(--tinta-media);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 14px -10px rgba(0, 0, 0, .9);
  transition: color 180ms var(--suave), background 180ms var(--suave), box-shadow 180ms var(--suave), transform 260ms var(--muelle);
}
.velo.hoja-premium .hoja-aspa {
  width: 17px;
  height: 17px;
  transition: transform 320ms var(--muelle);
}
@media (hover: hover) and (pointer: fine) {
  .velo.hoja-premium .hoja-cerrar:hover {
    color: var(--tinta);
    background: #24211a;
    box-shadow: inset 0 0 0 1px rgba(227, 179, 94, .5), 0 8px 18px -8px rgba(227, 179, 94, .4);
  }
  .velo.hoja-premium .hoja-cerrar:hover .hoja-aspa { transform: rotate(90deg); }
}
.velo.hoja-premium .hoja-cerrar:active { transform: scale(.9); background: #24211a; color: var(--tinta); }
.velo.hoja-premium .hoja-cerrar:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 3px;
  border-radius: 50%;
}

/* El asa de la hoja inferior (solo en el teléfono; se agarra para arrastrar). */
.velo.hoja-premium .hoja-asa { display: none; }


/* =============================================================================
   3 · CUERPO Y PIE DE BOTONES
   ========================================================================== */

.velo.hoja-premium .hoja-cuerpo {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Sin relleno inferior: lo pone el último elemento o la barra de botones. Un
     `sticky` dentro de un cuerpo con relleno deja una franja por donde se ve
     pasar el contenido. */
  padding: 8px 24px 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 179, 94, .35) transparent;
}
.velo.hoja-premium .hoja-cuerpo::-webkit-scrollbar { width: 8px; }
.velo.hoja-premium .hoja-cuerpo::-webkit-scrollbar-track { background: transparent; }
.velo.hoja-premium .hoja-cuerpo::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 99px;
  background: rgba(227, 179, 94, .32);
  background-clip: padding-box;
}
.velo.hoja-premium .hoja-cuerpo > :last-child:not(.form):not(.form-botones) {
  margin-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* La barra de botones: siempre a la vista al pie de la hoja (en un formulario
   largo hay que desplazar para llegar al final, pero guardar no se pierde). */
.velo.hoja-premium .form-botones {
  position: sticky;
  bottom: 0;
  z-index: 2;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  margin: 0 -24px;
  padding: 26px 24px max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(7, 7, 9, 0), #070709 24px);
}
.velo.hoja-premium .form-botones > .boton-bloque { flex: 1 1 auto; width: auto; min-width: 0; }
.velo.hoja-premium .form-botones > .boton-fantasma { flex: none; }
/* Con el teclado abierto no hay barra de inicio debajo. */
.velo.hoja-premium.teclado .form-botones { padding-bottom: 14px; }


/* =============================================================================
   4 · HOJA INFERIOR (teléfono)
   Sube desde abajo y ocupa el ancho entero: es lo que hace una app nativa, y
   deja el pulgar cerca del cierre. Se arrastra por el asa para cerrarla.
   ========================================================================== */

@media (max-width: 640px) {
  .velo.hoja-premium {
    align-items: flex-end;
    padding: 0 0 var(--teclado, 0px);
  }
  .velo.hoja-premium .hoja {
    width: 100%;
    max-height: min(92dvh, calc(100dvh - var(--teclado, 0px) - 12px));
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .08),
      0 -1px 0 rgba(0, 0, 0, .6),
      0 -24px 60px -20px rgba(0, 0, 0, .75);
    animation-name: hjSube;
    animation-duration: 460ms;
  }
  .velo.hoja-premium[data-estado="saliendo"] .hoja { animation-name: hjBaja; animation-duration: 240ms; }
  @keyframes hjSube { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes hjBaja { from { transform: none; } to { transform: translateY(100%); } }

  .velo.hoja-premium .hoja-asa {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 4;
    display: block;
    width: 44px;
    height: 4px;
    margin-left: -22px;
    border-radius: 4px;
    background: rgba(233, 237, 245, .26);
    touch-action: none;
  }
  /* Zona de agarre amplia: el asa es fina, el dedo no. */
  .velo.hoja-premium .hoja-asa::before { content: ''; position: absolute; inset: -9px -44px -13px; }
  .velo.hoja-premium .hoja-cabeza { padding: 28px 16px 14px 20px; touch-action: none; }
  .velo.hoja-premium .hoja-cabeza::after { left: 20px; right: 20px; }
  .velo.hoja-premium .hoja-cabeza h2 { font-size: 24px; }
  .velo.hoja-premium .hoja-cuerpo { padding: 6px 16px 0; scroll-padding-bottom: 120px; }
  .velo.hoja-premium .form-botones { margin: 0 -16px; padding: 24px 16px max(18px, env(safe-area-inset-bottom)); }
  .velo.hoja-premium .hoja-agua { right: -46px; top: -40px; width: 150px; height: 150px; }
}
@media (max-width: 380px) {
  .velo.hoja-premium .hoja-cabeza h2 { font-size: 22px; }
  .velo.hoja-premium .hoja-sello { display: none; }
}
@media (pointer: coarse) {
  .velo.hoja-premium .hoja-cerrar { width: 44px; height: 44px; margin-top: -4px; }
}


/* =============================================================================
   5 · FORMULARIOS
   ========================================================================== */

.velo.hoja-premium .form { gap: 18px; }
.velo.hoja-premium .form-campos { gap: 20px 14px; }
.velo.hoja-premium .form-grupo { gap: 20px 14px; }
.velo.hoja-premium .campo { gap: 8px; min-width: 0; }

/* La etiqueta: pequeña, en mayúsculas con tracking; al enfocar el campo se enciende en oro. */
.velo.hoja-premium .campo-nombre {
  font-family: var(--letra);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--tinta-media);
  transition: color 180ms var(--suave);
}
.velo.hoja-premium .campo:focus-within > .campo-nombre { color: var(--pm-oro-texto); }

/* La entrada: un hueco en la piedra. La luz entra en vez de salir (sombra
   interior, no elevación): lo que distingue donde se escribe de un bulto que se pulsa. */
.velo.hoja-premium .entrada {
  min-height: 48px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-s);
  background: rgba(0, 0, 0, .42);
  color: var(--tinta);
  caret-color: var(--oro);
  font-family: var(--letra);
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .09),
    inset 0 2px 7px rgba(0, 0, 0, .6),
    0 1px 0 rgba(255, 255, 255, .03);
  transition: box-shadow 180ms var(--suave), background 180ms var(--suave);
}
@media (hover: hover) and (pointer: fine) {
  .velo.hoja-premium .entrada:hover:not(:focus) {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, .17),
      inset 0 2px 7px rgba(0, 0, 0, .6),
      0 1px 0 rgba(255, 255, 255, .03);
  }
}
.velo.hoja-premium .entrada:focus {
  outline: none;
  background: rgba(0, 0, 0, .5);
  /* Anillo doble: el interior fija el borde, el exterior da el halo. */
  box-shadow:
    inset 0 0 0 1px var(--oro),
    inset 0 2px 7px rgba(0, 0, 0, .5),
    0 0 0 4px var(--oro-tenue);
}
.velo.hoja-premium .entrada::placeholder { color: #707b90; opacity: 1; }
/* Los importes y las cifras, en JetBrains Mono. */
.velo.hoja-premium input[type="number"].entrada {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -.01em;
  -moz-appearance: textfield;
          appearance: textfield;
}
.velo.hoja-premium input[type="number"].entrada::-webkit-outer-spin-button,
.velo.hoja-premium input[type="number"].entrada::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.velo.hoja-premium input[type="date"].entrada { min-width: 0; }
.velo.hoja-premium input[type="date"].entrada::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: .62;
  transition: opacity 160ms var(--suave);
}
.velo.hoja-premium input[type="date"].entrada::-webkit-calendar-picker-indicator:hover { opacity: 1; }

/* El desplegable: sin la flecha del sistema; un chevrón de la casa. */
.velo.hoja-premium select.entrada {
  padding-right: 42px;
  cursor: pointer;
  -webkit-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa5b8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 15px;
  text-overflow: ellipsis;
}
.velo.hoja-premium select.entrada:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3b35e' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
}
.velo.hoja-premium select.entrada option,
.velo.hoja-premium select.entrada optgroup { background: #121318; color: #e9edf5; }

.velo.hoja-premium .entrada-area {
  min-height: 96px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

/* El autocompletado de Chrome pinta los campos de amarillo y se lleva el tema. */
.velo.hoja-premium .entrada:-webkit-autofill,
.velo.hoja-premium .entrada:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--tinta);
  caret-color: var(--oro);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), inset 0 0 0 100px #0e0f13;
}

/* iOS amplía la página al enfocar un campo de menos de 16 px: en táctil, 16. */
@media (pointer: coarse) {
  .velo.hoja-premium .entrada,
  .velo.hoja-premium input[type="number"].entrada { font-size: 16px; }
}

/* La ayuda y el error de un campo. */
.velo.hoja-premium .campo-ayuda {
  font-family: var(--letra);
  font-size: 12px;
  line-height: 1.45;
  color: var(--tinta-tenue);
}
.velo.hoja-premium .campo-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-family: var(--letra);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: #f4a49c;
}
.velo.hoja-premium .campo-error:empty { display: none; }
.velo.hoja-premium .campo-error::before {
  content: '!';
  flex: none;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-top: 0;
  border-radius: 50%;
  background: rgba(232, 105, 95, .16);
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .5);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #f4a49c;
}
.velo.hoja-premium .campo-malo .entrada,
.velo.hoja-premium .campo-malo .segmentado,
.velo.hoja-premium .campo-malo .elige-cuenta {
  animation: hjTiembla 380ms var(--suave);
}
.velo.hoja-premium .campo-malo .entrada {
  box-shadow:
    inset 0 0 0 1px var(--rojo),
    inset 0 2px 7px rgba(0, 0, 0, .5),
    0 0 0 4px rgba(232, 105, 95, .14);
}
.velo.hoja-premium .campo-malo .entrada:focus {
  box-shadow:
    inset 0 0 0 1px var(--rojo),
    inset 0 2px 7px rgba(0, 0, 0, .5),
    0 0 0 4px rgba(232, 105, 95, .22);
}
@keyframes hjTiembla {
  0%, 100% { transform: none; }
  18% { transform: translateX(-5px); }
  42% { transform: translateX(4px); }
  66% { transform: translateX(-2px); }
  86% { transform: translateX(1px); }
}

/* Los atajos que rellenan un monto ("Todo lo pendiente · $2.126"). */
.velo.hoja-premium .form-atajos {
  gap: 8px;
  margin-top: -8px;
}
.velo.hoja-premium .form-atajos .boton {
  height: auto;
  min-height: 38px;
  padding-block: 8px;
  white-space: normal;
  text-align: left;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

/* El error del servidor: junto al botón, no como un aviso que se va solo. */
.velo.hoja-premium .form-error {
  position: relative;
  padding: 14px 16px 14px 50px;
  border-radius: var(--r-m);
  background: rgba(232, 105, 95, .1);
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .34);
  font-size: 13px;
  line-height: 1.5;
  color: var(--tinta);
  overflow-wrap: anywhere;
}
.velo.hoja-premium .form-error::before {
  content: '!';
  position: absolute;
  left: 15px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(232, 105, 95, .18);
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .55);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #f4a49c;
}
.velo.hoja-premium .form-error:not([hidden]) { animation: hjDespliega 300ms var(--suave) backwards; }

/* El bloque plegado ("Más detalles"). */
.velo.hoja-premium .form-detalle-boton { justify-content: space-between; text-align: left; }
.velo.hoja-premium .form-detalle-flecha {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--pm-oro-texto);
  transition: transform 260ms var(--muelle);
}
.velo.hoja-premium .form-detalle-icono { width: 16px; height: 16px; stroke-width: 1.8; }
.velo.hoja-premium .form-detalle { gap: 20px 14px; padding-top: 6px; }
.velo.hoja-premium .form-detalle:not([hidden]) { animation: hjDespliega 300ms var(--suave) backwards; }
@keyframes hjDespliega { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }


/* =============================================================================
   6 · CONTROLES SEGMENTADOS
   Una pista hundida con una pieza de grafito (con filete de oro) que se desliza
   hasta la opción elegida. La posición la dan `--i` y `--n` (formulario.js).
   ========================================================================== */

.segmentado > .segmento-guia { display: none; }

.velo.hoja-premium .campo > .segmentado,
.velo.hoja-premium .segmentado {
  position: relative;
  isolation: isolate;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-s);
  background: rgba(0, 0, 0, .42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), inset 0 2px 7px rgba(0, 0, 0, .6);
}
.velo.hoja-premium .segmentado > .segmento-guia {
  display: block;
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px - (var(--n, 2) - 1) * 4px) / var(--n, 2));
  transform: translateX(calc(var(--i, 0) * (100% + 4px)));
  border-radius: 9px;
  background: linear-gradient(180deg, #2c2d34, #1a1b21);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 0 0 1px rgba(227, 179, 94, .5),
    0 8px 14px -8px rgba(0, 0, 0, .9);
  pointer-events: none;
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .segmentado > .segmento-guia {
    background:
      radial-gradient(120% 140% at 14% -40%, color-mix(in srgb, var(--oro) 22%, transparent), transparent 60%),
      linear-gradient(180deg, #2c2d34, #1a1b21);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .1),
      inset 0 0 0 1px color-mix(in srgb, var(--oro) 52%, transparent),
      0 8px 14px -8px rgba(0, 0, 0, .9),
      0 0 18px -8px color-mix(in srgb, var(--oro) 50%, transparent);
  }
}
.velo.hoja-premium .segmentado.sin-marca > .segmento-guia { opacity: 0; }
.velo.hoja-premium .segmentado.con-guia > .segmento-guia {
  transition: transform 340ms var(--muelle), opacity 200ms var(--suave);
}

.velo.hoja-premium .segmentado > .segmento {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--tinta-media);
  font-family: var(--letra);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.15;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: none;
  transform: none;
  transition: color 200ms var(--suave), transform 160ms var(--muelle);
}
.velo.hoja-premium .segmentado > .segmento[aria-checked="true"],
.velo.hoja-premium .segmentado > .segmento[aria-selected="true"] {
  background: transparent;
  color: var(--pm-oro-texto);
  box-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  .velo.hoja-premium .segmentado > .segmento:not([aria-checked="true"]):hover { color: var(--tinta); transform: none; box-shadow: none; }
}
.velo.hoja-premium .segmentado > .segmento:active { transform: scale(.96); box-shadow: none; }
.velo.hoja-premium .segmentado > .segmento:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 1px;
  border-radius: 9px;
}
@media (pointer: coarse) {
  .velo.hoja-premium .campo > .segmentado > .segmento { min-height: 44px; }
}


/* =============================================================================
   7 · PANELES DE LECTURA
   Lo que hace que estos formularios no sean un alta de datos: antes de guardar
   te dicen cómo queda la cuenta, el préstamo o el payout. Cada uno es una
   lectura de instrumento: rótulo pequeño y cifra en JetBrains Mono.
   ========================================================================== */

.velo.hoja-premium .riesgo-panel {
  position: relative;
  padding: 18px 18px 16px;
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, .028);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 1px 0 rgba(255, 255, 255, .04);
}
/* El filete de oro de arriba: nace de la nada y se desvanece por los dos lados. */
.velo.hoja-premium .riesgo-panel::before {
  content: '';
  position: absolute;
  inset: 0 18px auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(227, 179, 94, .6), transparent);
}
.velo.hoja-premium .riesgo-malo {
  background: rgba(232, 105, 95, .08);
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .3), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.velo.hoja-premium .riesgo-malo::before {
  background: linear-gradient(90deg, transparent, rgba(232, 105, 95, .75), transparent);
}
.velo.hoja-premium .riesgo-datos { gap: 16px 18px; }
.velo.hoja-premium .riesgo-dato { gap: 6px; min-width: 0; }
.velo.hoja-premium .riesgo-panel .rotulo {
  font-family: var(--letra);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tinta-tenue);
}
.velo.hoja-premium .riesgo-dato b {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--tinta);
  overflow-wrap: anywhere;
}
.velo.hoja-premium .riesgo-dato b.oro { color: var(--oro); }
.velo.hoja-premium .riesgo-dato b.pos { color: var(--verde); }
.velo.hoja-premium .riesgo-dato b.neg { color: var(--rojo); }
.velo.hoja-premium .riesgo-dato b.tenue { color: var(--tinta-tenue); }

.velo.hoja-premium .riesgo-aviso {
  margin: 14px 0 0;
  padding-left: 12px;
  border-left: 2px solid rgba(232, 105, 95, .7);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--tinta);
}
.velo.hoja-premium .riesgo-panel .nota { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--tinta-media); }
.velo.hoja-premium .riesgo-panel .nota.pos { color: var(--verde); }
.velo.hoja-premium .riesgo-datos + .nota,
.velo.hoja-premium .riesgo-datos + .riesgo-aviso { margin-top: 14px; }

/* El límite de la firma: una banda dentro del panel. */
.velo.hoja-premium .riesgo-firma {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-s);
  background: rgba(79, 201, 138, .09);
  box-shadow: inset 0 0 0 1px rgba(79, 201, 138, .28);
}
.velo.hoja-premium .riesgo-firma-malo {
  background: rgba(232, 105, 95, .1);
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .32);
}
.velo.hoja-premium .riesgo-firma-cabeza { gap: 6px 12px; }
.velo.hoja-premium .riesgo-firma-cabeza b {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -.015em;
}
.velo.hoja-premium .riesgo-firma .metrica-pie {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--tinta-media);
  overflow-wrap: anywhere;
}

/* El resultado en vivo, con el signo ya puesto: la cifra de la casa. */
.velo.hoja-premium .form-previo {
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-m);
  background: rgba(255, 255, 255, .028);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: background 260ms var(--suave), box-shadow 260ms var(--suave);
}
.velo.hoja-premium .form-previo .rotulo {
  font-family: var(--letra);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tinta-media);
}
.velo.hoja-premium .form-previo b {
  font-family: var(--letra-display);
  font-size: 15px;
  font-style: italic;
  font-weight: 500;
  color: var(--tinta-tenue);
  text-align: right;
}
.velo.hoja-premium .form-previo b.form-cifra {
  font-size: 30px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.015em;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
  color: var(--tinta);
}
.velo.hoja-premium .form-cifra .fc-mon {
  margin-right: 2px;
  font-size: .56em;
  font-weight: 500;
  letter-spacing: 0;
  vertical-align: .52em;
  color: var(--oro);
}
.velo.hoja-premium .form-cifra .fc-signo { margin-right: 2px; }
.velo.hoja-premium .form-previo-pos {
  background: rgba(79, 201, 138, .09);
  box-shadow: inset 0 0 0 1px rgba(79, 201, 138, .3), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.velo.hoja-premium .form-previo-neg {
  background: rgba(232, 105, 95, .09);
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .32), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.velo.hoja-premium .form-previo-pos b.form-cifra { color: var(--verde); }
.velo.hoja-premium .form-previo-neg b.form-cifra { color: var(--rojo); }
.velo.hoja-premium .form-previo-pos b.form-cifra .fc-mon,
.velo.hoja-premium .form-previo-neg b.form-cifra .fc-mon { color: inherit; opacity: .8; }

/* Las notas sueltas dentro de un formulario. */
.velo.hoja-premium .form .nota { font-size: 12.5px; line-height: 1.5; color: var(--tinta-media); }
.velo.hoja-premium .form .nota.neg { color: #f4a49c; }
.velo.hoja-premium .form .nota.pos { color: var(--verde); }


/* =============================================================================
   8 · SELECTOR DE CUENTA
   Cada tarjeta enseña lo que de verdad separa a una cuenta de otra: su color,
   la fase, de cuánto es y cómo va hoy frente a su límite. La elegida lleva el
   canto de SU color y un check de oro; la frenada, un velo rojo.
   ========================================================================== */

.velo.hoja-premium .elige-cuenta {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}
.velo.hoja-premium .cuenta-chip {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 78px;
  padding: 14px 46px 14px 14px;
  border: 0;
  border-radius: var(--r-m);
  background: linear-gradient(165deg, #1d1e24 0%, #0d0d10 62%, #060608 125%);
  color: var(--tinta);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 0 0 1px rgba(255, 255, 255, .08),
    0 10px 18px -12px rgba(0, 0, 0, .9);
  transition: transform 260ms var(--muelle), box-shadow 260ms var(--suave), background 260ms var(--suave);
}
/* El velo del color de la cuenta, en la esquina. */
.velo.hoja-premium .cuenta-chip::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms var(--suave);
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .cuenta-chip::before {
    opacity: .75;
    background: radial-gradient(130% 100% at 0% -34%, color-mix(in srgb, var(--c, var(--oro)) 20%, transparent), transparent 60%);
  }
}
@media (hover: hover) and (pointer: fine) {
  .velo.hoja-premium .cuenta-chip:hover {
    transform: translateY(-2px);
    background: linear-gradient(165deg, #23242b 0%, #101114 62%, #070709 125%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .08),
      inset 0 0 0 1px rgba(255, 255, 255, .16),
      0 16px 26px -14px rgba(0, 0, 0, .95);
  }
}
.velo.hoja-premium .cuenta-chip:active { transform: scale(.985); }

.velo.hoja-premium .cuenta-chip.elegida {
  background: linear-gradient(165deg, #25262d 0%, #101114 62%, #070709 125%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 0 1.5px var(--c, var(--oro)),
    0 14px 24px -14px rgba(0, 0, 0, .95);
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .cuenta-chip.elegida {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .08),
      inset 0 0 0 1.5px var(--c, var(--oro)),
      0 14px 24px -14px rgba(0, 0, 0, .95),
      0 18px 30px -20px color-mix(in srgb, var(--c, var(--oro)) 60%, transparent);
  }
  .velo.hoja-premium .cuenta-chip.elegida::before { opacity: 1; }
}
.velo.hoja-premium .cuenta-chip:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 3px;
  border-radius: var(--r-m);
}

/* Frenada = su límite del día ya tocado: se ve ANTES de elegirla. */
.velo.hoja-premium .cuenta-chip.frenada {
  background: linear-gradient(165deg, #2a1a1b 0%, #130d0e 62%, #080506 125%);
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .36), 0 10px 18px -12px rgba(0, 0, 0, .9);
}
.velo.hoja-premium .cuenta-chip.frenada.elegida {
  box-shadow: inset 0 0 0 1.5px var(--rojo), 0 14px 24px -14px rgba(0, 0, 0, .95);
}

/* El punto del color de la cuenta, con su luz. */
.velo.hoja-premium .cc-punto {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--c, var(--oro));
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .06), 0 0 10px var(--c, var(--oro));
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .cc-punto { box-shadow: 0 0 0 3px rgba(255, 255, 255, .06), 0 0 10px color-mix(in srgb, var(--c, var(--oro)) 65%, transparent); }
}
.velo.hoja-premium .cc-cuerpo { gap: 3px; }
.velo.hoja-premium .cc-linea1 { gap: 6px 8px; }
.velo.hoja-premium .cc-nombre {
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
}
.velo.hoja-premium .cc-linea2 {
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
  color: var(--tinta-media);
  overflow-wrap: anywhere;
}
.velo.hoja-premium .cc-desde,
.velo.hoja-premium .cc-hoy,
.velo.hoja-premium .cc-firma {
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--tinta-tenue);
}
.velo.hoja-premium .cc-hoy.neg,
.velo.hoja-premium .cc-firma.neg { color: #f4a49c; }

/* El mando del radio: un aro que, al elegir, se llena de oro con su marca. */
.velo.hoja-premium .cc-marca {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .26);
  transition: background 220ms var(--suave), box-shadow 220ms var(--suave), transform 320ms var(--muelle);
}
.velo.hoja-premium .cc-check {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
  opacity: 0;
  transform: scale(.4);
  color: #1b1307;
  transition: opacity 160ms var(--suave), transform 320ms var(--muelle);
}
.velo.hoja-premium .cuenta-chip.elegida .cc-marca {
  background: linear-gradient(180deg, #efcf86, #dfb15a 52%, #b0802c);
  box-shadow: 0 0 0 1px rgba(255, 247, 222, .5), 0 0 14px -2px rgba(227, 179, 94, .6);
  transform: scale(1.05);
}
.velo.hoja-premium .cuenta-chip.elegida .cc-check { opacity: 1; transform: scale(1); }

@media (max-width: 560px) {
  .velo.hoja-premium .elige-cuenta { grid-template-columns: 1fr; }
}


/* =============================================================================
   9 · DIÁLOGO DE CONFIRMACIÓN Y BOTÓN DE BORRAR
   Lo irreversible: la misma hoja con un velo rojo, el sello de la papelera (la
   moneda de grafito en rojo) y un botón de metal rojo.
   ========================================================================== */

.velo.hoja-peligro .hoja { width: min(520px, 100%); }
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-peligro .hoja {
    background:
      var(--pm-grano) 0 0 / 160px 160px,
      radial-gradient(120% 60% at 12% -20%, color-mix(in srgb, var(--rojo) 19%, transparent), transparent 62%),
      linear-gradient(180deg, #1a1416 0%, #0e0c0d 46%, #070607 100%);
    background-blend-mode: overlay, normal, normal;
  }
  .velo.hoja-peligro .hoja::after {
    background: linear-gradient(155deg,
      color-mix(in srgb, var(--rojo) 72%, rgba(255, 255, 255, .4)) 0%,
      color-mix(in srgb, var(--rojo) 26%, transparent) 24%,
      rgba(255, 255, 255, .04) 54%,
      rgba(0, 0, 0, .55) 100%);
  }
}
.velo.hoja-peligro .hoja-cabeza::after { background: linear-gradient(90deg, rgba(232, 105, 95, .85), rgba(255, 255, 255, .1) 42%, transparent); }
.velo.hoja-peligro .hoja-kicker { color: #f4b8b2; }
.velo.hoja-peligro .hoja-kicker::before { background: var(--rojo); box-shadow: 0 0 8px var(--rojo); }
.velo.hoja-peligro .form-botones { background: linear-gradient(180deg, rgba(7, 6, 7, 0), #070607 24px); }

.velo.hoja-premium .confirmar-ficha {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-m);
  background: linear-gradient(120deg, rgba(232, 105, 95, .14), rgba(232, 105, 95, .04));
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .3);
}
.velo.hoja-premium .confirmar-ficha .pm-sello { color: var(--rojo); }
.velo.hoja-premium .confirmar-texto { flex: 1; min-width: 0; }
.velo.hoja-premium .confirmar-rotulo {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #f4b8b2;
}
.velo.hoja-premium .confirmar-que {
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--tinta);
  overflow-wrap: anywhere;
}
.velo.hoja-premium .confirmar-rotulo + .confirmar-que { margin-top: 6px; }

.velo.hoja-premium .aviso-texto {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--r-m);
  background: rgba(227, 179, 94, .09);
  box-shadow: inset 0 0 0 1px rgba(227, 179, 94, .28);
  color: var(--tinta-media);
}
.velo.hoja-premium .confirmar-arrastra-rotulo {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--pm-oro-texto);
}
.velo.hoja-premium .falta-lista {
  margin: 10px 0 0;
  padding-left: 18px;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--tinta-media);
}
.velo.hoja-premium .falta-lista li::marker { color: var(--oro); }

/* El botón de borrar: metal rojo, el hermano del oro pulido (mismos estados que
   los del kit: hover, pulsado, foco, ocupado, desactivado). */
.velo.hoja-premium .boton.boton-peligro {
  --pm-b-onda: rgba(255, 205, 198, .8);
  --pm-b-barrido: rgba(255, 190, 183, .3);
  --pm-b-sombra:
    inset 0 1px 0 rgba(255, 214, 208, .24),
    inset 0 -1px 0 rgba(0, 0, 0, .5),
    0 1px 2px rgba(0, 0, 0, .55),
    0 12px 24px -12px rgba(232, 105, 95, .6);
  --pm-b-sombra-hover:
    inset 0 1px 0 rgba(255, 214, 208, .3),
    inset 0 -1px 0 rgba(0, 0, 0, .5),
    0 1px 2px rgba(0, 0, 0, .55),
    0 16px 30px -12px rgba(232, 105, 95, .75);
  --pm-b-sombra-activo: inset 0 2px 4px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(0, 0, 0, .3);
  color: #ffe4e0;
  background: linear-gradient(180deg, #5c2824 0%, #3c1714 56%, #2a0f0d 100%);
  background-color: #3c1714;
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  .velo.hoja-premium .boton.boton-peligro {
    background:
      var(--pm-grano) 0 0 / 160px 160px padding-box,
      radial-gradient(140% 130% at 14% -35%, color-mix(in srgb, var(--rojo) 38%, transparent), transparent 60%) padding-box,
      linear-gradient(180deg, #5c2824 0%, #3c1714 56%, #2a0f0d 100%) padding-box,
      linear-gradient(155deg, color-mix(in srgb, var(--rojo) 85%, #fff), color-mix(in srgb, var(--rojo) 40%, transparent) 40%, rgba(255, 255, 255, .06) 66%, rgba(0, 0, 0, .6)) border-box;
    background-blend-mode: overlay, normal, normal, normal;
    background-color: #3c1714;
  }
}
@media (hover: hover) and (pointer: fine) {
  .velo.hoja-premium .boton.boton-peligro:where(:not(:disabled)):hover { color: #fff; background-color: #4a1d19; }
}

/* Ocupado: algo se está guardando. El botón queda desactivado (no admite otro
   toque) pero se ve VIVO, con la banda de luz recorriéndolo, no apagado. */
.velo.hoja-premium .boton[aria-busy="true"]:disabled {
  opacity: 1;
  filter: none;
  cursor: progress;
}
.velo.hoja-premium .boton.boton-oro[aria-busy="true"]:disabled { filter: brightness(.96) saturate(.95); }


/* =============================================================================
   10 · DETALLES DENTRO DE LA HOJA
   Paneles, filas y pastillas ya existentes leen sus tokens (redeclarados arriba).
   Aquí solo lo que hace falta para que casen con el grafito.
   ========================================================================== */

.velo.hoja-premium .hoja-cuerpo .panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.velo.hoja-premium .hoja-cuerpo .panel::after { display: none; }
.velo.hoja-premium .hoja-cuerpo .vacio { color: var(--tinta-media); }

/* Pastillas: el texto de color sobre su propio tinte, mezclado con blanco (>= 4,5:1). */
.velo.hoja-premium .pastilla-oro    { --p-tinta: #f0d9a8; }
.velo.hoja-premium .pastilla-verde  { --p-tinta: #b4e8cd; }
.velo.hoja-premium .pastilla-rojo   { --p-tinta: #f4b8b2; }
.velo.hoja-premium .pastilla-azul   { --p-tinta: #bdd0f1; }
:root[data-theme="dia"] .velo.hoja-premium .pastilla-oro    { --p-tinta: #f0d9a8; }
:root[data-theme="dia"] .velo.hoja-premium .pastilla-verde  { --p-tinta: #b4e8cd; }
:root[data-theme="dia"] .velo.hoja-premium .pastilla-rojo   { --p-tinta: #f4b8b2; }
:root[data-theme="dia"] .velo.hoja-premium .pastilla-azul   { --p-tinta: #bdd0f1; }

/* Las filas pulsables de una hoja: el foco con anillo de oro y el radio de la fila. */
.velo.hoja-premium .fila.pulsable:focus-visible { border-radius: var(--r-s); }


/* =============================================================================
   11 · AVISOS (toasts)
   Una pieza de grafito con su sello de tono (check verde, aviso rojo u oro), el
   canto en degradado y la sombra profunda. Entra con el muelle del sistema.
   ========================================================================== */

.avisos .aviso {
  --tono: var(--tinta-tenue);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 15px 20px 15px 62px;
  border-radius: var(--r-m);
  background: linear-gradient(165deg, #202126 0%, #0c0c0f 58%, #050506 125%);
  color: #e9edf5;
  font-family: var(--letra);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -.004em;
  overflow-wrap: anywhere;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 0 0 1px rgba(255, 255, 255, .07),
    0 1px 2px rgba(0, 0, 0, .6),
    0 22px 34px -16px rgba(0, 0, 0, .92);
  animation: hjAvisoEntra 460ms var(--muelle) backwards;
}
/* El sello de tono: la moneda de grafito con su aro y su glifo. */
.avisos .aviso::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  border-radius: 50%;
  /* (sobrescribe el filo lateral de piezas.css) */
  right: auto;
  bottom: auto;
  background: #0a0a0d no-repeat center / 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 1px 0 rgba(255, 255, 255, .12), 0 6px 12px -6px rgba(0, 0, 0, .9);
}
/* La luz del tono en la esquina: un velo que se apaga hacia la derecha. */
.avisos .aviso::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(120% 140% at 0% 50%, rgba(255, 255, 255, .06), transparent 60%);
}
.avisos .aviso-ok::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234fc98a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 1px rgba(79, 201, 138, .55), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 16px -4px rgba(79, 201, 138, .55);
}
.avisos .aviso-ok::after { background: radial-gradient(120% 140% at 0% 50%, rgba(79, 201, 138, .16), transparent 60%); }
.avisos .aviso-mal::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e8695f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5v7'/%3E%3Cpath d='M12 17.5h.01'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .6), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 16px -4px rgba(232, 105, 95, .6);
}
.avisos .aviso-mal::after { background: radial-gradient(120% 140% at 0% 50%, rgba(232, 105, 95, .18), transparent 60%); }
.avisos .aviso-ojo::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e3b35e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 6.5v7'/%3E%3Cpath d='M12 17.5h.01'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 0 1px rgba(227, 179, 94, .6), inset 0 1px 0 rgba(255, 255, 255, .1), 0 0 16px -4px rgba(227, 179, 94, .55);
}
.avisos .aviso-ojo::after { background: radial-gradient(120% 140% at 0% 50%, rgba(227, 179, 94, .16), transparent 60%); }
@keyframes hjAvisoEntra {
  from { opacity: 0; transform: translateY(18px) scale(.95); }
  to   { opacity: 1; transform: none; }
}
@media (max-width: 920px) {
  .avisos .aviso { max-width: 440px; }
}


/* =============================================================================
   12 · ACCIONES DE FILA (editar / borrar)
   Discretas en reposo, 44 px al tacto (40 con ratón + margen de acierto); se
   encienden en oro al señalarlas y en rojo la de borrar. Los colores salen de
   tokens y de la tinta, así que valen sobre una fila clara de "Día" y dentro de
   una ficha de grafito.
   ========================================================================== */

.fila-acciones.acciones-premium { gap: 4px; margin-left: var(--e2); }
.acciones-premium .boton-icono {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--r-s);
  background: transparent;
  color: var(--tinta-media);
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 260ms var(--muelle), background 180ms var(--suave), color 180ms var(--suave), box-shadow 180ms var(--suave);
}
/* El margen de acierto: el dedo no tiene que apuntar al dibujo. */
.acciones-premium .boton-icono::before { content: ''; position: absolute; inset: -2px; }
.acciones-premium .boton-icono svg { width: 17px; height: 17px; transition: transform 260ms var(--muelle); }
@media (hover: hover) and (pointer: fine) {
  .acciones-premium .boton-icono:hover {
    transform: translateY(-1px);
    background: var(--oro-tenue);
    color: var(--oro);
    box-shadow: inset 0 0 0 1px rgba(227, 179, 94, .34);
  }
  .acciones-premium .boton-icono:hover svg { transform: scale(1.08); }
  .acciones-premium .boton-icono-malo:hover {
    background: var(--rojo-tenue);
    color: var(--rojo);
    box-shadow: inset 0 0 0 1px rgba(232, 105, 95, .38);
  }
}
.acciones-premium .boton-icono:active {
  transform: scale(.9);
  background: var(--oro-tenue);
  color: var(--oro);
}
.acciones-premium .boton-icono-malo:active { background: var(--rojo-tenue); color: var(--rojo); }
.acciones-premium .boton-icono:focus-visible {
  outline: 2px solid var(--oro);
  outline-offset: 2px;
  border-radius: var(--r-s);
}
@media (pointer: coarse) {
  .acciones-premium .boton-icono {
    width: 44px;
    height: 44px;
    color: var(--tinta-media);
    background: rgba(128, 138, 160, .1);
    box-shadow: inset 0 0 0 1px rgba(128, 138, 160, .16);
  }
}
@supports (background: color-mix(in srgb, red 50%, blue)) {
  @media (pointer: coarse) {
    .acciones-premium .boton-icono {
      background: color-mix(in srgb, var(--tinta) 7%, transparent);
      box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tinta) 11%, transparent);
    }
    .acciones-premium .boton-icono:active { background: var(--oro-tenue); }
    .acciones-premium .boton-icono-malo:active { background: var(--rojo-tenue); }
  }
}


/* =============================================================================
   13 · TEMA "DÍA" Y MENOS MOVIMIENTO
   La hoja es de grafito también en "Día": lo que el kit afina para una página
   clara (sombras azuladas de los botones) se repone aquí a las de la noche. El
   velo, en "Día", es azul oscuro y no negro: el negro ensucia el papel.
   ========================================================================== */

:root[data-theme="dia"] .velo.hoja-premium { background: rgba(18, 26, 44, .46); }
:root[data-theme="dia"] .velo.hoja-premium .boton {
  --pm-b-sombra:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(0, 0, 0, .55),
    0 1px 2px rgba(0, 0, 0, .55),
    0 12px 22px -14px rgba(0, 0, 0, .85);
  --pm-b-sombra-hover:
    inset 0 1px 0 rgba(255, 255, 255, .1),
    inset 0 -1px 0 rgba(0, 0, 0, .55),
    0 1px 2px rgba(0, 0, 0, .55),
    0 16px 26px -14px rgba(0, 0, 0, .9),
    0 18px 30px -20px var(--pm-halo);
}
:root[data-theme="dia"] .velo.hoja-premium .boton.boton-oro {
  --pm-b-sombra:
    inset 0 1px 0 rgba(255, 250, 230, .6),
    inset 0 -1px 0 rgba(96, 60, 0, .38),
    0 1px 2px rgba(0, 0, 0, .45),
    0 12px 24px -12px var(--pm-halo),
    0 18px 30px -18px rgba(0, 0, 0, .65);
  --pm-b-sombra-hover:
    inset 0 1px 0 rgba(255, 250, 230, .7),
    inset 0 -1px 0 rgba(96, 60, 0, .38),
    0 1px 2px rgba(0, 0, 0, .45),
    0 16px 30px -12px var(--pm-halo),
    0 22px 34px -18px rgba(0, 0, 0, .7);
}
:root[data-theme="dia"] .velo.hoja-premium .boton.boton-fantasma { --pm-b-sombra: none; --pm-b-sombra-hover: none; }
/* El fantasma, sobre grafito, usa la tinta clara de la hoja (la del kit sigue al tema). */
.velo.hoja-premium .boton.boton-fantasma { color: var(--tinta-media); border-color: rgba(255, 255, 255, .14); }
@media (hover: hover) and (pointer: fine) {
  .velo.hoja-premium .boton.boton-fantasma:where(:not(:disabled)):hover { color: var(--tinta); }
}

@media (prefers-reduced-motion: reduce) {
  .velo.hoja-premium,
  .velo.hoja-premium .hoja,
  .velo.hoja-premium[data-estado="saliendo"],
  .velo.hoja-premium[data-estado="saliendo"] .hoja,
  .velo.hoja-premium .form-error,
  .velo.hoja-premium .form-detalle,
  .velo.hoja-premium .campo-malo .entrada,
  .velo.hoja-premium .campo-malo .segmentado,
  .velo.hoja-premium .campo-malo .elige-cuenta,
  .avisos .aviso { animation: none !important; }
  .velo.hoja-premium .segmentado > .segmento-guia,
  .velo.hoja-premium .cuenta-chip,
  .velo.hoja-premium .cc-marca,
  .velo.hoja-premium .cc-check,
  .velo.hoja-premium .hoja-aspa,
  .acciones-premium .boton-icono { transition: none; }
  .velo.hoja-premium .hoja-cerrar:hover .hoja-aspa { transform: none; }
}
