/* Feedback sheet. Portal colors by default; .night follows the Lights Out theme. */
.feedback {
  --fb-paper: #fff; --fb-ink: #1f2328; --fb-muted: #656e78; --fb-line: #e4e7eb; --fb-field: #d5dae0;
  --fb-accent: #1667d9; --fb-accent-dark: #1256b8; --fb-tint: #e8f1fd; --fb-tint-line: #bbd4f5; --fb-on-accent: #fff;
  --fb-good: #187436; --fb-bad: #bd3221; --fb-bad-bg: #fbe9e6; --fb-quiet: #f6f7f9;
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  margin: auto; padding: 0; border: 1px solid var(--fb-line); border-radius: 16px;
  background: var(--fb-paper); color: var(--fb-ink);
  box-shadow: 0 20px 60px #10182742;
  font: 14px/1.55 Inter, "Segoe UI", Arial, sans-serif;
}
.feedback[open] { animation: feedback-in .16s ease-out; }
.feedback::backdrop { background: #101827a8; backdrop-filter: blur(2px); }
.feedback.night {
  --fb-paper: #171e2d; --fb-ink: #f3f5fc; --fb-muted: #b3bdd2; --fb-line: #3c4961; --fb-field: #4a5770;
  --fb-accent: #becaff; --fb-accent-dark: #a9b8ff; --fb-tint: #232c45; --fb-tint-line: #7f8fd6; --fb-on-accent: #151c38;
  --fb-good: #83e1b0; --fb-bad: #ffacb6; --fb-bad-bg: #472a35; --fb-quiet: #1d2536;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
.feedback.night::backdrop { background: #03050bcc; backdrop-filter: blur(4px); }
body.feedback-open { overflow: hidden; }
.feedback .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.feedback-form, .feedback-done { padding: 22px 24px 20px; }
.feedback-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback h2 { margin: 0; font: 700 20px/1.3 "Space Grotesk", Inter, "Segoe UI", sans-serif; letter-spacing: -.015em; color: var(--fb-ink); }
.feedback.night h2 { font-family: inherit; font-weight: 600; }
.feedback-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--fb-quiet); color: var(--fb-muted); font-size: 20px; line-height: 1; cursor: pointer; }
.feedback-close:hover { color: var(--fb-ink); }
.feedback-lede { margin: 4px 0 18px; color: var(--fb-muted); font-size: 13px; }

.feedback-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; padding: 0; border: 0; }
.feedback-kind { position: relative; cursor: pointer; }
.feedback-kind input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-kind span { display: block; height: 100%; padding: 11px 13px; border: 1px solid var(--fb-field); border-radius: 11px; transition: border-color .12s, background-color .12s; }
.feedback-kind strong { display: block; font-size: 14px; font-weight: 600; }
.feedback-kind small { display: block; margin-top: 1px; color: var(--fb-muted); font-size: 12px; }
.feedback-kind:hover span { border-color: var(--fb-tint-line); }
.feedback-kind input:checked + span { border-color: var(--fb-accent); background: var(--fb-tint); box-shadow: inset 0 0 0 1px var(--fb-accent); }
.feedback-kind input:focus-visible + span { outline: 2px solid var(--fb-accent); outline-offset: 2px; }

.feedback textarea {
  display: block; width: 100%; min-height: 128px; resize: vertical; box-sizing: border-box;
  padding: 11px 13px; border: 1px solid var(--fb-field); border-radius: 11px;
  background: var(--fb-paper); color: var(--fb-ink); font: inherit; line-height: 1.5;
}
.feedback textarea::placeholder { color: var(--fb-muted); opacity: .8; }
.feedback textarea:focus { outline: none; border-color: var(--fb-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fb-accent) 22%, transparent); }
.feedback-context { margin: 10px 0 0; color: var(--fb-muted); font-size: 12px; line-height: 1.5; }
.feedback-error { margin: 12px 0 0; padding: 8px 11px; border-radius: 9px; background: var(--fb-bad-bg); color: var(--fb-bad); font-size: 13px; }

.feedback-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.feedback-cancel, .feedback-send { min-height: 38px; padding: 8px 16px; border-radius: 10px; font: 600 13.5px/1 inherit; font-family: inherit; cursor: pointer; }
.feedback-cancel { border: 1px solid var(--fb-field); background: transparent; color: var(--fb-ink); }
.feedback-cancel:hover { background: var(--fb-quiet); }
.feedback-send { min-width: 92px; border: 1px solid var(--fb-accent-dark); background: var(--fb-accent); color: var(--fb-on-accent); }
.feedback-send:hover { background: var(--fb-accent-dark); }
.feedback-send:disabled { opacity: .7; cursor: default; }

.feedback-done { text-align: center; padding-top: 30px; }
.feedback-done svg { width: 52px; height: 52px; margin-bottom: 12px; fill: none; stroke: var(--fb-good); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.feedback-done circle { stroke-opacity: .3; }
.feedback-done path { stroke-dasharray: 32; stroke-dashoffset: 32; animation: feedback-check .38s .08s ease-out forwards; }
.feedback-done h2:focus { outline: none; }
.feedback-done p { margin: 6px auto 20px; max-width: 34ch; color: var(--fb-muted); }

/* The topbar link on the portal pages. */
.feedback-link { margin-left: auto; padding: 4px 0; border: 0; background: none; color: var(--blue, #1667d9); font: 600 12px/1 inherit; font-family: inherit; cursor: pointer; }
.feedback-link:hover { text-decoration: underline; }
.topbar:has(.feedback-link) .topbar-right { margin-left: 18px; }

@keyframes feedback-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes feedback-check { to { stroke-dashoffset: 0; } }

@media (max-width: 600px) {
  .feedback { width: 100vw; max-width: none; max-height: 92dvh; margin: auto 0 0; border-bottom: 0; border-radius: 20px 20px 0 0; }
  .feedback[open] { animation-name: feedback-up; }
  .feedback-form, .feedback-done { padding: 20px 18px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .feedback-kinds { grid-template-columns: 1fr; gap: 8px; }
  .feedback-actions { justify-content: stretch; }
  .feedback-actions button { flex: 1; min-height: 46px; }
  @keyframes feedback-up { from { transform: translateY(40px); opacity: .4; } }
}
@media (prefers-reduced-motion: reduce) {
  .feedback[open], .feedback-done path { animation: none; stroke-dashoffset: 0; }
}
