:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #d7dee8;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --blue: #124f86;
  --green: #16794f;
  --red: #b4232f;
  --gold: #c3862b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #eef3f8;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 48px);
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

main {
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 22px clamp(14px, 3vw, 34px) 48px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(22, 121, 79, 0.12);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric,
.panel,
.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric {
  min-height: 128px;
  padding: 18px;
}

.metric.primary {
  border-top: 5px solid var(--blue);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(1.65rem, 4vw, 2.55rem);
  line-height: 1;
  letter-spacing: 0;
}

.metric small {
  color: var(--muted);
}

.feature-grid,
.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-top: 16px;
}

.feature-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 16px;
  align-items: center;
}

.feature-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--soft);
}

.feature-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.2rem, 2.2vw, 1.8rem);
}

.button {
  display: inline-flex;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-size: 0.88rem;
}

.panel {
  padding: 16px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.panel-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.ranking-list {
  display: grid;
  gap: 10px;
}

.ranking-card {
  display: grid;
  grid-template-columns: 44px 112px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
}

.rank {
  color: var(--blue);
  font-weight: 900;
  font-size: 1.2rem;
  text-align: center;
}

.ranking-card img {
  width: 112px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 5px;
  background: var(--soft);
}

.entry-title {
  margin: 0;
  font-weight: 900;
}

.entry-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.views {
  color: var(--green);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.compact-table,
.data-table,
.mini-ranking {
  overflow-x: auto;
}

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

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

th {
  color: #fff;
  background: var(--blue);
  white-space: nowrap;
  font-size: 0.78rem;
}

td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}

.region-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.bars {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  gap: 5px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

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

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
}

.comments-list {
  display: grid;
  gap: 10px;
}

.comment {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfdff;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.comment p {
  margin: 7px 0 0;
  line-height: 1.42;
}

@media (max-width: 980px) {
  .overview-grid,
  .feature-grid,
  .split-layout,
  .region-grid {
    grid-template-columns: 1fr;
  }

  .feature-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .ranking-card {
    grid-template-columns: 36px 86px 1fr;
  }

  .ranking-card .views {
    grid-column: 2 / -1;
  }
}
