/* Help -> Feedback v2 workspace (2026-10-28): screenshot large on the left with Pen / Arrow / Undo,
   a chat sidebar on the right (type or record, Send). Phone: screenshot on top, chat sheet below.
   App tokens only, so it follows Day / Night. Rhythm: 24 / 16 / 12 / 8. Taps >= 44px. */

/* While a picture is being taken, none of our own UI may be in it. */
html.wf-fb-capturing #wf-help-btn, html.wf-fb-capturing #wf-help-panel, html.wf-fb-capturing .wf-fb,
html.wf-fb-capturing .wf-fb-hint, html.wf-fb-capturing .wf-fb-busy { visibility: hidden !important; }
html.wf-fb-open #wf-help-btn { display: none !important; }

.wf-fb-hint {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1260;
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--radius-pill, 999px);
  background: var(--bg-raised); color: var(--white); border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0,0,0,.22); font: 600 13.5px/1.35 var(--font-body);
}

.wf-fb {
  position: fixed; inset: 0; z-index: 1250; display: flex;
  background: var(--bg-base); color: var(--white); font-family: var(--font-body);
}
.wf-fb-stage { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 16px 24px 24px; background: var(--bg-raised); }
.wf-fb-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-fb-tools[hidden] { display: none !important; }
.wf-fb-pick.inv-kind-switch { margin: 0; }
.wf-fb-pick .inv-kind-tab { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; }
.wf-fb-gap { flex: 1 1 auto; }
.wf-fb-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 44px; padding: 0 16px;
  border-radius: var(--radius-pill, 999px); border: 1px solid var(--border); background: var(--bg-base); color: var(--white);
  font: 600 13.5px var(--font-body); cursor: pointer;
}
.wf-fb-tool:hover:not(:disabled) { border-color: var(--accent, var(--gold)); }
.wf-fb-tool:disabled { opacity: .45; cursor: default; }
.wf-fb-tool.wf-fb-icon { padding: 0; width: 44px; }
.wf-fb-canvas-wrap { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.wf-fb-canvas {
  display: block; max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair;
  border-radius: var(--radius, 10px); border: 1px solid var(--border); box-shadow: 0 12px 36px rgba(0,0,0,.18);
}
.wf-fb.is-sent .wf-fb-canvas { cursor: default; }
.wf-fb.is-retaking .wf-fb-canvas-wrap { opacity: .4; }
.wf-fb-nocap { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px; max-width: 360px; }
.wf-fb-nocap-t { font-size: 16px; font-weight: 700; }
.wf-fb-nocap-s { font-size: 13.5px; color: var(--muted); line-height: 1.45; }
/* "Try again": a real pill with its label on one line (the phone's 44px icon-button rule must not reach it). */
.wf-fb .wf-fb-nocap .wf-fb-retry { width: auto; min-width: 148px; padding: 0 20px; white-space: nowrap; }
.wf-fb .wf-fb-nocap .wf-fb-retry span { display: inline; }

.wf-fb-side { flex: 0 0 380px; width: 380px; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--border); background: var(--bg-base); }
.wf-fb-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.wf-fb-head-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.wf-fb-title { font-size: 16px; font-weight: 700; }
.wf-fb-sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.wf-fb-close.wf-help-x { margin-left: 0; width: 44px; height: 44px; min-height: 44px; flex: 0 0 44px; }
.wf-fb-thread { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.wf-fb-msg { display: flex; }
.wf-fb-msg.is-user { justify-content: flex-end; }
.wf-fb-msg.is-note { justify-content: center; }
.wf-fb-bubble { max-width: 88%; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 8px; }
.wf-fb-msg.is-user .wf-fb-bubble { background: var(--accent, var(--gold)); color: var(--on-accent, #0a0a0b); border-bottom-right-radius: 4px; }
.wf-fb-msg.is-note .wf-fb-bubble { background: transparent; color: var(--muted); font-size: 12.5px; text-align: center; padding: 4px 8px; }
.wf-fb-msg.is-sending .wf-fb-bubble { opacity: .6; }
.wf-fb-msg.is-failed .wf-fb-bubble { outline: 2px solid #d92d20; outline-offset: 2px; }
.wf-fb-voice { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.wf-fb-audio { width: 240px; max-width: 100%; height: 40px; }
.wf-fb-bottom { border-top: 1px solid var(--border); padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; }
.wf-fb-micwrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.wf-fb-bigmic {
  width: 64px; height: 64px; min-height: 64px; padding: 0; border-radius: 50%; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent, var(--gold)); color: var(--on-accent, #0a0a0b); box-shadow: 0 6px 18px rgba(0,0,0,.18);
  transition: transform .12s ease, background .12s ease;
}
.wf-fb-bigmic:hover:not(:disabled) { transform: scale(1.04); }
.wf-fb-bigmic:focus-visible { outline: 2px solid var(--accent, var(--gold)); outline-offset: 3px; }
.wf-fb-bigmic:disabled { opacity: .5; cursor: default; }
.wf-fb.is-recording .wf-fb-bigmic { background: #d92d20; color: #fff; animation: wfFbPulse 1.2s infinite ease-in-out; }
.wf-fb-miclbl { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.wf-fb.is-recording .wf-fb-miclbl { color: #d92d20; font-weight: 600; }
@keyframes wfFbPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(217,45,32,.45); } 50% { box-shadow: 0 0 0 10px rgba(217,45,32,0); } }
@media (prefers-reduced-motion: reduce) { .wf-fb.is-recording .wf-fb-bigmic { animation: none; } }
.wf-fb-input {
  width: 100%; resize: none; min-height: 64px; max-height: 140px; padding: 12px 14px; box-sizing: border-box;
  border-radius: var(--radius, 10px); border: 1px solid var(--border); background: var(--bg-raised); color: var(--white); font: 400 14px/1.45 var(--font-body);
}
.wf-fb-input:focus { outline: none; border-color: var(--accent, var(--gold)); }
.wf-fb-sendbtn { width: 100%; }
.wf-fb.is-sending .wf-fb-sendbtn { opacity: .6; }
.wf-fb-status { font-size: 12.5px; color: var(--off-white, var(--muted)); line-height: 1.4; }
.wf-fb-status:empty { display: none; }

/* A voice note: play / pause, progress, time */
.wf-fb-clip { min-width: 240px; }
.wf-fb-voice-l { font-size: 12px; font-weight: 700; letter-spacing: .02em; opacity: .85; }
.wf-fb-player { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wf-fb-play {
  flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid currentColor; background: transparent; color: inherit;
}
.wf-fb-player.is-loading .wf-fb-play { opacity: .5; }
.wf-fb-prog { flex: 1 1 auto; min-width: 60px; height: 4px; border-radius: 2px; background: currentColor; opacity: .9; position: relative; overflow: hidden; }
.wf-fb-prog { background: color-mix(in srgb, currentColor 25%, transparent); }
.wf-fb-prog-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: currentColor; }
.wf-fb-ptime { flex: 0 0 auto; font-size: 12px; font-variant-numeric: tabular-nums; }
.wf-fb-clip-acts { display: flex; justify-content: flex-end; gap: 8px; }
.wf-fb-mini { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; border: 0; background: color-mix(in srgb, currentColor 14%, transparent); color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

/* The confirmation after Send */
.wf-fb.is-done { align-items: center; justify-content: center; background: color-mix(in srgb, var(--bg-base) 92%, transparent); }
.wf-fb-okwrap { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; overflow-y: auto; }
.wf-fb-ok {
  width: min(440px, 100%); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  padding: 32px 24px 24px; border-radius: var(--radius-lg, 14px); border: 1px solid var(--border); background: var(--bg-raised);
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
}
.wf-fb-ok-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #12b76a; color: #fff; margin-bottom: 4px; }
.wf-fb-ok-title { font-size: 20px; font-weight: 700; }
.wf-fb-ok-sub { font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 340px; }
.wf-fb-ok-num { font: 700 13px var(--font-body); letter-spacing: .04em; padding: 8px 14px; border-radius: var(--radius-pill, 999px); border: 1px solid var(--border); background: var(--bg-base); }
.wf-fb-ok-thumb { width: 100%; max-height: 200px; object-fit: cover; object-position: top; border-radius: var(--radius, 10px); border: 1px solid var(--border); margin-top: 4px; }
.wf-fb-ok-done { width: 100%; margin-top: 12px; }

/* A ticket, opened from the notification */
.wf-fb-ticket { align-items: center; justify-content: center; background: rgba(0,0,0,.45); padding: 24px; box-sizing: border-box; }
.wf-fb-tk-card { width: min(880px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: var(--radius-lg, 14px); border: 1px solid var(--border); background: var(--bg-base); box-shadow: 0 24px 64px rgba(0,0,0,.3); overflow: hidden; }
.wf-fb-tk-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 16px 12px 24px; border-bottom: 1px solid var(--border); }
.wf-fb-tk-title { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 700; }
.wf-fb-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill, 999px); }
.wf-fb-badge.is-fixed { background: color-mix(in srgb, #12b76a 18%, transparent); color: #12b76a; }
.wf-fb-badge.is-open { background: color-mix(in srgb, var(--accent, var(--gold)) 18%, transparent); color: var(--accent, var(--gold)); }
.wf-fb-tk-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.wf-fb-tk-pics { display: grid; grid-template-columns: 1fr; gap: 16px; }
.wf-fb-tk-pics.is-two { grid-template-columns: 1fr 1fr; }
.wf-fb-tk-fig { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.wf-fb-tk-fig figcaption, .wf-fb-tk-label { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.wf-fb-tk-img { width: 100%; border-radius: var(--radius, 10px); border: 1px solid var(--border); background: var(--bg-raised); min-height: 120px; object-fit: contain; }
.wf-fb-tk-sec { display: flex; flex-direction: column; gap: 12px; }
.wf-fb-tk-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; border-radius: var(--radius, 10px); background: var(--bg-raised); border: 1px solid var(--border); }
.wf-fb-tk-sec .wf-fb-player { padding: 8px 14px 8px 8px; border-radius: var(--radius, 10px); background: var(--bg-raised); border: 1px solid var(--border); }
.wf-fb-tk-reply .wf-fb-tk-text { border-color: color-mix(in srgb, #12b76a 45%, var(--border)); }
.wf-fb-tk-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); flex-wrap: wrap; }
.wf-fb-tk-foot .wf-fb-status { flex: 1 1 100%; }
.wf-fb-tk-acked { flex: 1 1 auto; font-size: 13.5px; color: var(--muted); }

/* Phone: the screenshot on top, the chat sheet below. */
@media (max-width: 768px) {
  .wf-fb { flex-direction: column; }
  /* The picture takes what the chat sheet leaves; the sheet is only as tall as its content. */
  /* The picture keeps at least half the screen whatever the sheet holds (voice notes are chips in one row). */
  .wf-fb-stage { flex: 1 1 0; min-height: 50vh; padding: 12px 16px 20px; gap: 8px; }
  .wf-fb.is-noshot .wf-fb-stage { min-height: 36vh; }
  .wf-fb-tools { flex-wrap: nowrap; }
  .wf-fb-pick .inv-kind-tab { padding: 0; width: 44px; justify-content: center; }
  .wf-fb-pick .inv-kind-tab span, .wf-fb-tools .wf-fb-tool span { display: none; }
  .wf-fb-tool { padding: 0; width: 44px; }
  .wf-fb-side { flex: 0 0 auto; max-height: 50vh; overflow-y: auto; overscroll-behavior: contain; width: auto; border-left: 0; border-top: 1px solid var(--border); border-radius: 18px 18px 0 0; margin-top: -12px; box-shadow: 0 -8px 24px rgba(0,0,0,.12); }
  .wf-fb-head { padding: 12px 16px 8px; }
  /* Voice notes as compact chips that wrap onto rows (never a sideways row: it clipped the first chip). Two rows show; more scroll. */
  .wf-fb-thread { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; max-height: 128px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px; }
  .wf-fb-thread:empty { display: none; }
  .wf-fb-thread .wf-fb-msg { flex: 0 0 auto; max-width: 100%; }
  .wf-fb-thread .wf-fb-msg.is-note .wf-fb-bubble { white-space: nowrap; }
  .wf-fb-thread .wf-fb-bubble { max-width: none; }
  .wf-fb-clip { min-width: 0; flex-direction: row; align-items: center; gap: 4px; padding: 4px 4px 4px 4px; border-radius: var(--radius-pill, 999px); }
  .wf-fb-msg.is-user .wf-fb-clip { border-bottom-right-radius: var(--radius-pill, 999px); }
  .wf-fb-clip .wf-fb-voice-l { display: none; }
  .wf-fb-clip .wf-fb-player { gap: 8px; }
  .wf-fb-clip .wf-fb-prog { flex: 0 0 36px; min-width: 36px; }
  .wf-fb-clip .wf-fb-ptime { min-width: 34px; }
  .wf-fb-clip .wf-fb-clip-acts { gap: 0; }
  .wf-fb-micwrap { flex-direction: row; justify-content: center; gap: 12px; }
  .wf-fb-miclbl { text-align: left; }
  .wf-fb-audio { width: 200px; }
  .wf-fb-bottom { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .wf-fb-bigmic { width: 56px; height: 56px; min-height: 56px; }
  .wf-fb-input { min-height: 48px; height: 48px; padding: 12px 14px; }
  .wf-fb-ticket { padding: 0; align-items: stretch; }
  .wf-fb-tk-card { width: 100%; border-radius: 0; border: 0; }
  .wf-fb-tk-head { padding: 12px 12px 12px 16px; }
  .wf-fb-tk-body { padding: 16px; gap: 24px; }
  .wf-fb-tk-pics.is-two { grid-template-columns: 1fr; }
  .wf-fb-tk-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .wf-fb-tk-foot > button { flex: 1 1 0; }
  .wf-fb-tk-foot .wf-fb-tk-acked { flex: 1 1 100%; }
}
@media print { .wf-fb, .wf-fb-hint { display: none !important; } }
/* The notifications drawer sits on the right edge: the Help button steps aside while it is open. */
body:has(#modal-notifications.open) #wf-help-btn:not(.is-open) { display: none !important; }
/* The workspace / ticket close button keeps a 44px target whatever the shared close-button rules say. */
.wf-fb .wf-fb-close { width: 44px !important; height: 44px !important; min-width: 44px !important; min-height: 44px !important; flex: 0 0 44px !important; }
