/* FoxTaming consultation widget — scoped under .fc-* namespaces.
   Tokens align with style.css dark/light theme variables. */
.fc-panel { --fc-line: var(--border); }

/* ---------- launcher ---------- */
.fc-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 22px; border: 0; border-radius: 999px;
  background: oklch(0.28 0.05 256); color: #fff;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 12px 32px -10px rgb(16 24 40 / .45);
}
.fc-launcher:hover { background: oklch(0.34 0.06 256); }
.fc-launcher img { width: 36px; height: 36px; border-radius: 50%; background: #fff5e5; padding: 0; object-fit: contain; }
.fc-launcher:focus-visible { outline: 3px solid #eeb27f; outline-offset: 3px; }
.fc-hidden { display: none !important; }

/* ---------- panel shell ---------- */
.fc-panel {
  position: fixed; right: 24px; bottom: 96px; z-index: 95;
  width: 440px; max-width: calc(100vw - 32px);
  height: min(700px, calc(100dvh - 120px));
  display: flex; flex-direction: column;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--fc-line); border-radius: 24px;
  box-shadow: 0 24px 64px -16px rgb(13 27 56 / .28), 0 2px 8px rgb(13 27 56 / .08);
  overflow: hidden; font-size: 15px; line-height: 1.75;
}
.fc-panel[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .fc-panel { animation: fc-pop .18s ease; }
  @keyframes fc-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

.fc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--fc-line); flex: none;
}
.fc-head img { width: 38px; height: 38px; border-radius: 50%; background: #fff5e5; padding: 0; }
.fc-title strong { display: block; font-size: 14px; }
.fc-sub { display: block; color: var(--fg-muted); font-size: 11px; }
.fc-x {
  margin-left: auto; border: 0; background: transparent; cursor: pointer;
  width: 44px; height: 44px; font-size: 24px; line-height: 1; color: var(--fg-muted); border-radius: 10px;
}
.fc-x:hover { color: var(--fg); background: var(--bg-soft); }

.fc-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px; scrollbar-gutter: stable; }

.fc-body :is(p, h3, label, button, input, select, textarea, li) { font-size: inherit; }
/* ---------- welcome hero ---------- */
.fc-welcome { margin: 10px 0 24px; }
.fc-welcome > img { width: 72px; height: 72px; border-radius: 22px; background: #fff5e5; padding: 0; }
.fc-body .fc-welcome-kicker { font-family: inherit; font-weight: 600; font-size: 11px; line-height: 1.4; letter-spacing: .12em; color: var(--fg-muted); margin: 20px 0 10px; }
.fc-body .fc-welcome h3 { font-size: 26px; font-weight: 700; line-height: 1.35; letter-spacing: -.04em; margin: 0 0 12px; }
.fc-welcome p:last-child { font-size: 14px; color: var(--fg-muted); max-width: 30ch; margin: 0; }
.fc-ai-label { font: 11px Georgia, serif; letter-spacing: .12em; color: var(--primary-strong); margin: 0 0 12px; }
.fc-assistant { display: flex; gap: 10px; margin: 0 0 16px; }
.fc-assistant > img { flex: none; width: 28px; height: 28px; margin-top: 3px; border-radius: 50%; background: #fff5e5; padding: 0; }
.fc-assistant .fc-text { white-space: pre-wrap; word-break: break-word; margin: 0; }
.fc-user {
  padding: 12px 15px; margin: 0 0 16px 32px; border-radius: 14px 14px 4px 14px;
  background: color-mix(in oklch, var(--primary) 9%, var(--card));
  white-space: pre-wrap; word-break: break-word;
}
.fc-body .fc-prompt {
  width: auto; text-align: left; margin: 0;
  border: 1px solid var(--fc-line); border-radius: 999px; padding: 9px 12px;
  font: inherit; font-size: 12.5px; background: var(--card); color: var(--fg-muted); cursor: pointer;
}
.fc-prompt:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--card); }
.fc-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.fc-body .fc-quick-label { width: 100%; font-size: 11px; color: var(--fg-muted); margin-bottom: 2px; }
.fc-fallback-link { font-size: 12px; color: var(--fg-muted); align-self: center; text-decoration: underline; text-underline-offset: 2px; }
.fc-fallback-link:hover { color: var(--primary-strong); }
.fc-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.fc-status { color: var(--fg-muted); font-size: 13px; margin: 4px 0 16px; }
.fc-error {
  color: #c74725; font-size: 13px; margin: 4px 0 16px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.fc-error button { font: inherit; font-size: 13px; color: var(--primary-strong); background: none; border: 1px solid var(--fc-line); border-radius: 7px; padding: 4px 10px; cursor: pointer; }
.fc-error button:hover { border-color: var(--primary); }

.fc-consent {
  border: 1px solid var(--fc-line); border-radius: 16px; padding: 18px;
  background: var(--bg-soft); font-size: 13.5px; margin-bottom: 16px;
}
.fc-consent-title { margin: 0 0 10px; font-size: 14px; }
.fc-consent p { margin: 0 0 10px; color: var(--fg-muted); }
.fc-consent ul { margin: 0 0 14px; padding-left: 18px; color: var(--fg-muted); line-height: 1.8; }
.fc-consent label { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; color: var(--fg); }
.fc-consent input[type='checkbox'] { margin-top: 4px; flex: none; width: 16px; height: 16px; }

.fc-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  border-top: 1px solid var(--fc-line); margin-top: 24px; padding: 14px 0 0;
}
.fc-body .fc-text-action {
  border: 0; background: none; padding: 0; font: inherit; font-size: 12px;
  color: var(--fg-muted); cursor: pointer; min-height: 36px;
}
.fc-text-action:hover:not(:disabled) { color: var(--primary-strong); }
.fc-text-action:disabled { opacity: .55; cursor: wait; }
.fc-btn {
  font: inherit; font-size: 14px; min-height: 36px; border-radius: 8px; padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--fc-line); background: var(--card); color: var(--fg);
}
.fc-btn:hover { border-color: var(--primary); color: var(--primary-strong); }
.fc-btn:disabled { opacity: .55; cursor: wait; }
.fc-btn-primary { background: var(--primary-strong); border-color: transparent; color: #fff; }
.fc-btn-primary:hover { color: #fff; filter: brightness(1.08); }
.fc-summary-trigger { width: 100%; margin-bottom: 10px; border-radius: 12px; }

/* ---------- summary region ---------- */
.fc-summary {
  margin: 18px 0 6px; border: 1px solid var(--fc-line); border-radius: 16px;
  padding: 16px; background: var(--bg-soft);
}
.fc-summary h3 { margin: 0 0 8px; font-size: 15px; }
.fc-summary .fc-hint { color: var(--fg-muted); font-size: 12.5px; margin: 0 0 12px; }
.fc-summary label { display: block; font-size: 13px; margin: 14px 0 6px; }
.fc-summary .fc-check { margin-top: 12px; }
.fc-summary .fc-actions { border-top: 0; margin-top: 16px; padding-top: 0; }
.fc-summary label > span { color: var(--fg-muted); font-size: 12px; margin-left: 6px; }
.fc-summary textarea, .fc-summary input:not([type='checkbox']), .fc-summary select {
  width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--fc-line); border-radius: 8px;
  font: inherit; font-size: 15px; color: var(--fg); background: var(--bg);
}
.fc-summary textarea { resize: vertical; min-height: 120px; }
.fc-summary .fc-contact-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; }
.fc-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin-top: 14px; }
.fc-check input { margin-top: 4px; flex: none; width: 16px; height: 16px; }
.fc-ref {
  margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; font-size: 13.5px;
  background: color-mix(in oklch, var(--primary) 9%, var(--card)); color: var(--fg);
}
.fc-fail { color: #c74725; font-size: 13px; margin: 10px 0 0; }

/* ---------- composer ---------- */
.fc-foot { flex: none; border-top: 0; padding: 16px 22px calc(18px + env(safe-area-inset-bottom)); }
.fc-composer {
  display: flex; align-items: flex-end; gap: 8px;
  border: 1px solid var(--fc-line); border-radius: 18px; background: var(--bg-soft); padding: 7px;
}
.fc-composer:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px color-mix(in oklch, var(--primary) 22%, transparent);
}
.fc-composer textarea {
  flex: 1 1 auto; min-width: 0; resize: none; max-height: 132px;
  padding: 8px; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 15px; line-height: 1.5; color: var(--fg);
}
.fc-send {
  flex: none; width: 36px; height: 36px; border: 0; border-radius: 12px;
  background: oklch(0.28 0.05 256); color: #fff; font-size: 18px; cursor: pointer;
}
.fc-send:hover { background: oklch(0.34 0.06 256); }
.fc-send:disabled { opacity: .5; cursor: wait; }
.fc-count { font-size: 11px; color: var(--fg-muted); margin: 4px 2px 0; min-height: 1em; }
.fc-count:empty { display: none; }
.fc-privacy { font-size: 11px; color: var(--fg-muted); margin: 9px 2px 0; }

.fc-panel :is(button, a, input, select, textarea):focus-visible { outline: 3px solid #eeb27f; outline-offset: 2px; }
.fc-panel .fc-composer textarea:focus-visible { outline: none; }

/* ---------- mobile: full-screen panel ---------- */
@media (max-width: 640px) {
  .fc-launcher { bottom: 20px; right: 16px; }
  .fc-panel {
    right: 0; bottom: 0; left: 0; top: 0;
    width: 100%; max-width: none; height: 100dvh; min-height: 100dvh;
    border-radius: 0; border: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  }
  .fc-scroll { padding: 20px; }
  .fc-foot { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .fc-body .fc-welcome h3 { font-size: 27px; }
  /* keep scrolling inside the panel so the locked page never rubber-bands */
  .fc-scroll { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
}
