/* ============================================================================
   feedback-widget.css — the Give Feedback pill (bottom-right).
   Marked Script system: cream paper, ink, Tuscan-red accent, NO green.
   Scoped under .fbw-; never touches existing stylesheets.
   ============================================================================ */

.fbw-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  font-family: "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink, #210706);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
/* never intercept clicks outside its own children */
.fbw-root { pointer-events: none; }
.fbw-root > * { pointer-events: auto; }

/* ---- collapsed pill -------------------------------------------------------- */
.fbw-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  appearance: none;
  border: 1px solid var(--ink, #210706);
  background: var(--ink, #210706);
  color: var(--bg, #f1e6d2);
  border-radius: 999px;
  padding: 9px 16px 10px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px -12px rgba(33, 7, 6, 0.45);
  transition: transform 0.18s cubic-bezier(0.22, 0.7, 0.3, 1),
              box-shadow 0.18s ease;
}
.fbw-pill:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -12px rgba(33, 7, 6, 0.5); }
.fbw-pill:focus-visible { outline: 2px solid var(--accent, #891d1a); outline-offset: 2px; }
.fbw-pill .fbw-nib {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, #891d1a);
  flex: none;
}
.fbw-pill.fbw-pill-sent {
  background: var(--surface, #fbf7ef);
  color: var(--muted, #6e5a49);
  border-color: var(--line-strong, #d8c6a8);
  box-shadow: none;
}
.fbw-pill.fbw-pill-sent .fbw-nib { background: var(--blue, #565d72); }

/* minimized: small corner dot */
.fbw-dot {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--ink, #210706);
  background: var(--ink, #210706);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 10px 28px -12px rgba(33, 7, 6, 0.45);
  transition: transform 0.18s cubic-bezier(0.22, 0.7, 0.3, 1), box-shadow 0.18s ease;
}
.fbw-dot:hover { transform: translateY(-1px); box-shadow: 0 14px 32px -12px rgba(33, 7, 6, 0.5); }
.fbw-dot:focus-visible { outline: 2px solid var(--accent, #891d1a); outline-offset: 2px; }
.fbw-dot .fbw-nib { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent, #891d1a); }

.fbw-dismiss {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  font-size: 15px;
  line-height: 1;
  padding: 2px 2px 2px 6px;
  margin-left: 2px;
  cursor: pointer;
  opacity: 0.65;
  border-left: 1px solid currentColor;
}
.fbw-dismiss:hover { opacity: 1; }
.fbw-dismiss:focus-visible { outline: 2px solid var(--accent, #891d1a); outline-offset: 2px; border-radius: 4px; }

/* ---- expanded panel -------------------------------------------------------- */
.fbw-panel {
  width: min(370px, calc(100vw - 28px));
  background: var(--surface, #fbf7ef);
  border: 1px solid var(--ink, #210706);
  border-radius: 16px;
  box-shadow: 0 28px 64px -20px rgba(33, 7, 6, 0.48);
  padding: 20px 20px 18px;
  transform-origin: bottom right;
  animation: fbw-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fbw-pop {
  from { opacity: 0; transform: translateY(16px) scale(0.93); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.fbw-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}
.fbw-head h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0;
  flex: 1;
}
.fbw-close {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted, #6e5a49);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}
.fbw-close:hover { color: var(--ink, #210706); }
.fbw-close:focus-visible { outline: 2px solid var(--accent, #891d1a); }

/* optional tag label — sits at the top of the panel, above the chips */
.fbw-tag-label {
  margin: 0 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint, #8a7257);
}

/* tag chips — modern inline pills (mark + label), wrap; per-signal selected colour */
.fbw-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 13px;
}
.fbw-signal {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line-strong, #d8c6a8);
  background: var(--surface, #fbf7ef);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft, #43291e);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease,
              transform 0.14s ease, box-shadow 0.14s ease;
}
.fbw-signal .fbw-mark {
  font-family: "Fraunces", Georgia, serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.fbw-signal:hover { border-color: var(--ink, #210706); transform: translateY(-1px); box-shadow: 0 6px 14px -10px rgba(33, 7, 6, 0.4); }
.fbw-signal:focus-visible { outline: 2px solid var(--accent, #891d1a); outline-offset: 2px; }
.fbw-signal[aria-pressed="true"] { box-shadow: none; transform: none; }
.fbw-signal-loved[aria-pressed="true"]    { background: var(--accent, #891d1a); border-color: var(--accent, #891d1a); color: #fff; }
.fbw-signal-loved[aria-pressed="true"] .fbw-mark { color: #fff; }
.fbw-signal-confused[aria-pressed="true"] { background: var(--soft-amber, #f4e9ce); border-color: var(--amber, #92671c); color: var(--amber, #92671c); }
.fbw-signal-broken[aria-pressed="true"]   { background: var(--ink, #210706); border-color: var(--ink, #210706); color: var(--bg, #f1e6d2); }
.fbw-signal-idea[aria-pressed="true"]     { background: var(--soft-blue, #e7eaf1); border-color: var(--blue, #565d72); color: var(--blue-strong, #434a5e); }

.fbw-text {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1.5px solid var(--line-strong, #d8c6a8);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink, #210706);
  margin-bottom: 11px;
  box-sizing: border-box;
}
.fbw-text::placeholder { color: var(--faint, #8a7257); }
.fbw-text:focus { outline: 2px solid var(--accent, #891d1a); outline-offset: 1px; border-color: transparent; }

/* manual image: attach button / paste, or the attached preview */
.fbw-shot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.fbw-attach {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px dashed var(--line-strong, #d8c6a8);
  background: transparent;
  color: var(--muted, #6e5a49);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.13s ease, color 0.13s ease;
}
.fbw-attach svg { flex: none; }
.fbw-attach:hover { border-color: var(--ink, #210706); color: var(--ink, #210706); }
.fbw-attach:focus-visible { outline: 2px solid var(--accent, #891d1a); outline-offset: 2px; }
.fbw-shot-hint { font-size: 11px; color: var(--faint, #8a7257); }
.fbw-shot-preview { display: inline-flex; align-items: center; gap: 8px; }
.fbw-shot-preview img {
  width: 44px; height: 44px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line-strong, #d8c6a8);
}
.fbw-shot-remove {
  appearance: none; border: none; background: transparent;
  color: var(--accent, #891d1a); font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: 2px;
}

/* actions row */
.fbw-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fbw-send {
  appearance: none;
  border: none;
  background: var(--accent, #891d1a);
  color: #fff;
  border-radius: 11px;
  padding: 10px 22px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 22px -12px rgba(137, 29, 26, 0.55);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.fbw-send:hover {
  background: var(--accent-strong, #6e1613);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px -12px rgba(137, 29, 26, 0.6);
}
.fbw-send:focus-visible { outline: 2px solid var(--ink, #210706); outline-offset: 2px; }
.fbw-send[disabled] { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.fbw-status { font-size: 12px; color: var(--muted, #6e5a49); }
.fbw-status.fbw-status-error { color: var(--danger, #9f2d2d); font-weight: 600; }

/* sent state */
.fbw-done {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 2px;
}
.fbw-done .fbw-done-mark {
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--accent, #891d1a);
  flex: none;
}
.fbw-done p { margin: 0; font-size: 14px; line-height: 1.5; }
.fbw-done a { color: var(--accent, #891d1a); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ---- small screens: bottom sheet ----------------------------------------- */
@media (max-width: 480px) {
  .fbw-root { right: 10px; bottom: 10px; left: 10px; align-items: stretch; }
  .fbw-pill { align-self: flex-end; }
  .fbw-panel { width: 100%; }
  .fbw-signals { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .fbw-panel { animation: none; }
  .fbw-pill, .fbw-send, .fbw-signal { transition: none; }
  .fbw-pill:hover, .fbw-send:hover, .fbw-signal:hover { transform: none; }
}
