/* Spoy значком на экране (static/install.js): кнопка внизу меню, карточка-предложение и окно с шагами */

/* кнопка в меню — как «Написать нам» и язык под ней */
.inst-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 14px; border: 0; border-radius: 999px;
  flex: none; background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.inst-btn:hover { background: var(--glass); color: var(--text); }
.inst-btn:focus-visible { outline: 2px solid var(--border-2); outline-offset: 2px; }
.inst-btn svg { width: 16px; height: 16px; flex: none; }
/* служебные кнопки внизу стоят тесно: промежуток меню 20px для них велик (как в feedback.css) */
.side-account + .inst-btn { margin-top: -12px; }
.inst-btn + .fb-btn, .inst-btn + .lang-box { margin-top: -16px; }

/* значок приложения — тот же файл, что встанет на экран */
.inst-app { flex: none; display: block; width: 44px; height: 44px; border-radius: 22.5%; box-shadow: 0 0 0 1px var(--border); }

/* ---------- карточка-предложение: в углу главной ---------- */
.inst-card {
  position: fixed; z-index: 45; right: 20px; bottom: 20px; width: 360px; max-width: calc(100vw - 24px); box-sizing: border-box;
  display: flex; gap: 14px; align-items: flex-start; padding: 16px;
  border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .55);
  animation: inst-in .24s cubic-bezier(.2, .8, .2, 1);
}
.inst-card.out { opacity: 0; transform: translateY(8px); transition: opacity .16s ease, transform .16s ease; }
body.song-parked .inst-card { bottom: 100px; } /* над мини-плеером открытой песни (keep.css) */
.inst-card-body { min-width: 0; }
.inst-card b { display: block; font-size: 15px; font-weight: 600; line-height: 1.3; }
.inst-card p { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }
.inst-btns { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- окно с шагами ---------- */
.modal .card.inst-sheet { position: relative; width: min(460px, 100%); gap: 16px; }
.inst-close {
  position: absolute; z-index: 1; top: 12px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--glass); color: var(--text); font-size: 13px; transition: background-color .15s ease;
}
.inst-close:hover { background: var(--glass-2); }
.inst-head { display: flex; gap: 14px; align-items: center; padding-right: 36px; }
.inst-head .inst-app { width: 56px; height: 56px; }
.inst-head h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; line-height: 1.2; letter-spacing: -.015em; }
.inst-head p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); }

.inst-steps { list-style: none; counter-reset: inst; margin: 0; padding: 0; display: grid; gap: 8px; }
.inst-steps li {
  counter-increment: inst; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start;
  padding: 12px 14px; border-radius: 14px; background: var(--glass); font-size: 14px; line-height: 1.6;
}
.inst-steps li::before {
  content: counter(inst); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-3); font-size: 13px; font-weight: 600; line-height: 1;
}
.inst-steps small { display: block; margin-top: 2px; font-size: 13px; line-height: 1.5; color: var(--muted); }

/* справа от шага — как выглядит нужная кнопка браузера */
.inst-look { display: flex; align-items: center; gap: 3px; min-height: 28px; font: 600 12px var(--mono); color: var(--muted); }
.inst-ic {
  display: grid; place-items: center; width: 32px; height: 32px; margin-top: -2px;
  border-radius: 10px; background: var(--surface-3); color: var(--text);
}
.inst-ic svg { width: 18px; height: 18px; }
.inst-ic.blue { color: #4aa3ff; } /* кнопки Safari синие */

.inst-sheet kbd {
  display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 6px; text-align: center;
  background: var(--surface-3); border: 1px solid var(--border-2); border-bottom-width: 2px;
  font: 600 12px/1.6 var(--mono); color: var(--text);
}

.inst-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--note-soft); }
.inst-note svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--note); }
.inst-note p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); }
/* окно на отступах .stack (16px), не на gap: кнопка, которая относится к подсказке, ближе к ней; «Понятно» — с обычным отступом */
.inst-note + .inst-wide:not([data-inst-close]) { margin-top: 8px; }
.btn.inst-wide { width: 100%; height: 44px; justify-content: center; }
.btn.inst-wide svg { width: 16px; height: 16px; margin-right: 8px; }

@keyframes inst-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .inst-card { animation: none; } .inst-card.out { transition: none; } }

/* меню свёрнуто до значков */
@media (max-width: 1100px) {
  .inst-btn { justify-content: center; padding: 0; height: 40px; }
  .inst-btn span { display: none; }
  .side-account + .inst-btn { margin-top: -10px; }
  .inst-btn + .fb-btn, .inst-btn + .lang-box { margin-top: -14px; }
}
/* меню полосой сверху: места мало — там только карточка и раздел справки */
@media (max-width: 700px) {
  .inst-btn { display: none; }
  .side-account + .inst-btn + .fb-btn { margin-top: 0; }
}
/* телефон: карточка снизу во всю ширину */
@media (max-width: 560px) {
  .inst-card { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; max-width: none; padding: 14px; }
  body.song-parked .inst-card { bottom: calc(96px + env(safe-area-inset-bottom)); }
  .inst-btns .btn { flex: 1; height: 38px; }
  .inst-head .inst-app { width: 48px; height: 48px; }
  .inst-head h2 { font-size: 18px; }
}
