.epfk-scale-wrap,
.epfk-scale-wrap * { box-sizing: border-box; }

.epfk-scale-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 18px 0 24px;
}

.epfk-scale {
  --epfk-end-x: 0%;
  --epfk-primary-x: 0%;
  width: 620px;
  max-width: 100%;
  font-family: var(--epfk-font, Inter, Arial, sans-serif);
  color: #111827;
  position: relative;
  padding-top: 58px;
  padding-bottom: 72px;
}

.epfk-info {
  position: absolute;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.15;
  font-weight: 800;
  white-space: nowrap;
}

.epfk-info-end {
  top: 0;
  left: clamp(6px, calc(var(--epfk-end-x) + 28px), calc(100% - 270px));
}

.epfk-info-primary {
  bottom: 0;
  right: clamp(6px, calc(100% - var(--epfk-primary-x) + 28px), calc(100% - 270px));
  align-items: flex-end;
  text-align: right;
}

.epfk-title { font-size: 14px; font-weight: 800; }
.epfk-measure { display: inline-flex; align-items: baseline; gap: 6px; }
.epfk-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e5e7eb;
  font-weight: 900;
}
.epfk-unit { font-size: 13px; font-weight: 800; }

.epfk-arrow {
  position: absolute;
  left: clamp(8px, var(--epfk-end-x), calc(100% - 8px));
  transform: translateX(-50%);
  width: 0;
  height: 0;
  z-index: 18;
}

.epfk-arrow-end { top: 30px; }
.epfk-arrow-primary { bottom: 38px; left: clamp(8px, var(--epfk-primary-x), calc(100% - 8px)); }

.epfk-arrow-end::before,
.epfk-arrow-primary::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 7px;
  height: 22px;
  background: #555;
  border-radius: 2px;
}

.epfk-arrow-end::before { top: 0; }
.epfk-arrow-primary::before { bottom: 0; }

.epfk-arrow-end::after,
.epfk-arrow-primary::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
}

.epfk-arrow-end::after {
  top: 20px;
  border-top: 16px solid #555;
}

.epfk-arrow-primary::after {
  bottom: 20px;
  border-bottom: 16px solid #555;
}

.epfk-bar {
  display: flex;
  width: 100%;
  height: 32px;
  overflow: hidden;
  border: 2px solid #111827;
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: #fff;
}

.epfk-seg {
  flex: var(--epfk-width, 1) 1 0;
  min-width: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 2px solid #111827;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.epfk-seg:last-child { border-right: 0; }
.epfk-seg.is-active {
  box-shadow: inset 0 0 0 3px #111827;
  font-size: 16px;
}

.epfk-axis {
  position: relative;
  width: 100%;
  height: 28px;
  margin: 5px 0;
}

.epfk-axis span {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.epfk-axis span:first-child { transform: translate(0, -50%); }
.epfk-axis span:last-child { transform: translate(-100%, -50%); }

.epfk-gradient {
  width: 100%;
  height: 30px;
  border: 2px solid #111827;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(90deg, #2fe332 0%, #79ea3d 15%, #b8e132 30%, #ece232 45%, #d9ab2d 65%, #d27a1c 82%, #d31111 100%);
}

@media (max-width: 768px) {
  .epfk-scale { padding-top: 70px; padding-bottom: 84px; }
  .epfk-info { white-space: normal; max-width: 70%; }
  .epfk-title { font-size: 12px; }
  .epfk-unit { font-size: 11px; }
  .epfk-bar, .epfk-seg { height: 26px; }
  .epfk-seg { font-size: 10px; border-right-width: 1px; }
  .epfk-seg.is-active { font-size: 12px; box-shadow: inset 0 0 0 2px #111827; }
  .epfk-axis span { font-size: 9px; }
}
