body {
  background:
    radial-gradient(circle at 8% 0%, rgba(214, 31, 51, 0.2), transparent 34%),
    radial-gradient(circle at 95% 100%, rgba(143, 18, 33, 0.14), transparent 30%),
    #fff5f7;
  color: #0f172a;
  overflow-y: scroll;
  overflow-x: hidden;
}

html,
#root {
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(rgba(143, 18, 33, 0.14) 0.4px, transparent 0.4px);
  background-size: 3px 3px;
}

@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .print-report { display: block !important; color: #0f172a !important; }
  .print-report h1, .print-report h2, .print-report h3 { color: #0f172a !important; }
  .print-report section { break-inside: avoid; page-break-inside: avoid; }
}

/* ── Smooth animations ────────────────────────── */

.fade-in-card {
  animation: fadeInUp 0.38s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Card effects ─────────────────────────────── */

.card-elevated {
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 220ms cubic-bezier(0.22, 0.61, 0.36, 1),
              border-color 220ms ease;
}

.card-elevated:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px rgba(143, 18, 33, 0.12), 0 4px 10px rgba(0,0,0,0.05);
  border-color: rgba(214, 31, 51, 0.35);
}

.card-paper {
  position: relative;
  overflow: visible;
}

.card-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 26%);
  border-radius: inherit;
}

.card-paper-no-overlay::before {
  display: none;
}

.chart-shell {
  width: 100%;
  min-height: 18rem;
  padding: 0.15rem 0.15rem 0.45rem;
  overflow: hidden;
}

.page-frame {
  border: 1px solid rgba(244, 63, 94, 0.18);
  border-radius: 1.25rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.52));
  box-shadow: 0 10px 26px rgba(143, 18, 33, 0.08);
  padding: 0.95rem;
}

.app-main-shell {
  overflow-x: hidden;
}

.methodology-flow {
  row-gap: 0.6rem;
}

.ui-select {
  width: 100%;
  border-radius: 0.9rem;
  border: 1px solid #cbd5e1;
  background-color: #ffffff;
  color: #334155;
  padding: 0.58rem 2.2rem 0.58rem 0.82rem;
  font-size: 0.92rem;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 15px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.ui-select:hover {
  border-color: #f43f5e;
}

.ui-select:focus {
  outline: none;
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.2);
}

.ui-select option {
  color: #0f172a;
}

.ui-select-compact {
  width: auto;
  min-width: 8.4rem;
  border-radius: 999px;
  padding: 0.34rem 2rem 0.34rem 0.85rem;
  font-size: 0.78rem;
}

.ui-select-on-dark {
  border-color: rgba(255, 228, 232, 0.45);
  background-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background-image:
    linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%);
}

.ui-select-on-dark:hover {
  border-color: rgba(255, 228, 232, 0.72);
}

.ui-select-on-dark:focus {
  border-color: rgba(255, 228, 232, 0.9);
  box-shadow: 0 0 0 3px rgba(255, 228, 232, 0.25);
}

.ui-select-on-dark option {
  color: #111827;
}

/* ── Sidebar ──────────────────────────────────── */

.sidebar-shell {
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 120, 134, 0.2), transparent 38%),
    radial-gradient(circle at 100% 100%, rgba(143, 18, 33, 0.4), transparent 44%),
    linear-gradient(180deg, #d61f33 0%, #bc1e2f 52%, #8f1221 100%);
  box-shadow: 4px 0 24px rgba(143, 18, 33, 0.24);
  border-right: 1px solid rgba(255, 200, 206, 0.32);
  overflow-y: auto;
}

.sidebar-shell::-webkit-scrollbar { width: 6px; }
.sidebar-shell::-webkit-scrollbar-thumb {
  background: rgba(255, 209, 214, 0.55);
  border-radius: 999px;
}
.sidebar-shell::-webkit-scrollbar-track {
  background: rgba(113, 13, 27, 0.2);
}

/* ── Top bar ──────────────────────────────────── */

.topbar-shell {
  background:
    radial-gradient(circle at 35% -120%, rgba(255, 170, 180, 0.34), transparent 40%),
    linear-gradient(90deg, #d61f33 0%, #bc1e2f 60%, #a31728 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 18px rgba(117, 16, 30, 0.22);
  left: 0;
  right: 0;
}

/* ── Hero section ─────────────────────────────── */

.hero-glow {
  position: relative;
  overflow: hidden;
}

.hero-glow::after {
  content: "";
  position: absolute;
  inset: -20% auto auto -10%;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 64%);
  pointer-events: none;
  animation: none;
}

.hero-glow::before {
  content: "";
  position: absolute;
  inset: auto -8% -40% auto;
  width: 300px;
  height: 300px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 138, 150, 0.45), transparent 62%);
  pointer-events: none;
  animation: none;
}

@keyframes pulse-glow {
  from { opacity: 0.4; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1.1); }
}

.gradient-hero {
  background-image:
    radial-gradient(circle at 8% 0%, rgba(255, 152, 164, 0.22), transparent 42%),
    radial-gradient(circle at 95% 100%, rgba(143, 18, 33, 0.22), transparent 44%);
}

.hero-solid {
  background:
    radial-gradient(circle at 14% -10%, rgba(255, 153, 167, 0.25), transparent 45%),
    radial-gradient(circle at 92% 120%, rgba(87, 8, 18, 0.35), transparent 44%),
    linear-gradient(120deg, #991b2b 0%, #871221 54%, #6f0e1b 100%);
  color: #ffffff;
}

.hero-solid h2,
.hero-solid p,
.hero-solid span {
  color: #fff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* ── Selection & scrollbar ────────────────────── */

::selection {
  background: rgba(214, 31, 51, 0.2);
  color: #8f1221;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb {
  background: rgba(143, 18, 33, 0.22);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(143, 18, 33, 0.35);
}
::-webkit-scrollbar-track {
  background: transparent;
}

/* ── Focus ring ───────────────────────────────── */

*:focus-visible {
  outline: 2px solid rgba(214, 31, 51, 0.5);
  outline-offset: 2px;
}

/* ── Mobile compatibility refinements ───────────────────────────────────── */

@media (max-width: 1024px) {
  .sidebar-shell {
    width: min(86vw, 320px);
  }
}

@media (max-width: 640px) {
  .card-elevated:hover {
    transform: none;
  }

  .page-frame {
    padding: 0.7rem;
    border-radius: 1rem;
  }

  .chart-shell {
    min-height: 16.5rem;
  }

  .topbar-shell {
    padding-top: 0;
    padding-bottom: 0;
  }

  .topbar-shell p {
    line-height: 1.25;
  }

  .ui-select-compact {
    min-width: 7.4rem;
  }
}
