.study-design-table-wrapper {
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  padding: 80px 0 28px;
  overflow: visible;
}

.study-design-table-wrapper + .study-design-table-permission {
  width: 818px;
  max-width: 100%;
  margin: 0;
  margin-left: max(0px, calc((100% - 1286px) / 2));
}

#hibsago-baseline-demographics-table {
  width: 1286px;
  max-width: 100%;
  margin: 0;
  position: static;
  left: auto;
  transform: none;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: rgba(0, 0, 0, 0.7);
  background: #fff;
  font-family: Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 22px;
}

#hibsago-baseline-demographics-table * {
  box-sizing: border-box;
}

#hibsago-baseline-demographics-table .hibsago-table-title {
  width: 44.851%;
  padding: 4px 130px 0 0 !important;
  color: #39134b;
  background: #fff;
  font-family: Oswald, Arial, sans-serif;
  font-size: 21px;
  font-weight: 700;
  line-height: 32px;
  text-align: left;
  vertical-align: top;
}

#hibsago-baseline-demographics-table .hibsago-study-head {
  padding: 14px 8px;
  border-right: 2px solid #fff;
  background: #ff0058;
  color: #fff;
  font-family: Oswald, Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

#hibsago-baseline-demographics-table .hibsago-study-head-1 {
  border-radius: 24px 0 0 0;
}

#hibsago-baseline-demographics-table .hibsago-study-head-2 {
  border-right: 0;
  border-radius: 0 24px 0 0;
}

#hibsago-baseline-demographics-table .hibsago-column-head,
#hibsago-baseline-demographics-table tbody th,
#hibsago-baseline-demographics-table tbody td {
  height: 34px;
  padding: 7px 12px;
  border-right: 1px solid #b8d1dc;
  vertical-align: middle;
}

#hibsago-baseline-demographics-table .hibsago-column-head {
  color: #544f40;
  background: #fff;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

#hibsago-baseline-demographics-table tbody th {
  font-weight: 700;
  text-align: left;
}

#hibsago-baseline-demographics-table tbody td {
  text-align: center;
}

#hibsago-baseline-demographics-table tbody tr:nth-child(odd) th,
#hibsago-baseline-demographics-table tbody tr:nth-child(odd) td {
  background: #f2f0f2;
}

#hibsago-baseline-demographics-table tbody tr.hibsago-subrow th {
  padding-left: 34px;
  font-weight: 400;
}

#hibsago-baseline-demographics-table .hibsago-divider {
  border-right-width: 3px;
}

#hibsago-baseline-demographics-table .hibsago-last {
  border-right: 0;
}


#hibsago-baseline-demographics-table .hibsago-label-spacer { width: 44.851%; height: 52.97px; padding: 0; background: #FFFFFF; border: 0; }
#hibsago-baseline-demographics-table .hibsago-study-head { width: 27.574%; height: 58.86px; }
#hibsago-baseline-demographics-table .hibsago-column-head,
#hibsago-baseline-demographics-table tbody td { width: 13.787%; }
#hibsago-baseline-demographics-table tbody th { width: 44.851%; }

/* Study design mobile table — updated Figma structure. */
@media (max-width: 767px) {
  .study-design-table-wrapper + .study-design-table-permission {
    width: calc(100% + 12px);
    max-width: none;
    margin-left: -6px;
  }

  .study-design-table-wrapper {
    display: block !important;
    box-sizing: border-box;
    width: calc(100% + 40px) !important;
    max-width: none !important;
    margin-left: -20px;
    padding: 48px 8px;
    overflow: visible;
  }

  #hibsago-baseline-demographics-table {
    position: static !important;
    left: auto !important;
    transform: none !important;
    display: table;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    overflow: visible;
    color: rgba(0, 0, 0, 0.7);
    background: #fff;
    font-family: Roboto, Arial, sans-serif;
  }

  #hibsago-baseline-demographics-table thead,
  #hibsago-baseline-demographics-table tbody {
    display: table-row-group;
  }

  #hibsago-baseline-demographics-table thead tr:first-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #hibsago-baseline-demographics-table .hibsago-table-title {
    grid-column: 1 / -1;
    display: block;
    width: 100% !important;
    height: auto !important;
    min-height: 58px;
    padding: 8px 8px 7px !important;
    color: #39134b !important;
    background: #fff !important;
    font-family: Oswald, Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 24px !important;
    text-align: left !important;
    vertical-align: top !important;
    overflow-wrap: normal;
  }

  #hibsago-baseline-demographics-table .hibsago-study-head {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: 32px !important;
    padding: 4px 6px !important;
    border-right: 2px solid #fff !important;
    border-radius: 0 !important;
    background: #ff0058 !important;
    color: #fff !important;
    font-family: Oswald, Arial, sans-serif !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 24px !important;
    text-align: center !important;
  }

  #hibsago-baseline-demographics-table .hibsago-study-head-2 {
    border-right: 0 !important;
  }

  #hibsago-baseline-demographics-table thead tr:nth-child(2) {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #hibsago-baseline-demographics-table .hibsago-label-spacer {
    display: none !important;
  }

  #hibsago-baseline-demographics-table .hibsago-column-head {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: 44px !important;
    padding: 5px 2px !important;
    border-right: 1px solid #b8d1dc !important;
    border-bottom: 1px solid #b8d1dc !important;
    color: #544f40 !important;
    background: #fff !important;
    font-family: Roboto, Arial, sans-serif !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 16px !important;
    text-align: center !important;
  }

  #hibsago-baseline-demographics-table .hibsago-column-head.hibsago-divider {
    border-right-width: 3px !important;
  }

  #hibsago-baseline-demographics-table .hibsago-column-head.hibsago-last {
    border-right: 0 !important;
  }

  #hibsago-baseline-demographics-table tbody tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    background: #fff !important;
  }

  #hibsago-baseline-demographics-table tbody th {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-height: 32px;
    padding: 4px 6px !important;
    border: 0 !important;
    background: #39134b !important;
    color: #fff !important;
    font-family: Roboto, Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 24px !important;
    text-align: center !important;
    overflow-wrap: normal;
  }

  #hibsago-baseline-demographics-table tbody td {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 0;
    height: 44px !important;
    padding: 8px 2px !important;
    border-right: 1px solid #b8d1dc !important;
    border-bottom: 1px solid #b8d1dc !important;
    background: #fff !important;
    color: rgba(0, 0, 0, 0.7) !important;
    font-family: Roboto, Arial, sans-serif !important;
    font-size: 16px !important;
    font-weight: 400;
    line-height: 22px !important;
    text-align: center !important;
    white-space: nowrap;
  }

  #hibsago-baseline-demographics-table tbody td:first-of-type {
    border-left: 1px solid #b8d1dc !important;
  }

  #hibsago-baseline-demographics-table tbody td.hibsago-divider {
    border-right-width: 3px !important;
  }

  #hibsago-baseline-demographics-table tbody td.hibsago-last {
    border-right: 1px solid #b8d1dc !important;
  }

  #hibsago-baseline-demographics-table tbody tr.hibsago-group-row td:empty {
    display: none;
  }

  #hibsago-baseline-demographics-table tbody tr.hibsago-subrow th {
    padding: 4px 6px !important;
    background: #e8e6e6 !important;
    color: #544f40 !important;
    font-weight: 700 !important;
  }
}
/* End study design mobile table. */

/* Remove only the marked blank Race, HBsAg and Current NA cells on mobile. */
@media (max-width: 767px) {
  #hibsago-baseline-demographics-table tbody tr.hibsago-group-row:nth-child(3) > td,
  #hibsago-baseline-demographics-table tbody tr.hibsago-group-row:nth-child(13) > td,
  #hibsago-baseline-demographics-table tbody tr.hibsago-group-row:nth-child(16) > td {
    display: none !important;
  }
}


/* Match the final row heading to its table heading color. */
#hibsago-baseline-demographics-table tbody tr:last-child > th > span {
  color: inherit !important;
}
