/* Install help popup (assets/js/install-help.js). Uses the site's tokens so it follows light/dark. */
html.ih-lock, html.ih-lock body { overflow: hidden; }

.ih-backdrop {
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(14, 13, 11, 0.66);
  opacity: 0;
  transition: opacity .2s ease;
  overscroll-behavior: contain;
}
.ih-backdrop[hidden] { display: none; }
.ih-backdrop.is-open { opacity: 1; }

.ih-panel {
  position: relative;
  width: 100%; max-width: 680px;
  max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(10px) scale(.98);
  transition: transform .22s cubic-bezier(.16, 1, .3, 1);
}
.ih-backdrop.is-open .ih-panel { transform: none; }

.ih-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

.ih-close {
  position: absolute; top: 12px; right: 12px; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 19, 17, 0.62); color: #fff;
  cursor: pointer;
  transition: background-color .18s ease;
}
.ih-close:hover { background: rgba(20, 19, 17, 0.85); }

.ih-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #111 center / cover no-repeat;
  border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0;
  overflow: hidden;
}
.ih-video { display: block; width: 100%; height: 100%; object-fit: contain; background: #111; }
.ih-video::cue { font-family: var(--font); font-size: 1.05em; line-height: 1.35; background: rgba(0, 0, 0, 0.78); color: #fff; }

.ih-play {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 0; padding: 0; cursor: pointer;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.42));
  color: #fff; font: inherit;
}
.ih-play__circle {
  width: 74px; height: 74px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  padding-left: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1b1207;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transition: transform .18s ease;
}
html[data-theme="light"] .ih-play__circle { color: #fff7ef; }
.ih-play:hover .ih-play__circle { transform: scale(1.06); }
.ih-play__text {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 13px; font-weight: 600;
}
.ih-backdrop.is-playing .ih-play { display: none; }

.ih-body { padding: 22px 28px 24px; }
.ih-eyebrow {
  display: inline-block;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.ih-title { font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -.02em; margin: 0 0 8px; }
.ih-desc { font-size: 15px; line-height: 1.55; color: var(--muted); margin: 0 0 16px; }
.ih-desc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }

.ih-steps { list-style: none; counter-reset: ih; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.ih-steps li {
  counter-increment: ih;
  position: relative;
  padding-left: 38px; min-height: 26px;
  font-size: 15px; line-height: 1.5;
}
.ih-steps li::before {
  content: counter(ih);
  position: absolute; left: 0; top: -1px;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tint); color: var(--accent);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 800;
}
.ih-steps strong { font-weight: 700; color: var(--ink); }

.ih-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.ih-retry { font-size: 13.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.ih-retry:hover { color: var(--accent); }
.ih-ok { min-width: 132px; }

.ih-close:focus-visible, .ih-play:focus-visible, .ih-retry:focus-visible, .ih-ok:focus-visible, .ih-desc a:focus-visible, .ih-video:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.ih-play:focus-visible { outline-offset: -4px; }

/* Phones: full-width sheet from the bottom, scrollable */
@media (max-width: 600px) {
  .ih-backdrop { align-items: flex-end; padding: 0; }
  .ih-panel {
    max-width: none;
    max-height: 92vh; max-height: 92dvh;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    border-bottom: 0;
    transform: translateY(24px);
  }
  .ih-media { border-radius: calc(var(--r-lg) - 1px) calc(var(--r-lg) - 1px) 0 0; }
  .ih-body { padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); }
  .ih-title { font-size: 19px; }
  .ih-desc, .ih-steps li { font-size: 14.5px; }
  .ih-play__circle { width: 60px; height: 60px; }
  .ih-foot { flex-direction: column-reverse; align-items: stretch; text-align: center; }
  .ih-ok { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ih-backdrop, .ih-panel, .ih-play__circle { transition: none; }
  .ih-panel { transform: none; }
}
