/* Always-visible feedback button + a right-docked SIDE PANEL (not a blocking
   popup) - built so users can start dictating and keep clicking through the app.
   External module, no inline JS (CSP script-src 'self'). Reuses the page's design
   tokens so it adapts to dark + light. FAB bottom-right; coexists with Meridian. */

.fb-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 78;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 18px; border-radius: 999px; cursor: pointer;
  font-family: var(--font-ui, sans-serif); font-size: 14px; font-weight: 600;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.28); border: 1px solid var(--gold, #C9A24B);
  background: linear-gradient(180deg, var(--gold-soft, #D9B86E), var(--bronze, #9C7A33));
  box-shadow: 0 14px 30px -12px rgba(0,0,0,.55); transition: transform .15s, box-shadow .2s;
}
.fb-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -12px rgba(0,0,0,.6); }
.fb-fab svg { width: 18px; height: 18px; }
.fb-fab .fb-fab-label { white-space: nowrap; }
.fb-fab-hidden { display: none !important; }
/* Coexist with the Meridian assistant (also bottom-right). When Meridian shows
   its floating launcher (minimized/popup), stack the feedback button above it;
   when its panel is docked right, sit just left of the panel. */
body.asst-min .fb-fab,
body.asst-popup.asst-right .fb-fab { bottom: 88px; }
body.asst-dock.asst-right .fb-fab { right: calc(var(--asst-w, 380px) + 20px); bottom: 20px; }
@media (max-width: 560px) { .fb-fab .fb-fab-label { display: none; } .fb-fab { padding: 13px; } }

/* ---- right-docked side panel (no scrim → app stays interactive) ---- */
.fb-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 120;
  width: min(440px, 94vw); display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface, #161F2A), var(--grad-card, #141d27));
  border-left: 1px solid var(--border, #26313E);
  box-shadow: -18px 0 48px -28px rgba(0,0,0,.6);
  transform: translateX(105%); transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.fb-panel.show { transform: none; }
@media (max-width: 560px) { .fb-panel { width: 100vw; } }
.fb-panel-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border, #26313E);
}
.fb-panel-title { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-display, serif); font-weight: 600; font-size: 16px; color: var(--text, #F4F1EA); }
.fb-panel-title svg { width: 18px; height: 18px; color: var(--gold-soft, #D9B86E); }
.fb-panel-body { flex: 1 1 auto; overflow-y: auto; padding: clamp(16px, 3vw, 22px); }
.fb-close {
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border-2, #313E4D); background: var(--surface, #161F2A);
  color: var(--mist, #AEB9C6); cursor: pointer; font-size: 16px; line-height: 1;
}
.fb-close:hover { color: var(--text, #F4F1EA); border-color: var(--gold, #C9A24B); }

/* the "dictate + keep exploring" explainer */
.fb-livehint {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 11px; font-size: 12.5px; line-height: 1.5;
  color: var(--mist, #AEB9C6); border: 1px solid color-mix(in srgb, var(--gold, #C9A24B) 40%, transparent);
  background: color-mix(in srgb, var(--gold, #C9A24B) 10%, transparent);
}
.fb-livehint b { color: var(--champagne, #E8D9B5); font-weight: 600; }

.fb-kick {
  display: inline-flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-soft, #D9B86E); font-weight: 600;
}
.fb-kick::before { content: ""; width: 20px; height: 1px; background: var(--gold, #C9A24B); display: inline-block; }
.fb-title { font-family: var(--font-display, serif); font-weight: 600; font-size: clamp(20px, 3.4vw, 26px); margin: 8px 0 4px; letter-spacing: -.4px; color: var(--text, #F4F1EA); }
.fb-sub { color: var(--mist, #AEB9C6); font-size: 13.5px; margin: 0 0 18px; max-width: 46ch; }

.fb-q { margin: 16px 0; }
.fb-q-label { font-size: 13.5px; color: var(--text, #F4F1EA); font-weight: 600; margin-bottom: 8px; display: block; }
.fb-stars { display: inline-flex; gap: 4px; }
.fb-star {
  width: 34px; height: 34px; padding: 0; border: 0; background: transparent; cursor: pointer;
  color: var(--border-2, #313E4D); transition: transform .12s, color .12s; line-height: 0;
}
.fb-star svg { width: 26px; height: 26px; }
.fb-star:hover { transform: scale(1.12); }
.fb-star.on { color: var(--gold, #C9A24B); }
.fb-scale-hint { display: inline-block; margin-left: 10px; font-size: 11.5px; color: var(--mist-dim, #7C8794); }

.fb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-chip {
  font-family: var(--font-ui, sans-serif); font-size: 12.5px; font-weight: 600; cursor: pointer;
  padding: 7px 13px; border-radius: 999px; color: var(--mist, #AEB9C6);
  background: var(--bg, #0E141B); border: 1px solid var(--border-2, #313E4D); transition: all .15s;
}
.fb-chip:hover { color: var(--text, #F4F1EA); border-color: var(--gold, #C9A24B); }
.fb-chip.sel { background: linear-gradient(180deg, var(--gold-soft, #D9B86E), var(--bronze, #9C7A33)); color:var(--on-gold,#1a1206); border-color: var(--gold, #C9A24B); }

.fb-textwrap { position: relative; }
.fb-text {
  width: 100%; min-height: 96px; resize: vertical; line-height: 1.5;
  background: var(--bg, #0E141B); border: 1px solid var(--border-2, #313E4D); border-radius: 10px;
  color: var(--text, #F4F1EA); font-family: var(--font-ui, sans-serif); font-size: 14px; padding: 12px 46px 12px 13px;
}
.fb-text:focus { outline: none; border-color: var(--gold, #C9A24B); }
.fb-mic {
  position: absolute; right: 8px; bottom: 10px; width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--border-2, #313E4D); background: var(--surface, #161F2A);
  color: var(--mist, #AEB9C6); cursor: pointer; display: grid; place-items: center;
}
.fb-mic svg { width: 17px; height: 17px; }
.fb-mic:hover { color: var(--text, #F4F1EA); border-color: var(--gold, #C9A24B); }
/* Active recording = positive GREEN framing (not an alarming red). */
.fb-mic.rec { color: var(--ok, #7FA07A); border-color: var(--ok, #7FA07A); background: color-mix(in srgb, var(--ok, #7FA07A) 16%, transparent); animation: fbPulse 1.4s infinite; }
@keyframes fbPulse { 0% { box-shadow: 0 0 0 0 rgba(127,160,122,.5); } 70% { box-shadow: 0 0 0 7px rgba(127,160,122,0); } 100% { box-shadow: 0 0 0 0 rgba(127,160,122,0); } }
.fb-mic-hint { font-size: 11.5px; color: var(--mist-dim, #7C8794); margin-top: 6px; min-height: 16px; }

.fb-input {
  width: 100%; background: var(--bg, #0E141B); border: 1px solid var(--border-2, #313E4D); border-radius: 10px;
  color: var(--text, #F4F1EA); font-family: var(--font-ui, sans-serif); font-size: 14px; padding: 11px 13px;
}
.fb-input:focus { outline: none; border-color: var(--gold, #C9A24B); }
.fb-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .fb-row2 { grid-template-columns: 1fr; } }

.fb-actions { display: flex; align-items: center; gap: 12px; margin-top: 22px; }
.fb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-ui, sans-serif); font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 12px 22px; border-radius: 11px; border: 1px solid transparent; transition: transform .14s, box-shadow .2s;
}
.fb-btn:active { transform: translateY(1px); }
.fb-btn-primary { background: linear-gradient(180deg, var(--gold-soft, #D9B86E), var(--bronze, #9C7A33)); color:var(--on-gold,#1a1206); box-shadow: 0 10px 24px -14px rgba(201,162,75,.7); }
.fb-btn-primary:hover { transform: translateY(-1px); }
.fb-btn-primary[disabled] { opacity: .55; cursor: default; transform: none; }
.fb-privacy { font-size: 11.5px; color: var(--mist-dim, #7C8794); margin-top: 14px; }

.fb-done { text-align: center; padding: 18px 6px; }
.fb-done .fb-check {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--ok, #7FA07A) 16%, transparent); color: var(--ok, #7FA07A);
  border: 1px solid color-mix(in srgb, var(--ok, #7FA07A) 40%, transparent);
}
.fb-done .fb-check svg { width: 28px; height: 28px; }
.fb-done h3 { font-family: var(--font-display, serif); font-weight: 600; font-size: 22px; margin: 0 0 6px; color: var(--text, #F4F1EA); }
.fb-done p { color: var(--mist, #AEB9C6); font-size: 14px; margin: 0; }
.fb-err { margin-top: 14px; font-size: 13px; color: #e7b4a0; background: color-mix(in srgb, #C0855A 12%, transparent); border: 1px solid color-mix(in srgb, #C0855A 40%, transparent); border-radius: 9px; padding: 10px 13px; display: none; }
.fb-err.show { display: block; }

/* ---- prominent voice CTA (top of the form) ---- */
.fb-voice-cta {
  display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; padding: 14px 16px;
  border-radius: 13px; border: 1px solid color-mix(in srgb, var(--gold, #C9A24B) 45%, transparent);
  background: color-mix(in srgb, var(--gold, #C9A24B) 10%, transparent);
}
.fb-voice-txt { font-size: 13px; color: var(--mist, #AEB9C6); flex: 1 1 auto; }
.fb-voice-txt b { color: var(--champagne, #E8D9B5); font-weight: 600; }
.fb-voice-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  padding: 12px 18px; border-radius: 11px; border: 1px solid var(--gold, #C9A24B);
  background: linear-gradient(180deg, var(--gold-soft, #D9B86E), var(--bronze, #9C7A33)); color:var(--on-gold,#1a1206);
  font-family: var(--font-ui, sans-serif); font-size: 14px; font-weight: 700; box-shadow: 0 10px 24px -14px rgba(201,162,75,.7);
  transition: transform .14s;
}
.fb-voice-btn:hover { transform: translateY(-1px); }
.fb-voice-btn svg { width: 18px; height: 18px; }
@media (max-width: 480px) { .fb-voice-cta { flex-direction: column; align-items: stretch; } .fb-voice-btn { justify-content: center; } }

.fb-meridian-hint {
  display: flex; align-items: flex-start; gap: 9px; margin: 0 0 16px; font-size: 12.5px;
  color: var(--mist, #AEB9C6); padding: 10px 12px; border-radius: 10px;
  background: var(--bg, #0E141B); border: 1px solid var(--border, #26313E);
}
.fb-meridian-hint svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--gold-soft, #D9B86E); margin-top: 1px; }
.fb-meridian-hint b { color: var(--champagne, #E8D9B5); font-weight: 600; }

/* ---- big primary free-text ---- */
.fb-text-lg { min-height: 120px; }

/* ---- section headers + guided block ---- */
.fb-section-h {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700;
  color: var(--mist-dim, #7C8794); margin: 22px 0 12px;
  padding-top: 16px; border-top: 1px solid var(--border, #26313E);
}
.fb-guided .fb-q { margin: 14px 0; }
.fb-guided .fb-text { min-height: 64px; }

/* ---- compact ratings list ---- */
.fb-rates { display: grid; gap: 10px; }
.fb-rate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.fb-rate-label { font-size: 13.5px; color: var(--text, #F4F1EA); }
.fb-rates .fb-star { width: 28px; height: 28px; }
.fb-rates .fb-star svg { width: 22px; height: 22px; }

/* gold buttons: white text + subtle shadow in dark (matches .btn-primary); dark in light */
.fb-btn-primary,.fb-voice-btn{text-shadow:0 1px 2px rgba(0,0,0,.28)}
