/* -------------------------------------------------- */
/* RESET & BASE TYPOGRAPHY */
/* -------------------------------------------------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: #111111;
  line-height: 1.45;
}

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

a:hover {
  text-decoration: underline;
}

/* -------------------------------------------------- */
/* HEADER */
/* -------------------------------------------------- */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: #ffffff;
  border-bottom: 1px solid #eee;
  z-index: 10;
}

.logo img {
  height: 48px;
  width: auto;
}

nav {
  display: flex;
  gap: 24px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

main {
  padding-top: 96px;
  padding-left: 6vw;
  padding-right: 6vw;
}

h1 {
  font-size: 2.4rem;
  margin-bottom: 24px;
}

/* -------------------------------------------------- */
/* VISUALISATION CONTAINER */
/* -------------------------------------------------- */

.viz-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 20px;
  margin-top: 20px;
  padding-bottom: 40px;
}

/* -------------------------------------------------- */
/* LEFT SIDEBAR */
/* -------------------------------------------------- */

#firmList {
  border-right: 1px solid #ccc;
  padding-right: 10px;
}

#firmHeaders {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  font-size: 10px;
  margin-bottom: 10px;
  text-align: center;
}

.firm-item {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 8px;
  text-align: center;
}

.firm-item input[type="radio"],
.firm-item input[type="checkbox"] {
  transform: scale(0.9);
}

/* -------------------------------------------------- */
/* CHART AREA */
/* -------------------------------------------------- */

.chart-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0px;
  overflow-x: auto;
  padding-bottom: 20px;
}

/* Let each chart be a fixed-width flex item in the row */
.chart-row svg {
  flex: 0 0 auto; /* stay in one row, no stretching */
}

/* Chart styling */
.line-firm {
  stroke: #005EB8;
  stroke-width: 1.5;
  fill: none;
}

.area-others {
  fill: #d8d8d8;
}

.chart-title {
  font-size: 12px;
  font-weight: normal;
  text-anchor: middle;
}

/* -------------------------------------------------- */
/* INTERPRETATION BLOCK */
/* -------------------------------------------------- */

.interpretation-block {
  margin-top: 16px;
  padding: 12px 16px;
  background: #f5f8fc;
  border-left: 4px solid #005EB8;
}

.interpretation-text {
  font-weight: 600;
  margin-bottom: 4px;
}

.considerations-text {
  color: #333;
}

/* -------------------------------------------------- */
/* MOBILE RESPONSIVE */
/* -------------------------------------------------- */

@media (max-width: 600px) {

  /* Stack sidebar above charts */
  .viz-container {
    grid-template-columns: 1fr;
  }

  #firmList {
    border-right: none;
    border-bottom: 1px solid #ccc;
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  /* Keep charts in a single horizontal row */
  .chart-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
  }

  /* Scale charts down on mobile while keeping them in one row */
  .chart-row svg {
    flex: 0 0 22vw; /* ~5 charts across, scrollable */
  }

  .chart-title {
    font-size: 10px;
  }
}