/* Explicit feedback metadata only: business code owns the message and state. */
:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is([data-feedback-tone], [data-status-tone]) {
  --feedback-accent: #c4b7c0;
  --feedback-ink: #e5dce2;
  --feedback-background: #1d181e;
  --feedback-border: #4b3c48;
  --feedback-symbol: "·";
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is([data-feedback-tone="success"], [data-status-tone="success"]) {
  --feedback-accent: #a3cfb6;
  --feedback-ink: #dfede4;
  --feedback-background: #17251e;
  --feedback-border: #3b5b48;
  --feedback-symbol: "✓";
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is([data-feedback-tone="error"], [data-status-tone="error"]) {
  --feedback-accent: #ffb0b7;
  --feedback-ink: #f7dfe2;
  --feedback-background: #30191f;
  --feedback-border: #79434f;
  --feedback-symbol: "×";
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is([data-feedback-tone="warning"], [data-status-tone="warning"]) {
  --feedback-accent: #ebc58f;
  --feedback-ink: #f0e5d5;
  --feedback-background: #2a2319;
  --feedback-border: #6e5636;
  --feedback-symbol: "!";
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is([data-feedback-tone="info"], [data-status-tone="info"]) {
  --feedback-accent: #d4bdce;
  --feedback-ink: #ebe0e8;
  --feedback-background: #251d26;
  --feedback-border: #60495b;
  --feedback-symbol: "i";
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is([data-feedback-tone="loading"], [data-status-tone="loading"]) {
  --feedback-accent: #edbccb;
  --feedback-ink: #efe0e7;
  --feedback-background: #291e27;
  --feedback-border: #684957;
  --feedback-symbol: "…";
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) [data-feedback-tone]:not(:empty) {
  position: relative;
  display: block;
  padding: 12px 16px;
  border: 1px solid var(--feedback-border);
  border-radius: 8px;
  background: var(--feedback-background);
  color: var(--feedback-ink);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) [data-feedback-tone]:not(:empty)::before {
  content: var(--feedback-symbol) " " attr(data-feedback-label) " · ";
  color: var(--feedback-accent);
  font-weight: 700;
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) [data-status-tone]:not(:empty) {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--feedback-border);
  border-radius: 6px;
  background: var(--feedback-background);
  color: var(--feedback-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: middle;
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) [data-status-tone]:not(:empty)::before {
  content: var(--feedback-symbol) " ";
  color: var(--feedback-accent);
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) [data-loading="true"] {
  cursor: progress;
}

/* A positioned progress line leaves the button label and measured width intact. */
:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is(button, a.button, a.console-action)[data-loading="true"] {
  position: relative;
}

:is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is(button, a.button, a.console-action)[data-loading="true"]::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 4px;
  left: 12px;
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, #ff737e33, #ffc4d0, #ff737e33);
  background-size: 200% 100%;
  pointer-events: none;
  animation: dashboard-feedback-progress 1.2s linear infinite;
}

@keyframes dashboard-feedback-progress {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.account-page, .admin-page, .dashboard-confirm-dialog, :where(#auth-container)) :is(button, a.button, a.console-action)[data-loading="true"]::after {
    animation: none;
    background-position: 50% 0;
  }
}
