:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f1e9;
  color: #17362e;
}

* { box-sizing: border-box; }

html,
body,
.page-shell {
  width: 100%;
  min-width: 320px;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: radial-gradient(circle at 82% 8%, rgba(196, 150, 77, 0.17), transparent 26rem), #f4f1e9;
}

.page-shell { position: relative; }

.dashboard-frame {
  display: block;
  width: 100%;
  height: 100dvh;
  min-height: 100vh;
  border: 0;
  background: #f4f1e9;
  opacity: 0;
  transition: opacity 240ms ease;
}

.loading-panel {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 0.55rem;
  padding: 2rem;
  text-align: center;
  background: radial-gradient(circle at 72% 18%, rgba(196, 150, 77, 0.17), transparent 24rem), #f4f1e9;
  transition: opacity 220ms ease, visibility 220ms ease;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin-bottom: 0.6rem;
  border-radius: 1.1rem;
  background: #164b3d;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  box-shadow: 0 1rem 2.5rem rgba(22, 75, 61, 0.18);
}

.loading-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 4vw, 2.25rem);
  font-weight: 700;
}

.loading-copy {
  margin: 0;
  color: #66766f;
  font-size: 0.95rem;
}

.spinner {
  width: 1.6rem;
  height: 1.6rem;
  margin-top: 1rem;
  border: 3px solid rgba(22, 75, 61, 0.18);
  border-top-color: #164b3d;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.retry-button {
  display: none;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(22, 75, 61, 0.22);
  border-radius: 0.75rem;
  background: #fff;
  color: #164b3d;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.6rem 1.5rem rgba(23, 54, 46, 0.1);
}

.retry-button:hover,
.retry-button:focus-visible {
  border-color: #164b3d;
  outline: none;
}

.is-slow .retry-button { display: inline-flex; }
.is-loaded .dashboard-frame { opacity: 1; }

.is-loaded .loading-panel {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .dashboard-frame,
  .loading-panel { transition: none; }
  .spinner { animation-duration: 1.6s; }
}
