
.ha-smart-install,
.ha-smart-install * { box-sizing: border-box; }

.ha-smart-install {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  font-family: inherit;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

.ha-smart-install--visible {
  opacity: 1;
  pointer-events: auto;
}

.ha-smart-install--leaving {
  opacity: 0;
  pointer-events: none;
}

.ha-smart-install__scrim {
  position: absolute;
  inset: 0;
  background: rgba(13, 25, 36, .28);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.ha-smart-install__sheet {
  position: relative;
  width: min(100%, 450px);
  padding: 18px 18px calc(16px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.74);
  border-radius: 28px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 24px 70px rgba(16, 33, 49, .22);
  color: #20384d;
  transform: translateY(24px) scale(.985);
  transition: transform .28s cubic-bezier(.2,.72,.2,1);
  text-align: right;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ha-smart-install__sheet::-webkit-scrollbar { display: none; }

.ha-smart-install--visible .ha-smart-install__sheet {
  transform: translateY(0) scale(1);
}

.ha-smart-install__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: #f1f4f6;
  color: #6e7f8c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 400 27px/1 Arial, sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ha-smart-install__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 46px;
}

.ha-smart-install__icon {
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #f5f7f9;
  border: 1px solid #edf1f4;
}

.ha-smart-install__icon img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.ha-smart-install__brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ha-smart-install__brand-copy span {
  direction: ltr;
  text-align: right;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: .09em;
  color: #2a4861;
}

.ha-smart-install__brand-copy small {
  font-size: 10.5px;
  line-height: 1.6;
  color: #81909c;
}

.ha-smart-install__sheet h2 {
  margin: 18px 0 10px;
  padding: 0;
  font-size: clamp(20px, 5.2vw, 24px);
  line-height: 1.55;
  font-weight: 850;
  color: #20384d;
}

.ha-smart-install__sheet p {
  margin: 0 0 16px;
  padding: 0;
  font-size: 13px;
  line-height: 1.95;
  color: #6f808e;
}

.ha-smart-install__benefits {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ha-smart-install__benefits li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  line-height: 1.85;
  color: #596b79;
}

.ha-smart-install__benefits li::before {
  content: "✓";
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #f0f4f7;
  color: #294a66;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
}

.ha-smart-install__benefits span { min-width: 0; }

.ha-smart-install__benefits strong {
  color: #294a66;
  font-weight: 850;
}

.ha-smart-install__primary,
.ha-smart-install__later {
  width: 100%;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ha-smart-install__primary {
  min-height: 54px;
  border-radius: 18px;
  padding: 13px 18px;
  background: #294a66;
  color: #fff;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(41, 74, 102, .20);
}

.ha-smart-install__primary:active { transform: translateY(1px); }
.ha-smart-install__primary.is-loading { opacity: .78; cursor: wait; }

.ha-smart-install__later {
  min-height: 42px;
  margin-top: 4px;
  padding: 8px 14px;
  background: transparent;
  color: #8996a0;
  font-size: 12px;
  font-weight: 700;
}

.ha-smart-install__primary:focus-visible,
.ha-smart-install__later:focus-visible,
.ha-smart-install__close:focus-visible {
  outline: 3px solid rgba(41, 74, 102, .22);
  outline-offset: 2px;
}

@media (min-width: 560px) {
  .ha-smart-install { align-items: center; }
}

@media (max-width: 380px) {
  .ha-smart-install__sheet {
    padding-left: 16px;
    padding-right: 16px;
  }
  .ha-smart-install__brand {
    gap: 10px;
    padding-right: 44px;
  }
  .ha-smart-install__sheet h2 {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ha-smart-install,
  .ha-smart-install__sheet { transition: none !important; }
}
