.lpe-widget {
  --lpe-divider-position: 100%;
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.lpe-empty {
  padding: 16px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.lpe-title {
  margin-bottom: 12px;
}

.lpe-body,
.lpe-progress-block,
.lpe-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lpe-track-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lpe-track {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 100%;
  min-height: 36px;
  background: #e5e7eb;
}

.lpe-fill {
  position: absolute;
  left: 0;
  top: 0;
  transition: width .9s ease, height .9s ease;
  will-change: width, height;
}

.lpe-fill-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lpe-fill-primary { z-index: 1; }
.lpe-fill-overflow { z-index: 2; }

.lpe-layout-horizontal .lpe-fill,
.lpe-layout-compact .lpe-fill {
  height: 100%;
}

.lpe-layout-horizontal .lpe-fill-overflow,
.lpe-layout-compact .lpe-fill-overflow {
  left: auto;
  right: 0;
}

.lpe-layout-compact .lpe-track {
  min-height: 28px;
}

.lpe-layout-compact .lpe-meta {
  gap: 4px;
}

.lpe-layout-vertical .lpe-progress-block {
  flex-direction: row;
  align-items: flex-end;
  gap: 16px;
}

.lpe-layout-vertical .lpe-vertical-wrap {
  height: 220px;
  display: flex;
  align-items: stretch;
}

.lpe-layout-vertical .lpe-track-wrap {
  align-items: center;
}

.lpe-layout-vertical .lpe-track {
  width: 36px;
  height: 220px;
  min-width: 36px;
  min-height: 220px;
}

.lpe-layout-vertical .lpe-fill {
  width: 100%;
  top: auto;
  bottom: 0;
}

.lpe-layout-vertical .lpe-fill-overflow {
  top: 0;
  bottom: auto;
}

.lpe-marker {
  position: absolute;
  z-index: 4;
  opacity: .95;
}

.lpe-layout-horizontal .lpe-marker,
.lpe-layout-compact .lpe-marker {
  top: 0;
  bottom: 0;
  width: 2px;
  left: calc(var(--lpe-divider-position) - 1px);
}

.lpe-layout-vertical .lpe-marker {
  left: 0;
  right: 0;
  height: 2px;
  top: calc(100% - var(--lpe-divider-position));
}

.lpe-percent {
  font-weight: 700;
  word-break: break-word;
}

.lpe-percent-inside {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #ffffff;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

.lpe-fill-primary > .lpe-percent-inside {
  position: absolute;
  inset: 0;
}

.lpe-percent-outside {
  color: #111827;
}

.lpe-layout-vertical .lpe-percent-outside {
  text-align: center;
}

.lpe-percent.is-overflow {
  font-weight: 700;
}

.lpe-current,
.lpe-target {
  display: flex;
  gap: 6px;
  align-items: baseline;
  flex-wrap: nowrap;
}

.lpe-layout-horizontal .lpe-meta,
.lpe-layout-compact .lpe-meta {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.lpe-layout-horizontal .lpe-current,
.lpe-layout-horizontal .lpe-target,
.lpe-layout-compact .lpe-current,
.lpe-layout-compact .lpe-target {
  min-width: 0;
}

.lpe-layout-horizontal .lpe-target,
.lpe-layout-compact .lpe-target {
  justify-content: flex-end;
  text-align: right;
  margin-left: auto;
}

.lpe-current-label,
.lpe-target-label {
  font-weight: 600;
}

.lpe-ring-wrap {
  display: flex;
  justify-content: center;
}

.lpe-ring {
  position: relative;
  width: 160px;
  height: 160px;
}

.lpe-ring-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.lpe-ring-track,
.lpe-ring-progress {
  transition: stroke-dashoffset .9s ease;
  transform-origin: 50% 50%;
}

.lpe-ring-progress {
  will-change: stroke-dashoffset;
}

.lpe-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 18px;
}

.lpe-layout-horizontal .lpe-track-wrap,
.lpe-layout-compact .lpe-track-wrap {
  gap: 10px;
}


.lpe-meta {
  width: 100%;
}

.lpe-layout-horizontal .lpe-meta,
.lpe-layout-compact .lpe-meta {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lpe-layout-horizontal .lpe-current,
.lpe-layout-horizontal .lpe-target,
.lpe-layout-compact .lpe-current,
.lpe-layout-compact .lpe-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.lpe-layout-horizontal .lpe-target,
.lpe-layout-compact .lpe-target {
  margin-left: auto;
  text-align: right;
}

.lpe-track {
  display: block;
}

.lpe-percent {
  position: relative;
  z-index: 4;
  font-weight: 700;
  line-height: 1;
}

.lpe-percent-inside {
  color: #fff;
  width: 100%;
  text-align: center;
  padding: 0 8px;
  white-space: nowrap;
}

.lpe-percent-track-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  pointer-events: none;
}

.lpe-percent-outside {
  margin-top: 6px;
}

.lpe-layout-horizontal .lpe-fill-primary,
.lpe-layout-compact .lpe-fill-primary {
  min-width: 0;
}

/*
 * Отметка 100% на горизонтальной шкале имеет смысл только при overflow
 * (percent > 100, класс .lpe-has-overflow на .lpe-widget) — иначе шкала
 * выглядит как обычный единый progress bar. vertical/compact не трогаем.
 */
.lpe-layout-horizontal .lpe-marker {
  display: none;
}

.lpe-layout-horizontal.lpe-has-overflow .lpe-marker {
  display: block;
}
