/* Feedback widget. Uses the page's tokens with fallbacks so it also works on
   pages that do not define them. Everything is prefixed fbw- to avoid clashes. */
.fbw-launcher,
.fbw-panel {
  --fbw-forest: var(--forest, #24401C);
  --fbw-forest-deep: var(--forest-deep, #182D12);
  --fbw-lime: var(--lime, #BAD06D);
  --fbw-paper: var(--paper, #F8FAF9);
  --fbw-ink: var(--ink, #10150F);
  --fbw-muted: var(--muted, #566055);
  --fbw-line: var(--line, #D2DBD4);
  --fbw-sage: var(--sage, #E2E9E3);
  --fbw-display: var(--font-display, "Funnel Display", "Helvetica Neue", Arial, sans-serif);
  --fbw-body: var(--font-body, "Host Grotesk", "Helvetica Neue", Arial, sans-serif);
  box-sizing: border-box;
}
.fbw-panel *,
.fbw-panel *::before,
.fbw-panel *::after { box-sizing: border-box; }

/* Launcher */
.fbw-launcher {
  position: fixed;
  right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--fbw-forest);
  color: var(--fbw-lime);
  font-family: var(--fbw-body);
  font-weight: 600;
  font-size: .9375rem;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 21, 15, .22);
  transition: background-color .2s ease, transform .2s ease;
}
.fbw-launcher:hover { background: var(--fbw-forest-deep); transform: translateY(-1px); }
.fbw-launcher:focus-visible { outline: 3px solid var(--fbw-lime); outline-offset: 3px; }
.fbw-launcher svg { width: 18px; height: 18px; flex: none; }
.fbw-launcher[aria-expanded="true"] { background: var(--fbw-forest-deep); }

/* Panel */
.fbw-panel {
  position: fixed;
  right: 20px;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 71;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
  background: var(--fbw-paper);
  color: var(--fbw-ink);
  border: 1px solid var(--fbw-line);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(16, 21, 15, .22);
  font-family: var(--fbw-body);
  font-size: .9375rem;
  line-height: 1.45;
}
.fbw-panel[hidden] { display: none; }
.fbw-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 4px;
}
.fbw-title {
  margin: 0;
  font-family: var(--fbw-display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--fbw-ink);
}
.fbw-sub { margin: 4px 18px 0; color: var(--fbw-muted); font-size: .875rem; }
.fbw-x {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--fbw-muted);
  cursor: pointer;
}
.fbw-x:hover { background: var(--fbw-sage); color: var(--fbw-ink); }
.fbw-x:focus-visible { outline: 2px solid var(--fbw-forest); outline-offset: 1px; }
.fbw-x svg { width: 18px; height: 18px; }

.fbw-form { display: grid; gap: 14px; padding: 14px 18px 18px; }
.fbw-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.fbw-label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--fbw-ink);
}
.fbw-types { display: grid; gap: 6px; }
.fbw-type {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--fbw-line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.fbw-type:hover { border-color: var(--fbw-forest); }
.fbw-type input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 2px solid var(--fbw-line);
  border-radius: 50%;
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fbw-type input:checked { border-color: var(--fbw-forest); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 9px var(--fbw-forest); }
.fbw-type input:focus-visible { outline: 2px solid var(--fbw-forest); outline-offset: 2px; }
.fbw-type:has(input:checked) { border-color: var(--fbw-forest); background: #f2f6ea; }
.fbw-type span { font-weight: 500; }

.fbw-textarea {
  display: block;
  width: 100%;
  min-height: 108px;
  padding: 10px 12px;
  border: 1px solid var(--fbw-line);
  border-radius: 10px;
  background: #fff;
  color: var(--fbw-ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS from zooming the page on focus */
  line-height: 1.45;
  resize: vertical;
}
.fbw-textarea:focus { outline: 2px solid var(--fbw-forest); outline-offset: 0; border-color: var(--fbw-forest); }

.fbw-shot-skeleton {
  height: 96px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--fbw-sage) 0%, #eef2ee 50%, var(--fbw-sage) 100%);
  background-size: 200% 100%;
  animation: fbw-shimmer 1.2s ease-in-out infinite;
}
@keyframes fbw-shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.fbw-shot { position: relative; width: fit-content; max-width: 100%; }
.fbw-shot img {
  display: block;
  max-width: 100%;
  max-height: 120px;
  border: 1px solid var(--fbw-line);
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}
.fbw-shot-remove {
  position: absolute;
  top: -10px;
  right: -10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--fbw-line);
  border-radius: 50%;
  background: #fff;
  color: var(--fbw-muted);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(16, 21, 15, .12);
}
.fbw-shot-remove:hover { color: var(--fbw-ink); }
.fbw-shot-remove:focus-visible { outline: 2px solid var(--fbw-forest); outline-offset: 1px; }
.fbw-shot-remove svg { width: 14px; height: 14px; }
.fbw-note {
  margin: 0;
  padding: 8px 12px;
  border: 1px dashed var(--fbw-line);
  border-radius: 10px;
  color: var(--fbw-muted);
  font-size: .8125rem;
}
.fbw-context { margin: 0; color: var(--fbw-muted); font-size: .75rem; }
.fbw-context b { font-weight: 600; color: var(--fbw-ink); }
.fbw-error { margin: 0; color: #9b2c1f; font-size: .875rem; }
.fbw-error:empty { display: none; }

.fbw-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 2px; }
.fbw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  font-family: var(--fbw-body);
  font-weight: 600;
  font-size: .9375rem;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}
.fbw-btn:focus-visible { outline: 3px solid var(--fbw-lime); outline-offset: 2px; }
.fbw-btn-primary { background: var(--fbw-forest); color: var(--fbw-paper); }
.fbw-btn-primary:hover:not(:disabled) { background: var(--fbw-forest-deep); }
.fbw-btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.fbw-btn-ghost { background: transparent; color: var(--fbw-ink); }
.fbw-btn-ghost:hover { background: var(--fbw-sage); }

.fbw-done { display: grid; justify-items: center; gap: 10px; padding: 26px 22px 24px; text-align: center; }
.fbw-done-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--fbw-lime);
  color: var(--fbw-forest);
}
.fbw-done-icon svg { width: 24px; height: 24px; }
.fbw-done p { margin: 0; }
.fbw-done .fbw-title { font-size: 1.2rem; }
.fbw-done .fbw-actions { justify-content: center; padding-top: 6px; }

.fbw-sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Phones: the page shows a fixed bottom action bar at this width
   (about 69px tall plus the safe area), so sit above it. */
@media (max-width: 640px) {
  .fbw-launcher {
    right: 16px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    width: 48px;
    min-height: 48px;
    padding: 0;
    justify-content: center;
  }
  .fbw-launcher .fbw-launcher-text {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .fbw-launcher svg { width: 20px; height: 20px; }
  .fbw-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(140px + env(safe-area-inset-bottom));
    max-height: calc(100vh - 160px - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 160px - env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .fbw-launcher, .fbw-btn, .fbw-type { transition: none; }
  .fbw-launcher:hover { transform: none; }
  .fbw-shot-skeleton { animation: none; }
}
