/* Help panel (scripts/html-feedback.js): Help tab, point mode, selection chip, panel, toast, replay.
   Uses each skin's tokens, so it follows skin and color mode without per-skin rules. */

/* Help tab in the top bar: the one filled button, so it reads as the way to ask. */
.help-toggle { font: 700 12px var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--accent); border: 1px solid var(--accent); border-radius: 6px; padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.help-toggle:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.help-toggle[aria-expanded="true"] { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.help-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-skin="wolff"] .help-toggle { border-radius: 999px; letter-spacing: .02em; text-transform: none; font-weight: 600; }

/* ---------- Point mode ---------- */
body.fb-pointing .markdown-body, body.fb-pointing .markdown-body * { cursor: crosshair !important; }
body.fb-pointing .markdown-body a { pointer-events: auto; }
.fb-outline { position: absolute; z-index: 55; pointer-events: none; border: 2px solid var(--accent); border-radius: calc(var(--radius) + 2px); background: color-mix(in srgb, var(--accent) 7%, transparent); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .12); transition: top .08s, left .08s, width .08s, height .08s; }
.fb-outline[hidden] { display: none; }
.fb-outline-label { position: absolute; left: -2px; bottom: 100%; margin-bottom: 4px; max-width: min(420px, 90vw); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 3px 8px; font: 600 11.5px var(--font-ui); color: #fff; background: var(--accent); border-radius: 4px; }

/* Hangs just under the Help tab (html-feedback.js sets right and the arrow position), where the eye already is. */
.fb-pointbar { position: fixed; z-index: 80; top: calc(var(--top-h) + 10px); right: 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 24px); padding: 10px 14px; font: 14px var(--font-ui); color: var(--text); background: var(--popup-bg); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: 0 18px 40px rgba(0, 0, 0, .25); }
.fb-pointbar::before { content: ""; position: absolute; top: -10px; right: var(--fb-arrow-right, 24px); border: 7px solid transparent; border-top: 0; border-bottom-color: var(--accent); margin-right: -7px; }
.fb-pointbar[hidden] { display: none; }
.fb-pointbar-text { font-weight: 700; color: var(--heading); }
.fb-pointbar-keys { font-size: 12.5px; color: var(--muted); }

.fb-pin-host { position: relative; }
.fb-pin { position: absolute; z-index: 5; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--accent); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--accent), 0 6px 14px rgba(0, 0, 0, .35); cursor: grab; touch-action: none; }
.fb-pin::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #fff; }
.fb-pin[hidden] { display: none; }

/* ---------- Selection chip ---------- */
.fb-chip { position: absolute; z-index: 65; padding: 7px 12px; font: 700 12.5px var(--font-ui); color: #fff; background: var(--accent); border: 0; border-radius: 999px; box-shadow: 0 8px 20px rgba(0, 0, 0, .25); cursor: pointer; }
.fb-chip[hidden] { display: none; }
.fb-chip-docked { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 11px 18px; font-size: 14px; }

/* ---------- Panel: right-hand card on desktop, bottom sheet on phones ---------- */
.fb-panel { position: fixed; z-index: 75; top: calc(var(--top-h) + 12px); right: 16px; width: min(390px, calc(100vw - 32px)); max-height: calc(100vh - var(--top-h) - 28px); overflow: auto; padding: 14px 16px 16px; color: var(--text); background: var(--popup-bg); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: 0 22px 50px rgba(0, 0, 0, .28); font: 14px/1.45 var(--font-ui); }
.fb-panel[hidden] { display: none; }
.fb-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.fb-head strong { font: 800 13px var(--font-head); letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep); }
.fb-close { width: 30px; height: 30px; font-size: 22px; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.fb-close:hover { background: var(--surface); color: var(--heading); }
.fb-target { padding: 10px 12px; margin-bottom: 12px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.fb-target-label { font-weight: 600; color: var(--heading); }
.fb-target-label small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.fb-target-tools { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.fb-stage { display: grid; gap: 10px; }
.fb-question { margin: 2px 0 0; font-weight: 700; color: var(--heading); }
.fb-hint { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.fb-kinds { display: grid; gap: 6px; }
.fb-kind { padding: 11px 12px; text-align: left; font: 600 14px var(--font-ui); color: var(--heading); background: transparent; border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; }
.fb-kind:hover, .fb-kind:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); outline: none; }
.fb-field { display: grid; gap: 5px; }
.fb-field > span { font-weight: 600; color: var(--heading); }
.fb-field small { font-weight: 400; color: var(--muted); }
.fb-field textarea, .fb-field input { width: 100%; padding: 8px 10px; font: 14px/1.4 var(--font-ui); color: var(--text); background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; resize: vertical; }
.fb-field textarea:focus, .fb-field input:focus { outline: none; border-color: var(--accent); }
.fb-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.fb-choice { padding: 6px 10px; font: 600 12.5px var(--font-ui); color: var(--heading); background: transparent; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; }
.fb-choice.is-on { color: #fff; background: var(--accent); border-color: var(--accent); }
.fb-drop { padding: 14px; font-size: 13px; text-align: center; color: var(--muted); border: 1.5px dashed var(--rule); border-radius: var(--radius); }
.fb-drop.is-over, .fb-drop:focus { border-color: var(--accent); outline: none; }
.fb-shot { display: grid; gap: 6px; justify-items: center; }
.fb-shot img { max-width: 100%; max-height: 160px; border-radius: 4px; border: 1px solid var(--rule); }
.fb-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.fb-actions .fb-link:first-child { margin-right: auto; }
.fb-button { padding: 7px 12px; font: 600 13px var(--font-ui); color: var(--heading); background: transparent; border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; text-decoration: none; }
.fb-button:hover:not(:disabled) { border-color: var(--accent); color: var(--heading); }
.fb-button:disabled { opacity: .45; cursor: default; }
.fb-primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.fb-primary:hover:not(:disabled) { color: #fff; background: var(--accent-deep); border-color: var(--accent-deep); }
.fb-link { padding: 0; font: 600 13px var(--font-ui); color: var(--accent-deep); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: .16em; }
.fb-help { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fb-help li { padding: 9px 11px; border: 1px solid var(--rule); border-radius: var(--radius); }
.fb-help small { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fb-help a { font-weight: 700; }
.fb-help p { margin: 3px 0; font-size: 13px; color: var(--muted); }
.fb-help .fb-gloss { color: var(--text); }
.fb-sendlist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.fb-sending { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 4px 4px 10px; font-size: 12.5px; color: var(--heading); background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; }
.fb-sending > span { min-width: 0; }
.fb-sending > .fb-x { flex: none; }
.fb-sending.is-fixed { padding-right: 10px; }
.fb-sending.is-off { opacity: .5; text-decoration: line-through; }
.fb-x { width: 22px; height: 22px; font-size: 14px; line-height: 1; color: var(--muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; }
.fb-x:hover { background: var(--rule); color: var(--heading); }
.fb-honey { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-join { padding: 12px; background: var(--note-bg); border-radius: var(--radius); }
.fb-join p { margin: 0 0 10px; }
.fb-error { margin: 0; padding: 8px 10px; font-size: 13px; color: var(--warn); background: var(--warn-bg); border-radius: 6px; }

/* ---------- Margin mark, toast, welcome card, replay ---------- */
/* A short accent bar just left of a block the reader flagged (box-shadow, so no layout shift and ::before stays free). */
.fb-flagged { box-shadow: -8px 0 0 -5px var(--accent); }
.fb-toast { position: fixed; z-index: 90; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100vw - 32px); padding: 10px 16px; font: 600 14px var(--font-ui); color: var(--top-text); background: var(--top-bg); border-radius: var(--radius); box-shadow: 0 14px 30px rgba(0, 0, 0, .3); }
.fb-toast[hidden] { display: none; }
.fb-welcome { position: fixed; z-index: 85; right: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); padding: 14px 16px; font: 14px/1.5 var(--font-ui); color: var(--text); background: var(--popup-bg); border: 1px solid var(--rule); border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: 0 22px 50px rgba(0, 0, 0, .28); }
.fb-welcome p { margin: 0 0 8px; }
body.fb-pointing .fb-welcome, body:has(.fb-panel:not([hidden])) .fb-welcome { display: none; }
.fb-replay-banner { position: fixed; z-index: 85; top: calc(var(--top-h) + 10px); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 24px); padding: 8px 8px 8px 14px; font: 600 13px var(--font-ui); color: #fff; background: var(--accent-deep); border-radius: var(--radius); box-shadow: 0 14px 30px rgba(0, 0, 0, .3); }
.fb-replay-banner .fb-close { color: #fff; }
.fb-replay-banner .fb-close:hover { background: rgba(255, 255, 255, .15); color: #fff; }
::highlight(fb-replay) { background: color-mix(in srgb, var(--accent) 40%, transparent); color: inherit; }

@media (max-width: 820px) {
  /* Room for Help on a phone: PDF goes (the whole manual is a download away on a desktop anyway). */
  .pdf-download { display: none; }
  .help-toggle { padding: 7px 9px; }
  .fb-panel { top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 72vh; padding-bottom: calc(16px + env(safe-area-inset-bottom)); border-radius: 14px 14px 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  .fb-pointbar { left: 12px; right: 12px !important; justify-content: center; gap: 8px 12px; }
  .fb-pointbar-keys { display: none; }
  .fb-welcome { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; }
}
