@layer components {
  /* Desactivar cualquier isla de iPhone heredada en todo el sitio */
  .phone__island,
  .kob-phone-notch {
    display: none;
  }

  /* Marco único de dispositivo Android (.ks-device) */
  .ks-device {
    --ks-dev-w: min(90vw, 268px);
    position: relative;
    width: var(--ks-dev-w);
    margin-inline: auto;
    container-type: inline-size;
    user-select: none;
  }

  @media (max-width: 768px) {
    .ks-device {
      --ks-dev-w: min(86vw, 228px);
    }
  }

  .ks-device__body {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 10px;
    border-radius: 44px;
    corner-shape: squircle;
    background: linear-gradient(160deg, #1b2434 0%, #0b1019 52%, #070a10 100%);
    box-shadow:
      0 26px 64px rgba(1, 6, 15, 0.68),
      0 6px 18px rgba(0, 0, 0, 0.42),
      inset 0 1px 1px rgba(255, 255, 255, 0.18),
      inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }

  /* Brillo sutil de bisel metálico sin backdrop-filter */
  .ks-device__body::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, transparent 32%, transparent 72%, rgba(45, 212, 191, 0.06) 100%);
    z-index: 4;
  }

  /* Barra de estado Android dedicada arriba de la pantalla:
     la cámara perforada vive acá y jamás tapa las píldoras del Flow ni el AppBar */
  .ks-device__status {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 28px;
    padding-inline: 18px;
    background: #080c12;
    border-top-left-radius: 34px;
    border-top-right-radius: 34px;
    color: rgba(241, 245, 249, 0.86);
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .ks-device__time {
    justify-self: start;
    font-variant-numeric: tabular-nums;
  }

  /* Cámara perforada Android centrada en la barra de estado */
  .ks-device__cam {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: radial-gradient(circle at 38% 36%, #1e293b 0%, #090d14 45%, #020408 100%);
    box-shadow:
      inset 0 0 0 1.2px rgba(255, 255, 255, 0.14),
      0 0 0 1px rgba(0, 0, 0, 0.65);
    justify-self: center;
  }

  .ks-device__sys {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    opacity: 0.86;
  }

  .ks-device__sys svg {
    width: auto;
    height: 11px;
    display: block;
    fill: currentColor;
  }

  .ks-device__screen {
    position: relative;
    width: 100%;
    aspect-ratio: 393 / 852;
    background: #080c12;
    border-bottom-left-radius: 34px;
    border-bottom-right-radius: 34px;
    overflow: hidden;
  }

  .ks-device__shot,
  .ks-device__screen > img,
  .ks-device__screen > picture > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    opacity: 0;
    transform: translateY(8px);
    transition:
      opacity var(--dur-med, 280ms) var(--ease-out, ease-out),
      transform var(--dur-med, 280ms) var(--ease-out, ease-out);
    pointer-events: none;
  }

  .ks-device__shot.is-on,
  .ks-device__shot.is-active,
  .ks-device__screen > img.is-on,
  .ks-device__screen > img.is-active,
  .ks-device__screen > .ks-device__shot:only-child,
  .ks-device__screen > img:only-child,
  .ks-device__screen > picture:only-child > img {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 2;
  }

  /* Onboarding 5-step diorama inside .ks-device */
  #kob-s1:checked ~ .kob-stage .ks-device__screen > .kob-shot--s1,
  #kob-s2:checked ~ .kob-stage .ks-device__screen > .kob-shot--s2,
  #kob-s3:checked ~ .kob-stage .ks-device__screen > .kob-shot--s3,
  #kob-s4:checked ~ .kob-stage .ks-device__screen > .kob-shot--s4,
  #kob-s5:checked ~ .kob-stage .ks-device__screen > .kob-shot--s5 {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    z-index: 2;
  }

  /* Reflejo diagonal sutil de vidrio */
  .ks-device__screen::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.015) 28%, transparent 54%);
  }

  /* Barra gestual inferior Android */
  .ks-device__screen::before {
    content: "";
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 32%;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
    z-index: 4;
    pointer-events: none;
  }

  @media (prefers-reduced-motion: reduce) {
    .ks-device__shot {
      transition: none;
      transform: none;
    }
  }
}
