/* Maintenance Mode notice (restricted tabs) and the admin preview dialog. */
.mtc-maint-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(460px, calc(100vw - 24px - var(--safe-area-left, 0px) - var(--safe-area-right, 0px)));
  max-width: none;
  max-height: calc(100vh - 24px - var(--safe-area-top, 0px) - var(--safe-area-bottom, 0px));
  max-height: calc(100dvh - 24px - var(--safe-area-top, 0px) - var(--safe-area-bottom, 0px));
  margin: auto;
  overflow: visible;
}
html.platform-android .mtc-maint-dialog {
  max-height: calc(100dvh - 24px - var(--safe-area-top, 0px) - var(--android-bottom-safe-area, 24px));
}
.mtc-maint-dialog::backdrop {
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.97), rgba(220, 252, 231, 0.97));
}
.mtc-maint-panel {
  box-sizing: border-box;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  padding: 24px 20px 20px;
  max-height: inherit;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.mtc-maint-tab { padding: 16px 12px 112px; }
.mtc-maint-tab .mtc-maint-panel { max-width: 460px; margin: 0 auto; max-height: none; overflow: visible; }
.mtc-maint-body { text-align: center; color: #111827; }
.mtc-maint-logo { width: 104px; height: auto; display: block; margin: 0 auto 12px; }
.mtc-maint-title { font-size: 1.4rem; font-weight: 700; margin: 0 0 12px; outline: none; }
.mtc-maint-message {
  font-size: 1rem; line-height: 1.5; color: #374151; margin: 0 0 18px;
  white-space: pre-line; overflow-wrap: anywhere;
}
.mtc-maint-subtle { font-size: 0.95rem; line-height: 1.45; color: #4b5563; margin: 0 0 16px; }
.mtc-maint-date {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 12px;
  padding: 10px 14px; margin: 0 auto 18px; max-width: 280px;
}
.mtc-maint-date-label { margin: 0; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: #166534; }
.mtc-maint-date-value { margin: 4px 0 0; font-size: 1.25rem; font-weight: 700; color: #14532d; }
.mtc-maint-thanks { font-size: 0.95rem; line-height: 1.45; color: #4b5563; margin: 0 0 16px; }
.mtc-maint-preview-label { margin: 0 0 12px; font-size: 0.8rem; color: #6b7280; text-align: center; }
.mtc-maint-preview-close {
  display: block; margin: 14px auto 0; background: #111827; color: #fff; border: 0;
  border-radius: 8px; padding: 8px 16px; font-size: 0.9rem; cursor: pointer;
}
@media (max-width: 420px) {
  .mtc-maint-panel { padding: 20px 16px 16px; }
  .mtc-maint-logo { width: 84px; }
  .mtc-maint-title { font-size: 1.25rem; }
}

/* Admin header control */
.admin-maintenance {
  border: 1px solid #e5e7eb; border-radius: 12px; background: #fff;
  padding: 12px 14px; margin: 16px 0 12px;
}
.admin-maintenance.is-active { border-color: #fca5a5; background: #fef2f2; }
.admin-maintenance-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.admin-maintenance-status { margin: 0; font-weight: 600; font-size: 0.95rem; }
.admin-maintenance-status .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: #22c55e; vertical-align: middle; }
.admin-maintenance.is-active .admin-maintenance-status .dot { background: #dc2626; }
.admin-maintenance-counts { margin: 4px 0 0; font-size: 0.82rem; color: #4b5563; }
.admin-maintenance-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-maintenance-fields { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
.admin-maintenance-fields label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.admin-maintenance-fields textarea,
.admin-maintenance-fields input[type="date"] {
  box-sizing: border-box; width: 100%; border: 1px solid #d1d5db; border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 0.9rem; background: #fff;
}
.admin-maintenance-fields textarea { min-height: 72px; resize: vertical; }
.admin-maintenance-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.admin-maintenance-hint { font-size: 0.75rem; color: #6b7280; }
.admin-maintenance-error { color: #b91c1c; font-size: 0.82rem; margin: 6px 0 0; }
.admin-maintenance-details summary { cursor: pointer; font-size: 0.85rem; color: #15803d; margin-top: 8px; }
.admin-maintenance-dialog { border: 0; border-radius: 14px; padding: 20px; width: min(460px, calc(100vw - 32px)); max-height: 85vh; overflow-y: auto; }
.admin-maintenance-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.admin-maintenance-dialog h3 { margin: 0 0 10px; font-size: 1.1rem; }
.admin-maintenance-dialog ul { padding-left: 18px; margin: 8px 0 12px; font-size: 0.88rem; }
.admin-maintenance-dialog li.nonzero { font-weight: 600; }
.admin-maintenance-dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
@media (min-width: 720px) {
  .admin-maintenance-fields { grid-template-columns: 2fr 1fr; }
}

/* Connections panel: purchases unavailable during maintenance */
.mtc-ma-maintenance-note { margin: 6px 0 0; font-size: 0.78rem; line-height: 1.35; color: #6b7280; }
