/* =========================================================
   Add-to-home-screen invitation.

   Sits above the content as a card rather than a full-width banner, because a
   banner pinned to the bottom of a phone lands exactly where the thumb rests
   and gets dismissed by accident.

   Nothing here renders until JS adds .is-open, so a visitor who never
   qualifies never pays for the layout.
   ========================================================= */

.wm-a2hs {
  position: fixed;
  z-index: 9000;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 28px));
  transform: translate(-50%, 140%);
  opacity: 0;
  visibility: hidden;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .35s ease, visibility 0s .5s;

  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px 15px;
  align-items: center;
  padding: 16px 17px;

  border-radius: 18px;
  border: 1px solid rgba(216, 173, 87, .26);
  background: linear-gradient(155deg, rgba(24, 20, 13, .97), rgba(9, 9, 9, .97));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: #e8eef6;
}

.wm-a2hs.is-open {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .35s ease, visibility 0s;
}

.wm-a2hs-icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  border: 1px solid rgba(216, 173, 87, .3);
  background: rgba(216, 173, 87, .09);
  display: grid; place-items: center;
  overflow: hidden;
}
.wm-a2hs-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.wm-a2hs-text b {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .1px;
  margin-bottom: 2px;
}
.wm-a2hs-text span {
  display: block;
  font-size: 12.8px;
  line-height: 1.5;
  color: rgba(232, 238, 246, .58);
}

.wm-a2hs-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 9px;
}

.wm-a2hs button {
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  border-radius: 10px;
  padding: 11px 16px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .12s ease, border-color .2s ease, background .2s ease;
}
.wm-a2hs button:active { transform: translateY(1px); }

.wm-a2hs-go {
  flex: 1;
  background: linear-gradient(135deg, #d8ad57, #f3d27d);
  color: #15100a;
}
.wm-a2hs-no {
  background: transparent;
  border-color: rgba(255, 255, 255, .13);
  color: rgba(232, 238, 246, .62);
}
.wm-a2hs-no:hover { border-color: rgba(255, 255, 255, .26); color: #e8eef6; }

/* --- iOS instructions ------------------------------------------------ */
.wm-a2hs-steps {
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: 12.8px;
  line-height: 1.75;
  color: rgba(232, 238, 246, .72);
  list-style: none;
  counter-reset: step;
}
.wm-a2hs-steps li { counter-increment: step; padding-inline-start: 26px; position: relative; }
.wm-a2hs-steps li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 0;
  top: 3px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: rgba(216, 173, 87, .16);
  color: #f2c86b;
  font-size: 10.5px; font-weight: 800;
  display: grid; place-items: center;
}
.wm-a2hs-steps .ios-share {
  display: inline-grid; place-items: center;
  width: 19px; height: 19px;
  vertical-align: -4px;
  color: #6fb2ff;
}
.wm-a2hs-steps .ios-share svg { width: 15px; height: 15px; }

/* The card is chrome, not content — it keeps the page's own direction so the
   buttons never end up reversed relative to the rest of the interface. */
[dir="rtl"] .wm-a2hs { direction: rtl; }

@media (prefers-reduced-motion: reduce) {
  .wm-a2hs { transition: opacity .2s ease, visibility 0s; transform: translate(-50%, 0); }
}

@media print { .wm-a2hs { display: none !important; } }
