/* Shared in-app alert / confirm (replaces native alert/confirm) */
#hubDialogOverlay.hub-dialog-overlay,
.hub-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.hub-dialog-overlay[hidden] {
  display: none !important;
}
.hub-dialog {
  position: relative;
  width: min(400px, 100%);
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  animation: hub-dialog-in 0.22s ease;
}
@keyframes hub-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.hub-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #e8f0f4;
  background: linear-gradient(180deg, rgba(232, 247, 251, 0.7) 0%, rgba(255, 255, 255, 0.15) 100%);
}
.hub-dialog--danger .hub-dialog-head,
.hub-dialog--warn .hub-dialog-head {
  background: linear-gradient(180deg, rgba(254, 242, 242, 0.75) 0%, rgba(255, 255, 255, 0.15) 100%);
}
.hub-dialog-head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.hub-dialog-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: #fff;
  font-size: 0.95rem;
  background: linear-gradient(145deg, #38bdf8 0%, #0284c7 100%);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.28);
}
.hub-dialog--warn .hub-dialog-icon {
  background: linear-gradient(145deg, #fb923c 0%, #ea580c 100%);
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.28);
}
.hub-dialog--danger .hub-dialog-icon {
  background: linear-gradient(145deg, #f87171 0%, #dc2626 100%);
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.28);
}
.hub-dialog-head-text {
  min-width: 0;
  flex: 1 1 auto;
}
.hub-dialog-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.hub-dialog-sub {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  line-height: 1.4;
}
.hub-dialog-sub:empty {
  display: none;
}
.hub-dialog-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hub-dialog-close:hover,
.hub-dialog-close:focus-visible {
  background: #f1f5f9 !important;
  color: #475569;
  outline: none;
}
.hub-dialog-body {
  padding: 16px 18px 4px;
}
.hub-dialog-msg {
  margin: 0 0 12px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}
.hub-dialog-hint {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #9a3412;
}
.hub-dialog-hint.is-visible {
  display: flex;
}
.hub-dialog-hint i {
  margin-top: 1px;
  flex-shrink: 0;
}
.hub-dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 14px 18px 16px;
}
.hub-dialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  margin: 0;
  padding: 0 16px;
  border-radius: 12px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
}
.hub-dialog-btn--ghost {
  background: #fff;
  border-color: #e2e8f0;
  color: #0f172a;
}
.hub-dialog-btn--ghost:hover,
.hub-dialog-btn--ghost:focus-visible {
  background: #f8fafc !important;
  border-color: #cbd5e1;
  outline: none;
}
.hub-dialog-btn--primary {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}
.hub-dialog-btn--primary:hover,
.hub-dialog-btn--primary:focus-visible {
  background: #0369a1 !important;
  outline: none;
}
.hub-dialog-btn--danger {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.28);
}
.hub-dialog-btn--danger:hover,
.hub-dialog-btn--danger:focus-visible {
  background: #b91c1c !important;
  outline: none;
}
.hub-dialog--alert .hub-dialog-btn--cancel {
  display: none;
}
