/*
  THE "ADD TO HOME SCREEN" CARD. Phones only, second visit onwards.

  Shared and byte-identical with every site on the network, like tabbar.css
  next to it. Same defensive habits for the same reason: this file is dropped
  into seven sites with seven unrelated stylesheets, and a bare element
  selector in any one of them would otherwise reach in. So the host element is
  <jdl-install>, a tag name no site has a rule for, and every property a host
  might plausibly set on a card is declared here rather than left to chance.

  It sits ABOVE the tab bar, never over it: --jdl-tabbar-h is the bar's height
  and is 0px wherever the bar is not shown, so the one expression is right in
  both cases. See tabbar.css for where that variable comes from.
*/

jdl-install { display: none; }

@media (max-width: 640px) {
  jdl-install.jdl-install {
    display: block;
    box-sizing: border-box;
    position: fixed;
    top: auto;
    right: 10px;
    left: 10px;
    /* clear of the tab bar, plus the home bar on a phone that has one */
    bottom: calc(var(--jdl-tabbar-h, 0px) + 10px + env(safe-area-inset-bottom, 0px));
    z-index: 39;                 /* under the tab bar (40), over the page */
    margin: 0;
    padding: 12px 12px 12px 14px;
    border: 1px solid #E4EAF4;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px -10px rgba(11, 18, 32, .35);
    color: #0B1220;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    transition: transform .26s cubic-bezier(.4, 0, .2, 1), opacity .26s;
  }

  jdl-install.jdl-install.is-up { transform: translateY(0); opacity: 1; }

  @media (prefers-reduced-motion: reduce) {
    jdl-install.jdl-install { transition: none; }
  }

  .jdl-install-row {
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    display: flex;
    align-items: flex-start;
    gap: 11px;
  }

  .jdl-install-icon {
    flex: none;
    width: 38px;
    height: 38px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    display: block;
    background: #F5F8FE;
  }

  .jdl-install-text { flex: 1; min-width: 0; margin: 0; padding: 0; }

  .jdl-install-text b {
    display: block;
    margin: 0;
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: #0B1220;
  }

  .jdl-install-text span {
    display: block;
    margin: 1px 0 0;
    font-size: 12.5px;
    font-weight: 400;
    color: #5A6478;
  }

  /* The share glyph, drawn inline so the iOS line reads as the real button. */
  .jdl-install-text i {
    font-style: normal;
    display: inline-flex;
    width: 15px;
    height: 15px;
    vertical-align: -3px;
    margin: 0 1px;
  }
  .jdl-install-text i svg { width: 100%; height: 100%; display: block; }

  .jdl-install-acts {
    margin: 10px 0 0;
    padding: 0;
    border: 0;
    background: none;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  /* Both buttons are at least 44px tall, the platform's tap-target floor. */
  .jdl-install-go,
  .jdl-install-no {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .jdl-install-go {
    flex: 1;
    border: 0;
    background: var(--jdl-install-accent, #2C55F5);
    color: #fff;
  }
  .jdl-install-go:active { filter: brightness(.94); }

  .jdl-install-no {
    flex: none;
    border: 1px solid #E4EAF4;
    background: #fff;
    color: #5A6478;
  }
  .jdl-install-no:active { background: #F5F8FE; }

  /* On iOS there is no button to press -- the person uses Safari's own Share
     menu -- so the card explains, and the only control is Got it. */
  jdl-install.jdl-install[data-mode="ios"] .jdl-install-go { display: none; }
  jdl-install.jdl-install[data-mode="ios"] .jdl-install-no { flex: 1; }
}
