:root {
  --bg: #fafaf8;
  --bg-alt: #f1efe9;
  --bg-card: #ffffff;
  --text: #1f2030;
  --muted: #5f6175;
  --accent: #d4584c;
  --accent-2: #4a6fa5;
  --border: rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

p { margin: 0 0 12px; }
ul { margin: 0 0 12px; padding-left: 20px; }
li { margin-bottom: 6px; }

.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 250, 248, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.nav__inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.nav__links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
}

.nav__links a:focus-visible,
.btn:focus-visible,
th button:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}

.nav__links a.active {
  color: #fff;
  background: var(--accent);
}

.hero {
  padding: 72px 0 56px;
}

.badge {
  display: inline-block;
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

h1 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1.1;
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.4rem, 3.4vw, 2rem);
  line-height: 1.2;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.subtitle {
  color: var(--accent-2);
  font-weight: 600;
  margin: 0 0 12px;
}

.lead {
  max-width: 860px;
  color: var(--muted);
  font-size: 1.05rem;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.btn {
  text-decoration: none;
  border-radius: 10px;
  font-weight: 600;
  padding: 10px 16px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--outline {
  border: 1px solid var(--border);
  color: var(--text);
}

.section { padding: 58px 0; }
.section--alt { background: var(--bg-alt); }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.two-col {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 8px 28px rgba(25, 25, 35, 0.04);
}

.card h3 { margin-top: 0; }

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.muted { color: var(--muted); }
.status { color: var(--muted); font-size: 0.92rem; }
.status--error { color: #a11f1f; }
.empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
  color: var(--muted);
}

.bar-chart {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: 170px 1fr 50px;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.bar-track {
  height: 10px;
  background: #e8e5de;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.viz-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  padding: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

caption {
  text-align: left;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 8px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th button {
  background: none;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 0;
}

select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

pre {
  background: #111623;
  color: #f7f8ff;
  border-radius: 12px;
  padding: 16px;
  overflow: auto;
  font-size: 0.85rem;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.footer a { color: var(--muted); text-decoration: none; }

@media (max-width: 760px) {
  .container { width: min(1120px, calc(100% - 28px)); }
  .bar-row { grid-template-columns: 130px 1fr 45px; }
  .actions { gap: 8px; }
  .btn { width: 100%; }
}
