/* Plan helper under the plan description (modules/plan_help.php, js/plan-help.js): an inset panel with the suggested
   questions, one question field and the answer as a short thread — the question quoted with the accent bar, the answer
   as plain reading text. Phones: roomy targets like the rest of the checkout; desktop: the flat 8px web-frame look. */
.plan-help { display: grid; gap: 12px; margin-block: 16px; padding: 16px; border-radius: 20px; background: var(--panel-2); }
.ph-head { display: flex; gap: 12px; align-items: flex-start; }
.ph-mark { display: grid; flex: none; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.ph-head h2 { font-size: 1.02rem; font-weight: 800; }
.ph-lead { margin-top: 2px; color: var(--muted); font-size: .86rem; }

.ph-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-chip { min-height: 44px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: transparent; color: var(--text-2);
  font-size: .86rem; font-weight: 600; cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.ph-chip:hover { border-color: rgb(var(--accent-rgb) / .5); color: var(--text); }
.ph-chip:active { background: var(--accent-soft); }
.plan-help.is-busy .ph-chip { opacity: .5; pointer-events: none; }

.ph-form { display: grid; gap: 4px; }
.ph-form input { width: 100%; min-width: 0; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-2); color: var(--text);
  outline: 0; transition: border-color .2s, box-shadow .2s; }
.ph-form input:focus { border-color: rgb(var(--accent-rgb) / .55); box-shadow: 0 0 0 4px rgb(var(--accent-rgb) / .1); }
.ph-form input[readonly] { color: var(--muted); }
.ph-send { flex: none; min-height: 48px; border-radius: 14px; }
.ph-send:disabled { opacity: .6; cursor: progress; }

.ph-answer { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.ph-asked { padding-inline-start: 10px; border-inline-start: 3px solid var(--accent); color: var(--text-2); font-size: .9rem; font-weight: 700; overflow-wrap: anywhere; }
.ph-text { display: grid; gap: 6px; color: var(--text); line-height: 1.75; overflow-wrap: anywhere; }
.ph-text ul { display: grid; gap: 4px; margin: 0; padding-inline-start: 20px; }
.ph-text li::marker { color: var(--accent); }
.ph-wait { color: var(--muted); }
.plan-help.is-busy .ph-wait { animation: ph-wait 1.2s ease-in-out infinite alternate; } /* only while an answer is on its way */
@keyframes ph-wait { to { opacity: .45; } }
.ph-fail { color: var(--danger); font-weight: 600; }
.ph-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--muted); font-size: .82rem; }
.ph-foot [data-ph-uncovered] { color: var(--warn); font-weight: 600; }
.ph-foot .link-btn { min-height: 32px; font-size: .84rem; }

@media (prefers-reduced-motion: reduce) {
  .plan-help.is-busy .ph-wait { animation: none; }
}
/* Phones: the suggestions as one row that scrolls sideways (the cut-off chip shows there is more), so the field stays close. */
@media (max-width: 600px) {
  .ph-chips { flex-wrap: nowrap; margin-inline: -16px; padding-inline: 16px; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 16px; scroll-snap-type: x proximity; }
  .ph-chips::-webkit-scrollbar { display: none; }
  .ph-chip { flex: none; scroll-snap-align: start; white-space: nowrap; }
}
@media (min-width: 901px) {
  .checkout-page .plan-help { border-radius: 12px; background: var(--bg); }
  .ph-chip { min-height: 34px; padding: 4px 12px; }
  .ph-form input, .ph-send { min-height: 40px; border-radius: 8px; }
  .ph-mark { border-radius: 8px; }
}
