.profile-page {
  max-width: 790px;
  padding-bottom: 18px;
  --profile-surface: #ffffff;
  --profile-border: #eceef1;
  --profile-radius: 16px;
  --profile-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 2px 6px rgba(15, 23, 42, 0.03);
  --profile-input-fill: #f7fcf9;
  --profile-input-fill-hover: #f2faf5;
  --profile-input-fill-focus: #ffffff;
  --profile-input-border: #dcefe3;
  --profile-input-border-hover: #b8dcc4;
  --profile-input-inset: inset 0 1px 2px rgba(22, 101, 52, 0.04);
  --profile-input-focus-border: #9fd4b0;
}

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

.profile-page h1.profile-page__title {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
  color: #1f2937;
  font-weight: 700;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  letter-spacing: normal;
}

.profile-page__lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: #64748b;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-form__lead {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.45;
  color: #475569;
}

/* 02.06.2026: блок кнопки «Сохранить» — начало */
.profile-form__actions {
  margin-top: 2px;
}

.profile-form__actions .profile-btn--primary {
  width: 100%;
  border: 1px solid #16a34a !important;
}

.profile-form__actions .profile-btn--primary:focus,
.profile-form__actions .profile-btn--primary:focus-visible,
.profile-form__actions .profile-btn--primary:active {
  border-color: #15803d !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.28) !important;
}

.profile-form__actions .profile-btn--primary.profile-btn--pending {
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22);
}

@media (min-width: 992px) {
  .profile-form__actions {
    display: flex;
    justify-content: center;
  }

  .profile-form__actions .profile-btn--primary {
    width: 50%;
    max-width: 360px;
  }
}
/* 02.06.2026: блок кнопки «Сохранить» — конец */

.profile-card {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--profile-border);
  border-radius: var(--profile-radius);
  background: var(--profile-surface);
  box-shadow: var(--profile-shadow);
}

.profile-card--tz {
  padding-bottom: 14px;
}

.profile-card__title {
  padding: 0;
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.profile-card__hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
}

.profile-card--tz .profile-card__hint {
  margin-bottom: 10px;
}

.profile-card__actions-inline {
  margin: 12px 0 0;
}

.profile-card__calc-alt {
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.profile-card__calc-alt-label,
.profile-card__calc-alt-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
  color: #64748b;
}

.profile-card__calc-alt-steps {
  margin: 0 0 12px;
  padding-left: 1.2em;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.profile-card__calc-alt-steps li + li {
  margin-top: 4px;
}

.profile-field--compact {
  max-width: 200px;
}

.profile-card--account {
  padding-bottom: 14px;
}

.profile-card--account .profile-field--account {
  margin-bottom: 0;
  max-width: 420px;
}

.profile-card__hint--account {
  margin: 8px 0 0;
}

.profile-form + .profile-card--danger-zone {
  margin-top: 14px;
}

.profile-quick-links.profile-card {
  margin-top: 14px;
}

.profile-quick-links__hint {
  margin-bottom: 16px;
}

.profile-quick-links__grid.water-page-links,
.profile-quick-links__grid.home-tracker-links.water-page-links {
  margin: 0;
}

.profile-quick-links .water-page-links .water-page-stats-cta,
.profile-quick-links .water-page-links .water-page-weight-cta {
  margin-top: 0;
}

.profile-quick-links__grid.water-page-links .water-page-stats-cta__btn,
.profile-quick-links__grid.water-page-links .water-page-weight-cta__btn {
  min-height: 56px;
  padding: 14px 22px;
  font-size: 17px;
}

.profile-quick-links__grid.water-page-links .water-page-link-cta__title {
  font-size: 17px;
  font-weight: 700;
}

@media (min-width: 641px) {
  .profile-quick-links__grid.water-page-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .profile-quick-links__grid.water-page-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
}

.profile-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.profile-field--grow {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.profile-field:last-child {
  margin-bottom: 0;
}

.profile-field__label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.profile-page .profile-field__input,
.profile-page .profile-field__select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--profile-input-border);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  color: #111827;
  background-color: var(--profile-input-fill);
  box-shadow: var(--profile-input-inset);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.profile-page .profile-field__input:hover,
.profile-page .profile-field__select:hover {
  border-color: var(--profile-input-border-hover);
  background-color: var(--profile-input-fill-hover);
}

.profile-page .profile-field__input:focus,
.profile-page .profile-field__input:focus-visible,
.profile-page .profile-field__select:focus,
.profile-page .profile-field__select:focus-visible,
.profile-page input.profile-field__input:focus,
.profile-page input.profile-field__input:focus-visible,
.profile-page select.profile-field__select:focus,
.profile-page select.profile-field__select:focus-visible {
  outline: none !important;
  border-color: var(--profile-input-focus-border) !important;
  background-color: var(--profile-input-fill-focus) !important;
  box-shadow: var(--profile-input-inset) !important;
}

.profile-page .profile-field__input:invalid,
.profile-page .profile-field__input:user-invalid {
  border-color: var(--profile-input-border);
  box-shadow: var(--profile-input-inset);
}

.profile-page .profile-field__input:invalid:focus,
.profile-page .profile-field__input:invalid:focus-visible,
.profile-page .profile-field__input:user-invalid:focus,
.profile-page .profile-field__input:user-invalid:focus-visible {
  outline: none !important;
  border-color: var(--profile-input-focus-border) !important;
  box-shadow: var(--profile-input-inset) !important;
}

.profile-page .profile-field__input[type='number'] {
  accent-color: #16a34a;
}

.profile-page .profile-field__input.profile-field__input--readonly {
  display: block;
  cursor: default;
  user-select: text;
}

.profile-page .profile-field__select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath fill='%23166534' d='M1 1l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.profile-page .profile-field__input:-webkit-autofill,
.profile-page .profile-field__input:-webkit-autofill:hover,
.profile-page .profile-field__input:-webkit-autofill:focus {
  -webkit-text-fill-color: #111827 !important;
  caret-color: #111827;
  border-color: var(--profile-input-border) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--profile-input-fill) inset, var(--profile-input-inset) !important;
  box-shadow: 0 0 0 1000px var(--profile-input-fill) inset, var(--profile-input-inset) !important;
  transition: background-color 600000s 0s, color 600000s 0s;
}

.profile-page .profile-field__input:-webkit-autofill:focus {
  border-color: var(--profile-input-focus-border) !important;
  -webkit-box-shadow:
    0 0 0 1000px var(--profile-input-fill-focus) inset,
    var(--profile-input-inset) !important;
  box-shadow:
    0 0 0 1000px var(--profile-input-fill-focus) inset,
    var(--profile-input-inset) !important;
}

.profile-tz-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.profile-tz-detect {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  font-size: 13px;
  line-height: 1.35;
  color: #0369a1;
}

.profile-macros-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-macros-grid .profile-field {
  margin-bottom: 0;
}

.profile-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.profile-btn:hover {
  text-decoration: none;
}

.profile-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.profile-btn--primary {
  background: #16a34a;
  color: #fff;
  border-color: #16a34a;
}

.profile-btn--primary:hover {
  background: #15803d;
  border-color: #15803d;
  color: #fff;
}

.profile-btn--secondary {
  background: #fff;
  color: #334155;
  border-color: #d1d5db;
}

.profile-btn--secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}

/* Калькуляторы — вторичные, один стиль (не конкурируют с «Сохранить») */
.profile-page .profile-btn--calc-norm,
.profile-page .profile-btn--calc-water {
  width: 100%;
  border-radius: 12px;
  background: #fff;
  color: #475569 !important;
  border: 1px solid var(--profile-input-border);
  box-shadow: var(--profile-input-inset);
  font-weight: 500;
}

.profile-page .profile-btn--calc-norm:hover,
.profile-page .profile-btn--calc-water:hover {
  background: var(--profile-input-fill-hover);
  border-color: var(--profile-input-border-hover);
  color: #334155 !important;
  box-shadow: var(--profile-input-inset);
}

.profile-page .profile-btn--calc-norm:focus,
.profile-page .profile-btn--calc-norm:focus-visible,
.profile-page .profile-btn--calc-norm:active,
.profile-page .profile-btn--calc-water:focus,
.profile-page .profile-btn--calc-water:focus-visible,
.profile-page .profile-btn--calc-water:active {
  outline: none !important;
  background: var(--profile-input-fill-hover);
  border-color: var(--profile-input-border-hover);
  color: #334155 !important;
  box-shadow: var(--profile-input-inset);
}

.profile-btn--tz {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 44px;
  padding-left: 16px;
  padding-right: 16px;
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
  white-space: nowrap;
}

.profile-btn--tz:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
  color: #0284c7;
}

.profile-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

@keyframes profileNoticeFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.profile-notice-overlay {
  position: fixed;
  inset: 0;
  /* 02.06.2026: было 10000 → стало 260001, иначе под мобильным drawer (12000) */
  z-index: 260001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: profileNoticeFadeIn 0.25s ease;
  box-sizing: border-box;
}

.profile-notice-overlay *,
.profile-notice-overlay *::before,
.profile-notice-overlay *::after {
  box-sizing: border-box;
}

.profile-notice-modal {
  width: 100%;
  max-width: 360px;
  padding: 24px 22px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #eceef1;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  text-align: center;
}

.profile-notice-modal__title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: #1f2937;
}

.profile-notice-modal__body {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: #64748b;
}

.profile-notice-modal__actions {
  margin-top: 20px;
}

.profile-notice-overlay .profile-notice-modal__ok {
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  border: none !important;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: #22c55e;
  outline: none !important;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.2s ease;
}

.profile-notice-overlay .profile-notice-modal__ok:hover {
  background: #16a34a;
  text-decoration: none;
}

.profile-notice-overlay .profile-notice-modal__ok:focus,
.profile-notice-overlay .profile-notice-modal__ok:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35) !important;
}

.profile-notice-overlay .profile-notice-modal--error .profile-notice-modal__ok {
  background: #dc2626;
}

.profile-notice-overlay .profile-notice-modal--error .profile-notice-modal__ok:hover {
  background: #b91c1c;
}

.profile-notice-overlay .profile-notice-modal--error .profile-notice-modal__ok:focus-visible {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35) !important;
}

.profile-notice-modal--info .profile-notice-modal__title {
  color: #166534;
}

/* 02.06.2026: confirm-модалки профиля (очистка, несохранённые данные) — начало */
.profile-notice-overlay--confirm .profile-notice-modal {
  max-width: 360px;
  padding: 24px 22px;
}

.profile-notice-modal--confirm .profile-notice-modal__title {
  color: #1f2937;
}

.profile-notice-modal--confirm.profile-notice-modal--danger .profile-notice-modal__title {
  color: #991b1b;
}

.profile-notice-modal__actions--split {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  align-items: stretch;
}

.profile-notice-modal__actions--split .profile-notice-modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  text-align: center;
  line-height: 1.3;
}

.profile-notice-modal__actions--unsaved {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.profile-notice-modal__actions--unsaved .profile-notice-modal__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  text-align: center;
  line-height: 1.3;
}

.profile-notice-overlay .profile-notice-modal__btn--primary {
  border: none !important;
  background: #22c55e;
  color: #fff;
}

.profile-notice-overlay .profile-notice-modal__btn--primary:hover:not(:disabled) {
  background: #16a34a;
}

.profile-notice-overlay .profile-notice-modal__btn--primary:focus,
.profile-notice-overlay .profile-notice-modal__btn--primary:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.35) !important;
}

.profile-notice-overlay .profile-notice-modal__btn--primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.profile-notice-modal__btn--text {
  border: none !important;
  background: transparent;
  color: #64748b;
  font-weight: 500;
  min-height: 40px;
  padding: 8px 18px;
}

.profile-notice-modal__btn--text:hover:not(:disabled) {
  color: #475569;
  background: #f8fafc;
}

.profile-notice-modal__btn--text:focus,
.profile-notice-modal__btn--text:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  color: #475569;
  background: #f1f5f9;
}

.profile-notice-modal__btn--text:disabled {
  opacity: 0.55;
  cursor: wait;
}
/* 02.06.2026: confirm-модалки профиля — конец */

.profile-card--danger-zone {
  border-color: #fecaca;
  background: #fffbfb;
  box-shadow: 0 1px 2px rgba(248, 113, 113, 0.08);
}

.profile-card--danger-zone .profile-card__title {
  color: #991b1b;
}

.profile-btn--danger {
  width: 100%;
  max-width: 320px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  background: #fff;
  color: #b91c1c;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.profile-btn--danger:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
}

.profile-btn--danger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.profile-notice-modal--danger .profile-notice-modal__title {
  color: #991b1b;
}

.profile-notice-modal__btn {
  width: 100%;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  outline: none !important;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.profile-notice-modal__btn--ghost {
  border: 1px solid #e2e8f0 !important;
  background: #fff;
  color: #475569;
}

.profile-notice-modal__btn--ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1 !important;
}

.profile-notice-modal__btn--ghost:focus,
.profile-notice-modal__btn--ghost:focus-visible {
  border-color: #cbd5e1 !important;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.28) !important;
}

.profile-notice-modal__btn--danger {
  border: 1px solid #dc2626 !important;
  background: #dc2626;
  color: #fff;
}

.profile-notice-modal__btn--danger:hover {
  background: #b91c1c;
  border-color: #b91c1c !important;
}

.profile-notice-modal__btn--danger:focus,
.profile-notice-modal__btn--danger:focus-visible {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.32) !important;
}

@media (min-width: 992px) {
  .profile-card--water .profile-field--compact .profile-field__input,
  .profile-card--water .profile-field__input {
    max-width: 200px;
  }
}

@media (max-width: 991px) {
  .profile-page {
    max-width: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  .profile-page .profile-field__input:focus {
    scroll-margin-top: 72px;
    scroll-margin-bottom: 24px;
  }
}

@media (max-width: 600px) {
  .profile-tz-row {
    flex-direction: column;
  }

  .profile-btn--tz {
    width: 100%;
  }

  .profile-macros-grid {
    grid-template-columns: 1fr;
  }

  .profile-card__actions-inline .profile-btn--calc-norm,
  .profile-card__actions-inline .profile-btn--calc-water {
    width: 100%;
  }
}

.profile-goal-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

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

.profile-goal-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.profile-goal-option:hover {
  border-color: #9ca3af;
}

.profile-goal-option:has(input:checked) {
  border-color: #22c55e;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}

.profile-goal-option:has(input:checked):hover {
  border-color: #16a34a;
}

.profile-goal-option:has(input:focus-visible) {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.profile-goal-option input {
  flex-shrink: 0;
  margin: 0;
  width: 18px;
  height: 18px;
  border: 2px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  transition: border-color 0.15s ease;
}

.profile-goal-option input:checked {
  border-color: #22c55e;
}

.profile-goal-option input:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.profile-goal-option input:focus {
  outline: none;
}

.profile-goal-option__label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

.profile-goal-option:has(input:checked) .profile-goal-option__label {
  color: #166534;
}

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

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

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

.profile-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;
}

.profile-guest__btn--primary {
  background: #22c55e;
  color: #fff !important;
}

.profile-guest__btn--primary:hover {
  background: #16a34a;
  color: #fff !important;
}
