* {
  box-sizing: border-box;
}

:root {
  --bg: #08111f;
  --bg-elevated: rgba(14, 24, 42, 0.8);
  --bg-soft: rgba(21, 35, 61, 0.65);
  --surface: rgba(16, 25, 43, 0.92);
  --surface-2: rgba(24, 38, 65, 0.82);
  --surface-3: rgba(34, 51, 82, 0.7);
  --text: #edf4ff;
  --muted: #9ab0cf;
  --muted-2: #6f87a8;
  --border: rgba(146, 178, 223, 0.16);
  --accent: #4de2c5;
  --accent-2: #6f8dff;
  --accent-3: #f8c35d;
  --good: #57d89b;
  --bad: #ff6d86;
  --warn: #ffd166;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1520px;
}

body[data-theme="light"] {
  --bg: #eef4fb;
  --bg-elevated: rgba(255, 255, 255, 0.92);
  --bg-soft: rgba(244, 247, 252, 0.86);
  --surface: rgba(255, 255, 255, 0.96);
  --surface-2: rgba(248, 250, 255, 0.96);
  --surface-3: rgba(232, 239, 250, 0.96);
  --text: #10213c;
  --muted: #587092;
  --muted-2: #7b90ad;
  --border: rgba(89, 118, 165, 0.16);
  --accent: #0fb395;
  --accent-2: #405efc;
  --accent-3: #c78b10;
  --good: #11a96b;
  --bad: #d63f67;
  --warn: #bd8500;
  --shadow: 0 24px 60px rgba(46, 73, 117, 0.14);
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 141, 255, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(77, 226, 197, 0.16), transparent 22%),
    linear-gradient(180deg, #07101d 0%, var(--bg) 45%, #09111f 100%);
  transition: background 240ms ease, color 240ms ease;
}

body[data-theme="light"] {
  background:
    radial-gradient(circle at top left, rgba(64, 94, 252, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(15, 179, 149, 0.16), transparent 22%),
    linear-gradient(180deg, #f7fbff 0%, var(--bg) 45%, #eef4fb 100%);
}

img {
  max-width: 100%;
  display: block;
}

svg,
canvas,
table {
  max-width: 100%;
}

button {
  font: inherit;
}

button,
select {
  min-height: 44px;
}

body * {
  min-width: 0;
}

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow: hidden;
  background: rgba(4, 9, 18, 0.86);
  backdrop-filter: blur(18px) saturate(1.06);
  transition: opacity 520ms ease, visibility 520ms ease, transform 520ms ease;
}

.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
}

.loader-backdrop,
.loader-grid,
.loader-glow,
.loader-particles {
  position: absolute;
  inset: 0;
}

.loader-grid {
  background-image:
    linear-gradient(rgba(111, 141, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 141, 255, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 82%);
  opacity: 0.28;
}

.loader-glow {
  filter: blur(48px);
  opacity: 0.55;
}

.loader-glow-a {
  background: radial-gradient(circle at 24% 28%, rgba(77, 226, 197, 0.28), transparent 30%);
  animation: driftGlowA 7s ease-in-out infinite;
}

.loader-glow-b {
  background: radial-gradient(circle at 78% 24%, rgba(111, 141, 255, 0.3), transparent 30%);
  animation: driftGlowB 8s ease-in-out infinite;
}

.loader-particles span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(237, 244, 255, 0.5);
  box-shadow: 0 0 18px rgba(111, 141, 255, 0.35);
  animation: particleFloat 8s linear infinite;
}

.loader-particles span:nth-child(1) { top: 14%; left: 18%; animation-delay: 0s; }
.loader-particles span:nth-child(2) { top: 26%; left: 74%; animation-delay: -1.2s; }
.loader-particles span:nth-child(3) { top: 62%; left: 14%; animation-delay: -2.4s; }
.loader-particles span:nth-child(4) { top: 76%; left: 68%; animation-delay: -3.6s; }
.loader-particles span:nth-child(5) { top: 52%; left: 48%; animation-delay: -4.8s; }
.loader-particles span:nth-child(6) { top: 36%; left: 38%; animation-delay: -6s; }

.loader-frame {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
}

.loader-panel {
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid rgba(146, 178, 223, 0.16);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(13, 22, 38, 0.92), rgba(10, 18, 31, 0.88));
  box-shadow: 0 36px 90px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.loader-brand-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
}

.loader-mark-wrap {
  position: relative;
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
}

.loader-logo {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  filter: drop-shadow(0 18px 38px rgba(77, 226, 197, 0.24));
  animation: loaderLogoFloat 3.2s ease-in-out infinite;
}

.loader-mark-wrap::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(77, 226, 197, 0.26), rgba(111, 141, 255, 0.08) 55%, transparent 70%);
  filter: blur(8px);
}

.loader-ring {
  position: absolute;
  inset: 0;
  width: 110px;
  height: 110px;
  transform: rotate(-90deg);
}

.loader-ring-track,
.loader-ring-progress {
  fill: none;
  stroke-width: 6;
}

.loader-ring-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.loader-ring-progress {
  stroke: url(#loaderGradient);
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  filter: drop-shadow(0 0 10px rgba(77, 226, 197, 0.45));
  transition: stroke-dashoffset 260ms ease;
}

.loader-copy {
  display: grid;
  gap: 8px;
}

.loader-kicker {
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.loader-copy h2 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  line-height: 1.02;
}

.loader-status-text {
  margin: 0;
  color: rgba(237, 244, 255, 0.84);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 1.5em;
}

.loader-percent {
  display: grid;
  align-items: end;
  justify-items: end;
  min-width: 86px;
  color: var(--text);
}

.loader-percent span {
  font-size: clamp(2rem, 5vw, 3.4rem);
  line-height: 0.95;
  font-weight: 800;
}

.loader-percent small {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.loader-progress-shell {
  display: grid;
  gap: 10px;
}

.loader-progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

.loader-progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(77, 226, 197, 0.95), rgba(111, 141, 255, 0.95), rgba(248, 195, 93, 0.92));
  box-shadow: 0 0 24px rgba(77, 226, 197, 0.28);
  transition: width 220ms ease;
}

.loader-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transform: translateX(-100%);
  animation: shimmerSweep 1.8s linear infinite;
}

.loader-stage-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.loader-stage {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(146, 178, 223, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.84rem;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, color 220ms ease;
}

.loader-stage.active,
.loader-stage.complete {
  color: var(--text);
  border-color: rgba(77, 226, 197, 0.24);
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.12), rgba(111, 141, 255, 0.12));
}

.loader-stage.active {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(77, 226, 197, 0.08);
}

.loader-preview-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
}

.loader-preview-card {
  min-height: 166px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(146, 178, 223, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.018));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.loader-preview-card-lg {
  grid-column: span 1;
}

.loader-preview-wide {
  grid-column: span 3;
  min-height: 124px;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: translateX(-100%);
  animation: shimmerSweep 1.65s ease-in-out infinite;
}

.skeleton-title { width: 56%; height: 14px; margin-bottom: 10px; }
.skeleton-subtitle { width: 74%; height: 10px; margin-bottom: 18px; }
.skeleton-pill { width: 42%; height: 10px; margin-bottom: 14px; }
.skeleton-kpi { width: 62%; height: 38px; margin-bottom: 14px; border-radius: 14px; }
.skeleton-line { width: 100%; height: 10px; margin-top: 10px; }
.skeleton-line.short { width: 72%; }

.loader-mini-chart {
  margin-top: 20px;
  height: 72px;
  display: flex;
  align-items: end;
  gap: 10px;
}

.loader-mini-chart span {
  flex: 1;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, rgba(77, 226, 197, 0.8), rgba(111, 141, 255, 0.28));
  animation: chartPulse 1.8s ease-in-out infinite;
}

.loader-mini-chart span:nth-child(1) { height: 32%; animation-delay: 0s; }
.loader-mini-chart span:nth-child(2) { height: 68%; animation-delay: -0.2s; }
.loader-mini-chart span:nth-child(3) { height: 48%; animation-delay: -0.4s; }
.loader-mini-chart span:nth-child(4) { height: 82%; animation-delay: -0.6s; }
.loader-mini-chart span:nth-child(5) { height: 58%; animation-delay: -0.8s; }
.loader-mini-chart span:nth-child(6) { height: 92%; animation-delay: -1s; }

.loader-donut {
  width: 86px;
  height: 86px;
  margin-top: 8px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, rgba(77, 226, 197, 0.92), rgba(111, 141, 255, 0.86), rgba(248, 195, 93, 0.88), rgba(77, 226, 197, 0.92));
  mask: radial-gradient(circle at center, transparent 54%, black 55%);
  animation: rotateLoader 4.4s linear infinite;
}

.loader-preview-table {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.loader-preview-table span {
  display: block;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  position: relative;
  overflow: hidden;
}

.loader-preview-table span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-100%);
  animation: shimmerSweep 1.7s linear infinite;
}

.loader-preview-table span:nth-child(1) { width: 100%; }
.loader-preview-table span:nth-child(2) { width: 86%; }
.loader-preview-table span:nth-child(3) { width: 94%; }
.loader-preview-table span:nth-child(4) { width: 72%; }

body.booting .shell {
  opacity: 0.62;
  transform: scale(0.988);
  filter: blur(14px) saturate(0.88);
}

.shell {
  transition: opacity 520ms ease, transform 520ms ease, filter 520ms ease;
}

@keyframes loaderLogoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-7px); }
}

@keyframes shimmerSweep {
  100% { transform: translateX(100%); }
}

@keyframes rotateLoader {
  100% { transform: rotate(360deg); }
}

@keyframes chartPulse {
  0%, 100% { opacity: 0.7; transform: scaleY(0.94); }
  50% { opacity: 1; transform: scaleY(1.04); }
}

@keyframes particleFloat {
  0% { transform: translate3d(0, 0, 0) scale(0.9); opacity: 0; }
  10%, 80% { opacity: 0.8; }
  100% { transform: translate3d(18px, -34px, 0) scale(1.1); opacity: 0; }
}

@keyframes driftGlowA {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(22px, 16px, 0); }
}

@keyframes driftGlowB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-24px, 18px, 0); }
}

.shell {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  padding: 24px;
}

.sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  min-height: calc(100vh - 48px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  padding: 0;
  background: rgba(4, 9, 18, 0.56);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.sidebar.open + .sidebar-scrim {
  opacity: 1;
  pointer-events: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(77, 226, 197, 0.2);
}

.brand h1,
.topbar h2,
.section-header h3,
.panel h4,
.metric-card h4,
.story-card h4,
.table-panel h4,
.feed-card h4 {
  margin: 0;
}

.brand-eyebrow,
.eyebrow,
.section-kicker {
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.sidebar-copy,
.section-summary,
.panel p,
.story-card p,
.feed-card p,
.footer-note,
.legend,
.stat-label,
.table-subtitle,
.empty-note,
.callout p {
  color: var(--muted);
}

.sidebar-copy {
  margin-bottom: 18px;
  line-height: 1.55;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text);
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav-button:hover,
.nav-button.active {
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.12), rgba(111, 141, 255, 0.18));
  border-color: var(--border);
  transform: translateX(4px);
}

.nav-button strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.nav-button span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(77, 226, 197, 0.12);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

.badge.ghost {
  background: rgba(111, 141, 255, 0.1);
}

.page {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-copy {
  min-width: 0;
}

.topbar-copy h2,
.section-header h3,
.hero-panel h3,
.story-card h4,
.feed-card h4,
.panel h4,
.stack-card h5,
.metric-label,
.metric-value,
.table-subtitle,
.section-summary,
.sidebar-copy p,
.callout p,
.timeline-item h4,
.timeline-item p,
.progress-line span,
.progress-line strong {
  overflow-wrap: anywhere;
}

.lang-switcher {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.lang-button {
  min-width: 52px;
  min-height: 44px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.lang-button:hover {
  color: var(--text);
}

.lang-button.active {
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.18), rgba(111, 141, 255, 0.24));
  color: var(--text);
  box-shadow: 0 10px 24px rgba(77, 226, 197, 0.12);
}

.theme-toggle,
.icon-button,
.tab-button,
.sort-chip,
.action-button,
.filter-chip {
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, opacity 180ms ease;
}

.theme-toggle,
.icon-button,
.action-button {
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle:hover,
.icon-button:hover,
.tab-button:hover,
.sort-chip:hover,
.action-button:hover,
.filter-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 226, 197, 0.28);
}

.action-button.primary {
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.18), rgba(111, 141, 255, 0.24));
}

.action-button.is-busy {
  opacity: 0.75;
}

.control-select-wrap {
  display: inline-grid;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.control-select-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.control-select {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  min-height: 24px;
  width: 100%;
}

.control-select option {
  color: #10213c;
}

.controlbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--bg-elevated);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.filter-group,
.control-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tab-shell {
  display: grid;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.tab-shell-copy {
  display: grid;
  gap: 6px;
}

.tab-shell-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tab-strip {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.tab-strip::-webkit-scrollbar {
  height: 8px;
}

.tab-strip::-webkit-scrollbar-thumb {
  background: rgba(111, 141, 255, 0.22);
  border-radius: 999px;
}

.filter-chip {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
}

.category-tab {
  position: relative;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 11px 16px;
  white-space: nowrap;
  scroll-snap-align: start;
}

.filter-chip.active {
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.16), rgba(111, 141, 255, 0.2));
  border-color: rgba(77, 226, 197, 0.3);
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(77, 226, 197, 0.08);
  font-size: 0.8rem;
}

.status-chip.ghost {
  background: rgba(111, 141, 255, 0.08);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(77, 226, 197, 0.12);
}

.mobile-only {
  display: none;
}

.content {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.tab-panel-stage {
  display: grid;
  min-width: 0;
}

.section {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 480ms ease, transform 480ms ease;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-inner {
  padding: 24px;
  min-width: 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.section-title-wrap {
  display: grid;
  gap: 8px;
}

.section-summary {
  max-width: 72ch;
  line-height: 1.6;
}

.hero {
  position: relative;
  min-height: 420px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: 18px;
  background: linear-gradient(135deg, rgba(8, 17, 31, 0.15), rgba(8, 17, 31, 0.6));
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.03) contrast(1.02) brightness(0.65);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgba(4, 9, 18, 0.88) 20%, rgba(4, 9, 18, 0.4) 62%, rgba(4, 9, 18, 0.92) 100%);
}

.hero-panel,
.hero-side {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.hero-panel {
  padding: 34px;
  display: grid;
  align-content: end;
  gap: 16px;
}

.hero-panel h3 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
}

.hero-panel p {
  margin: 0;
  max-width: 58ch;
  color: rgba(237, 244, 255, 0.82);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-side {
  padding: 26px;
  display: grid;
  align-content: center;
}

.glass-card,
.metric-card,
.story-card,
.feed-card,
.table-panel,
.panel,
.callout {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.glass-card {
  padding: 22px;
  backdrop-filter: blur(14px);
}

.grid-2,
.grid-3,
.metric-grid,
.story-grid,
.feed-grid,
.compare-grid,
.chart-grid,
.snapshot-grid {
  display: grid;
  gap: 18px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.story-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feed-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-grid { grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr); }
.snapshot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.metric-card,
.story-card,
.feed-card,
.panel,
.callout,
.table-panel {
  padding: 20px;
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.75;
}

.metric-label {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.metric-value {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.metric-subvalue {
  color: var(--muted);
  font-size: 0.88rem;
}

.list {
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 10px;
  line-height: 1.55;
}

.key-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.key-list li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.key-list .index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.18), rgba(111, 141, 255, 0.18));
  font-weight: 700;
}

.bars {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  gap: 8px;
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.92rem;
}

.bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

body[data-theme="light"] .bar-track {
  background: rgba(16, 33, 60, 0.08);
}

.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-fill.negative {
  background: linear-gradient(90deg, #ff8aa0, var(--bad));
}

.signal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.signal.positive { color: var(--good); }
.signal.negative { color: var(--bad); }
.signal.neutral { color: var(--warn); }

.story-card,
.feed-card {
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.story-card:hover,
.feed-card:hover,
.metric-card:hover,
.panel:hover,
.callout:hover,
.table-panel:hover {
  transform: translateY(-4px);
  border-color: rgba(77, 226, 197, 0.24);
}

.story-meta,
.feed-meta,
.inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  font-size: 0.8rem;
}

.compare-column {
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
}

.compare-column h4 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.compare-column ul {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 10px;
  line-height: 1.55;
}

.table-panel {
  overflow: hidden;
  min-width: 0;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.sort-chip-group,
.tab-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sort-chip,
.tab-button {
  padding: 10px 14px;
}

.sort-chip.active,
.tab-button.active {
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.16), rgba(111, 141, 255, 0.2));
  border-color: rgba(77, 226, 197, 0.3);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.score-badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.timeline {
  position: relative;
  display: grid;
  gap: 16px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), rgba(111, 141, 255, 0));
}

.timeline-item {
  position: relative;
  padding-left: 34px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(77, 226, 197, 0.08);
}

.timeline-item h4 {
  margin-bottom: 6px;
}

.callout {
  display: grid;
  gap: 12px;
  background: linear-gradient(135deg, rgba(77, 226, 197, 0.12), rgba(111, 141, 255, 0.16));
}

.dual-panel {
  display: grid;
  gap: 18px;
}

.stack-list {
  display: grid;
  gap: 14px;
}

.stack-card {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.stack-card h5 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.progress-group {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.progress-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.footer-note {
  font-size: 0.82rem;
  line-height: 1.55;
}

@media (max-width: 1180px) {
  .loader-brand-row,
  .loader-preview-grid,
  .loader-stage-list,
  .shell,
  .hero,
  .chart-grid,
  .metric-grid,
  .grid-3,
  .story-grid,
  .snapshot-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 16px auto 16px 16px;
    width: min(88vw, 320px);
    transform: translateX(-120%);
    transition: transform 240ms ease;
    z-index: 40;
    min-height: auto;
    overflow-y: auto;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-only {
    display: inline-flex;
  }

  .shell {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .loader-panel {
    padding: 22px;
  }

  .loader-percent {
    justify-items: start;
  }

  .loader-preview-wide {
    grid-column: span 1;
  }

  .topbar {
    padding: 16px 18px;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
  }

  .controlbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .tab-shell,
  .control-meta {
    width: 100%;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .topbar,
  .section-header,
  .table-toolbar,
  .hero,
  .grid-2,
  .compare-grid,
  .feed-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .section-header,
  .table-toolbar {
    display: grid;
  }

  .topbar-actions,
  .filter-group,
  .control-meta {
    width: 100%;
  }

  .tab-strip {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .lang-switcher,
  .action-button,
  .theme-toggle,
  .control-select-wrap {
    width: 100%;
    justify-content: center;
  }

  .category-tab {
    width: auto;
    min-width: max-content;
  }

  .lang-button {
    flex: 1;
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .topbar-actions > .badge,
  .lang-switcher,
  .control-select-wrap {
    grid-column: 1 / -1;
  }

  .sort-chip-group,
  .tab-group {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sort-chip,
  .tab-button {
    width: 100%;
  }

  .hero {
    min-height: 0;
  }

  .hero-panel,
  .hero-side,
  .section-inner {
    padding: 18px;
  }

  .app-loader {
    padding: 16px;
  }

  .loader-mark-wrap {
    width: 92px;
    height: 92px;
  }

  .loader-logo,
  .loader-ring {
    width: 58px;
    height: 58px;
  }

  .loader-ring {
    width: 92px;
    height: 92px;
  }

  .loader-copy h2 {
    font-size: 1.6rem;
  }

  .loader-stage {
    font-size: 0.8rem;
  }

  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .progress-line {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 12px;
    gap: 12px;
  }

  .topbar,
  .controlbar,
  .sidebar,
  .section,
  .loader-panel {
    border-radius: 22px;
  }

  .topbar,
  .controlbar {
    padding: 14px;
  }

  .topbar {
    gap: 14px;
  }

  .topbar-copy h2 {
    font-size: clamp(1.35rem, 6vw, 1.8rem);
    line-height: 1.08;
  }

  .section-inner,
  .hero-panel,
  .hero-side,
  .sidebar {
    padding: 16px;
  }

  .hero-panel {
    gap: 12px;
  }

  .hero-panel p,
  .section-summary,
  .sidebar-copy,
  .tab-shell-note,
  .metric-subvalue,
  .panel p,
  .callout p {
    font-size: 0.94rem;
  }

  .metric-value {
    font-size: clamp(1.32rem, 8vw, 1.8rem);
  }

  .badge,
  .pill,
  .status-chip,
  .filter-chip,
  .sort-chip,
  .tab-button,
  .action-button,
  .theme-toggle,
  .icon-button {
    padding-top: 11px;
    padding-bottom: 11px;
  }

  .app-loader {
    padding: 12px;
  }

  .loader-panel {
    padding: 16px;
    gap: 16px;
  }

  .loader-brand-row {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 14px;
  }

  .loader-copy {
    width: 100%;
  }

  .loader-copy h2 {
    font-size: 1.35rem;
  }

  .loader-status-text {
    font-size: 0.94rem;
  }

  .loader-percent {
    min-width: 0;
    justify-items: start;
  }

  .loader-mark-wrap {
    width: 84px;
    height: 84px;
  }

  .loader-logo {
    width: 52px;
    height: 52px;
  }

  .loader-ring {
    width: 84px;
    height: 84px;
  }

  .loader-preview-card {
    min-height: 140px;
    padding: 16px;
  }

  .loader-stage {
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }

  .action-button,
  .theme-toggle,
  .control-select-wrap,
  .lang-switcher,
  .topbar-actions > .badge {
    grid-column: auto;
    width: 100%;
  }

  .sort-chip-group,
  .tab-group {
    grid-template-columns: 1fr;
  }

  .bar-meta {
    flex-direction: column;
    align-items: flex-start;
  }
}
