/* ====================== PROFILE IDENTITY ====================== */

.profile-identity {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  margin: 10px 0 28px;
  padding: 22px 0 30px;
  border-bottom: 1px solid #242424;
  background: transparent;
}

.profile-identity-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-identity-avatar .avatar {
  margin: 0;
  border: 2px solid #303030;
  box-shadow: 0 0 0 5px #0b0b0b;
}

.profile-identity-info {
  min-width: 0;
}

.profile-identity-info h2 {
  margin: 0 0 18px;
  overflow: hidden;
  color: #fff;
  font-size: 27px;
  line-height: 1.08;
  font-weight: 1000;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
}

.profile-identity-subscription {
  display: grid;
  gap: 7px;
}

.profile-identity-subscription span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.profile-identity-subscription b {
  color: var(--lime);
  font-size: 17px;
  line-height: 1.1;
  font-weight: 1000;
}

@media (max-width: 420px) {
  .profile-identity {
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 18px;
    padding: 18px 0 25px;
  }

  .profile-identity-avatar .avatar {
    width: 98px !important;
    height: 98px !important;
  }

  .profile-identity-info h2 {
    margin-bottom: 14px;
    font-size: 23px;
  }

  .profile-identity-subscription b {
    font-size: 15px;
  }
}

/* ====================== WEIGHT EDGE-TO-EDGE HERO ====================== */

.weight-edge-hero {
  margin: 26px 0 38px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Верхняя статистика */

.weight-edge-header {
  display: grid;
  grid-template-columns:
    minmax(90px, 1.15fr)
    minmax(0, 2fr)
    44px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.weight-edge-current,
.weight-edge-stat {
  min-width: 0;
}

.weight-edge-current > span,
.weight-edge-stat > span {
  display: block;
  margin-bottom: 5px;
  overflow: hidden;
  color: #a1a6af;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.weight-edge-current strong {
  display: block;
  color: var(--lime);
  font-size: 34px;
  line-height: 0.95;
  font-weight: 1000;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.weight-edge-current strong small {
  font-size: 12px;
  letter-spacing: 0;
}

.weight-edge-stat b {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Статистика выбранного периода */

.weight-period-summary {
  min-width: 0;
}

.weight-period-summary-single {
  display: flex;
  align-items: center;
}

.weight-period-summary-single .weight-edge-stat {
  width: 100%;
  padding: 0;
  border: 0;
}

.weight-period-summary-single .weight-edge-stat > span {
  margin-bottom: 6px;
  font-size: 9px;
}

.weight-period-summary-single .weight-edge-stat b {
  color: var(--lime);
  font-size: 24px;
  line-height: 1;
}

.weight-period-summary-all {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.weight-period-summary-all .weight-edge-stat {
  min-width: 0;
  padding: 0 4px;
  border-right: 1px solid #202020;
}

.weight-period-summary-all .weight-edge-stat b {
  font-size: clamp(14px, 3.7vw, 19px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.weight-period-summary-all .weight-edge-stat:first-child {
  padding-left: 0;
}

.weight-period-summary-all .weight-edge-stat:last-child {
  padding-right: 0;
  border-right: 0;
}

.weight-period-summary-all .weight-edge-stat:nth-child(2) b {
  color: var(--lime);
}

.weight-period-summary-all .weight-edge-stat:nth-child(3) b {
  color: var(--red);
}

/* Кнопка добавления веса */

.weight-edge-add {
  position: relative;
  min-width: 0;
}

.weight-edge-add > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  list-style: none;
}

.weight-edge-add > summary::-webkit-details-marker {
  display: none;
}

.weight-edge-add > summary i {
  position: relative;
  width: 36px;
  height: 36px;
  display: block;
  border: 1.5px solid var(--lime);
  border-radius: 50%;
}

.weight-edge-add > summary i::before,
.weight-edge-add > summary i::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  border-radius: 2px;
  background: var(--lime);
  transform: translate(-50%, -50%);
}

.weight-edge-add > summary i::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.weight-edge-add[open] > summary i {
  transform: rotate(45deg);
}

.weight-edge-add > summary span {
  display: none;
}

.weight-edge-add[open]::before {
  content: "";
  position: fixed;
  z-index: 1199;
  inset: 0;
  background: var(--af-sheet-backdrop);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.weight-edge-form {
  position: fixed;
  z-index: 1200;
  top: 50%;
  left: 50%;
  bottom: auto;
  width: min(410px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: 0;
  padding: 38px 20px 16px;
  overflow-y: auto;
  border: 1px solid var(--af-sheet-border);
  border-radius: 34px;
  background: var(--af-sheet-bg);
  box-shadow: var(--af-sheet-shadow);
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}

.weight-edge-form::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 50%;
  width: 52px;
  height: 5px;
  border-radius: 999px;
  background: var(--af-sheet-handle);
  transform: translateX(-50%);
}

.weight-edge-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.weight-edge-form-head span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.weight-edge-form-head b {
  display: block;
  margin: 0;
  color: #fff;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 1000;
  letter-spacing: -.035em;
}

.weight-edge-form-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.weight-edge-form-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  width: 100%;
  min-width: 0;
}

.weight-edge-form-fields label {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.weight-edge-form-fields label > span {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
}

.weight-edge-form-fields .input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 64px;
  min-height: 64px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid #303236;
  border-radius: 24px;
  background: rgba(0, 0, 0, .12);
  color: #fff;

  font-size: 17px !important;
  box-sizing: border-box;
}

.weight-edge-form-fields input[type="number"] {
  padding-right: 52px;
  text-align: left;
  color: var(--lime);
  font-size: 24px !important;
  font-weight: 1000;
}

.weight-edge-input-wrap{position:relative;display:block}
.weight-edge-input-wrap>small{position:absolute;top:50%;right:18px;color:#9299a5;font-size:12px;font-weight:900;text-transform:uppercase;pointer-events:none;transform:translateY(-50%)}
.weight-edge-form>.af-sheet-date{margin-top:20px;margin-bottom:0}

.weight-edge-save {
  display: block;
  width: max-content;
  min-height: 44px;
  margin-top: 26px;
  margin-right: auto;
  margin-left: auto;
  padding: 10px 24px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--lime);
  font-size: 16px !important;
  font-weight: 900;
  cursor: pointer;
}

/* Маленькие переключатели периодов */

.weight-edge-periods {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 4px 0 10px;
}

.weight-edge-periods button {
  min-width: 0;
  min-height: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.weight-edge-periods button.active {
  color: var(--lime);
}

/* Свайпер */

.weight-edge-swiper {
  display: flex;
  width: calc(100% + 32px);
  margin-right: -16px;
  margin-left: -16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  touch-action: pan-x;
  -webkit-overflow-scrolling: touch;
}

.weight-edge-swiper::-webkit-scrollbar {
  display: none;
}

.weight-edge-swiper .weight-slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 0 16px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* График */

.weight-edge-chart {
  width: 100%;
  height: 285px;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  scrollbar-width: none;
}

.weight-edge-chart::-webkit-scrollbar {
  display: none;
}

.weight-edge-chart canvas {
  width: 100%;
  min-width: 100%;
  height: 100%;
  display: block;
}

/* Мобильная версия */

@media (max-width: 420px) {
  .weight-edge-header {
    grid-template-columns:
      minmax(82px, 1fr)
      minmax(0, 1.65fr)
      36px;
    gap: 7px;
  }

  .weight-edge-current > span,
  .weight-edge-stat > span {
    font-size: 7px;
  }

  .weight-edge-current strong {
    font-size: 27px;
  }

  .weight-edge-current strong small {
    font-size: 9px;
  }

  .weight-period-summary-single .weight-edge-stat b {
    font-size: 21px;
  }

  .weight-period-summary-all .weight-edge-stat {
    padding: 0 5px;
  }

  .weight-edge-add > summary i {
    width: 32px;
    height: 32px;
  }

  .weight-edge-chart {
    height: 256px;
  }

  .weight-edge-form {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    max-height: calc(100dvh - 28px);
    padding: 36px 16px 14px;
  }

  .weight-edge-form-head b {
    font-size: 24px;
  }

  .weight-edge-form-actions {
    gap: 7px;
  }

  .weight-edge-form-fields {
    gap: 18px;
  }

  .weight-edge-form-fields .input {
    height: 56px;
    min-height: 56px;
    border-radius: 20px;
  }
}

@media (min-width: 760px) {
  .weight-edge-header {
    grid-template-columns: minmax(90px, 1.15fr) minmax(0, 2fr) 52px;
  }

  .weight-edge-add,
  .weight-edge-add > summary {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .weight-edge-add {
    justify-self: end;
  }

  .weight-edge-add > summary i {
    width: 42px;
    height: 42px;
  }
}
