/*
 * RÉPLICAS DE INTERFAZ (heros). Ver ADR 0010 y DESIGN.md → «Réplicas».
 *
 * Excepción documentada a «solo tokens del sistema de diseño»: dentro de `.rp` se
 * usan los colores y tipografías REALES de las interfaces que se replican (Google,
 * Chrome, Android/iOS), declarados aquí como variables `--g-*` / `--c-*`. Fuera
 * de las réplicas no se usan.
 *
 * Layout: una sola estructura con dos aspectos por container query:
 *   ≥ 560 px de escenario → ventana de Chrome de escritorio.
 *   < 560 px              → teléfono (barra de estado + barra de Chrome Android).
 */

.rp {
  /* Google */
  --g-bg: #ffffff;
  --g-text: #1f1f1f;
  --g-text-2: #4d5156;
  --g-text-3: #70757a;
  --g-link: #1a0dab;
  --g-link-visited: #681da8;
  --g-blue: #4285f4;
  --g-blue-ui: #0b57d0;
  --g-red: #ea4335;
  --g-yellow: #fbbc05;
  --g-green: #34a853;
  --g-star: #fbbc04;
  --g-open: #188038;
  --g-closed: #d93025;
  --g-border: #dadce0;
  --g-divider: #ebebeb;
  --g-chip: #f1f3f4;
  --g-hover: #f8f9fa;
  --g-tint: #e8f0fe;
  --g-font: Arial, "Liberation Sans", Helvetica, sans-serif;
  --g-font-ui: "Google Sans", Roboto, Arial, "Liberation Sans", Helvetica, sans-serif;
  /* Chrome (tema claro) */
  --c-frame: #dfe3e8;
  --c-toolbar: #ffffff;
  --c-omni: #edf0f4;
  --c-icon: #474747;
  /* Sistema */
  --os-notif: #f2f2f4;

  container: rp / inline-size;
  position: relative;
  width: 100%;
  font-family: var(--g-font);
  color: var(--g-text);
  -webkit-font-smoothing: antialiased;
  text-align: left;
  line-height: normal;
  letter-spacing: normal;
}
.rp *,
.rp *::before,
.rp *::after {
  box-sizing: border-box;
}
.rp svg {
  display: block;
}

/* ---------- Carcasa ---------- */
.rp-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: var(--rp-h-m);
  max-width: 430px;
  margin-inline: auto;
  overflow: hidden;
  background: var(--g-bg);
  border-radius: 34px;
  box-shadow:
    0 0 0 7px #0d0c0b,
    0 0 0 8px rgb(255 255 255 / 0.14),
    0 30px 60px -20px rgb(0 0 0 / 0.6);
  isolation: isolate;
}
.rp-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--g-bg);
}
.rp-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* Barra de Chrome de escritorio: oculta en teléfono. */
.rp-chrome {
  display: none;
}
.rp-phonebar {
  flex: none;
  background: #ffffff;
  border-bottom: 1px solid var(--g-divider);
}
.rp-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 30px;
  padding: 6px 22px 0 26px;
  font: 600 14px/1 var(--g-font-ui);
  color: #111;
}
.rp-status-ico {
  display: flex;
  align-items: center;
  gap: 5px;
}
.rp-status-ico i {
  display: block;
  background: #111;
}
.rp-signal {
  width: 15px;
  height: 10px;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.rp-wifi {
  width: 14px;
  height: 10px;
  border-radius: 14px 14px 0 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.rp-battery {
  width: 22px;
  height: 11px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px #111;
  background: linear-gradient(90deg, #111 0 72%, transparent 72%) !important;
  background-clip: content-box !important;
  padding: 2.5px;
}
.rp-momni {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 12px 6px 14px;
}
.rp-momni .rp-url {
  flex: 1;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 14px 0 38px;
  margin-left: -34px;
  border-radius: 20px;
  background: var(--c-omni);
  font: 15px/1.3 var(--g-font-ui);
  color: #1f1f1f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-momni .rp-omni-ico {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  margin-left: 12px;
  color: var(--c-icon);
}
.rp-tabcount {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-icon);
  border-radius: 5px;
  font: 700 11px/1 var(--g-font-ui);
  color: var(--c-icon);
}
.rp-tool {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--c-icon);
}
.rp-tool-off {
  opacity: 0.35;
}

/* Favicon redondo (resultados, pestañas). */
.rp-fav {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font: 700 10px/1 var(--g-font-ui);
}
.rp-fav-google {
  background: #fff;
  color: var(--g-blue);
  box-shadow: inset 0 0 0 1px var(--g-border);
}

@container rp (min-width: 560px) {
  .rp-shell {
    height: var(--rp-h-d);
    max-width: none;
    border-radius: 12px;
    box-shadow:
      0 0 0 1px rgb(255 255 255 / 0.12),
      0 40px 80px -30px rgb(0 0 0 / 0.75);
  }
  .rp-phonebar {
    display: none;
  }
  .rp-chrome {
    display: block;
    flex: none;
    background: var(--c-frame);
  }
  .rp-tabstrip {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 42px;
    padding: 0 12px 0 14px;
  }
  .rp-lights {
    display: flex;
    gap: 8px;
    align-self: center;
    margin-right: 14px;
  }
  .rp-lights i {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f57;
    box-shadow: inset 0 0 0 0.5px rgb(0 0 0 / 0.15);
  }
  .rp-lights i:nth-child(2) {
    background: #febc2e;
  }
  .rp-lights i:nth-child(3) {
    background: #28c840;
  }
  .rp-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
    width: 240px;
    height: 34px;
    padding: 0 10px 0 12px;
    background: var(--c-toolbar);
    border-radius: 10px 10px 0 0;
    font: 12.5px/1 var(--g-font-ui);
    color: #1f1f1f;
  }
  .rp-tab::before,
  .rp-tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 0 0, transparent 9.5px, var(--c-toolbar) 10px);
  }
  .rp-tab::before {
    left: -10px;
    background: radial-gradient(circle at 0 0, transparent 9.5px, var(--c-toolbar) 10px);
    transform: scaleX(-1);
  }
  .rp-tab::after {
    right: -10px;
  }
  .rp-tab-fav {
    width: 16px;
    height: 16px;
    font-size: 9px;
  }
  .rp-tab-title {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rp-tab-x {
    width: 14px;
    height: 14px;
    color: #5f6368;
  }
  .rp-newtab {
    align-self: center;
    margin-left: 6px;
    font: 300 22px/1 var(--g-font-ui);
    color: #474747;
  }
  .rp-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 44px;
    padding: 0 14px;
    background: var(--c-toolbar);
    border-bottom: 1px solid var(--g-divider);
  }
  .rp-omni {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 34px;
    padding: 0 14px;
    margin-left: 4px;
    border-radius: 17px;
    background: var(--c-omni);
    font: 14px/1 var(--g-font-ui);
    color: #1f1f1f;
    min-width: 0;
  }
  .rp-omni-ico {
    width: 16px;
    height: 16px;
    color: var(--c-icon);
    flex: none;
  }
  .rp-omni .rp-url {
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .rp-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #8d6e63;
    box-shadow: inset 0 -8px 0 #6d4c41;
  }
}

/* ---------- Notificación del sistema (mensaje que llega) ---------- */
.rp-notif {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 2px 11px;
  padding: 12px 14px 13px 12px;
  border-radius: 20px;
  background: var(--os-notif);
  box-shadow:
    0 0 0 1px rgb(0 0 0 / 0.06),
    0 14px 34px -8px rgb(0 0 0 / 0.35);
  font-family: var(--g-font-ui);
  color: #111;
  will-change: transform, opacity;
}
.rp-notif-app {
  grid-row: span 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #25d366;
}
.rp-notif-app svg {
  width: 26px;
  height: 26px;
}
.rp-notif-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #6b6b6b;
}
.rp-notif-from {
  font-size: 14.5px;
  font-weight: 700;
}
.rp-notif-text {
  font-size: 14px;
  line-height: 1.32;
  color: #222;
}
@container rp (min-width: 560px) {
  .rp-notif {
    top: 12px;
    left: auto;
    right: 18px;
    width: 340px;
    border-radius: 16px;
  }
}

/* ---------- Cursor y toque ---------- */
.rp-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 17px;
  height: 23px;
  will-change: transform, opacity;
}
.rp-touch {
  position: absolute;
  top: -22px;
  left: -22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgb(60 64 67 / 0.22);
  box-shadow: 0 0 0 1.5px rgb(60 64 67 / 0.3);
  will-change: transform, opacity;
}
.rp-cursor {
  display: none;
}
@container rp (min-width: 560px) {
  .rp-cursor {
    display: block;
  }
  .rp-touch {
    display: none;
  }
}
