/* 1.2.5 in-bubble polls, quizzes and forms. Built only from theme tokens so Fluid, Classic,
   Dark, Glass Bubble and the five element themes all stay readable; accents are softened
   with color-mix for eye-friendly fills. Targets: 44px rows, 4.5:1 text. */
.form-message-card { width: min(380px, calc(100vw - 88px)); max-width: 100%; min-width: min(260px, 100%); }
@media (min-width: 900px) { .form-message-card { width: min(420px, calc(100vw - 480px)); } }
.fb-card {
  --fb-accent: var(--accent, #086EA6);
  --fb-ink: var(--ink, #152A3A);
  --fb-muted: var(--muted, #5A6975);
  --fb-track: color-mix(in srgb, var(--fb-accent) 9%, transparent);
  --fb-fill: color-mix(in srgb, var(--fb-accent) 22%, transparent);
  --fb-fill-lead: color-mix(in srgb, var(--fb-accent) 34%, transparent);
  display: grid; gap: 10px; box-sizing: border-box; width: 100%; padding: 12px;
  color: var(--fb-ink); text-align: left;
  background: color-mix(in srgb, var(--surface, #fff) 88%, transparent);
  border: 1px solid color-mix(in srgb, var(--fb-accent) 22%, var(--line, #D8E8F2));
  border-radius: 12px;
}
.fb-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.fb-glyph { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--fb-accent); background: var(--fb-track); }
.fb-glyph ion-icon { width: 17px; height: 17px; }
.fb-kind { font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--fb-accent); }
.fb-chip { padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; color: var(--fb-muted); background: color-mix(in srgb, var(--fb-ink) 7%, transparent); }
.fb-closed .fb-chip:first-of-type { color: var(--fb-ink); }
.fb-title { display: block; font-size: 16px; line-height: 1.35; font-weight: 700; overflow-wrap: anywhere; }
.fb-question { margin: -4px 0 0; font-size: 14px; line-height: 1.45; color: var(--fb-ink); overflow-wrap: anywhere; }
.fb-muted { margin: 0; font-size: 12.5px; color: var(--fb-muted); }
.fb-error { margin: 0; font-size: 12.5px; font-weight: 600; color: #B42318; }
html[data-eagle-appearance="dark"] .fb-error, html[data-eagle-tone="dark"] .fb-error, html[data-eagle-glass="dark"] .fb-error { color: #FDA29B; }

.fb-options { display: grid; gap: 6px; }
.fb-option {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; align-items: center; gap: 8px;
  min-height: 44px; box-sizing: border-box; width: 100%; padding: 8px 10px; margin: 0;
  font: inherit; font-size: 14px; color: var(--fb-ink); text-align: left;
  background: var(--fb-track); border: 1px solid transparent; border-radius: 10px;
}
button.fb-option { cursor: pointer; transition: border-color .15s, background-color .15s; }
button.fb-option:hover { border-color: color-mix(in srgb, var(--fb-accent) 40%, transparent); }
button.fb-option:focus-visible, .fb-open:focus-visible, .fb-submit:focus-visible, .fb-send:focus-visible, .fb-input:focus-visible { outline: 2px solid var(--fb-accent); outline-offset: 2px; }
.fb-option.fb-mine { border-color: var(--fb-accent); }
.fb-mark { display: grid; place-items: center; color: var(--fb-accent); }
.fb-mark ion-icon { width: 20px; height: 20px; }
.fb-label { min-width: 0; overflow-wrap: anywhere; line-height: 1.35; }
.fb-lead { display: grid; color: var(--fb-accent); }
.fb-lead ion-icon { width: 15px; height: 15px; }
.fb-nums { display: grid; justify-items: end; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fb-nums b { font-size: 14px; }
.fb-nums small { font-size: 11px; color: var(--fb-muted); }
/* Result bar sits behind the row and grows in. */
.fb-bar { position: absolute; z-index: -1; inset: 0 auto 0 0; width: var(--fb-pct); background: var(--fb-fill); border-radius: 10px 0 0 10px;
  animation: fb-grow .7s cubic-bezier(.2,.8,.2,1) both; transform-origin: left center; }
.fb-leading .fb-bar { background: var(--fb-fill-lead); }
.fb-leading .fb-label { font-weight: 700; }
@keyframes fb-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .fb-bar { animation: none; } }
html[data-eagle-motion="off"] .fb-bar { animation: none; }

.fb-creator { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; }
.fb-donut, .fb-ring { display: block; }
.fb-ring-track { fill: none; stroke: var(--fb-track); stroke-width: 7; }
.fb-ring-value { fill: none; stroke: var(--fb-accent); stroke-width: 7; stroke-linecap: round; }
.fb-ring text { font: 700 12px system-ui, sans-serif; fill: var(--fb-ink); }
.fb-donut-seg { fill: none; stroke-width: 9; }
.fb-seg-0 { stroke: var(--fb-accent); }
.fb-seg-1 { stroke: color-mix(in srgb, var(--fb-accent) 62%, #F2A65A); }
.fb-seg-2 { stroke: color-mix(in srgb, var(--fb-accent) 45%, #57B894); }
.fb-seg-3 { stroke: color-mix(in srgb, var(--fb-accent) 40%, #B58BD6); }
.fb-seg-4 { stroke: color-mix(in srgb, var(--fb-accent) 40%, #E8C34E); }
.fb-seg-5 { stroke: color-mix(in srgb, var(--fb-accent) 30%, #9AA6B2); }
.fb-donut-num { font: 700 15px system-ui, sans-serif; fill: var(--fb-ink); }
.fb-donut-cap { font: 500 8.5px system-ui, sans-serif; fill: var(--fb-muted); }

.fb-multi { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
.fb-multi:not(:has(.fb-score, .fb-stat)) { grid-template-columns: minmax(0, 1fr); }
.fb-multi-main { display: grid; gap: 6px; min-width: 0; }
.fb-meta, .fb-progress-label { font-size: 12.5px; color: var(--fb-muted); }
.fb-progress { height: 8px; border-radius: 999px; background: var(--fb-track); overflow: hidden; }
.fb-progress span { display: block; height: 100%; width: var(--fb-pct); border-radius: inherit; background: var(--fb-accent); transition: width .5s; }
.fb-score { display: flex; align-items: center; gap: 8px; }
.fb-score span, .fb-stat { display: grid; line-height: 1.15; }
.fb-score b, .fb-stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.fb-stat { place-items: center; min-width: 56px; padding: 6px 8px; border-radius: 10px; background: var(--fb-track); }
.fb-score small, .fb-stat small { font-size: 11.5px; color: var(--fb-muted); }

.fb-inline-text { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 6px; }
.fb-input { box-sizing: border-box; min-width: 0; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 16px; color: var(--fb-ink);
  background: var(--surface, #fff); border: 1px solid color-mix(in srgb, var(--fb-accent) 45%, var(--line, #ccc)); border-radius: 10px; }
.fb-send, .fb-submit { min-height: 44px; border: 0; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer;
  color: var(--theme-on-primary, #fff); background: var(--fb-accent); }
.fb-send { display: grid; place-items: center; }
.fb-send:disabled { opacity: .55; cursor: default; }
.fb-submit { width: 100%; }

.fb-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.fb-total { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--fb-muted); font-variant-numeric: tabular-nums; }
.fb-total ion-icon { width: 15px; height: 15px; }
.fb-open { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer;
  color: var(--theme-on-primary, #fff); background: var(--fb-accent); border: 1px solid var(--fb-accent); }
.fb-open.fb-open-quiet { color: var(--fb-accent); background: transparent; }
.fb-open ion-icon { width: 15px; height: 15px; }
.fb-loading { display: grid; gap: 6px; margin: 0; }
.fb-skeleton { display: block; height: 12px; border-radius: 6px; background: var(--fb-track); }
.fb-skeleton.short { width: 60%; }
/* Inside outgoing bubbles keep the card distinct from the bubble fill. */
.bubble.mine .fb-card { background: color-mix(in srgb, var(--surface, #fff) 94%, transparent); }

.fb-first { margin: 4px 0 0; font-size: 0.86rem; color: var(--ink); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fb-card .fb-first > span, .fb-first > span { color: var(--muted); font-size: 0.75rem; font-weight: 500; margin-right: 4px; }
@media (pointer: coarse) { .fb-open { min-height: 44px; } }
