.feedback-button,
.share-chat-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.share-chat-button:hover,
.feedback-button:hover {
  color: var(--text, var(--ink));
  text-decoration-color: currentColor;
}

.share-chat-button svg,
.feedback-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feedback-dialog {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--border, var(--line));
  border-radius: 16px;
  color: var(--text, var(--ink));
  background: var(--surface);
  box-shadow: var(--shadow-dialog, var(--shadow, 0 24px 90px rgba(0, 0, 0, 0.58)));
}

.feedback-dialog:has(#feedback-admin-panel:not([hidden])) {
  width: min(560px, calc(100vw - 32px));
}

.feedback-dialog::backdrop {
  background: rgba(8, 11, 16, 0.62);
}

.feedback-form {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 0 20px 18px;
}

.feedback-admin-panel {
  display: grid;
  gap: 12px;
  padding: 0 20px 18px;
}

.feedback-loading {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--muted);
  font-size: 0.82rem;
}

.feedback-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
}

.feedback-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.feedback-copy,
.feedback-status,
.feedback-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.feedback-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--border, var(--line));
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}

.feedback-close:hover {
  color: var(--text, var(--ink));
  border-color: var(--text, var(--ink));
}

.feedback-close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.feedback-form label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.feedback-form textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  padding: 12px 12px;
  border: 1px solid var(--border, var(--line));
  border-radius: 10px;
  resize: vertical;
  color: var(--text, var(--ink));
  background: color-mix(in srgb, var(--surface) 86%, #000);
  line-height: 1.45;
  outline: none;
}

.feedback-form textarea:focus {
  border-color: var(--accent, var(--cobalt, var(--text)));
}

.feedback-form textarea::placeholder {
  color: var(--faint);
}

.feedback-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.feedback-attach-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border, var(--line));
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 650;
}

.feedback-attach-button:hover {
  color: var(--text, var(--ink));
  border-color: var(--text, var(--ink));
}

.feedback-attach-button svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
}

.feedback-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-attachment-chip {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid var(--border, var(--line));
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface) 86%, #000);
}

.feedback-attachment-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feedback-attachment-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--on-accent, #fff);
  background: rgba(0, 0, 0, 0.55);
  font-size: 12px;
  line-height: 1;
}

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

.feedback-status[data-tone="error"] {
  color: var(--danger, var(--risk, #e07886));
}

.feedback-status[data-tone="ok"] {
  color: var(--success, var(--positive, #65c7cf));
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.feedback-actions button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border, var(--line));
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
}

.feedback-actions button[type="submit"] {
  color: var(--on-accent, var(--ledger, #10151e));
  background: var(--accent, var(--cobalt, #8299ef));
  border-color: transparent;
}

.feedback-actions button:hover {
  color: var(--text, var(--ink));
  border-color: var(--text, var(--ink));
}

.feedback-actions button[type="submit"]:hover {
  color: var(--on-accent, var(--ledger, #10151e));
  border-color: transparent;
  filter: brightness(1.06);
}

/* display:none (not just off-screen positioning) is required here: Chrome's
 * autofill reliably skips display:none fields but will still fill an
 * absolutely-positioned off-screen input from a saved "Company" profile
 * value despite autocomplete="off" and tabindex="-1" — confirmed in
 * production, where two real submissions from the same Chrome user were
 * silently dropped as false-positive spam because autofill populated this
 * field. See bot/services/ui_feedback.py's HONEYPOT_FIELDS.
 */
.feedback-honeypot {
  display: none;
}

.feedback-back-to-list {
  justify-self: start;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 650;
}

.feedback-back-to-list:hover {
  color: var(--text, var(--ink));
}

.feedback-admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border, var(--line));
}

.feedback-admin-tab {
  padding: 0 4px 8px;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 700;
}

.feedback-admin-tab[aria-selected="true"] {
  color: var(--text, var(--ink));
  border-bottom-color: var(--accent, var(--cobalt, #8299ef));
}

.feedback-admin-list {
  display: grid;
  gap: 10px;
  max-height: min(56vh, 480px);
  overflow-y: auto;
}

.feedback-admin-empty {
  margin: 12px 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.feedback-entry {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 86%, #000);
}

.feedback-entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  color: var(--muted);
  font-size: 0.74rem;
}

.feedback-entry-user {
  color: var(--text, var(--ink));
  font-weight: 700;
}

.feedback-entry-date {
  margin-left: auto;
}

.feedback-entry-message {
  margin: 0;
  color: var(--text, var(--ink));
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.feedback-entry-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-entry-thumb {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border, var(--line));
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.feedback-entry-actions {
  display: flex;
  justify-content: flex-end;
}

.feedback-entry-finish {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--on-accent, var(--ledger, #10151e));
  background: var(--accent, var(--cobalt, #8299ef));
  font-size: 0.76rem;
  font-weight: 700;
}

.feedback-entry-finish:hover {
  filter: brightness(1.06);
}

.feedback-entry-finish:disabled {
  opacity: 0.6;
}

.feedback-entry-badge {
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--success, var(--positive, #65c7cf));
  background: color-mix(in srgb, var(--success, var(--positive, #65c7cf)) 16%, transparent);
  font-size: 0.72rem;
  font-weight: 700;
}

.feedback-admin-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
  border-top: 1px solid var(--border, var(--line));
}

.feedback-admin-compose {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 55%, transparent);
}

.feedback-admin-compose:hover {
  color: var(--text, var(--ink));
  text-decoration-color: currentColor;
}

@media (max-width: 860px) {
  .site-header .feedback-button {
    display: none;
  }
}
