.home-epi {
  position: relative;
  z-index: 1;
  background-color: #031527;
}

.home-epi__sheet {
  padding: 100px 0 43px;
  background-color: #ffffff;
}

.home-epi__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 64px;
}

.home-epi__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 100%;
  text-align: center;
}

.home-epi__eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 500;
  line-height: 130%;
  color: #031527;
}

.home-epi__eyebrow > span:last-child {
  opacity: 0.9;
}

.home-epi__heading {
  max-width: 862px;
  margin: 0;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  color: #031527;
}

.home-epi__heading .accent {
  display: block;
}

.home-epi__intro {
  max-width: 1124px;
  margin: 0;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: #031527bf;
}

/* ---------- Workspace card ---------- */

.home-epi__workspace {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  padding: 24px 24px 32px;
  border: 1px solid #e9e9e9;
  border-radius: 32px;
  background-color: #ffffff;
}

.home-epi__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-epi__workspace > .home-epi__bar {
  margin-bottom: 20px;
}

.home-epi__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.home-epi__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background-color: #0072ff;
  font-size: 18px;
  font-weight: 700;
  line-height: 140%;
  color: #ffffff;
}

.home-epi__bar-title {
  margin: 0;
  font-size: 24px;
  line-height: 140%;
  color: #031527;
}

.home-epi__bar-meta {
  margin: 0;
  font-family: var(--font-base);
  font-size: 14px;
  font-weight: 400;
  line-height: 180%;
  letter-spacing: 0;
  color: #031527bf;
}

/* ---------- Tabs + filters ---------- */

.home-epi__controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.home-epi__tabs {
  display: flex;
  gap: 12px;
}

.home-epi__tab {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 82px;
  padding: 14px 16px;
  border-radius: 24px;
  background-color: #f7f7f6;
  text-align: center;
}

.home-epi__tab-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #031527;
}

.home-epi__tab-range {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  color: #031527bf;
}

.home-epi__tab.is-active {
  background-color: #0072ff;
}

.home-epi__tab.is-active .home-epi__tab-name,
.home-epi__tab.is-active .home-epi__tab-range {
  color: #ffffff;
}

.home-epi__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background-color: #f7f7f6;
}

.home-epi__filters-label {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  color: #031527;
}

.home-epi__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.home-epi__chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #0315271f;
  border-radius: 100px;
  background-color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.8;
  color: #031527;
  white-space: nowrap;
}

/* ---------- Stat cards ---------- */
.home-epi__stats {
  display: flex;
  gap: 16px;
}

.home-epi__stat {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
  padding: 16px 24px 24px;
  border: 1px solid #e9e9e9;
  border-radius: 32px;
  background-color: #ffffff;
}

.home-epi__stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: #ffd367;
}

.home-epi__stat-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.home-epi__stat-value {
  margin: 0;
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: #031527;
}

.home-epi__stat-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  color: #161c2d;
}

/* ---------- Rankings table ---------- */

.home-epi__rank {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 16px;
}

.home-epi__rank-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.home-epi__rank-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: #031527;
}

.home-epi__rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 100px;
  background-color: #f7f7f6;
  font-size: 14px;
  line-height: 1.8;
  color: #0072ff;
}

.home-epi__table {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background-color: #ffffff;
}

.home-epi__table::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid #e9e9e9;
  border-radius: 24px;
  pointer-events: none;
}

/* Column widths: Rank | Brand | Units | Net New | Standing | Main Drivers */
.home-epi__tr {
  display: grid;
  grid-template-columns: 56px minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 2.8fr) minmax(0, 3.3fr);
  align-items: center;
  min-height: 64px;
}

.home-epi__tr--head {
  min-height: 54px;
  background-color: #f7f7f6;
}

.home-epi__tbody .home-epi__tr:nth-child(odd) {
  background-color: #f7f7f6;
}

.home-epi__th,
.home-epi__td {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: #031527;
}

.home-epi__th {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}

.home-epi__th:first-child,
.home-epi__td:first-child {
  padding-left: 16px;
}

.home-epi__group {
  padding: 4px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #0072ff;
}

.home-epi__td--brand {
  flex-direction: column;
  align-items: flex-start;
  font-weight: 500;
  gap: 2px;
}

.home-epi__brand-parent {
  font-size: 12px;
  color: #031527bf;
}

.home-epi__withheld {
  display: block;
  width: 120px;
  height: 8px;
  border-radius: 149px;
  background-color: #ebecee;
}

.home-epi__td--standing {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding-right: 32px;
}

.home-epi__progress {
  display: block;
  height: 6px;
  border: 0.5px solid #b8b8b8;
  overflow: hidden;
  border-radius: 100px;
  background-color: #f7f7f6;
}

.home-epi__progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background-color: #0072ff;
}

.home-epi__standing-text {
  font-size: 11px;
  line-height: 2;
  font-weight: 500;
  color: #031527;
}

.home-epi__standing-text strong {
  font-weight: 500;
  color: #031527;
}

.home-epi__td--drivers {
  flex-wrap: wrap;
  gap: 6px;
}

.home-epi__tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.home-epi__tag.is-blue {
  background-color: #0072ff1f;
  color: #0072ff;
}

.home-epi__tag.is-orange {
  background-color: #e880001f;
  color: #e88000;
}

.home-epi__tag.is-green {
  background-color: #03b2001f;
  color: #007e13;
}

.home-epi__caption {
  margin: 0;
  font-size: 12px;
  line-height: 180%;
  color: #03152799;
}

/* ---------- Footnotes + actions ---------- */

.home-epi__footnotes {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: -8px;
}

.home-epi__footnote {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 150%;
  color: #031527bf;
}

.home-epi__actions {
  margin-top: -16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
  .home-epi__heading {
    font-size: 40px;
  }

  .home-epi__stats {
    flex-wrap: wrap;
  }

  .home-epi__stat {
    flex: 1 1 calc(50% - 8px);
  }

  .home-epi__tr {
    grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 2.4fr) minmax(0, 2.6fr);
  }

  .home-epi__td--standing {
    padding-right: 12px;
  }
}

/* ---------- Mobile: table becomes cards ---------- */

@media (max-width: 767px) {
  .home-epi__sheet {
    padding: 64px 0;
  }

  .home-epi__inner {
    gap: 40px;
  }

  .home-epi__heading {
    font-size: 32px;
  }

  .home-epi__intro br {
    display: none;
  }

  .home-epi__workspace {
    gap: 24px;
    padding: 16px;
    border-radius: 24px;
  }

  .home-epi__bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .home-epi__tabs {
    gap: 8px;
  }

  .home-epi__tab {
    min-height: 64px;
    padding: 8px;
  }

  .home-epi__tab-name {
    font-size: 14px;
  }

  .home-epi__tab-range {
    font-size: 12px;
  }

  .home-epi__stat {
    flex-basis: 100%;
  }

  .home-epi__stat-value {
    font-size: 40px;
  }

  .home-epi__rank {
    margin-top: 0;
  }

  .home-epi__table {
    overflow: visible;
    border-radius: 0;
    background-color: transparent;
  }

  .home-epi__table::after {
    display: none;
  }

  .home-epi__tr--head {
    display: none;
  }

  .home-epi__group {
    padding: 0 0 8px;
  }

  .home-epi__tr,
  .home-epi__tbody .home-epi__tr:nth-child(odd) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid #e9e9e9;
    border-radius: 20px;
    background-color: #ffffff;
  }

  .home-epi__td,
  .home-epi__td:first-child {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 0;
  }

  .home-epi__td::before {
    content: attr(data-label);
    font-size: 12px;
    line-height: 1.4;
    color: rgba(3, 21, 39, 0.6);
  }

  .home-epi__td--brand,
  .home-epi__td--standing,
  .home-epi__td--drivers {
    grid-column: 1 / -1;
  }

  .home-epi__td--brand::before {
    display: none;
  }

  .home-epi__td--standing {
    align-items: stretch;
  }

  .home-epi__td--drivers {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .home-epi__td--drivers::before {
    flex-basis: 100%;
  }

  .home-epi__brand-name {
    font-weight: 600;
  }
}
