/* Common H5 feedback primitives: toast, inline status, and lightweight dialogs. */
.h5-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 1000;
  max-width: min(78vw, 360px);
  padding: 10px 16px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 19, 29, .86);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .18);
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 8px));
  transition: opacity .2s ease, transform .2s ease;
}

.h5-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}

.h5-toast.error { background: rgba(220, 21, 70, .94); }
.h5-toast.success { background: rgba(21, 145, 92, .94); }

.h5-ui-status:not(:empty) {
  padding: 8px 10px;
  border-radius: 8px;
}

.h5-ui-status.error {
  color: #f33862;
  background: #fff1f4;
  border: 1px solid #ffd3dd;
}

.h5-ui-status.success {
  color: #148d5f;
  background: #eefaf4;
  border: 1px solid #c9efdc;
}

.h5-dialog-layer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.h5-dialog-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .44);
  backdrop-filter: blur(2px);
}

.h5-dialog-card {
  position: relative;
  z-index: 1;
  width: min(100%, 328px);
  padding: 20px 18px 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 52px rgba(15, 23, 42, .22);
  animation: h5-dialog-in .18s ease-out;
}

.h5-dialog-title {
  margin: 0;
  color: #151923;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
}

.h5-dialog-message {
  margin-top: 10px;
  color: #4b5565;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.h5-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.h5-dialog-button {
  min-width: 88px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
}

.h5-dialog-button.cancel {
  color: #555d6b;
  background: #f2f4f7;
}

.h5-dialog-button.confirm {
  color: #fff;
  background: linear-gradient(180deg, #ff1c57 0%, #ef0c40 100%);
  box-shadow: 0 10px 22px rgba(239, 12, 64, .18);
}

@keyframes h5-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
