/* Feedback widget (task 565). Colours and type come only from the page's own tokens: the site and cabinet set
   --color-*, the terminal sets --surface/--ink/--accent; the widget maps both and keeps no colours of its own,
   except the cover on a screenshot. */
:root .bm-fb-ui {
  --fb-bg: var(--color-surface, var(--surface, Canvas));
  --fb-bg-2: var(--color-paper-2, var(--surface-2, var(--fb-bg)));
  --fb-ink: var(--color-ink, var(--ink, CanvasText));
  --fb-muted: var(--color-muted, var(--muted-strong, var(--muted, GrayText)));
  --fb-rule: var(--color-rule, var(--line, GrayText));
  --fb-accent: var(--color-accent, var(--accent, Highlight));
  /* The primary action as the site draws it: ink on surface (light), surface on ink (dark); the terminal's accent fill. */
  --fb-primary: var(--color-ink, var(--accent-fill, Highlight));
  --fb-on-primary: var(--color-surface, var(--accent-on-fill, HighlightText));
  --fb-focus: var(--color-focus, var(--accent, Highlight));
  --fb-error: var(--color-error, var(--loss, #c0392b));
  --fb-shadow: var(--color-shadow, rgb(0 0 0 / .24));
  --fb-font: var(--font-body, system-ui, sans-serif);
  --fb-display: var(--font-display, var(--fb-font));
  font-family: var(--fb-font);
  color: var(--fb-ink);
  box-sizing: border-box;
}
:root .bm-fb-ui *, :root .bm-fb-ui *::before, :root .bm-fb-ui *::after { box-sizing: inherit; }

:root .bm-fb-ui :focus-visible { outline: 2px solid var(--fb-focus); outline-offset: 2px; }
:root .bm-fb-ui button { font: inherit; cursor: pointer; }

/* Launcher: a pill bottom right, above the cookie bar and the cabinet tab bar (placed by the script). */
:root .bm-fb-launch {
  position: fixed; right: 16px; bottom: var(--bm-fb-bottom, 16px); z-index: 60;
  /* 20% smaller than the first 48 px pill (Evgeny A., 19.11): height, padding, gap, type and icon alike. */
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px 0 11px; max-width: calc(100vw - 24px); text-decoration: none;
  border: 1px solid var(--fb-rule); border-radius: 999px; background: var(--fb-primary); color: var(--fb-on-primary);
  font-weight: 600; font-size: 12px; box-shadow: 0 6px 19px var(--fb-shadow);
  transition: padding .2s ease, transform .2s ease;
}
:root .bm-fb-launch svg { flex: none; width: 16px; height: 16px; }
:root .bm-fb-launch:focus-visible { outline: 2px solid var(--fb-focus); outline-offset: 3px; }
:root .bm-fb-launch:hover { transform: translateY(-1px); }
html.bm-fb-open .bm-fb-launch { display: none; }
/* The terminal (Evgeny A. 20.11.2026, #622): every table keeps the button's width free on the right, so no row's
   buttons or values sit under it; on a phone the button is a round icon (its label stays for screen readers). */
:root body.is-terminal .table-scroll { padding-right: var(--bm-fb-reserve, 0px); }
@media (max-width: 767px) {
  :root body.is-terminal .bm-fb-launch { width: 40px; min-height: 40px; padding: 0; justify-content: center; }
  :root body.is-terminal .bm-fb-launch span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 720px) {
  :root .bm-fb-launch { right: 12px; }
}
@media print { :root .bm-fb-ui { display: none !important; } }

/* The chip under a selection. */
:root .bm-fb-chip {
  position: fixed; z-index: 70; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 0; border-radius: 999px; background: var(--fb-primary); color: var(--fb-on-primary); font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 18px var(--fb-shadow);
}
:root .bm-fb-chip svg { width: 16px; height: 16px; }
@media (pointer: coarse) { :root .bm-fb-chip { min-height: 44px; padding: 0 16px; } }
:root .bm-fb-chip[hidden], :root .bm-fb-panel[hidden] { display: none; }

/* The one-time hint. */
:root .bm-fb-toast {
  position: fixed; right: 16px; bottom: calc(var(--bm-fb-bottom, 16px) + 56px); z-index: 61; max-width: 320px;
  display: grid; gap: 6px; padding: 14px 16px; border-left: 3px solid var(--fb-accent);
  background: var(--fb-bg); box-shadow: 0 10px 28px var(--fb-shadow); font-size: 14px; line-height: 1.45;
}
:root .bm-fb-toast p { margin: 0; }

/* The panel: a side sheet on wide screens, a bottom sheet on phones; never modal, the page stays usable. */
:root .bm-fb-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 80; width: min(400px, 100vw);
  display: flex; flex-direction: column; gap: 14px; padding: 18px 20px 24px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--fb-bg); border-left: 1px solid var(--fb-rule); box-shadow: -12px 0 32px var(--fb-shadow);
  font-size: 15px; line-height: 1.45; animation: bm-fb-in .22s ease-out;
}
@keyframes bm-fb-in { from { transform: translateX(24px); opacity: 0; } }
@media (max-width: 640px) {
  :root .bm-fb-panel { top: auto; left: 0; width: 100vw; height: 90dvh; border-left: 0; border-top: 1px solid var(--fb-rule); border-radius: 16px 16px 0 0; animation-name: bm-fb-up; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  @keyframes bm-fb-up { from { transform: translateY(24px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { :root .bm-fb-panel, :root .bm-fb-launch { animation: none; transition: none; } }

:root .bm-fb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--fb-rule); }
:root .bm-fb-head h2 { margin: 0; font-family: var(--fb-display); font-size: 20px; line-height: 1.2; font-weight: 700; color: var(--fb-ink); }
:root .bm-fb-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: -10px -10px 0 0; border: 0; border-radius: 8px; background: none; color: var(--fb-muted); }
:root .bm-fb-icon:hover { color: var(--fb-ink); background: var(--fb-bg-2); }

:root .bm-fb-form { display: flex; flex-direction: column; gap: 14px; }
:root .bm-fb-label { display: block; margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--fb-muted); }
:root .bm-fb-quote blockquote { margin: 0 0 6px; padding: 6px 0 6px 12px; border-left: 3px solid var(--fb-rule); color: var(--fb-ink); font-style: italic; overflow-wrap: anywhere; }
:root .bm-fb-quote[hidden] { display: none; }

:root .bm-fb-kinds { display: flex; flex-wrap: wrap; gap: 8px; }
:root .bm-fb-kind { min-height: 44px; padding: 0 14px; border: 1px solid var(--fb-rule); border-radius: 999px; background: none; color: var(--fb-ink); font-size: 14px; }
:root .bm-fb-kind[aria-pressed="true"] { border-color: var(--fb-primary); background: var(--fb-primary); color: var(--fb-on-primary); font-weight: 600; }
@media (pointer: coarse) { :root .bm-fb-kind { min-height: 44px; } }

:root .bm-fb-ui textarea, :root .bm-fb-ui input[type=email] {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--fb-rule); border-radius: 8px;
  background: var(--fb-bg-2); color: var(--fb-ink); font: inherit; resize: vertical;
}
:root .bm-fb-ui textarea { min-height: 84px; }
:root .bm-fb-ui textarea::placeholder, :root .bm-fb-ui input::placeholder { color: var(--fb-muted); opacity: 1; }
:root .bm-fb-ui input:disabled { opacity: .5; }

:root .bm-fb-check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--fb-ink); cursor: pointer; }
:root .bm-fb-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--fb-accent); }
:root .bm-fb-reply { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
:root .bm-fb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

:root .bm-fb-shot { display: grid; gap: 8px; }
:root .bm-fb-shot[hidden] { display: none; }
:root .bm-fb-canvas { width: 100%; height: auto; border: 1px solid var(--fb-rule); border-radius: 6px; cursor: crosshair; touch-action: none; }

:root .bm-fb-send { align-self: flex-start; min-height: 44px; padding: 0 22px; border: 1px solid var(--fb-primary); border-radius: 999px; background: var(--fb-primary); color: var(--fb-on-primary); font-weight: 700; }
:root .bm-fb-send:disabled { opacity: .6; cursor: progress; }
:root .bm-fb-quiet { min-height: 44px; padding: 0 16px; border: 1px solid var(--fb-rule); border-radius: 999px; background: none; color: var(--fb-ink); }
:root .bm-fb-link { justify-self: start; align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none; color: var(--fb-ink); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
:root .bm-fb-row { display: flex; flex-wrap: wrap; gap: 8px; }
:root .bm-fb-sendrow { align-items: center; gap: 12px; }
:root .bm-fb-keys { font-size: 13px; color: var(--fb-muted); }

:root .bm-fb-consent, :root .bm-fb-muted, :root .bm-fb-what { margin: 0; font-size: 13px; color: var(--fb-muted); }
:root .bm-fb-consent a { color: var(--fb-ink); }
:root .bm-fb-what summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
:root .bm-fb-what ul { margin: 4px 0 0; padding-left: 18px; }
:root .bm-fb-status { margin: 0; font-size: 14px; min-height: 0; }
:root .bm-fb-status:empty { display: none; }
:root .bm-fb-error { margin: 0; color: var(--fb-error); font-size: 14px; }

:root .bm-fb-done { display: grid; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid var(--fb-rule); }
:root .bm-fb-done p { margin: 0; }
:root .bm-fb-number { font-family: var(--fb-display); font-size: 18px; font-weight: 700; }
:root .bm-fb-thread { display: grid; gap: 10px; }
:root .bm-fb-msgs { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
:root .bm-fb-msgs li { padding: 10px 12px; border-radius: 10px; background: var(--fb-bg-2); }
:root .bm-fb-msgs li[data-from="support"] { border-left: 3px solid var(--fb-accent); }
:root .bm-fb-msgs p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
:root .bm-fb-who { font-size: 12px; font-weight: 600; color: var(--fb-muted); }
:root .bm-fb-ai { display: block; margin-top: 6px; font-size: 12px; color: var(--fb-muted); }

