.feedback-dialog {
  width: min(650px, calc(100vw - 32px));
  max-height: min(780px, calc(100dvh - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line, #29282f);
  border-radius: 16px;
  background: var(--surface, #121216);
  color: var(--text, #f1f0f5);
  box-shadow: none;
}

.feedback-dialog::backdrop {
  background: rgb(0 0 0 / 72%);
}

.feedback-dialog__shell {
  display: flex;
  max-height: inherit;
  flex-direction: column;
}

.feedback-dialog__header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 25px 28px 0;
}

.feedback-dialog__header h2 {
  margin: 0;
  padding-right: 10px;
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -.02em;
  line-height: 1.35;
}

.feedback-dialog__close,
.feedback-button {
  min-height: 44px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.3;
}

.feedback-dialog__close {
  flex: 0 0 44px;
  width: 44px;
  padding: 8px 4px;
  border: 1px solid var(--line, #29282f);
  background: var(--surface-2, #19191f);
  color: var(--muted, #a19fae);
}

.feedback-dialog__close:hover {
  border-color: var(--purple, #a78bfa);
  color: var(--text, #f1f0f5);
}

.feedback-dialog__body {
  min-height: 0;
  overflow-y: auto;
  padding: 7px 28px 28px;
  overscroll-behavior: contain;
}

.feedback-dialog__intro,
.feedback-session-status,
.feedback-field__hint,
.feedback-privacy,
.feedback-history__hint,
.feedback-history__state,
.feedback-history__meta {
  color: var(--muted, #a19fae);
  font-size: 12px;
  line-height: 1.75;
}

.feedback-dialog__intro {
  margin: 0 0 4px;
}

.feedback-session-status {
  min-height: 21px;
  margin: 0 0 20px;
}

.feedback-session-status.is-ready,
.feedback-history__state.is-ready {
  color: var(--green, #87d4b2);
}

.feedback-session-status.is-error,
.feedback-history__state.is-error,
.feedback-form-message.is-error,
.feedback-field__error {
  color: #e5a4a4;
}

.feedback-form {
  display: grid;
  gap: 18px;
}

.feedback-form[aria-busy="true"] {
  cursor: progress;
}

.feedback-field {
  display: grid;
  gap: 7px;
}

.feedback-field > label {
  color: var(--text, #f1f0f5);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.feedback-field select,
.feedback-field input,
.feedback-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line, #29282f);
  border-radius: 7px;
  background: var(--surface-2, #19191f);
  color: var(--text, #f1f0f5);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
}

.feedback-field select,
.feedback-field input {
  padding: 9px 12px;
}

.feedback-field textarea {
  min-height: 150px;
  padding: 11px 12px;
  resize: vertical;
}

.feedback-field select:focus,
.feedback-field input:focus,
.feedback-field textarea:focus {
  border-color: var(--purple, #a78bfa);
  outline: 2px solid var(--purple, #a78bfa);
  outline-offset: 2px;
}

.feedback-field select:disabled,
.feedback-field input:disabled,
.feedback-field textarea:disabled {
  opacity: .64;
}

.feedback-field [aria-invalid="true"] {
  border-color: #d98f8f;
}

.feedback-field__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.feedback-field__hint {
  margin: 0;
}

.feedback-char-count {
  flex: 0 0 auto;
  color: var(--muted, #a19fae);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.feedback-field__error {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.feedback-privacy {
  margin: -3px 0 0;
  max-width: 70ch;
}

.feedback-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.feedback-form-message {
  margin: -2px 0 0;
  padding: 11px 0 0;
  color: var(--muted, #a19fae);
  font-size: 12px;
  line-height: 1.7;
}

.feedback-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.feedback-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 11px 20px;
  border: 1px solid transparent;
  color: var(--text, #f1f0f5);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.feedback-button--primary {
  min-width: 138px;
  background: var(--accent, #7540d9);
  color: #fff;
  font-weight: 650;
}

.feedback-button--primary:hover {
  background: #8150de;
}

.feedback-button--secondary,
.feedback-button--quiet {
  border-color: var(--line, #29282f);
  background: transparent;
  color: var(--text, #f1f0f5);
}

.feedback-button--secondary:hover,
.feedback-button--quiet:hover {
  border-color: var(--purple, #a78bfa);
  background: var(--surface-2, #19191f);
}

.feedback-button--quiet {
  min-width: 58px;
  padding-inline: 12px;
  color: var(--muted, #a19fae);
}

.feedback-button:disabled,
.feedback-dialog__close:disabled {
  cursor: default;
  opacity: .52;
}

.feedback-success {
  display: grid;
  gap: 14px;
  padding: 3px 0 8px;
}

.feedback-success h3,
.feedback-history h3 {
  margin: 0;
  color: var(--text, #f1f0f5);
  font-size: 17px;
  font-weight: 700;
}

.feedback-success > p {
  margin: 0;
  color: var(--muted, #a19fae);
  font-size: 12px;
  line-height: 1.8;
}

.feedback-ticket {
  display: grid;
  grid-template-columns: minmax(86px, .35fr) minmax(0, 1fr);
  gap: 0;
  margin: 0 0 4px;
  border-top: 1px solid var(--line, #29282f);
}

.feedback-ticket dt,
.feedback-ticket dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--line, #29282f);
  font-size: 12px;
  line-height: 1.6;
}

.feedback-ticket dt {
  color: var(--muted, #a19fae);
}

.feedback-ticket dd {
  color: var(--text, #f1f0f5);
  overflow-wrap: anywhere;
}

.feedback-ticket__id {
  font-variant-numeric: tabular-nums;
}

.feedback-success .feedback-button {
  justify-self: start;
}

.feedback-history {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line, #29282f);
}

.feedback-history__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.feedback-history__hint {
  margin: 6px 0 0;
}

.feedback-history__state {
  min-height: 21px;
  margin: 11px 0 0;
}

.feedback-history__state.is-pending {
  color: var(--muted, #a19fae);
}

.feedback-history__list {
  display: grid;
  gap: 0;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.feedback-history__item,
.feedback-history__empty {
  padding: 13px 0;
  border-top: 1px solid var(--line, #29282f);
}

.feedback-history__empty {
  color: var(--muted, #a19fae);
  font-size: 12px;
  line-height: 1.7;
}

.feedback-history__item-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.feedback-history__item-heading strong {
  min-width: 0;
  color: var(--text, #f1f0f5);
  font-size: 12px;
  font-weight: 650;
}

.feedback-history__status {
  flex: 0 0 auto;
  color: var(--muted, #a19fae);
  font-size: 11px;
}

.feedback-history__status.is-open,
.feedback-history__status.is-in_progress {
  color: var(--purple, #a78bfa);
}

.feedback-history__status.is-resolved {
  color: var(--green, #87d4b2);
}

.feedback-history__message {
  margin: 5px 0 0;
  color: var(--text, #f1f0f5);
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.feedback-history__meta {
  display: block;
  margin-top: 6px;
  font-size: 11px;
}

.feedback-history__reply {
  min-width: 0;
  margin-top: 12px;
  padding: 11px 12px 12px;
  border: 1px solid var(--line, #29282f);
  border-radius: 7px;
  background: var(--surface-2, #19191f);
}

.feedback-history__reply-heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.feedback-history__reply-label {
  color: var(--purple, #a78bfa);
  font-size: 12px;
  font-weight: 650;
}

.feedback-history__reply-time {
  flex: 0 1 auto;
  color: var(--muted, #a19fae);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}

.feedback-history__reply-message {
  min-width: 0;
  margin: 5px 0 0;
  color: var(--text, #f1f0f5);
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.feedback-dialog [hidden] {
  display: none !important;
}

.feedback-dialog :focus-visible {
  outline-color: var(--purple, #a78bfa);
}

:root[data-theme="light"] .feedback-dialog::backdrop {
  background: rgb(34 29 48 / 34%);
}

:root[data-theme="light"] .feedback-field__error,
:root[data-theme="light"] .feedback-form-message.is-error,
:root[data-theme="light"] .feedback-session-status.is-error,
:root[data-theme="light"] .feedback-history__state.is-error {
  color: #a33c45;
}

:root[data-theme="light"] .feedback-field [aria-invalid="true"] {
  border-color: #b94b57;
}

@media (max-width: 600px) {
  .feedback-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 13px;
  }

  .feedback-dialog__header {
    gap: 12px;
    padding: 20px 18px 0;
  }

  .feedback-dialog__header h2 {
    font-size: 22px;
  }

  .feedback-dialog__body {
    padding: 7px 18px 22px;
  }

  .feedback-form__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .feedback-form__actions .feedback-button,
  .feedback-success .feedback-button {
    width: 100%;
  }

  .feedback-field__meta {
    align-items: flex-start;
  }
  .feedback-field select,.feedback-field input,.feedback-field textarea{font-size:16px}

  .feedback-history__reply-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .feedback-history__reply-time {
    text-align: left;
  }

  .feedback-success .feedback-button {
    justify-self: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feedback-button {
    transition: none;
  }
}
.feedback-entry{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;min-height:44px;padding:8px 10px;border:0;background:transparent;color:var(--muted,#a19fae);font:inherit;font-size:12px;white-space:nowrap;cursor:pointer}
.feedback-entry:hover{color:var(--text,#f1f0f5)}
.feedback-entry svg{width:19px;height:19px;flex-shrink:0}
.feedback-entry:focus-visible{outline:2px solid var(--purple,#a78bfa);outline-offset:2px;border-radius:7px}
.feedback-footer{display:flex;justify-content:center;padding:0 16px 20px}
.feedback-login p{color:var(--muted,#a19fae);font-size:14px;line-height:1.7;margin:0 0 20px}
@media(max-width:720px){.header-feedback span{display:none}.header-feedback{padding-inline:8px}.reader-nav .feedback-entry{font-size:12px}}
