#jep-color-table-css,
#jep-color-table-css * {
  box-sizing: border-box;
}

#jep-color-table-css {
  --jep-blue: #040474;
  --jep-red: #ed1c24;
  --jep-text: #292929;
  --jep-line: #e5e7eb;
  --jep-info-bg: #f7f7f7;
  width: 100%;
  max-width: 1170px;
  margin: 0 auto;
  padding: 20px 15px 64px;
  color: var(--jep-text);
  font-family: Roboto, Arial, sans-serif;
}

.jep-tab-radio,
.jep-tone-radio {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.jep-color-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0 0 30px;
  border-bottom: 1px solid var(--jep-line);
}

.jep-color-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  margin: 0;
  padding: 10px 8px;
  border-bottom: 3px solid transparent;
  color: #555;
  text-align: center;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.jep-color-tab:hover {
  color: var(--jep-blue);
}

.jep-color-panel {
  display: none;
}

.jep-tab-off-white:checked ~ .jep-color-tabs label[for="jep-tab-off-white"],
.jep-tab-pastels:checked ~ .jep-color-tabs label[for="jep-tab-pastels"],
.jep-tab-neutral-natural:checked ~ .jep-color-tabs label[for="jep-tab-neutral-natural"],
.jep-tab-clear-bright:checked ~ .jep-color-tabs label[for="jep-tab-clear-bright"],
.jep-tab-soft-muted:checked ~ .jep-color-tabs label[for="jep-tab-soft-muted"],
.jep-tab-accents:checked ~ .jep-color-tabs label[for="jep-tab-accents"] {
  color: var(--jep-blue);
  border-bottom-color: var(--jep-red);
}

.jep-tab-off-white:checked ~ .jep-color-panels .jep-panel-off-white,
.jep-tab-pastels:checked ~ .jep-color-panels .jep-panel-pastels,
.jep-tab-neutral-natural:checked ~ .jep-color-panels .jep-panel-neutral-natural,
.jep-tab-clear-bright:checked ~ .jep-color-panels .jep-panel-clear-bright,
.jep-tab-soft-muted:checked ~ .jep-color-panels .jep-panel-soft-muted,
.jep-tab-accents:checked ~ .jep-color-panels .jep-panel-accents {
  display: block;
}

.jep-tab-off-white:focus-visible ~ .jep-color-tabs label[for="jep-tab-off-white"],
.jep-tab-pastels:focus-visible ~ .jep-color-tabs label[for="jep-tab-pastels"],
.jep-tab-neutral-natural:focus-visible ~ .jep-color-tabs label[for="jep-tab-neutral-natural"],
.jep-tab-clear-bright:focus-visible ~ .jep-color-tabs label[for="jep-tab-clear-bright"],
.jep-tab-soft-muted:focus-visible ~ .jep-color-tabs label[for="jep-tab-soft-muted"],
.jep-tab-accents:focus-visible ~ .jep-color-tabs label[for="jep-tab-accents"] {
  outline: 3px solid rgba(4, 4, 116, .22);
  outline-offset: -3px;
}

.jep-color-category-title {
  margin: 0 0 20px;
  color: var(--jep-blue);
  text-align: center;
  font-size: clamp(26px, 3vw, 35px);
  line-height: 1.25;
  font-weight: 500;
  text-transform: uppercase;
}

.jep-tone-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  margin: 0 0 34px;
}

.jep-tone-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin: 0;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #d9d9d9;
  color: #555;
  font-size: 10px;
  line-height: 1.1;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.jep-tone-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px rgba(4, 4, 116, .42);
}

.jep-tone-all {
  background: #fff;
}

.jep-tone-radio:focus-visible ~ .jep-tone-list .jep-tone-button {
  outline: none;
}

.jep-tone-all-radio:checked ~ .jep-tone-list .jep-tone-all,
.jep-tone-radio:nth-of-type(2):checked ~ .jep-tone-list .jep-tone-button:nth-child(2),
.jep-tone-radio:nth-of-type(3):checked ~ .jep-tone-list .jep-tone-button:nth-child(3),
.jep-tone-radio:nth-of-type(4):checked ~ .jep-tone-list .jep-tone-button:nth-child(4),
.jep-tone-radio:nth-of-type(5):checked ~ .jep-tone-list .jep-tone-button:nth-child(5),
.jep-tone-radio:nth-of-type(6):checked ~ .jep-tone-list .jep-tone-button:nth-child(6),
.jep-tone-radio:nth-of-type(7):checked ~ .jep-tone-list .jep-tone-button:nth-child(7),
.jep-tone-radio:nth-of-type(8):checked ~ .jep-tone-list .jep-tone-button:nth-child(8),
.jep-tone-radio:nth-of-type(9):checked ~ .jep-tone-list .jep-tone-button:nth-child(9),
.jep-tone-radio:nth-of-type(10):checked ~ .jep-tone-list .jep-tone-button:nth-child(10),
.jep-tone-radio:nth-of-type(11):checked ~ .jep-tone-list .jep-tone-button:nth-child(11),
.jep-tone-radio:nth-of-type(12):checked ~ .jep-tone-list .jep-tone-button:nth-child(12),
.jep-tone-radio:nth-of-type(13):checked ~ .jep-tone-list .jep-tone-button:nth-child(13),
.jep-tone-radio:nth-of-type(14):checked ~ .jep-tone-list .jep-tone-button:nth-child(14) {
  box-shadow: 0 0 0 3px var(--jep-blue);
}

.jep-tone-radio:not(.jep-tone-all-radio):checked ~ .jep-color-grid .jep-color-card {
  display: none;
}

.jep-color-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  background: transparent;
}

.jep-color-card {
  position: relative;
  min-width: 0;
  min-height: 172px;
  margin: 0;
  padding: 105px 10px 14px;
  overflow: hidden;
  background: var(--jep-info-bg);
  color: #1f1f1f;
  text-align: center;
}

.jep-color-swatch {
  display: block !important;
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 92px;
  opacity: 1 !important;
}

.jep-color-code,
.jep-color-name {
  display: block;
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.jep-color-code {
  font-size: 14px;
  font-weight: 700;
}

.jep-color-name {
  margin-top: 5px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 400;
}

.jep-color-error {
  padding: 18px;
  border: 1px solid #f1b6b9;
  background: #fff3f3;
  color: #8f1017;
}

@media (max-width: 849px) {
  #jep-color-table-css {
    padding: 18px 12px 50px;
  }

  .jep-color-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--jep-line);
    border-left: 1px solid var(--jep-line);
  }

  .jep-color-tab {
    min-height: 52px;
    border-right: 1px solid var(--jep-line);
    border-bottom: 1px solid var(--jep-line);
    font-size: 12px;
  }

  .jep-tab-off-white:checked ~ .jep-color-tabs label[for="jep-tab-off-white"],
  .jep-tab-pastels:checked ~ .jep-color-tabs label[for="jep-tab-pastels"],
  .jep-tab-neutral-natural:checked ~ .jep-color-tabs label[for="jep-tab-neutral-natural"],
  .jep-tab-clear-bright:checked ~ .jep-color-tabs label[for="jep-tab-clear-bright"],
  .jep-tab-soft-muted:checked ~ .jep-color-tabs label[for="jep-tab-soft-muted"],
  .jep-tab-accents:checked ~ .jep-color-tabs label[for="jep-tab-accents"] {
    color: #fff;
    border-bottom-color: var(--jep-blue);
    background: var(--jep-blue);
  }

  .jep-color-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .jep-tone-list {
    gap: 11px;
    margin-bottom: 28px;
  }

  .jep-tone-button {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 479px) {
  .jep-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jep-color-card {
    min-height: 160px;
    padding-top: 96px;
  }

  .jep-color-swatch {
    height: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .jep-color-tab,
  .jep-tone-button {
    transition: none;
  }
}
