/* Shared status screen; preserve the matching body/safe-area background. */
/* Gate every page root, including home intro and panel guards, before the first decision. */
body:is(.maintenance-pending,.maintenance-active) > :not(#maintenance-screen):not(script):not(style):not(link):not(#maintenance-overlay) {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body:is(.maintenance-pending,.maintenance-active) { overflow: hidden; }
#maintenance-overlay.maintenance-overlay {
  text-align: left;
  font-family: var(--ui-interface-font, "Funnel Display", sans-serif);
  background: var(--panel-bg, #101820);
  color: #eef3f8;
  box-sizing: border-box;
}
#maintenance-overlay .maintenance-status-layout { width: min(100%, 480px); margin: auto; }
#maintenance-overlay .maintenance-shell {
  width: 100%; margin: 0; padding: 0; overflow: visible; border-radius: 16px;
  border: 1px solid rgba(148,163,184,.17); background: rgba(27,37,47,.78);
  box-shadow: 0 20px 65px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.025);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
#maintenance-overlay .maintenance-content { display: block; padding: 32px; text-align: left; }
#maintenance-overlay .maintenance-status-heading {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding-bottom: 18px; margin-bottom: 24px; border-bottom: 1px solid rgba(148,163,184,.14);
  color: #8b98a8; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}
#maintenance-overlay .maintenance-http { flex-shrink: 0; font-family: monospace; font-size: 11px; font-weight: 400; letter-spacing: 0; }
#maintenance-overlay .maintenance-code { display: flex; align-items: center; gap: 14px; color: #f6a730; }
#maintenance-overlay .maintenance-code > svg { width: 22px; height: 22px; flex-shrink: 0; }
#maintenance-overlay .maintenance-code > span { font-size: 72px; font-weight: 700; line-height: 1; letter-spacing: -.04em; }
#maintenance-overlay .maintenance-title { margin: 14px 0 0; padding: 0; color: #f3f6fa; font-size: 22px; line-height: 1.3; font-weight: 600; letter-spacing: -.02em; text-align: left; text-transform: none; text-shadow: none; }
#maintenance-overlay .maintenance-copy { margin: 10px 0 0; max-width: none; color: #a6b2c1; font-size: 13px; line-height: 1.7; text-align: left; overflow-wrap: anywhere; }
#maintenance-overlay .maintenance-scope { display: flex; align-items: center; gap: 9px; margin-top: 20px; padding: 10px 13px; border: 1px solid rgba(246,167,48,.18); border-radius: 9px; background: rgba(246,167,48,.055); color: #a6b2c1; font-size: 12px; }
#maintenance-overlay .maintenance-badge-dot { width: 6px; height: 6px; flex-shrink: 0; margin: 0; background: #f6a730; box-shadow: none; animation: none; }
#maintenance-overlay .maintenance-scope > svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: #f6a730; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#maintenance-overlay .maintenance-actions { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; max-width: none; margin: 24px 0 0; }
#maintenance-overlay .maintenance-status-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 12px; min-height: 38px; box-sizing: border-box; border: 1px solid rgba(148,163,184,.2); border-radius: 9px; background: rgba(148,163,184,.055); color: #d2dbe5; font: inherit; font-size: 12px; line-height: 1.3; text-decoration: none; cursor: pointer; transition: background .2s, border-color .2s, transform .2s; }
#maintenance-overlay .maintenance-status-button svg { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#maintenance-overlay .maintenance-status-button:is(:hover,:focus-visible) .maintenance-retry-icon { animation: maintenanceRetryTurn .55s cubic-bezier(.22,1,.36,1); }
#maintenance-overlay .maintenance-status-button:is(:hover,:focus-visible) .maintenance-support-icon { animation: maintenanceSupportNudge .45s ease-out; }
@keyframes maintenanceRetryTurn { from { transform: rotate(-40deg); } to { transform: rotate(0); } }
@keyframes maintenanceSupportNudge {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(-1px) rotate(-7deg); }
  70% { transform: translateY(-1px) rotate(4deg); }
}
#maintenance-overlay .maintenance-status-button:hover { background: rgba(148,163,184,.13); border-color: rgba(148,163,184,.35); }
#maintenance-overlay .maintenance-status-primary { background: rgba(0,224,164,.09); border-color: rgba(0,224,164,.27); color: #55e5be; }
#maintenance-overlay .maintenance-status-primary:hover { background: rgba(0,224,164,.15); border-color: rgba(0,224,164,.42); }
#maintenance-overlay .maintenance-status-button:active { transform: scale(.97); }
#maintenance-overlay .maintenance-status-button:focus-visible, #maintenance-overlay .maintenance-login-prompt:focus-visible { outline: 2px solid #b1f6e3; outline-offset: 3px; }
#maintenance-overlay .maintenance-login-wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px; width: auto; max-width: none; margin: 22px 0 0; padding: 0; border: 0; }
#maintenance-overlay .maintenance-login-prompt { display: inline-block; color: #98a6b7; font-size: 10px; line-height: 1.5; text-decoration: none; transition: color .2s ease; }
#maintenance-overlay .maintenance-login-prompt:hover { color: #d2dbe5; }
#maintenance-overlay .maintenance-status-footer { display: flex; justify-content: center; gap: 7px; margin: 20px 0 0; color: #718093; font-size: 11px; }
#maintenance-overlay .maintenance-status-footer > span, #maintenance-overlay .maintenance-status-footer a { color: #00d9a5; }
#maintenance-overlay .maintenance-status-footer a { text-decoration: none; }
@media (max-width: 480px) {
  #maintenance-overlay .maintenance-content { padding: 24px; }
  #maintenance-overlay .maintenance-title { max-width: none; white-space: nowrap; font-size: clamp(16px, 4.6vw, 20px); }
  #maintenance-overlay .maintenance-actions { flex-wrap: nowrap; gap: 6px; }
  #maintenance-overlay .maintenance-status-button { flex: 0 1 auto; min-width: 0; padding: 9px 8px; gap: 5px; font-size: 11px; white-space: nowrap; }
  #maintenance-overlay .maintenance-status-button svg { width: 14px; height: 14px; }
  #maintenance-overlay .maintenance-login-wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 360px) {
  #maintenance-overlay .maintenance-status-button { padding-inline: 6px; gap: 4px; font-size: 10px; }
  #maintenance-overlay .maintenance-status-button svg { width: 13px; height: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  #maintenance-overlay .maintenance-shell { animation: none; }
  #maintenance-overlay .maintenance-status-button { transition: none; }
  #maintenance-overlay .maintenance-status-button:is(:hover,:focus-visible) svg { animation: none; }
  #maintenance-overlay .maintenance-login-prompt { transition: none; }
}
