html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

body {
  font-family:
    Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
}

.renderer-layout {
  min-height: 100vh;
  display: flex;
}

.renderer-shell {
  display: flex;
  flex: 1;
  width: 100%;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.renderer-sidebar {
  flex: 0 0 auto;
  width: var(--renderer-sidebar-width-xs, auto);
  max-width: 100%;
  display: flex;
  align-self: stretch;
}

.renderer-main-column {
  min-width: 0;
  flex: 1;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.renderer-page-content {
  min-width: 0;
  flex: 1;
}

@media (min-width: 900px) {
  .renderer-shell--with-sidebar.renderer-shell--sidebar-left {
    flex-direction: row;
  }

  .renderer-shell--with-sidebar.renderer-shell--sidebar-right {
    flex-direction: row-reverse;
  }

  .renderer-sidebar {
    width: var(
      --renderer-sidebar-width-md,
      var(--renderer-sidebar-width-xs, auto)
    );
  }
}

@media (min-width: 1200px) {
  .renderer-sidebar {
    width: var(
      --renderer-sidebar-width-lg,
      var(--renderer-sidebar-width-md, var(--renderer-sidebar-width-xs, auto))
    );
  }
}

.status-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #ffffff;
}

.status-panel {
  max-width: 420px;
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}

.status-logo {
  width: min(180px, 70vw);
  max-height: 96px;
  object-fit: contain;
}

.status-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #d7dee8;
  border-top-color: #2f6fed;
  border-radius: 999px;
  animation: status-spin 0.8s linear infinite;
}

.status-panel h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.status-panel p {
  margin: 0;
  color: #4b5563;
  line-height: 1.6;
}

.status-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes status-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Maintenance Screen ── */
.maintenance-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  overflow: hidden;
  position: relative;
}

.maintenance-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(100px);
}
.maintenance-orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,0.18) 0%, transparent 70%);
  top: -180px; left: -130px;
  animation: m-drift 24s ease-in-out infinite alternate;
}
.maintenance-orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(37,99,235,0.11) 0%, transparent 70%);
  bottom: -150px; right: -100px;
  animation: m-drift 30s ease-in-out infinite alternate-reverse;
}
@keyframes m-drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(20px, 14px); }
}

.maintenance-bg-wrench {
  position: fixed;
  pointer-events: none;
  color: #1d4ed8;
  animation: m-float 28s ease-in-out infinite alternate;
}
.maintenance-bg-wrench-1 {
  bottom: 8%; right: 6%;
  opacity: 0.07;
  animation-duration: 30s;
}
.maintenance-bg-wrench-2 {
  top: 7%; left: 5%;
  opacity: 0.06;
  animation-direction: alternate-reverse;
  animation-duration: 24s;
}
.maintenance-bg-wrench-1 > svg { transform: rotate(-38deg); }
.maintenance-bg-wrench-2 > svg { transform: rotate(28deg); }
@keyframes m-float {
  from { transform: translateY(0); }
  to   { transform: translateY(14px); }
}

.maintenance-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.75rem;
  padding: 2rem 1.25rem;
}

.maintenance-scene {
  position: relative;
  width: 160px; height: 160px;
}
.maintenance-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.70);
  border: 1px solid rgba(37,99,235,0.20);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 8px 36px rgba(37,99,235,0.12),
    0 2px 8px rgba(0,0,0,0.05),
    inset 0 1px 0 rgba(255,255,255,0.95);
  animation: m-ring-pulse 4s ease-in-out infinite;
}
@keyframes m-ring-pulse {
  0%, 100% {
    box-shadow: 0 8px 36px rgba(37,99,235,0.12), 0 2px 8px rgba(0,0,0,0.05),
                inset 0 1px 0 rgba(255,255,255,0.95);
  }
  50% {
    box-shadow: 0 8px 56px rgba(37,99,235,0.26), 0 2px 8px rgba(0,0,0,0.05),
                inset 0 1px 0 rgba(255,255,255,0.95);
  }
}

.maintenance-orbit {
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  border: 1px dashed rgba(37,99,235,0.22);
  animation: m-orbit-spin 20s linear infinite;
}
.maintenance-orbit-dot {
  position: absolute;
  top: -5px; left: 50%;
  transform: translateX(-50%);
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 10px #3b82f6, 0 0 4px #2563eb;
}
@keyframes m-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.maintenance-wrench-group {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.maintenance-wrench {
  color: #2563eb;
  filter: drop-shadow(0 2px 8px rgba(37,99,235,0.35));
  animation: m-tighten 3s ease-in-out infinite alternate;
}
@keyframes m-tighten {
  from { transform: rotate(-18deg); }
  to   { transform: rotate(18deg); }
}

.maintenance-logo {
  width: min(160px, 60vw);
  max-height: 56px;
  object-fit: contain;
}

.maintenance-title {
  font-size: clamp(1.375rem, 3.5vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1e3a5f;
  margin: 0;
  line-height: 1.2;
}
.maintenance-message {
  font-size: 0.9rem;
  font-weight: 300;
  color: #60a5fa;
  margin: 0.4rem 0 0;
  letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .maintenance-ring,
  .maintenance-orbit,
  .maintenance-wrench,
  .maintenance-orb,
  .maintenance-bg-wrench {
    animation: none !important;
  }
}
