:root {
  --mga-black: #111111;
  --mga-gold: #b49454;
  --mga-cream: #f6f3ed;
  --mga-safe-bottom: env(safe-area-inset-bottom, 0px);
}

.mga-install[hidden] { display: none !important; }

.mga-install {
  position: fixed;
  z-index: 2147483000;
  left: 14px;
  right: 14px;
  bottom: calc(16px + var(--mga-safe-bottom));
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  max-width: 580px;
  margin-inline: auto;
  padding: 14px 14px;
  color: #fff;
  background: rgba(17, 17, 17, .98);
  border: 1px solid rgba(180, 148, 84, .72);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .34);
  font-family: inherit;
}

.mga-install img { border-radius: 13px; }
.mga-install__copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.mga-install__copy strong { font-size: 14px; letter-spacing: .01em; }
.mga-install__copy span { margin-top: 4px; color: rgba(255,255,255,.74); font-size: 12px; }
.mga-install__button { min-height: 42px; padding: 0 15px; color: #111; background: #fff; border: 0; border-radius: 999px; font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
.mga-install__close { position: absolute; top: -10px; right: -7px; width: 28px; height: 28px; padding: 0; color: #111; background: #fff; border: 1px solid #ddd; border-radius: 50%; font: 20px/24px Arial, sans-serif; cursor: pointer; }

.mga-appbar { display: none; }

@media (max-width: 782px) {
  .mga-is-standalone body { padding-bottom: calc(73px + var(--mga-safe-bottom)); }
  .mga-is-standalone .mga-appbar {
    position: fixed;
    z-index: 2147482000;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    left: 0;
    right: 0;
    bottom: 0;
    min-height: calc(64px + var(--mga-safe-bottom));
    padding: 7px 5px var(--mga-safe-bottom);
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid rgba(17, 17, 17, .12);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, .08);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  .mga-appbar a,
  .mga-appbar button {
    appearance: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 50px;
    padding: 2px;
    color: #1a1a1a;
    background: transparent;
    border: 0;
    border-radius: 10px;
    text-decoration: none;
    font-family: inherit;
    font-size: 10px;
    font-weight: 650;
    line-height: 1.1;
    cursor: pointer;
  }

  .mga-appbar span { color: var(--mga-gold); font: 21px/1 Arial, sans-serif; }
  .mga-appbar a:focus-visible,
  .mga-appbar button:focus-visible { outline: 2px solid var(--mga-gold); outline-offset: 0; }
}

@media (max-width: 410px) {
  .mga-install { grid-template-columns: 44px minmax(0, 1fr); }
  .mga-install img { width: 44px; height: 44px; }
  .mga-install__button { grid-column: 1 / -1; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .mga-install, .mga-appbar { scroll-behavior: auto; }
}
