@layer aios.components {
/* AIOS "Add to Home Screen" prompt — mobile only (iOS + Android).
   Self-contained; rendered by aios-install-prompt.js. Theme-aware. */

.aios-a2hs-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-top) + 4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 12px calc(14px + env(safe-area-inset-bottom, 0px));
  background: rgba(6, 12, 24, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.aios-a2hs-backdrop.is-visible {
  opacity: 1;
}

.aios-a2hs-card {
  position: relative;
  width: min(440px, 100%);
  color: #0b1220;
  border-radius: 22px;
  background: linear-gradient(160deg, #ffffff, #eef4ff);
  box-shadow: 0 26px 70px rgba(9, 20, 48, 0.36), 0 0 0 1px rgba(9, 46, 170, 0.06) inset;
  padding: 18px 18px 16px;
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.3s ease;
}

.aios-a2hs-backdrop.is-visible .aios-a2hs-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.aios-a2hs-head {
  display: flex;
  align-items: center;
  gap: 13px;
}

.aios-a2hs-logo {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.22);
}

.aios-a2hs-titles {
  min-width: 0;
}

.aios-a2hs-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.aios-a2hs-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(11, 18, 32, 0.62);
}

.aios-a2hs-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: rgba(11, 18, 32, 0.5);
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.aios-a2hs-close:hover {
  color: #0b1220;
  background: rgba(9, 46, 170, 0.1);
}

.aios-a2hs-close:active {
  transform: scale(0.92);
}

/* iOS step-by-step instructions */
.aios-a2hs-steps {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.aios-a2hs-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #101a2e;
}

.aios-a2hs-steps .aios-a2hs-glyph {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #2458f6;
  background: rgba(36, 88, 246, 0.1);
}

.aios-a2hs-steps svg {
  width: 17px;
  height: 17px;
}

.aios-a2hs-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
}

.aios-a2hs-btn {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 13px;
  border: 0;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.aios-a2hs-btn:active {
  transform: scale(0.98);
}

.aios-a2hs-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #2458f6, #4d84ff);
  box-shadow: 0 12px 26px rgba(36, 88, 246, 0.32);
}

.aios-a2hs-btn.primary:hover {
  filter: brightness(1.05);
}

.aios-a2hs-btn.ghost {
  flex: 0 0 auto;
  color: rgba(11, 18, 32, 0.66);
  background: rgba(9, 46, 170, 0.07);
}

.aios-a2hs-btn.ghost:hover {
  background: rgba(9, 46, 170, 0.12);
}

/* Dark theme */
body[data-theme="dark"] .aios-a2hs-card {
  color: #eef2f7;
  background: linear-gradient(160deg, #1a2130, #10151f);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

body[data-theme="dark"] .aios-a2hs-sub {
  color: rgba(238, 242, 247, 0.62);
}

body[data-theme="dark"] .aios-a2hs-close {
  color: rgba(238, 242, 247, 0.55);
}

body[data-theme="dark"] .aios-a2hs-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .aios-a2hs-steps li {
  color: #e7ecf4;
}

body[data-theme="dark"] .aios-a2hs-steps .aios-a2hs-glyph {
  color: #9cc0ff;
  background: rgba(79, 139, 255, 0.16);
}

body[data-theme="dark"] .aios-a2hs-btn.ghost {
  color: rgba(238, 242, 247, 0.72);
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .aios-a2hs-btn.ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .aios-a2hs-backdrop,
  .aios-a2hs-card {
    transition: opacity 0.2s ease;
  }
  .aios-a2hs-backdrop.is-visible .aios-a2hs-card {
    transform: none;
  }
}
}
