/* Всплывашка «Нашли, что искали?» — подключается из lib/CmsFeedback.php.
   Цвета и шрифты — переменные pk-tech.css, поэтому тёмная тема бесплатно. */

.pkfb {
  --pkfb-shadow: 0 12px 32px -4px rgb(13 17 23 / .10), 0 1px 3px rgb(13 17 23 / .06);
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 70;
  box-sizing: border-box;
  width: 360px;
  max-width: calc(100vw - 32px);
  padding: 20px 20px 20px;
  background: var(--paper, #f8f9fa);
  color: var(--ink, #0d1117);
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 4px;
  box-shadow: var(--pkfb-shadow);
  font-family: var(--body, system-ui, sans-serif);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .32s ease, transform .32s cubic-bezier(.2, .7, .2, 1);
}
:root[data-theme=dark] .pkfb { --pkfb-shadow: 0 12px 32px -4px rgb(0 0 0 / .5), 0 1px 3px rgb(0 0 0 / .4); }
.pkfb.is-in { opacity: 1; transform: none; }
.pkfb *, .pkfb *::before, .pkfb *::after { box-sizing: border-box; }
.pkfb[hidden] { display: none; }

.pkfb__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted, #656d76);
  cursor: pointer;
}
.pkfb__close:hover { background: var(--paper-deep, #eef0f2); color: var(--ink, #0d1117); }
.pkfb__close svg { width: 16px; height: 16px; }

.pkfb__title {
  margin: 0 36px 0 0;
  font-family: var(--display, Georgia, serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0;
  text-wrap: balance;
}
.pkfb__text { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: var(--ink-muted, #656d76); }

.pkfb__row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pkfb__row--end { justify-content: flex-end; }

.pkfb__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 22px;
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 999px;
  background: transparent;
  color: var(--ink, #0d1117);
  font: 500 15px/1.2 var(--body, system-ui, sans-serif);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.pkfb__btn:hover { border-color: var(--ink, #0d1117); }
.pkfb__btn--solid { border-color: var(--accent, #1f883d); background: var(--accent, #1f883d); color: var(--on-accent, #fff); }
.pkfb__btn--solid:hover { border-color: var(--accent-ink, #1a7f37); background: var(--accent-ink, #1a7f37); }
.pkfb__btn[disabled] { opacity: .6; cursor: progress; }
.pkfb__btn svg { width: 15px; height: 15px; }

.pkfb__field { display: block; margin-top: 14px; }
.pkfb__field span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--ink-soft, #31373f); }
.pkfb__field input,
.pkfb__field textarea {
  display: block;
  width: 100%;
  margin: 0;
  padding: 11px 14px;
  border: 1px solid var(--line, #dfe3e8);
  border-radius: 4px;
  background: var(--paper-deep, #eef0f2);
  color: var(--ink, #0d1117);
  font: 400 15px/1.5 var(--body, system-ui, sans-serif);
  resize: none;
  outline: none;
  transition: border-color .2s;
}
.pkfb__field textarea { height: 92px; }
.pkfb__field input::placeholder, .pkfb__field textarea::placeholder { color: var(--ink-muted, #656d76); opacity: 1; }
.pkfb__field input:focus, .pkfb__field textarea:focus { border-color: var(--accent, #1f883d); }
.pkfb__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.pkfb__err { margin: 12px 0 0; font-size: 14px; line-height: 1.4; color: #cf222e; }
:root[data-theme=dark] .pkfb__err { color: #ff7b72; }

.pkfb__done { display: flex; align-items: flex-start; gap: 10px; margin-right: 36px; }
.pkfb__ok {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--accent, #1f883d);
  color: var(--on-accent, #fff);
}
.pkfb__ok svg { width: 15px; height: 15px; }
.pkfb__done .pkfb__title { margin: 0; font-size: 24px; }
.pkfb__link { display: inline-flex; gap: 6px; margin-top: 12px; font-weight: 500; font-size: 15px; color: var(--accent-ink, #1a7f37); text-decoration: none; }
.pkfb__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Телефон: сначала тонкая полоска в одну строку, поля — листом снизу. */
.pkfb-backdrop { position: fixed; inset: 0; z-index: 69; background: rgb(13 17 23 / .28); opacity: 0; transition: opacity .3s; }
.pkfb-backdrop.is-in { opacity: 1; }

@media (max-width: 720px) {
  .pkfb {
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 32px);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .pkfb.is-bar { display: flex; align-items: center; gap: 4px; padding: 6px 4px 6px 12px; }
  .pkfb.is-bar .pkfb__close { position: static; flex: none; }
  .pkfb__barq { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pkfb.is-bar .pkfb__btn { flex: none; min-height: 36px; padding: 0 11px; font-size: 14px; white-space: nowrap; }
  .pkfb__field input, .pkfb__field textarea { font-size: 16px; } /* iOS не увеличивает страницу */
  .pkfb__title { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .pkfb, .pkfb-backdrop { transition: none; }
}
