/* ═══ Ask Panelogue — help widget (client-side, no API) ═══════════════ */

.plg-ask-btn {
  position: fixed;
  z-index: 200;
  right: 24px;
  bottom: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px 12px 15px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 600;
  color: var(--on-dark);
  background: var(--charcoal);
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 10px rgba(60, 32, 8, 0.18), 0 14px 34px rgba(60, 32, 8, 0.22);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.plg-ask-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(60, 32, 8, 0.22), 0 18px 40px rgba(60, 32, 8, 0.26); }
.plg-ask-btn svg { color: var(--amber); }

.plg-ask-panel {
  position: fixed;
  z-index: 201;
  right: 24px;
  bottom: 88px;
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 20px rgba(60, 32, 8, 0.14), 0 30px 70px rgba(60, 32, 8, 0.22);
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 0.8, 0.3, 1);
}
.plg-ask-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.plg-ask__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--rule2);
}
.plg-ask__title { font-family: var(--font-head); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.plg-ask__close {
  border: none; background: none; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--muted);
  padding: 0 4px; transition: color 0.15s;
}
.plg-ask__close:hover { color: var(--ink); }

.plg-ask__field { padding: 14px 18px 6px; }
.plg-ask__input {
  width: 100%;
  font-family: var(--font-head);
  font-size: 14.5px;
  color: var(--ink);
  padding: 12px 15px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: #FBFAF7;
  outline: none;
  transition: border-color 0.16s;
}
.plg-ask__input:focus { border-color: var(--amber); }
.plg-ask__input::placeholder { color: var(--muted); }

.plg-ask__results { flex: 1; overflow-y: auto; padding: 10px 18px 6px; }

.plg-ask__intro { font-family: var(--font-head); font-size: 14px; color: var(--ink2); margin: 6px 0 12px; }
.plg-ask__intro--related { margin-top: 20px; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-family: var(--font-head); }

.plg-ask__chips { display: flex; flex-direction: column; gap: 8px; }
.plg-ask__chip {
  text-align: left;
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink2);
  padding: 10px 13px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.plg-ask__chip:hover { border-color: rgba(217, 130, 10, 0.4); background: rgba(217, 130, 10, 0.07); color: var(--ink); }

.plg-ask__answer {
  background: var(--paper2);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.plg-ask__answer--fallback { border-left-color: var(--orange); }
.plg-ask__q { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.plg-ask__a, .plg-ask__answer--fallback { font-family: var(--font-head); font-size: 14.5px; line-height: 1.55; color: var(--ink2); }
.plg-ask__a strong, .plg-ask__answer--fallback strong { color: var(--ink); font-weight: 700; }
.plg-ask__a a, .plg-ask__answer--fallback a { color: var(--orange); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(217, 99, 58, 0.35); }
.plg-ask__a a:hover, .plg-ask__answer--fallback a:hover { border-bottom-color: var(--orange); }

.plg-ask__escape { font-family: var(--font-head); margin: 16px 2px 4px; font-size: 12px; color: var(--muted); }
.plg-ask__escape a { color: var(--orange); font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(217, 99, 58, 0.3); }
.plg-ask__escape a:hover { border-bottom-color: var(--orange); }

.plg-ask__foot { padding: 10px 18px 14px; font-size: 11.5px; color: var(--muted); text-align: center; border-top: 1px solid var(--rule2); }

@media (max-width: 480px) {
  .plg-ask-btn { right: 16px; bottom: 16px; }
  .plg-ask-panel { right: 8px; left: 8px; bottom: 76px; width: auto; max-height: 76vh; }
}

@media (prefers-reduced-motion: reduce) {
  .plg-ask-panel, .plg-ask-btn { transition: opacity 0.2s ease; }
  .plg-ask-panel { transform: none; }
}
