:root {
  --feedback-bone: #e8e0cb;
  --feedback-muted: #817b6d;
  --feedback-red: #b3242a;
  --feedback-line: rgba(220, 208, 178, 0.22);
  --feedback-panel: #0b0c0f;
}

body.feedback-open { overflow: hidden; }
.feedback-dialog {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 20px;
  font-family: 'Special Elite', 'Courier New', monospace; user-select: text; -webkit-user-select: text;
}
.feedback-dialog.hidden, .feedback-toast.hidden { display: none !important; }
.feedback-backdrop { position: absolute; inset: 0; border: 0; background: rgba(2, 3, 5, .82); backdrop-filter: blur(8px); cursor: default; }
.feedback-panel {
  position: relative; width: min(680px, 100%); max-height: min(860px, calc(100dvh - 40px)); overflow: auto;
  border: 1px solid rgba(210, 196, 165, .3); background:
    radial-gradient(circle at 82% 8%, rgba(179, 36, 42, .12), transparent 30%),
    linear-gradient(145deg, rgba(18, 19, 22, .99), rgba(7, 8, 10, .99));
  color: var(--feedback-bone); box-shadow: 0 30px 110px rgba(0, 0, 0, .86), inset 0 0 70px rgba(0, 0, 0, .5);
  animation: feedback-in .22s ease-out;
}
.feedback-panel::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 4px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #713034 18%, #bf4042 50%, #713034 82%, transparent);
}
.feedback-grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.feedback-header { position: relative; display: flex; justify-content: space-between; gap: 24px; padding: 34px 36px 28px; border-bottom: 1px solid var(--feedback-line); }
.feedback-file { display: block; margin-bottom: 12px; color: #a82a30; font-size: 10px; letter-spacing: 3px; }
.feedback-header h2 {
  margin: 0; font: 400 clamp(40px, 8vw, 64px)/.9 'Staatliches', 'Arial Narrow', sans-serif; letter-spacing: 5px;
  background: linear-gradient(180deg, #f0eadb 3%, #9f998a 32%, #e3dac5 50%, #6f6c65 72%, #c3b9a3 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 2px #000);
}
.feedback-header p { max-width: 52ch; margin: 14px 0 0; color: #8d8677; font-size: 13px; line-height: 1.65; }
.feedback-close {
  position: relative; z-index: 1; flex: 0 0 auto; width: 48px; height: 48px; border: 1px solid var(--feedback-line); background: rgba(10, 11, 14, .68);
  color: #968e7d; font: 30px/1 Arial, sans-serif; cursor: pointer;
}
.feedback-close:hover { color: var(--feedback-bone); border-color: rgba(179, 36, 42, .72); }
.feedback-form { position: relative; display: grid; gap: 24px; padding: 30px 36px 36px; }
.feedback-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.feedback-fieldset legend, .feedback-field > span { display: block; margin-bottom: 10px; color: #a9a08e; font-size: 11px; letter-spacing: 2px; }
.feedback-field b { color: #746e62; font-size: 9px; font-weight: 400; }
.feedback-types { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.feedback-types label { min-width: 0; cursor: pointer; }
.feedback-types input { position: absolute; opacity: 0; pointer-events: none; }
.feedback-types span {
  min-height: 48px; display: grid; place-items: center; padding: 10px; border: 1px solid var(--feedback-line);
  background: rgba(11, 12, 15, .8); color: #80796c; text-align: center; font-size: 11px; line-height: 1.25; letter-spacing: 1px; text-transform: uppercase;
}
.feedback-types input:checked + span { border-color: rgba(179, 36, 42, .82); background: rgba(116, 25, 28, .23); color: #eee3ca; box-shadow: inset 3px 0 0 #a82a30; }
.feedback-types input:focus-visible + span { outline: 2px solid #d34643; outline-offset: 3px; }
.feedback-field { display: block; }
.feedback-field textarea, .feedback-field input {
  width: 100%; border: 1px solid var(--feedback-line); border-radius: 0; background: rgba(7, 8, 10, .82); color: #e8dfc8;
  font: 16px/1.6 'Special Elite', 'Courier New', monospace; letter-spacing: .35px; caret-color: #d34643;
}
.feedback-field textarea { min-height: 170px; resize: vertical; padding: 15px 16px; }
.feedback-field input { height: 50px; padding: 0 16px; }
.feedback-field textarea::placeholder, .feedback-field input::placeholder { color: #4e4b43; opacity: 1; }
.feedback-field textarea:hover, .feedback-field textarea:focus, .feedback-field input:hover, .feedback-field input:focus { border-color: rgba(179, 36, 42, .75); outline: none; box-shadow: 0 0 0 1px rgba(179, 36, 42, .35); }
.feedback-field small { display: block; margin-top: 8px; color: #5b574f; font-size: 9px; line-height: 1.4; letter-spacing: 1.2px; text-align: right; }
.feedback-error { margin: -7px 0 0; color: #e05a55; font-size: 11px; line-height: 1.55; letter-spacing: 1px; }
.feedback-actions { display: flex; align-items: center; justify-content: flex-end; gap: 20px; padding-top: 4px; }
.feedback-submit {
  min-height: 50px; padding: 13px 22px; border: 1px solid rgba(179, 36, 42, .72); background: linear-gradient(180deg, rgba(137, 29, 32, .46), rgba(74, 16, 18, .52));
  color: #eee3ca; font: 12px/1 'Special Elite', 'Courier New', monospace; letter-spacing: 2px; cursor: pointer;
}
.feedback-submit:hover:not(:disabled) { border-color: #d34643; background: linear-gradient(180deg, rgba(162, 36, 39, .58), rgba(82, 17, 19, .62)); }
.feedback-submit:disabled { cursor: wait; opacity: .6; }
.feedback-toast {
  position: fixed; z-index: 1100; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 13px; width: min(390px, calc(100% - 28px));
  padding: 15px 17px; border: 1px solid rgba(155, 148, 129, .35); border-left: 3px solid #a82a30; background: rgba(10, 11, 14, .97);
  color: #d9cfb9; box-shadow: 0 18px 60px rgba(0, 0, 0, .7); font-family: 'Special Elite', 'Courier New', monospace; animation: feedback-toast-in .28s ease-out;
}
.feedback-toast > span { color: #b3242a; }
.feedback-toast strong, .feedback-toast small { display: block; }
.feedback-toast strong { font-size: 12px; letter-spacing: 2px; }
.feedback-toast small { margin-top: 5px; color: #777064; font-size: 10px; line-height: 1.4; }
@keyframes feedback-in { from { opacity: 0; transform: translateY(12px) scale(.99); } }
@keyframes feedback-toast-in { from { opacity: 0; transform: translateY(12px); } }

:root[data-theme='light'] .feedback-backdrop { background: rgba(38, 42, 47, .48); }
:root[data-theme='light'] .feedback-panel {
  border-color: rgba(35, 38, 43, .28);
  background:
    radial-gradient(circle at 82% 8%, rgba(158, 32, 38, .08), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, .995), rgba(233, 235, 237, .995));
  color: #191b1f;
  box-shadow: 0 30px 100px rgba(17, 20, 24, .28), inset 0 0 70px rgba(255, 255, 255, .46);
}
:root[data-theme='light'] .feedback-grain { opacity: .035; mix-blend-mode: multiply; }
:root[data-theme='light'] .feedback-header { border-bottom-color: rgba(35, 38, 43, .18); }
:root[data-theme='light'] .feedback-header h2 {
  background: linear-gradient(180deg, #1b1d21 2%, #777b80 29%, #26292d 49%, #8c9095 69%, #35383d 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9));
}
:root[data-theme='light'] .feedback-header p { color: #565b62; }
:root[data-theme='light'] .feedback-close {
  border-color: rgba(35, 38, 43, .2); background: rgba(255, 255, 255, .7); color: #565b62;
}
:root[data-theme='light'] .feedback-close:hover { color: #191b1f; border-color: rgba(158, 32, 38, .65); }
:root[data-theme='light'] .feedback-fieldset legend,
:root[data-theme='light'] .feedback-field > span { color: #454950; }
:root[data-theme='light'] .feedback-field b { color: #6b7077; }
:root[data-theme='light'] .feedback-types span {
  border-color: rgba(35, 38, 43, .2); background: rgba(255, 255, 255, .72); color: #5c6168;
}
:root[data-theme='light'] .feedback-types input:checked + span {
  border-color: rgba(158, 32, 38, .72); background: rgba(158, 32, 38, .09); color: #272a2f; box-shadow: inset 3px 0 0 #9e2026;
}
:root[data-theme='light'] .feedback-field textarea,
:root[data-theme='light'] .feedback-field input {
  border-color: rgba(35, 38, 43, .22); background: rgba(255, 255, 255, .86); color: #202328; caret-color: #9e2026;
}
:root[data-theme='light'] .feedback-field textarea::placeholder,
:root[data-theme='light'] .feedback-field input::placeholder { color: #8a8f96; }
:root[data-theme='light'] .feedback-field textarea:hover,
:root[data-theme='light'] .feedback-field textarea:focus,
:root[data-theme='light'] .feedback-field input:hover,
:root[data-theme='light'] .feedback-field input:focus { border-color: rgba(158, 32, 38, .68); box-shadow: 0 0 0 1px rgba(158, 32, 38, .22); }
:root[data-theme='light'] .feedback-field small { color: #6b7077; }
:root[data-theme='light'] .feedback-error { color: #a51f25; }
:root[data-theme='light'] .feedback-submit {
  border-color: rgba(158, 32, 38, .65); background: linear-gradient(180deg, #ac2b31, #8f1d23); color: #fff8ea;
}
:root[data-theme='light'] .feedback-submit:hover:not(:disabled) { border-color: #77161b; background: linear-gradient(180deg, #bd343a, #971f25); }
:root[data-theme='light'] .feedback-toast { border-color: rgba(35, 38, 43, .24); border-left-color: #9e2026; background: rgba(255, 255, 255, .97); color: #25282d; box-shadow: 0 18px 60px rgba(22, 25, 29, .2); }
:root[data-theme='light'] .feedback-toast small { color: #676c74; }

@media (max-width: 600px) {
  .feedback-dialog { align-items: end; padding: 0; }
  .feedback-panel { width: 100%; max-height: 94dvh; border-inline: 0; border-bottom: 0; }
  .feedback-header { padding: 27px 20px 22px; }
  .feedback-header h2 { font-size: 44px; letter-spacing: 3px; }
  .feedback-header p { font-size: 16px; line-height: 1.55; }
  .feedback-form { gap: 22px; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
  .feedback-types { grid-template-columns: 1fr; }
  .feedback-types span { justify-content: start; padding-inline: 15px; font-size: 14px; }
  .feedback-fieldset legend, .feedback-field > span { font-size: 13px; }
  .feedback-actions { align-items: stretch; }
  .feedback-submit { width: 100%; font-size: 14px; }
  .feedback-toast { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-panel, .feedback-toast { animation: none; }
}
