.weight-page {
  max-width: 790px;
  padding-bottom: 18px;
  --weight-surface: #ffffff;
  --weight-border: #eceef1;
  --weight-radius: 16px;
  --weight-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 2px 6px rgba(15, 23, 42, 0.03);
  --weight-accent: #22c55e;
  --weight-accent-soft: #f0fdf4;
  --weight-accent-dark: #16a34a;
  --weight-success: #059669;
  --weight-danger: #dc2626;
}

.weight-page-head {
  margin: 0 0 16px;
}

/* 08.06.2026: было .weight-page h1.weight-page__title — стили перенесены в template-parts/calorazh-page-title.css */

@media (max-width: 991px) {
  .weight-page {
    max-width: 100%;
  }
}

.weight-date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 16px;
}

.weight-date-nav__btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid #e3e7ed;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.weight-date-nav__btn:hover:not(:disabled) {
  border-color: #86efac;
  color: var(--weight-accent-dark);
  background: var(--weight-accent-soft);
}

.weight-date-nav__btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.weight-date-nav__current {
  min-width: 0;
  flex: 1 1 auto;
  text-align: center;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 600;
  color: #1f2937;
}

.weight-app__loading {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 15px;
}

.weight-notice {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.weight-notice--error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.weight-streak {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: var(--weight-radius, 14px);
  background: #f8fafc;
  border: 1px solid var(--weight-border, #e7ebf0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.weight-streak__flame {
  font-size: 18px;
  line-height: 1;
}

.weight-streak__text {
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  color: #374151;
}

.weight-streak__text strong {
  font-size: inherit;
  font-weight: 700;
  color: #111827;
}

.weight-panel {
  margin-bottom: 14px;
  border: 1px solid var(--weight-border);
  border-radius: var(--weight-radius);
  background: var(--weight-surface);
  box-shadow: var(--weight-shadow);
}

.weight-panel__result {
  text-align: center;
  padding: 20px 18px 16px;
}

.weight-panel__value {
  font-size: 48px;
  line-height: 1.05;
  font-weight: 800;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.weight-panel__unit {
  font-size: 20px;
  font-weight: 600;
  color: #6b7280;
  margin-left: 4px;
}

.weight-panel__delta {
  margin-top: 10px;
  font-size: 14px;
}

.weight-panel__goal {
  padding: 12px 18px 0;
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  color: #64748b;
}

.weight-panel__goal--setup {
  padding-bottom: 4px;
  font-size: 13px;
  color: #94a3b8;
}

.weight-panel__goal-target strong {
  font-weight: 700;
  color: #374151;
}

.weight-panel__goal-progress {
  margin: 4px 0 0;
  padding: 0 18px 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--weight-accent-dark);
}

.weight-panel__goal-link {
  color: var(--weight-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.weight-panel__goal-setup-label {
  margin: 0 0 4px;
  font-size: 14px;
  color: #64748b;
}

.weight-panel__goal--setup {
  padding-bottom: 14px;
}

.weight-goal-setup__btn {
  display: inline-block;
  margin-top: 10px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--weight-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}

.weight-goal-setup__btn:hover {
  background: var(--weight-accent-dark);
  color: #fff;
  transform: translateY(-1px);
}

.weight-panel--empty .weight-panel__empty {
  margin: 0;
  padding: 8px 18px 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: #94a3b8;
}

.weight-panel__form {
  padding: 16px 18px 18px;
}

.weight-panel__form--edit {
  padding-top: 0;
  border-top: 1px solid #f1f5f9;
}

.weight-panel--empty .weight-panel__form {
  padding-top: 0;
}

.weight-panel--empty .weight-form__input {
  font-size: 32px;
  height: 56px;
}

.weight-delta--down {
  color: var(--weight-success);
  font-weight: 600;
}

.weight-delta--up {
  color: var(--weight-danger);
  font-weight: 600;
}

.weight-delta--neutral {
  color: #64748b;
}

.weight-form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.weight-form__input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.weight-form__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  padding: 0 14px;
  border: 2px solid #e5e7eb;
  border-radius: 14px;
  font-size: 28px;
  font-weight: 700;
  text-align: center;
  color: #111827;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.weight-form__input::placeholder {
  color: #c5cdd8;
  font-weight: 500;
  opacity: 1;
}

.weight-panel--empty .weight-form__input::placeholder {
  color: #d1d9e3;
  font-weight: 500;
}

.weight-form__input:focus {
  outline: none;
  border-color: #86efac;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.weight-form__adj {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid #e3e7ed;
  border-radius: 14px;
  background: #f9fafb;
  color: #334155;
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.weight-form__adj:hover {
  border-color: #86efac;
  background: var(--weight-accent-soft);
  color: var(--weight-accent-dark);
}

.weight-form__adj:active {
  transform: scale(0.96);
}

.weight-form__unit {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 600;
  color: #6b7280;
}

.weight-form__save {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 999px;
  background: var(--weight-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.weight-form__save:hover:not(:disabled) {
  background: var(--weight-accent-dark);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
  transform: translateY(-1px);
}

.weight-form__save:disabled {
  opacity: 0.65;
  cursor: wait;
}

.weight-form__delete {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.weight-form__delete:hover {
  color: #dc2626;
}

.weight-form__delete:focus,
.weight-form__delete:focus-visible,
.weight-form__delete:active {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.weight-form__future {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  text-align: center;
}

.weight-badges {
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--weight-border);
  border-radius: var(--weight-radius);
  background: var(--weight-surface);
  box-shadow: var(--weight-shadow);
}

.weight-badges__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  margin-bottom: 10px;
}

.weight-badges__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 520px) {
  .weight-badges__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.weight-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 35px;
  padding: 10px 10px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  opacity: 0.72;
  filter: grayscale(0.4);
  transition: opacity 0.2s ease, filter 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.weight-badge--unlocked {
  opacity: 1;
  filter: none;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.weight-badge__icon {
  flex: 0 0 auto;
  font-size: 16px;
  line-height: 1;
  color: #9ca3af;
}

.weight-badge--unlocked .weight-badge__icon {
  color: #d97706;
}

.weight-badge__label {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 600;
  color: #374151;
}

.weight-app--celebrate .weight-panel {
  animation: weight-celebrate 0.9s ease;
}

.weight-app--celebrate .weight-form__save {
  animation: weight-save-pop 0.5s ease;
}

@keyframes weight-celebrate {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.02);
    box-shadow: 0 8px 28px rgba(34, 197, 94, 0.18);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes weight-save-pop {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

.weight-guest__banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--weight-border);
  border-radius: var(--weight-radius);
  background: var(--weight-surface);
  box-shadow: var(--weight-shadow);
}

.weight-guest__banner-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.weight-guest__banner-actions {
  flex: 0 0 auto;
}

.weight-guest__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none !important;
}

.weight-guest__btn--primary {
  background: var(--weight-accent);
  border: 1px solid var(--weight-accent);
  color: #fff !important;
}

.weight-guest__btn--primary:hover {
  background: var(--weight-accent-dark);
  border-color: var(--weight-accent-dark);
  color: #fff !important;
}

.weight-guest__preview .weight-app--demo {
  pointer-events: none;
  user-select: none;
}

.weight-guest__preview .weight-form__save,
.weight-guest__preview .weight-form__save--guest-demo,
.weight-guest__preview .weight-form__save:disabled {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #9ca3af;
  font-weight: 600;
  opacity: 1;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* CTA внизу — [tracker_links], стили в tracker-links.css */
.weight-page .water-page-links.weight-page-links {
  margin-top: 20px;
  margin-bottom: 24px;
}

.weight-page-content {
  max-width: 790px;
  margin: 0;
}

.weight-page-content.entry-content {
  font-size: 15px;
  line-height: 1.55;
  color: #374151;
}

/* Реклама [ads-pc-2][ads-mob-2] в начале блока — воздух до вкладок */
.weight-page-content > * + .ubox-tabs {
  margin-top: 24px;
}

.weight-page-content .ubox-tabs:first-child {
  margin-top: 0;
}

.weight-page-content .ubox {
  margin-bottom: 16px;
}

.weight-page-content .ubox:last-child {
  margin-bottom: 0;
}

.weight-page-content .calorazh-profile-link-wrap--btn {
  margin-top: 4px;
  margin-bottom: 0;
}

.weight-page-content .ubox-tabs {
  margin-bottom: 16px;
}

.weight-app .calorazh-days {
  margin-bottom: 14px;
}

@media (max-width: 480px) {
  .weight-panel__value {
    font-size: 40px;
  }

  .weight-form__adj {
    width: 44px;
    height: 48px;
    font-size: 22px;
  }

  .weight-form__input {
    height: 48px;
    font-size: 24px;
  }
}

/* Подтверждение удаления записи (прокрутка — modal-scroll-lock.js) */

.weight-modal {
  --weight-accent: #22c55e;
  --weight-accent-dark: #16a34a;
  --weight-danger-soft: #fef2f2;
  --weight-danger-border: #fecaca;
  --weight-danger-text: #dc2626;
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  visibility: hidden;
  pointer-events: none;
}

.weight-modal.is-open {
  visibility: visible;
  pointer-events: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.weight-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.weight-modal.is-open .weight-modal__backdrop {
  opacity: 1;
}

.weight-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 22px 20px 18px;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--weight-border);
  border-radius: 20px;
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.06),
    0 20px 48px rgba(15, 23, 42, 0.12);
  transform: scale(0.96) translateY(8px);
  opacity: 1;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.weight-modal.is-open .weight-modal__dialog {
  transform: scale(1) translateY(0);
}

.weight-modal__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--weight-danger-soft);
  color: var(--weight-danger-text);
}

.weight-modal__dialog .weight-modal__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: #1f2937 !important;
}

.weight-modal__dialog .weight-modal__value {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: #111827 !important;
  letter-spacing: -0.02em;
}

.weight-modal__hint {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.4;
  color: #94a3b8 !important;
}

.weight-modal__message {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
  color: #64748b !important;
}

.weight-modal__icon--gentle {
  background: #f0fdf4;
  color: #22c55e;
}

.weight-modal__icon--error {
  background: #fdf2f8;
  color: #e879a9;
}

.weight-modal--notice .weight-modal__dialog {
  padding-top: 24px;
}

.weight-modal--notice .weight-modal__title {
  color: #334155 !important;
}

.weight-modal--notice .weight-modal__message {
  color: #475569 !important;
  font-size: 15px;
  line-height: 1.5;
}

.weight-modal__hint--notice {
  margin: -6px 0 18px;
  font-size: 13px;
  line-height: 1.45;
  color: #94a3b8 !important;
}

.weight-modal__actions {
  display: grid;
  gap: 8px;
}

.weight-modal__btn {
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.weight-modal__btn--primary {
  background: var(--weight-accent) !important;
  border-color: var(--weight-accent) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.22);
}

.weight-modal__btn--primary:hover {
  background: var(--weight-accent-dark) !important;
  border-color: var(--weight-accent-dark) !important;
  color: #ffffff !important;
}

.weight-modal__btn--danger {
  background: #ffffff !important;
  color: var(--weight-danger-text) !important;
  border-color: var(--weight-danger-border) !important;
  font-weight: 600;
  box-shadow: none;
}

.weight-modal__btn--danger:hover:not(:disabled) {
  background: var(--weight-danger-soft) !important;
  border-color: #fca5a5 !important;
  color: #b91c1c !important;
}

.weight-modal__btn--danger:disabled {
  opacity: 0.55;
  cursor: wait;
}
