/*! install.css 1.0.0 | DJ2000-UK/app-workbench */
/* Add to Home Screen (install.js, docs/INSTALL.md): a glass sheet from the foot
   of a phone's screen with the app's icon and name, a picture of the browser's
   own menus with the button to tap ringed, and the taps in order. Every colour
   comes from the app's tokens, with Habit Horse's names as fallbacks (--cyan for
   --accent). Unlayered, like setup.css and feedback.css, and scoped to its own
   classes: it wins over an app's own element rules (h2, ol, button, img) inside
   the sheet, and touches nothing else. */

.install {
  --install-accent: var(--accent, var(--cyan));
  --install-surface: color-mix(in srgb, var(--ink) 11%, var(--panel));
  --install-raised: color-mix(in srgb, var(--ink) 17%, var(--panel));
  --install-skel: color-mix(in srgb, var(--ink) 15%, transparent);
  box-sizing: border-box;
  width: min(440px, calc(100vw - 16px));
  max-width: none;
  max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  /* On a phone it sits at the foot, under the thumb, clear of the home bar. */
  margin: auto auto max(8px, env(safe-area-inset-bottom, 0px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-edge, var(--line-strong, var(--line)));
  border-radius: 32px;
  background: var(--glass-sheen, none), color-mix(in srgb, var(--panel) 84%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: inset 0 1px color-mix(in srgb, var(--white, var(--ink)) 9%, transparent), 0 24px 80px color-mix(in srgb, var(--void) 70%, transparent);
  color: var(--ink);
  font-family: var(--grouped-font, var(--font-sans, system-ui));
  -webkit-user-select: none;
  user-select: none;
}
.install *, .install *::before, .install *::after { box-sizing: border-box; }
.install[open] { display: flex; flex-direction: column; animation: install-rise 420ms cubic-bezier(.2, .8, .2, 1); }
.install::backdrop { background: color-mix(in srgb, var(--void) 52%, transparent); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.install:focus { outline: none; }
html:has(.install[open]) { overflow: hidden; }
.install [hidden] { display: none !important; }

.install__box { display: grid; flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr) auto; }
.install__scroll { display: grid; min-height: 0; padding: 26px 18px 6px; gap: 16px; align-content: start; overflow-y: auto; overscroll-behavior: contain; }

/* The app's own icon and the one line that says what this is. */
.install__head { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 0 4px; gap: 14px; align-items: center; }
.install__icon { display: block; width: 58px; height: 58px; border-radius: 13px; box-shadow: 0 8px 22px color-mix(in srgb, var(--void) 45%, transparent); }
.install__head h2 { margin: 0; color: var(--ink); font-family: inherit; font-size: 21px; font-weight: 700; letter-spacing: -.025em; line-height: 1.18; text-transform: none; text-wrap: balance; }
.install[data-guide="android-install"] .install__head { padding-bottom: 6px; }

/* The picture: the browser's own toolbar, menu and sheets, drawn plainly. */
.install__stage {
  position: relative;
  height: 204px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--ink) 9%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--ink) 5%, var(--void));
  font-size: 13px;
  line-height: 1.2;
}
.install__frame { position: absolute; inset: 0; opacity: 0; transition: opacity 260ms ease; }
.install__frame.is-on { opacity: 1; }
.install__stage svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.install__stage svg .fill, .install__key svg .fill { fill: currentColor; stroke: none; }

/* The button to tap: a ring in the accent that pulses, as a Setup step points out its control. */
.install .m-hit {
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px var(--install-accent), 0 0 0 2px transparent;
  color: var(--ink);
  animation: install-hit 1.2s ease-in-out infinite;
}
@keyframes install-hit {
  50% { box-shadow: 0 0 0 2px var(--install-accent), 0 0 0 7px color-mix(in srgb, var(--install-accent) 26%, transparent); }
}

/* The page behind the browser's controls. */
.install .m-page { position: absolute; top: 16px; right: 18px; left: 18px; display: grid; gap: 9px; }
.install .m-page--below { top: 64px; }
.install .m-page i { display: block; height: 10px; border-radius: 5px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.install .m-page i:nth-child(1) { width: 46%; height: 14px; }
.install .m-page i:nth-child(2) { width: 92%; }
.install .m-page i:nth-child(3) { width: 78%; }
.install .m-page i:nth-child(4) { width: 64%; }

.install .m-round,
.install .m-address {
  display: flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 999px;
  background: var(--install-raised);
  color: var(--ink);
}
.install .m-round { width: 40px; flex: none; }
.install .m-round--small { width: 34px; height: 34px; }
.install .m-address { min-width: 0; padding: 0 12px; gap: 5px; color: var(--muted-bright, var(--muted)); font-size: 13px; font-weight: 600; white-space: nowrap; }
.install .m-address > span { overflow: hidden; text-overflow: ellipsis; }
.install .m-address svg { width: 13px; height: 13px; }
.install .m-pressed { background: color-mix(in srgb, var(--ink) 26%, var(--panel)); }
.install .m-dim { opacity: .45; }

/* Safari 27: ‹, the address with its page menu at the left, and Tabs, floating at the foot; Safari 26 has ••• for Tabs. */
.install .m-safari { position: absolute; right: 12px; bottom: 12px; left: 12px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }

/* Safari 18 and before: the address above a row of five buttons. */
.install .m-classic { position: absolute; right: 0; bottom: 0; left: 0; display: grid; padding: 10px 12px 8px; gap: 8px; border-top: 1px solid color-mix(in srgb, var(--ink) 8%, transparent); background: var(--install-surface); }
.install .m-address--classic { height: 34px; border-radius: 11px; }
.install .m-tools { display: grid; grid-template-columns: repeat(5, 1fr); justify-items: center; color: var(--muted-bright, var(--muted)); }
.install .m-tools > span { display: grid; width: 38px; height: 34px; place-items: center; border-radius: 11px; }
.install .m-tools > .m-hit { color: var(--install-accent); }

/* Chrome on an iPhone, and Android: the address at the top. */
.install .m-chrome,
.install .m-droid { position: absolute; top: 12px; right: 12px; left: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.install .m-droid { grid-template-columns: minmax(0, 1fr) auto auto; }
.install .m-address--chrome,
.install .m-address--droid { height: 38px; }
.install .m-address--droid { justify-content: flex-start; }
.install .m-tabcount { display: grid; width: 22px; height: 22px; place-items: center; border: 2px solid var(--muted-bright, var(--muted)); border-radius: 6px; color: var(--muted-bright, var(--muted)); font-size: 11px; font-weight: 800; }
.install .m-droid .m-round { border-color: transparent; background: none; }
.install .m-droid .m-round.m-hit { background: var(--install-raised); }

/* Menus: rows with the one to tap lit, the rest grey bars. */
.install .m-menu {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 178px;
  padding: 6px;
  gap: 2px;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: 18px;
  background: var(--install-raised);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--void) 55%, transparent);
  transform-origin: 100% 100%;
}
.install .m-menu--safari { bottom: 62px; }
.install .m-menu--left { right: auto; left: 52px; transform-origin: 0 100%; }
.install .m-address--page { justify-content: flex-start; padding-left: 5px; }
.install .m-page-menu { display: grid; width: 30px; height: 30px; flex: none; place-items: center; border-radius: 50%; color: var(--ink); }
.install .m-address--page .m-page-menu svg { width: 17px; height: 17px; }
.install .m-menu--droid { top: 8px; bottom: auto; width: 206px; border-radius: 12px; transform-origin: 100% 0; }
.install .m-row { display: flex; min-height: 31px; padding: 0 10px; gap: 10px; align-items: center; justify-content: space-between; border-radius: 11px; color: var(--ink); font-size: 13px; font-weight: 600; white-space: nowrap; }
.install .m-row svg { width: 18px; height: 18px; }
.install .m-row.m-hit { background: color-mix(in srgb, var(--install-accent) 20%, var(--install-raised)); }
.install .m-menu--droid .m-row { justify-content: flex-start; }
.install .m-skel i { display: block; width: 62%; height: 8px; border-radius: 4px; background: var(--install-skel); }
.install .m-skel:nth-child(odd) i { width: 48%; }
.install .m-icons { display: grid; grid-template-columns: repeat(4, 1fr); min-height: 34px; padding: 0 6px; justify-items: center; align-items: center; border-bottom: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); }
.install .m-icons i { width: 18px; height: 18px; border-radius: 5px; background: var(--install-skel); }

/* The share sheet and Add to Home Screen, rising from the foot. */
.install .m-sheet {
  position: absolute;
  top: 14px;
  right: 10px;
  bottom: -1px;
  left: 10px;
  display: grid;
  padding: 12px;
  gap: 10px;
  align-content: start;
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  background: var(--install-surface);
  box-shadow: 0 -10px 30px color-mix(in srgb, var(--void) 45%, transparent);
}
.install .m-sheet__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: center; }
.install .m-favicon { display: block; width: 28px; height: 28px; border-radius: 7px; }
.install .m-icon-blank { background: var(--install-skel); }
.install .m-lines { display: grid; min-width: 0; gap: 1px; }
.install .m-lines b, .install .m-name { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.install .m-lines small, .install .m-dialog small { display: block; overflow: hidden; color: var(--muted-bright, var(--muted)); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.install .m-people { display: flex; gap: 12px; }
.install .m-people i { width: 28px; height: 28px; border-radius: 50%; background: var(--install-skel); }
.install .m-actions { display: flex; gap: 12px; align-items: center; }
.install .m-actions i,
.install .m-actions span { width: 36px; height: 36px; border-radius: 50%; background: var(--install-skel); }
.install .m-actions span { display: grid; margin-left: auto; place-items: center; background: var(--install-raised); color: var(--ink); }
.install .m-list { display: grid; padding: 3px; border-radius: 13px; background: color-mix(in srgb, var(--ink) 6%, transparent); }

.install .m-sheet--add { gap: 9px; }
.install .m-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-height: 30px; gap: 6px; align-items: center; color: var(--install-accent); font-size: 13px; font-weight: 600; }
.install .m-nav b { overflow: hidden; color: var(--ink); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.install .m-nav__add { padding: 5px 12px; border-radius: 999px; font-weight: 800; }
.install .m-card { display: flex; min-height: 50px; padding: 8px 10px; gap: 10px; align-items: center; border-radius: 13px; background: color-mix(in srgb, var(--ink) 6%, transparent); }
.install .m-card--switch { min-height: 40px; justify-content: space-between; font-size: 13px; font-weight: 600; }
.install .m-app-icon { display: block; width: 36px; height: 36px; flex: none; border-radius: 9px; }
.install .m-app-icon--small { width: 30px; height: 30px; border-radius: 8px; }
.install .m-switch { position: relative; width: 38px; height: 23px; flex: none; border-radius: 999px; background: var(--positive); }
.install .m-switch::after { position: absolute; top: 2px; right: 2px; width: 19px; height: 19px; border-radius: 50%; background: var(--white, var(--ink)); content: ""; }

/* Android's install dialog. */
.install .m-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(236px, calc(100% - 28px));
  padding: 16px 16px 10px;
  gap: 12px;
  border-radius: 22px;
  background: var(--install-raised);
  box-shadow: 0 18px 44px color-mix(in srgb, var(--void) 60%, transparent);
  font-size: 13px;
  transform: translate(-50%, -50%);
}
.install .m-dialog > b { font-size: 15px; }
.install .m-dialog__app { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; }
.install .m-dialog__buttons { display: flex; gap: 6px; justify-content: flex-end; color: var(--install-accent); font-weight: 700; }
.install .m-dialog__buttons > span { padding: 7px 12px; border-radius: 999px; }

/* Each picture comes in as the browser's own does: menus open from their button, sheets rise. */
.install__frame.is-on .m-menu { animation: install-pop 320ms cubic-bezier(.2, .8, .2, 1) both; }
.install__frame.is-on .m-sheet { animation: install-up 380ms cubic-bezier(.2, .8, .2, 1) both; }
.install__frame.is-on .m-dialog { animation: install-zoom 320ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes install-rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes install-pop { from { opacity: 0; transform: scale(.86); } }
@keyframes install-up { from { transform: translateY(70%); } }
@keyframes install-zoom { from { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }

/* The taps, in order. A tap on one shows its picture. */
.install__steps { display: grid; margin: 0; padding: 0; gap: 2px; list-style: none; }
.install__steps li { margin: 0; padding: 0; }
.install__step {
  display: grid;
  width: 100%;
  min-height: 46px;
  padding: 6px 10px;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 15px;
  background: none;
  color: var(--muted-bright, var(--muted));
  font: inherit;
  font-size: 16px;
  letter-spacing: -.01em;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.install__step[aria-current="step"] { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.install__step b { color: var(--ink); font-weight: 650; }
.install__n { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--ink) 13%, transparent); color: var(--ink); font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; transition: background-color 200ms ease, color 200ms ease; }
.install__step[aria-current="step"] .install__n { background: var(--install-accent); color: var(--accent-ink, var(--void)); }
.install__key { display: inline-grid; width: 34px; height: 26px; margin: 0 1px; place-items: center; vertical-align: -7px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 13%, transparent); color: var(--ink); }
.install__key svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Not now, and Install where the browser can install it in one tap: More's 56 px bold capitals. */
.install__foot { display: grid; padding: 8px 18px 18px; gap: 10px; }
.install__foot--two { grid-template-columns: 1fr 1fr; }
.install__btn {
  min-height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: var(--install-accent);
  color: var(--accent-ink, var(--void));
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.install__btn--quiet { background: color-mix(in srgb, var(--ink) 12%, transparent); color: var(--ink); }
.install__btn:active { filter: brightness(.92); }
.install__btn:focus-visible,
.install__step:focus-visible { outline: 2px solid var(--install-accent); outline-offset: 2px; }

/* A wide screen: in the middle, as a dialog. */
@media (min-width: 901px), (pointer: fine) {
  .install { margin: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .install[open],
  .install .m-hit,
  .install__frame.is-on .m-menu,
  .install__frame.is-on .m-sheet,
  .install__frame.is-on .m-dialog { animation: none; }
  .install__frame,
  .install__step,
  .install__n { transition: none; }
}
