/* Feedback uses the existing site's brand tokens. */
.feedback-launcher {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 19px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s, border-color .2s, transform .2s;
}
.feedback-launcher svg { color: var(--coral-600); }
.feedback-launcher:hover { color: var(--coral-600); border-color: var(--coral); transform: translateY(-2px); }
.feedback-dialog {
  width: min(620px, calc(100% - 32px));
  max-width: none;
  max-height: min(820px, calc(100dvh - 48px));
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-l);
  background: var(--bg);
  color: var(--ink);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.feedback-dialog::backdrop { background: rgba(21, 24, 30, .32); backdrop-filter: blur(5px); }
.feedback-dialog[open] { animation: feedback-in .2s var(--ease); }
.feedback-dialog [hidden] { display: none !important; }
.feedback-shell { display: flex; flex-direction: column; max-height: min(818px, calc(100dvh - 50px)); }
.feedback-header { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 22px 26px; border-bottom: 1px solid var(--line); }
.feedback-heading { display: flex; align-items: center; gap: 12px; }
.feedback-mark { display: grid; place-items: center; width: 46px; height: 46px; background: var(--coral-50); border-radius: 14px; }
.feedback-heading h2 { font-size: 18px; font-weight: 650; letter-spacing: -.3px; }
.feedback-heading p { margin-top: 2px; color: var(--muted); font-size: 12px; }
.feedback-content { flex: 1 1 auto; padding: 26px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
.feedback-welcome { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 28px; }
.feedback-welcome > img { flex: none; margin-top: 4px; border-radius: 12px; }
.feedback-welcome p { position: relative; padding: 15px 18px; background: var(--bg-soft); border-radius: 3px 16px 16px; font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.feedback-types { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 16px; border: 0; }
.feedback-types legend { padding: 0; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.feedback-types label { position: relative; cursor: pointer; }
.feedback-types input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.feedback-types span { display: block; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.feedback-types input:checked + span { background: var(--coral-50); color: #B13A23; border-color: #F8B5A6; }
.feedback-types input:focus-visible + span { outline: 2px solid var(--coral); outline-offset: 3px; }
.feedback-editor { border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-card); overflow: hidden; }
.feedback-editor:focus-within { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-50); }
.feedback-editor textarea { display: block; width: 100%; min-height: 144px; resize: vertical; padding: 16px; border: 0; outline: none; background: transparent; font: inherit; font-size: 14px; line-height: 1.8; color: var(--ink); }
.feedback-dialog textarea::placeholder, .feedback-dialog input::placeholder { color: var(--muted); opacity: 1; }
.feedback-editor-foot { display: flex; justify-content: space-between; gap: 12px; padding: 0 16px 12px; color: var(--muted); font-size: 11px; }
#feedback-count { flex: none; font-variant-numeric: tabular-nums; }
.feedback-details { margin-top: 18px; }
.feedback-details summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.feedback-details summary span { margin-left: 6px; font-size: 12px; color: var(--muted); }
.feedback-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 16px; }
.feedback-fields label { font-size: 12px; color: var(--ink-2); }
.feedback-fields input, .feedback-subject, .feedback-mail-body { display: block; width: 100%; padding: 10px 12px; margin-top: 6px; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; color: var(--ink); font: inherit; font-size: 13px; line-height: 1.7; }
.feedback-compose-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.feedback-compose-footer p { font-size: 11px; color: var(--muted); }
.feedback-compose-footer .btn { font-size: 13px; height: 42px; }
.feedback-channels { flex: none; max-height: 230px; overflow-y: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 16px 26px; background: var(--bg-card); border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.feedback-channels a, .feedback-channels button { color: var(--teal); font-weight: 600; overflow-wrap: anywhere; }
.feedback-channels button { border: 0; padding: 0; background: transparent; cursor: pointer; font-size: 12px; }
.feedback-channels a:hover, .feedback-channels button:hover { text-decoration: underline; }
#feedback-group-qr { width: 100%; text-align: center; padding: 18px 0 4px; margin-top: 20px; border-top: 1px solid var(--line); }
#feedback-group-qr h3 { font-size: 15px; margin-bottom: 12px; }
.feedback-qr-frame { position: relative; display: block; width: min(280px, 100%); aspect-ratio: 1; margin: auto; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
#feedback-group-qr img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Display the QR region of the supplied QQ poster; keep the linked file intact. */
#feedback-group-qr.is-qq-poster img { position: absolute; width: 142%; height: auto; left: -21%; top: -81%; max-width: none; }
#feedback-group-qr p { margin-top: 8px; }
#feedback-group-qr p, #feedback-group-qr > a:last-child { font-size: 12px; }
#feedback-group-qr > a:last-child { color: var(--teal); }
.feedback-preview-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.feedback-preview-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--teal-50); color: var(--teal); font-size: 21px; }
.feedback-preview-head h3 { font-size: 17px; }
.feedback-preview-head p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.feedback-recipient { padding: 11px 14px; margin-bottom: 18px; border-radius: 10px; background: var(--bg-soft); font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.feedback-recipient strong { margin-left: 12px; font-weight: 500; color: var(--ink-2); }
.feedback-label { display: block; font-size: 12px; color: var(--ink-2); }
.feedback-label span { margin-left: 6px; color: var(--muted); }
.feedback-subject { margin-bottom: 16px; }
.feedback-mail-body { resize: vertical; min-height: 190px; }
.feedback-mail-note { margin-top: 12px; font-size: 12px; line-height: 1.8; color: var(--muted); }
.feedback-preview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.feedback-back { margin-right: auto; border: 0; padding: 8px 0; background: transparent; font-size: 12px; color: var(--muted); cursor: pointer; }
.feedback-preview-actions .btn { padding: 0 15px; font-size: 12px; }
.feedback-action-bar { flex: none; padding: 18px 26px; border-top: 1px solid var(--line); background: #fff; }
.feedback-action-bar > div { margin-top: 0; }
.feedback-dialog [aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.feedback-status { color: var(--teal); font-size: 12px; }
.feedback-status:not(:empty) { margin-top: 14px; }
.feedback-copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
@keyframes feedback-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .feedback-launcher { right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); padding: 0 15px; min-height: 44px; font-size: 13px; }
  .feedback-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 24px); border-radius: 20px; }
  .feedback-shell { max-height: calc(100dvh - 26px); }
  .feedback-header { padding: 18px; }
  .feedback-heading h2 { font-size: 16px; }
  .feedback-mark { width: 40px; height: 40px; }
  .feedback-content { padding: 20px 18px; }
  .feedback-welcome { gap: 9px; margin-bottom: 22px; }
  .feedback-welcome > img { width: 30px; height: 30px; }
  .feedback-welcome p { padding: 12px 14px; font-size: 13px; }
  .feedback-editor-foot > span:first-child { max-width: 65%; }
  .feedback-fields { grid-template-columns: 1fr; }
  .feedback-details summary span { font-size: 11px; }
  .feedback-compose-footer { margin-top: 22px; }
  .feedback-compose-footer .btn { width: 100%; }
  .feedback-dialog input, .feedback-dialog textarea { font-size: 16px; }
  .feedback-channels { padding: 14px 18px; }
  .feedback-action-bar { padding: 16px 18px; }
  .feedback-preview-actions .feedback-back { flex-basis: 100%; text-align: left; }
  .feedback-preview-actions .btn { flex: 1; }
}
