/*
 * Notificaciones push (M5, rediseño F18): tarjeta única con el interruptor, el estado, los dispositivos y la prueba de aviso.
 * Solo consume tokens (tokens.css). El interruptor es un botón `role="switch"`: el estado se lee por posición y relleno, no solo por color.
 */
.ey-push {
  display: flex;
  flex-direction: column;
  gap: var(--ey-space-4);
}

.ey-push > * {
  margin: 0;
}

.ey-push__head {
  display: flex;
  align-items: center;
  gap: var(--ey-space-2);
}

.ey-push__head .ey-icon {
  stroke: var(--ey-icon-on-soft);
}

.ey-push__head .ey-title {
  margin: 0;
  color: var(--ey-text);
  font-weight: var(--ey-weight-bold);
  overflow-wrap: anywhere;
}

.ey-push__intro {
  color: var(--ey-text-muted);
}

/* Fila del interruptor: texto a la izquierda (también activa el interruptor) e interruptor a la derecha. */
.ey-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ey-space-4);
}

.ey-switch-row__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  cursor: pointer;
}

.ey-switch-row__label {
  font-size: var(--ey-text-h3);
  font-weight: var(--ey-weight-semibold);
}

.ey-switch-row__hint {
  color: var(--ey-text-muted);
}

.ey-switch {
  position: relative;
  flex: none;
  width: var(--ey-switch-width);
  min-height: var(--ey-touch-min);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.ey-switch::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: var(--ey-switch-height);
  border: var(--ey-border-strong) solid var(--ey-accent);
  border-radius: var(--ey-radius-xl);
  background: transparent;
  transform: translateY(-50%);
  transition: background var(--ey-motion-fast) var(--ey-ease);
}

.ey-switch::after {
  content: '';
  position: absolute;
  top: 50%;
  left: calc(var(--ey-border-strong) + var(--ey-space-1));
  width: var(--ey-switch-thumb);
  height: var(--ey-switch-thumb);
  margin-top: calc(var(--ey-switch-thumb) / -2);
  border-radius: var(--ey-radius-round);
  background: var(--ey-accent);
  transition: transform var(--ey-motion-fast) var(--ey-ease), background var(--ey-motion-fast) var(--ey-ease);
}

.ey-switch[aria-checked='true']::before {
  background: var(--ey-accent);
}

.ey-switch[aria-checked='true']::after {
  background: var(--ey-text-on-accent);
  transform: translateX(calc(var(--ey-switch-width) - var(--ey-switch-thumb) - 2 * (var(--ey-border-strong) + var(--ey-space-1))));
}

.ey-switch[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.ey-push__state {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ey-space-2);
  color: var(--ey-text-muted);
}

.ey-push__state .ey-badge {
  margin: 0;
}

.ey-push__section {
  display: flex;
  flex-direction: column;
  gap: var(--ey-space-4);
  padding-top: var(--ey-space-4);
  border-top: var(--ey-border-width) solid var(--ey-border-subtle);
}

.ey-push__section > * {
  margin: 0;
}

.ey-push__subtitle {
  color: var(--ey-text);
  font-size: var(--ey-text-h3);
  font-weight: var(--ey-weight-semibold);
}

.ey-devices {
  display: flex;
  flex-direction: column;
  gap: var(--ey-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ey-device {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ey-space-2);
  padding: var(--ey-space-4) var(--ey-space-2) var(--ey-space-4) var(--ey-space-4);
  border-radius: var(--ey-radius-md);
  background: var(--ey-surface-quiet);
}

.ey-device > .ey-icon {
  stroke: var(--ey-text);
}

.ey-device__text {
  display: flex;
  flex: 1 1 var(--ey-device-text-min);
  padding-left: var(--ey-space-2);
  flex-direction: column;
  min-width: 0;
}

.ey-device__name {
  font-weight: var(--ey-weight-bold);
  overflow-wrap: anywhere;
}

.ey-device__id {
  font-weight: var(--ey-weight-medium);
  overflow-wrap: anywhere;
}

.ey-device__meta {
  color: var(--ey-text-muted);
  overflow-wrap: anywhere;
}

.ey-device .ey-button {
  flex: none;
  margin: 0 0 0 auto;
  padding: 0 var(--ey-space-4);
}

/* Probar un aviso: el resumen se ve como un enlace dentro de la tarjeta; el detalle se abre al pulsarlo. */
.ey-push__test > summary {
  display: flex;
  align-items: center;
  min-height: var(--ey-touch-min);
  color: var(--ey-accent);
  font-weight: var(--ey-weight-bold);
  cursor: pointer;
  list-style: none;
}

.ey-push__test > summary::-webkit-details-marker {
  display: none;
}

.ey-push__test[open] > summary {
  margin-bottom: var(--ey-space-2);
}

.ey-push__test > :not(summary) {
  margin: 0 0 var(--ey-space-4);
}

.ey-push__last {
  margin: 0;
  color: var(--ey-text-muted);
  text-align: center;
}

.ey-push-extra {
  margin: 0;
}

.ey-push-extra > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ey-touch-min);
  color: var(--ey-accent);
  font-weight: var(--ey-weight-semibold);
  cursor: pointer;
}
