/* Install / update UI for the phone app (see js/app.js). Kept apart from site.css so the theme file stays untouched. */

.app-pill,
.app-toast {
  position: fixed;
  left: 50%;
  z-index: 70;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  padding: 9px 10px 9px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--panel-solid);
  color: var(--ink-1);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  font: 600 13px/1.35 var(--body);
}

.app-pill { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
.app-toast { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); border-radius: 14px; }

.app-pill[hidden],
.app-toast[hidden] { display: none; }

.app-pill__icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--gold-2), var(--gold-3));
  color: var(--gold-ink);
}

.app-pill__icon svg { width: 17px; height: 17px; }

.app-pill__text { font-weight: 500; color: var(--ink-2); }
.app-pill__text b { display: block; color: var(--ink-1); font-weight: 700; }

.app-pill__btn,
.app-toast__btn {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(150deg, var(--gold-2), var(--gold-3));
  color: var(--gold-ink);
  font: 700 12.5px/1 var(--body);
  cursor: pointer;
}

.app-pill__btn:hover,
.app-toast__btn:hover { background: linear-gradient(150deg, var(--gold-1), var(--gold-2)); }

.app-pill__close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font: 400 17px/1 var(--body);
  cursor: pointer;
}

.app-pill__close:hover { background: var(--panel-strong); color: var(--ink-1); }

/* Installed and running standalone: nothing to offer. */
html.is-app .app-pill { display: none; }

@media (max-width: 420px) {
  .app-pill { padding-left: 12px; }
  .app-pill__text { font-size: 12.5px; }
}

@media (prefers-reduced-motion: no-preference) {
  .app-pill,
  .app-toast { animation: app-rise 0.32s var(--ease-out) both; }
  @keyframes app-rise {
    from { opacity: 0; transform: translate(-50%, 12px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }
}
