/* =========================================================
   MERGED FINAL CSS
   - Base: style(1).css
   - Preserved legacy components from style.css
   - Conflict-safe unified version
   ========================================================= */

/* -------------------------
   Font faces
------------------------- */
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-1Thin.subset.woff2") format("woff2");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-2ExtraLight.subset.woff2") format("woff2");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-3Light.subset.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-4Regular.subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-5Medium.subset.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-6SemiBold.subset.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-7Bold.subset.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-8ExtraBold.subset.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Paperlogy";
  src: url("./fonts/Paperlogy-9Black.subset.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* -------------------------
   Theme tokens
------------------------- */
:root {
  --primary-color: #0052cc;
  --primary-dark: #073784;
  --accent-color: #13a87a;
  --accent-warm: #d94f3d;

  --background-color: #eef3f9;
  --surface-color: #ffffff;
  --surface-muted: #f7f9fc;
  --card-background-color: #ffffff;

  --border-color: #d8e0eb;
  --card-border-color: #dfe1e6;

  --text-color: #172b4d;
  --subtle-text-color: #5e6c84;
  --white-text: #ffffff;

  --shadow-color: rgba(15, 23, 42, 0.08);
  --soft-blue: #f3f7ff; /* added: used in legacy file */
  --danger-color: #d93025;
}

/* -------------------------
   Global reset / base
------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 32px 16px;
  background: linear-gradient(180deg, #f7f9fc 0%, #eef3f9 100%);
  color: var(--text-color);
  font-family: "Paperlogy", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
}

/* -------------------------
   Page containers
------------------------- */
.report-container,
.details-container {
  width: min(1280px, 100%);
  margin: 0 auto 32px auto;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  box-shadow: 0 24px 70px var(--shadow-color);
  padding: 32px;
  height: auto !important;
}

/* -------------------------
   Header
------------------------- */
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 2px solid rgba(0, 82, 204, 0.14);
}

.report-header-main {
  flex: 1;
  min-width: 0;
}

.report-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text-color);
}

.report-header p,
.report-subtitle {
  margin: 10px 0 0;
  font-size: 1rem;
  color: var(--subtle-text-color);
}

.report-header-side {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.logo,
.report-header .logo {
  max-width: 120px;
  max-height: 56px;
  object-fit: contain;
  margin-left: 0;
}

/* -------------------------
   Meta / toolbar
------------------------- */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  font-size: 0.92rem;
  color: var(--subtle-text-color);
}

.meta-pill strong {
  color: var(--text-color);
}

.toolbar-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
}

.toolbar-btn,
.lang-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--subtle-text-color);
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toolbar-btn:hover {
  color: var(--primary-dark);
  background: rgba(0, 82, 204, 0.08);
}

.toolbar-btn.active,
.lang-btn {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 82, 204, 0.18);
}

.toolbar-btn.active:hover,
.lang-btn:hover {
  background: var(--primary-dark);
  color: #fff;
}

/* -------------------------
   Sections / grid
------------------------- */
.gender-section + .gender-section {
  margin-top: 20px;
}

.gender-section[hidden] {
  display: none !important;
}

.gender-section-header,
.section-head,
.grid-item h3 {
  margin-bottom: 18px;
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0, 82, 204, 0.08);
  color: var(--primary-dark);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.grid-item,
.card,
.subcard {
  min-width: 0;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.grid-span-2 {
  grid-column: 1 / -1;
}

.section-head h3,
.grid-item h3 {
  margin: 0;
  color: var(--primary-color);
  font-size: 1.35rem;
  line-height: 1.2;
}

.section-subtitle {
  margin: 8px 0 0;
  color: var(--subtle-text-color);
  font-size: 0.95rem;
}

/* -------------------------
   Legacy summary / KPI / recommendation
------------------------- */
.key-takeaways-box p {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0;
}

.kpi-container {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 15px;
}

.stat-block {
  text-align: center;
  padding: 15px;
  border: 1px solid var(--card-border-color);
  border-radius: 10px;
  background-color: var(--surface-muted);
}

.stat-block .label {
  font-size: 1rem;
  color: var(--subtle-text-color);
  margin-bottom: 8px;
  display: block;
}

.stat-block .value {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-block .value.alert {
  color: var(--danger-color);
}

.recommendation-block ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0;
}

.recommendation-block li {
  position: relative;
  font-size: 1.05rem;
  line-height: 1.7;
  padding-left: 25px;
}

.recommendation-block li:not(:last-child) {
  margin-bottom: 15px;
}

.recommendation-block li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
}

/* -------------------------
   Legacy detail accordion
------------------------- */
.details-container h2 {
  font-size: 2rem;
  color: var(--text-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
  margin-bottom: 30px;
  height: auto !important;
}

.card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 20px;
}

.card-header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 12px 20px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
}

.card-header::after {
  content: "▼";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
}

.card-header.collapsed::after {
  content: "►";
}

.card-body {
  padding: 20px;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out, padding-top 0.4s ease-in-out, padding-bottom 0.4s ease-in-out;
}

.card-header.collapsed + .card-body {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.card-body p {
  margin-bottom: 15px;
}

.card-body .publication-date {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--subtle-text-color);
  margin-bottom: 15px;
}

.card-body a.source-link {
  font-size: 0.85rem;
  color: var(--primary-color);
  text-decoration: none;
}

.card-body a.source-link:hover {
  text-decoration: underline;
}

/* -------------------------
   General table shell
------------------------- */
.table-frame {
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: visible;
  background: var(--surface-color);
}

.table-frame--nested {
  border-radius: 14px;
}

/* -------------------------
   New data tables
------------------------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  overflow: visible;
}

.data-table tbody,
.data-table tr,
.data-table td {
  overflow: visible;
}

.data-table thead {
  background: linear-gradient(180deg, #f9fbff 0%, #f3f6fb 100%);
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.92rem;
  word-break: normal;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table th {
  color: var(--text-color);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.data-table tbody tr:hover td {
  background: rgba(0, 82, 204, 0.03);
}

.ranking-table .col-rank { width: 40px; }
.ranking-table .col-brand { width: 118px; }
.ranking-table .col-product { width: 40%; }
.ranking-table .col-price { width: 108px; }
.ranking-table .col-disc { width: 58px; }
.ranking-table .col-change { width: 96px; }
.ranking-table .col-item-type { width: 160px; }

.compact-table .col-brand { width: 120px; }
.compact-table .col-product { width: 40%; }
.compact-table .col-secondary { width: 146px; }
.compact-table .col-viewers { width: 64px; }

.ranking-table th:nth-child(1),
.ranking-table td:nth-child(1),
.ranking-table th:nth-child(4),
.ranking-table td:nth-child(4),
.ranking-table th:nth-child(5),
.ranking-table td:nth-child(5),
.ranking-table th:nth-child(6),
.ranking-table td:nth-child(6),
.compact-table th:nth-child(4),
.compact-table td:nth-child(4) {
  padding-left: 6px;
  padding-right: 6px;
}

.ranking-table th:nth-child(3),
.ranking-table td:nth-child(3),
.compact-table th:nth-child(2),
.compact-table td:nth-child(2) {
  padding-left: 14px;
  padding-right: 14px;
}

.ranking-table th:nth-child(2),
.ranking-table td:nth-child(2),
.ranking-table th:nth-child(7),
.ranking-table td:nth-child(7),
.compact-table th:nth-child(1),
.compact-table td:nth-child(1),
.compact-table th:nth-child(3),
.compact-table td:nth-child(3) {
  padding-left: 8px;
  padding-right: 8px;
}

/* -------------------------
   Legacy comparison table
------------------------- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
}

.comparison-table th {
  background-color: var(--soft-blue);
  color: var(--primary-color);
  text-align: left;
  padding: 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--card-border-color);
}

.comparison-table td {
  padding: 12px;
  border-bottom: 1px solid var(--card-border-color);
  font-size: 0.95rem;
  vertical-align: top;
}

.comparison-table td:first-child {
  font-weight: 700;
  color: var(--primary-color);
  width: 20%;
}

/* -------------------------
   Table cell variants
------------------------- */
.numeric-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: center;
}

.brand-cell {
  min-width: 0;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.brand-cell > span {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.product-cell {
  min-width: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tag-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* -------------------------
   Product hover preview
------------------------- */
.product-hover-card {
  position: relative;
  display: inline-flex;
  width: 100%;
  max-width: 100%;
}

.product-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  width: 100%;
  max-width: 100%;
}

.product-link:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.product-link-label {
  display: inline-block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-preview {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 200;
  width: 170px;
  padding: 8px;
  border-radius: 14px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.product-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--surface-muted);
}

.product-hover-card:hover .product-preview,
.product-hover-card:focus-within .product-preview {
  display: block;
}

body.preview-active .product-hover-card:hover .product-preview,
body.preview-active .product-hover-card:focus-within .product-preview {
  display: none;
}

.floating-product-preview {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 220px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}

.floating-product-preview.is-visible {
  display: block;
}

.floating-product-preview img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: var(--surface-muted);
}

/* -------------------------
   Tag / badge / ranking
------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 82, 204, 0.14);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 82, 204, 0.12);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge,
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.badge-count {
  background: var(--primary-color);
  color: #fff;
}

.badge-new,
.badge-up {
  background: rgba(19, 168, 122, 0.14);
  color: #0d8f68;
}

.badge-drop,
.badge-down {
  background: rgba(217, 79, 61, 0.12);
  color: #c03b2c;
}

.badge-same {
  background: rgba(94, 108, 132, 0.12);
  color: var(--subtle-text-color);
}

.rank-detail {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  width: 100%;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.rank-detail-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--subtle-text-color);
  white-space: nowrap;
}

/* -------------------------
   Buttons
------------------------- */
.expand-btn {
  margin-top: 14px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  background: rgba(0, 82, 204, 0.08);
  color: var(--primary-dark);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.expand-btn:hover {
  background: rgba(0, 82, 204, 0.14);
}

.ref-toggle-btn {
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s;
}

.ref-toggle-btn:hover {
  opacity: 0.8;
}

.reset-btn {
  background: none;
  border: 1px solid var(--card-border-color);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--subtle-text-color);
  transition: all 0.15s ease;
}

.reset-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* -------------------------
   Method / mini cards
------------------------- */
.method-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 10px;
}

.mini-card {
  background: var(--soft-blue);
  padding: 15px;
  border-radius: 8px;
  font-size: 0.9rem;
}

.chip {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* -------------------------
   Reference panel
------------------------- */
.ref-panel {
  display: none;
  margin-top: 10px;
  padding: 12px;
  background: var(--card-background-color);
  border: 1px solid var(--card-border-color);
  border-radius: 6px;
}

.ref-panel.active {
  display: block;
}

.ref-panel img {
  max-width: 100%;
  margin-bottom: 8px;
}

.ref-panel a {
  color: var(--primary-color);
  text-decoration: underline;
}

/* -------------------------
   Charts / insights
------------------------- */
.chart-description {
  font-size: 0.9rem;
  color: var(--subtle-text-color);
  margin: 0 0 15px 0;
}

.chart-container {
  position: relative;
  width: 100%;
  height: 400px;
}

.violin-container {
  height: 640px;
}

.chart-panel {
  position: relative;
  min-height: 320px;
  padding: 10px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
  border: 1px solid rgba(0, 82, 204, 0.08);
}

.chart-panel canvas {
  width: 100% !important;
  height: 320px !important;
}

.chart-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chart-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  font-size: 0.84rem;
  color: var(--subtle-text-color);
}

.chart-meta-item--stat {
  gap: 10px;
}

.chart-meta-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex-shrink: 0;
}

.chart-meta-swatch--up { background: rgba(19, 168, 122, 0.85); }
.chart-meta-swatch--down { background: rgba(217, 79, 61, 0.82); }
.chart-meta-swatch--flat { background: rgba(94, 108, 132, 0.55); }

.chart-meta-key {
  color: var(--subtle-text-color);
  font-size: 0.82rem;
}

.chart-meta-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.insights-card {
  background: linear-gradient(180deg, #f9fbff 0%, #f4f8ff 100%);
}

.insights-compact {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 82, 204, 0.1);
}

.insight-line {
  position: relative;
  margin: 0;
  padding-left: 18px;
  font-size: 0.94rem;
  line-height: 1.45;
}

.insight-line::before {
  content: "•";
  position: absolute;
  top: 0;
  left: 0;
  color: var(--primary-color);
  font-weight: 800;
}

/* -------------------------
   Filters / metric toggles
------------------------- */
.filter-group {
  margin-bottom: 12px;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip,
.metric-btn {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--card-border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: #fff;
  color: var(--text-color);
  transition: all 0.15s ease;
  user-select: none;
}

.filter-chip {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 500;
}

.filter-chip:hover,
.metric-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-chip.active,
.metric-btn.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.metric-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-status {
  font-size: 0.8rem;
  color: var(--subtle-text-color);
  margin-left: 8px;
}

/* -------------------------
   Modal
------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 32, 38, 0.34);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-content {
  background: #fff;
  border-radius: 1.5rem;
  max-width: 960px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 36px 100px rgba(26, 30, 38, 0.28);
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-kicker {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  font-weight: 600;
  margin: 0 0 0.25rem 0;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
  line-height: 1.3;
}

.modal-close-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.modal-close-btn:hover {
  opacity: 0.85;
}

.modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.modal-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.modal-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: rgba(255,255,255,0.66);
}

.modal-images .no-image {
  grid-column: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 2/1;
  border: 1px dashed #cbd5e1;
  border-radius: 1rem;
  color: #94a3b8;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.45);
}

.modal-info {
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1.25rem;
}

.modal-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.modal-info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-color);
  font-weight: 600;
  margin: 0 0 0.35rem 0;
}

.modal-info-value,
.modal-info-price {
  font-weight: 600;
  color: var(--text-color);
  margin: 0;
}

.modal-info-value {
  font-size: 0.95rem;
}

.modal-info-price {
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.modal-info a.modal-link {
  display: inline-block;
  margin-top: 1rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  transition: opacity 0.15s;
}

.modal-info a.modal-link:hover {
  opacity: 0.85;
}

/* -------------------------
   Layout helpers
------------------------- */
.risers-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.subcard h4 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-color);
}

/* -------------------------
   Footer
------------------------- */
.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--subtle-text-color);
  border-top: 1px solid var(--border-color);
  opacity: 0.8;
}

/* -------------------------
   Responsive
------------------------- */
@media (max-width: 980px) {
  .report-header {
    flex-direction: column;
  }

  .report-header-side {
    width: 100%;
    justify-content: flex-start;
  }

  .grid-container,
  .risers-split {
    grid-template-columns: 1fr;
  }

  .grid-span-2 {
    grid-column: auto;
  }

  .method-box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .report-container,
  .details-container {
    padding: 18px;
    border-radius: 18px;
    margin-bottom: 20px;
  }

  .meta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .meta-pill {
    justify-content: space-between;
  }

  .toolbar-group {
    width: 100%;
    justify-content: stretch;
  }

  .toolbar-btn,
  .lang-btn {
    flex: 1;
    text-align: center;
  }

  .chart-container {
    height: 300px;
  }

  .violin-container {
    height: 400px;
  }

  .chart-panel {
    min-height: 280px;
    padding: 6px;
  }

  .chart-panel canvas {
    height: 280px !important;
  }

  .data-table thead {
    display: none;
  }

  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table tbody tr {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
  }

  .data-table tbody tr:last-child {
    border-bottom: 0;
  }

  .data-table td {
    border-bottom: 0;
    padding: 8px 0;
    display: grid;
    grid-template-columns: minmax(84px, 120px) minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--subtle-text-color);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .numeric-cell,
  .tag-cell {
    white-space: normal;
  }

  .tag-cell {
    display: block;
  }

  .product-preview,
  .floating-product-preview {
    display: none !important;
  }

  .modal-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .report-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .logo,
  .report-header .logo {
    margin-top: 12px;
    max-height: 50px;
  }

  .report-header h1 {
    font-size: 2rem;
  }

  .stat-block .value {
    font-size: 1.8rem;
  }

  .grid-item {
    padding: 15px;
  }

  .grid-item h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }

  .key-takeaways-box p,
  .recommendation-block li {
    font-size: 1rem;
    line-height: 1.6;
  }
}