:root {
  --bg: #08090d;
  --surface: #11131a;
  --surface-2: #181b23;
  --surface-3: #20232d;
  --text: #f6f3ec;
  --muted: #a7a8b1;
  --line: rgba(255, 255, 255, 0.11);
  --accent: #e6bf63;
  --accent-soft: rgba(230, 191, 99, 0.12);
  --positive: #64d5a1;
  --negative: #ff7f88;
  --facebook: #6c7cff;
  --instagram: #d7559f;
  --tiktok: #64d6d3;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 0%, rgba(69, 54, 115, 0.23), transparent 32%),
    radial-gradient(circle at 0% 35%, rgba(230, 191, 99, 0.08), transparent 26%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.report-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(190px, 280px) 150px 150px auto auto;
  gap: 12px;
  align-items: end;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 13, 0.94);
  backdrop-filter: blur(18px);
}

.brand-link {
  align-self: center;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.report-toolbar label {
  display: grid;
  gap: 6px;
}

.report-toolbar label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.report-toolbar select,
.report-toolbar input,
.report-toolbar button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.report-toolbar select,
.report-toolbar input {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-2);
}

.report-toolbar button {
  padding: 0 17px;
  border-color: transparent;
  color: #111;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.report-toolbar .secondary-button {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-2);
}

.report-document {
  width: min(1440px, calc(100% - 48px));
  margin: 26px auto 80px;
}

.report-page {
  position: relative;
  min-height: 800px;
  margin-bottom: 24px;
  padding: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), transparent 38%),
    var(--surface);
  box-shadow: var(--shadow);
}

.cover-page {
  min-height: 820px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(120deg, transparent 0 58%, rgba(230, 191, 99, 0.9) 58% 59%, transparent 59%),
    radial-gradient(circle at 82% 18%, rgba(230, 191, 99, 0.22), transparent 25%),
    #050608;
}

.cover-page::after {
  content: "";
  position: absolute;
  right: -170px;
  bottom: -230px;
  width: 620px;
  height: 620px;
  border: 1px solid rgba(230, 191, 99, 0.4);
  border-radius: 50%;
  box-shadow:
    0 0 0 70px rgba(230, 191, 99, 0.035),
    0 0 0 140px rgba(230, 191, 99, 0.02);
}

.cover-kicker,
.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cover-content {
  position: relative;
  z-index: 2;
  max-width: 840px;
}

.cover-rule {
  width: 84px;
  height: 6px;
  margin-bottom: 28px;
  background: var(--accent);
}

.cover-page h1 {
  margin: 0;
  font-size: clamp(64px, 8vw, 118px);
  line-height: 0.86;
  letter-spacing: -0.065em;
  text-transform: uppercase;
}

#cover-brand {
  margin: 42px 0 6px;
  font-size: 27px;
  font-weight: 750;
}

.cover-period {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.cover-page footer,
.final-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: end;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.page-heading,
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.page-heading {
  margin-bottom: 28px;
}

.page-heading h2,
.card-heading h3 {
  margin: 7px 0 0;
  letter-spacing: -0.035em;
}

.page-heading h2 {
  font-size: clamp(34px, 4vw, 56px);
}

.card-heading h3 {
  font-size: 22px;
}

.data-status {
  max-width: 480px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
}

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

.kpi-card,
.report-card,
.platform-report-card,
.community-platform-card,
.top-content-card,
.conclusion-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.028), transparent),
    var(--surface-2);
}

.kpi-card {
  min-height: 152px;
  padding: 20px;
}

.kpi-label {
  color: var(--muted);
  font-size: 12px;
}

.kpi-value {
  margin-top: 16px;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 900;
  letter-spacing: -0.055em;
}

.kpi-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.delta-positive {
  color: var(--positive) !important;
}

.delta-negative {
  color: var(--negative) !important;
}

.chart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.report-card {
  padding: 22px;
}

.chart-card {
  min-height: 370px;
}

.chart-host {
  height: 270px;
  margin-top: 18px;
}

.chart-large {
  height: 360px;
}

.chart-host svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.change-chip {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.source-note,
.data-gaps {
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.statement-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.statement-card {
  position: relative;
  min-height: 150px;
  padding: 22px 22px 22px 70px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  font-size: 15px;
  line-height: 1.55;
}

.statement-number {
  position: absolute;
  top: 22px;
  left: 22px;
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.comparison-card {
  margin-top: 20px;
}

.comparison-table {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
}

.comparison-table th,
.comparison-table td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
}

.comparison-table th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.community-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.community-main,
.community-mini {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-2);
}

.community-main strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(54px, 6vw, 82px);
  letter-spacing: -0.07em;
}

.community-mini strong {
  display: block;
  margin-top: 14px;
  font-size: 38px;
}

.community-label {
  color: var(--muted);
  font-size: 12px;
}

.platform-community-grid,
.platform-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.community-platform-card,
.platform-report-card {
  padding: 20px;
}

.platform-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.platform-name {
  font-size: 21px;
  font-weight: 850;
}

.platform-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.platform-dot.facebook { background: var(--facebook); }
.platform-dot.instagram { background: var(--instagram); }
.platform-dot.tiktok { background: var(--tiktok); }

.community-platform-value {
  margin-top: 22px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.community-platform-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.wide-card {
  margin-top: 16px;
}

.platform-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
}

.platform-metric {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-3);
}

.platform-metric span {
  color: var(--muted);
  font-size: 10px;
}

.platform-metric strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
}

.platform-breakdown {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.breakdown-row strong {
  color: var(--text);
}

.demographic-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.demographic-tab {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.demographic-tab.active {
  color: #111;
  background: var(--accent);
}

.demographics-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 16px;
}

.demographic-panel {
  min-height: 500px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.demographic-panel h3 {
  margin: 0 0 20px;
  font-size: 20px;
}

.bar-list {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(85px, 0.65fr) 2fr 60px;
  gap: 10px;
  align-items: center;
  font-size: 11px;
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.demographic-empty {
  display: grid;
  place-items: center;
  min-height: 380px;
  color: var(--muted);
  line-height: 1.55;
  text-align: center;
}

.top-content-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.top-content-card {
  overflow: hidden;
}

.top-content-image {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 25%, rgba(230, 191, 99, 0.2), transparent 34%),
    var(--surface-3);
}

.top-content-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #111;
  background: var(--accent);
  font-weight: 900;
}

.top-content-body {
  padding: 14px;
}

.top-content-platform {
  color: var(--accent);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.top-content-caption {
  min-height: 62px;
  margin-top: 9px;
  font-size: 11px;
  line-height: 1.4;
}

.top-content-stats {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 9px;
}

.top-content-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 15px;
}

.highlight-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) 1.4fr;
  gap: 28px;
  align-items: stretch;
}

.highlight-media {
  min-height: 600px;
  overflow: hidden;
  border-radius: 22px;
  background: var(--surface-3);
}

.highlight-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.highlight-copy {
  padding: 20px 0;
}

.highlight-copy h3 {
  margin: 16px 0;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.highlight-caption {
  max-width: 780px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.highlight-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.highlight-stat {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}

.highlight-stat span {
  color: var(--muted);
  font-size: 10px;
}

.highlight-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.paid-kpi-grid {
  margin-bottom: 22px;
}

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

.paid-reading-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.paid-reading-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
}

.paid-reading-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.conclusion-block {
  min-height: 520px;
  padding: 28px;
}

.accent-block {
  border-color: rgba(230, 191, 99, 0.35);
  background:
    linear-gradient(145deg, rgba(230, 191, 99, 0.12), transparent 60%),
    var(--surface-2);
}

.narrative-list {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.narrative-item {
  position: relative;
  padding: 0 0 16px 24px;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  line-height: 1.55;
}

.narrative-item::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.final-footer {
  position: absolute;
  right: 42px;
  bottom: 36px;
  left: 42px;
}

.final-footer strong {
  color: var(--text);
  font-size: 24px;
  letter-spacing: -0.03em;
}

.report-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 70vh;
  color: var(--muted);
  text-align: center;
}

.report-state strong {
  color: var(--text);
  font-size: 20px;
}

.loader {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.error-state {
  color: var(--negative);
}

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

@media (max-width: 1050px) {
  .report-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brand-link {
    grid-column: 1 / -1;
  }

  .kpi-grid,
  .platform-community-grid,
  .platform-report-grid,
  .demographics-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-content-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .report-document {
    width: min(100% - 20px, 1440px);
  }

  .report-page {
    min-height: auto;
    padding: 24px;
    border-radius: 18px;
  }

  .kpi-grid,
  .chart-layout,
  .statement-grid,
  .community-hero,
  .platform-community-grid,
  .platform-report-grid,
  .demographics-layout,
  .highlight-layout,
  .paid-reading,
  .conclusion-columns {
    grid-template-columns: 1fr;
  }

  .top-content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cover-page h1 {
    font-size: 58px;
  }

  .final-footer {
    position: static;
    margin-top: 50px;
  }
}

@page {
  size: A4 landscape;
  margin: 8mm;
}

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f5f5f3;
    --surface-3: #ececea;
    --text: #111111;
    --muted: #626262;
    --line: rgba(0, 0, 0, 0.13);
    --shadow: none;
  }

  body {
    background: #ffffff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .no-print {
    display: none !important;
  }

  .report-document {
    width: 100%;
    margin: 0;
  }

  .report-page {
    min-height: 185mm;
    margin: 0;
    padding: 12mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    page-break-after: always;
  }

  .cover-page {
    color: #ffffff;
    background: #050608 !important;
  }

  .report-card,
  .kpi-card,
  .platform-report-card,
  .community-platform-card,
  .top-content-card,
  .conclusion-block,
  .statement-card,
  .community-main,
  .community-mini,
  .highlight-stat,
  .paid-reading-card,
  .demographic-panel {
    break-inside: avoid;
  }

  .chart-host {
    height: 215px;
  }

  .top-content-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}
