/* Install center: the "Add to Home Screen" sheet and the step card (js/install-center.js).
   Colours come from the page theme tokens (--bg --card --text --muted --line) so both light and dark work. */

.install-wrap {
  position: fixed;
  inset: 0;
  z-index: 100000000;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  background: rgba(8, 10, 14, 0.62);
}
.install-sheet {
  width: min(560px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}
.install-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.install-sheet h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}
.install-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.install-lede,
.install-foot {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.install-foot {
  font-size: 13px;
}
.install-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.install-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}
.install-list img {
  border-radius: 10px;
}
.install-list strong {
  display: block;
  font-size: 16px;
}
.install-list small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
.install-primary {
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: #f5b82e;
  color: #1a1405;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
/* Got it on the step card: a darker swipe crosses the button as the card's time runs out */
.install-primary[data-install-done] {
  position: relative;
  overflow: hidden;
}
.install-primary[data-install-done] > span {
  position: relative;
}
.install-primary[data-install-done]::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 20, 5, 0.28);
  transform: translateX(-100%);
  animation: install-coach-swipe var(--coach-seconds, 20s) linear forwards;
}
@keyframes install-coach-swipe {
  to {
    transform: translateX(0);
  }
}
.install-secondary {
  min-height: 44px;
  margin-right: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.install-primary:disabled {
  opacity: 0.45;
  cursor: default;
}

/* the steps stay on screen while the person uses Safari's own buttons */
.install-coach {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  z-index: 100000001;
  width: min(520px, calc(100% - 32px));
  margin-inline: auto;
  padding: 16px 18px;
  border: 3px solid #f5c518;
  border-radius: 20px;
  background: var(--card);
  color: var(--text);
  box-shadow:
    0 0 0 4px rgba(245, 197, 24, 0.28),
    0 18px 50px rgba(0, 0, 0, 0.45);
}
.install-coach header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.install-coach header img {
  border-radius: 10px;
}
.install-coach strong {
  display: block;
  font-size: 16px;
}
.install-coach small {
  color: var(--muted);
  font-size: 13px;
}
.install-coach ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
  padding-left: 22px;
  font-size: 15px;
  line-height: 1.4;
}
.install-glyph {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  margin: 0 0.15em;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* entry points: the app menu footer and a pill on the launcher */
.suite-drawer-install,
.tool-launcher-install {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.suite-drawer-install {
  width: 100%;
  margin-top: 14px;
  border-radius: 14px;
}
.tool-launcher-install {
  margin-top: 8px;
}
.installed-web-app [data-install-center] {
  display: none;
}
