#history-open { width: auto; padding: 10px 18px; margin-bottom: 18px; }
#history-dialog { width: min(1060px, calc(100% - 24px)); max-height: 85dvh; padding: 24px; border: 1px solid #555; border-radius: 8px; background: #303030; color: #fff; }
#history-dialog::backdrop { background: rgb(0 0 0 / 70%); }
#history-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#history-dialog h2 { font-size: 24px; margin: 0; overflow-wrap: anywhere; }
#history-dialog button { width: 40px; min-height: 40px; flex-shrink: 0; background: #bc1823; border-radius: 8px; }
#history-dialog button:hover { background: #98121b; }
#history-message { line-height: 1.5; }
#history-dialog table { width: 100%; border-collapse: collapse; table-layout: fixed; }
#history-dialog th, #history-dialog td { border: 1px solid #777; padding: 12px; text-align: left; line-height: 1.5; overflow-wrap: anywhere; }
#history-dialog th { background: #bc1823; }
#history-dialog th:nth-child(1) { width: 17%; }
#history-dialog th:nth-child(2) { width: 24%; }
#history-dialog th:nth-child(3) { width: 12%; }
#history-dialog th:nth-child(5) { width: 16%; }
#history-dialog footer { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 16px; }
.history-status { display: inline-block; padding: 4px 8px; border-radius: 6px; background: #464646; }
.history-status.approved { color: #bcf5d5; background: #214a36; }
.history-status.rejected, .history-status.failed { color: #ffd4d7; background: #682b32; }
.history-status.processing, .history-status.pending { color: #cce8ff; background: #234562; }
@media(max-width: 600px) {
  #history-dialog { padding: 16px; }
  #history-dialog h2 { font-size: 20px; }
  #history-dialog thead { display: none; }
  #history-dialog table, #history-dialog tbody, #history-dialog tr, #history-dialog td { display: block; width: 100%; }
  #history-dialog tr { border-bottom: 1px solid #888; padding: 12px 0; }
  #history-dialog td { border: 0; padding: 5px 0; display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
  #history-dialog td::before { content: attr(data-label); font-weight: bold; color: #ddd; }
}

#bonus-result-toast { position: fixed; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 1000; width: max-content; max-width: calc(100vw - 24px); box-sizing: border-box; padding: 14px 18px; border-radius: 8px; color: #fff; font: 600 14px/1.5 Arial, sans-serif; overflow-wrap: anywhere; box-shadow: 0 4px 18px rgb(0 0 0 / 35%); }
#bonus-result-toast[hidden] { display: none; }
#bonus-result-toast.approved { background: #166534; }
#bonus-result-toast.rejected { background: #b91c1c; }
