:root {
  --button: #7a8450;
  --profile-bg: #f9cdd5;
  --profile-red: #7a8450;
  --profile-toast-bg: rgba(122, 132, 80, 0.96);
  --profile-field: #fadde2;
  --profile-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  --profile-radius: 18px;
  --form-ui-label-size: 20px;
  --form-ui-input-size: 20px;
  --form-ui-input-padding-y: 8px;
  --form-ui-input-padding-x: 14px;
  --form-ui-input-radius: var(--profile-radius);
  --form-ui-submit-size: 20px;
  --form-ui-submit-padding-y: 0.45rem;
  --form-ui-submit-padding-x: 1.5rem;
  --form-ui-submit-radius: 16px;
  --form-ui-field-bg: var(--profile-field);
  --form-ui-text: var(--profile-red);
  --form-ui-shadow: var(--profile-shadow);
  --form-ui-focus-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.32), inset 0 1px 2px rgba(0, 0, 0, 0.2);
  --form-ui-submit-text: #ffffff;
  --form-ui-submit-bg: linear-gradient(180deg, #9aa664 0%, var(--profile-red) 45%, #687244 100%);
  --form-ui-submit-lip: #5f683f;
  --form-ui-submit-depth: 5px;
  --form-ui-submit-inner-active: inset 0 5px 14px rgba(0, 0, 0, 0.32), inset 0 -2px 8px rgba(0, 0, 0, 0.12);
  --dropdown-menu-bg: var(--profile-field);
  --dropdown-menu-text: var(--profile-red);
  --dropdown-menu-shadow: var(--profile-shadow);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.profile-screen {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--profile-bg);
  color: var(--profile-red);
  font-family: "Inder", system-ui, sans-serif;
}

.profile-screen__header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 16px 18px 0;
  width: min(760px, 100%);
  margin: 0 auto;
  box-sizing: border-box;
}

.profile-screen__back-link {
  color: var(--profile-red);
  font-size: 20px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.profile-screen__user-menu {
  position: relative;
}

.profile-screen__user-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.profile-screen__avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--profile-red);
  color: #fff;
  display: grid;
  place-items: center;
  border: none;
  cursor: pointer;
  box-shadow: var(--profile-shadow);
}

.profile-screen__avatar-letter {
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.profile-screen__dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 200px;
  padding: 0.5rem 0;
  background: var(--profile-field);
  border-radius: var(--profile-radius);
  box-shadow: var(--profile-shadow);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, visibility 0.14s ease;
  z-index: 20;
}

.profile-screen__user-menu:hover .profile-screen__dropdown,
.profile-screen__user-menu:focus-within .profile-screen__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.profile-screen__dropdown-link--active {
  pointer-events: none;
}

.profile-screen__main {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  padding: 20px 18px 32px;
  box-sizing: border-box;
}

.profile-screen__card {
  width: min(760px, 100%);
  border: none;
  padding: 28px 18px 22px;
}

.profile-screen__title {
  margin: 0 0 18px;
  text-align: center;
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.1;
  text-decoration: none;
}

.profile-screen__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-screen__field {
  gap: 10px;
}

.profile-screen__time-row {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(240px, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-screen__field--timezone .profile-screen__input-shell {
  overflow: visible;
}

.profile-screen__label {
  line-height: 1.2;
}

.profile-screen__input-shell {
  border: none;
}

.profile-screen .form-ui__input-shell:focus-within {
  box-shadow: var(--form-ui-focus-shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Для кастомных select выпадающее меню не должно обрезаться контейнером поля. */
.profile-screen__input-shell.dropdown {
  overflow: visible;
}

.profile-screen__input-shell--time {
  width: min(170px, 100%);
  position: relative;
}

.profile-screen__input-shell--time::before {
  content: none;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  opacity: 0.75;
  pointer-events: none;
  z-index: 2;
}

.profile-screen__label-with-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-screen__help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.profile-screen__help-btn img {
  display: block;
  width: 20px;
  height: 20px;
}

.profile-screen__help-btn:hover,
.profile-screen__help-btn:focus-visible {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

.profile-screen__inline-toast {
  position: fixed;
  z-index: 1200;
  width: 140px;
  max-width: 150px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--profile-toast-bg);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  white-space: normal;
  word-break: break-word;
}

.profile-screen__inline-toast::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 6px solid var(--profile-toast-bg);
}

.profile-screen__input {
  min-height: 56px;
}

/* Кастомный dropdown для select-полей профиля (чтобы убрать системный синий popup). */
.profile-screen__select-native {
  display: none;
}

.profile-screen__select-ui {
  position: relative;
  width: 100%;
  min-height: 56px;
}

.profile-screen__select-trigger {
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 8px 2.5rem 8px 12px;
  border: none;
  border-radius: var(--profile-radius);
  background: transparent;
  color: var(--profile-red);
  font-family: "Inder", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.profile-screen__select-trigger:hover,
.profile-screen__select-trigger:focus-visible {
  background: color-mix(in srgb, var(--button) 18%, var(--profile-field));
  outline: none;
  box-shadow: inset 0 0 0 2px var(--button);
}

.profile-screen__select-ui.is-open .profile-screen__select-trigger {
  box-shadow: var(--form-ui-focus-shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.profile-screen__select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: none;
  max-height: none;
  overflow: visible;
  padding: 6px 0;
  border-radius: 16px;
}

.profile-screen__select-ui.is-open .profile-screen__select-menu {
  display: block;
}

.profile-screen__select-option {
  width: 100%;
  margin: 0;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--dropdown-menu-text, var(--button));
  font-family: "Inder", system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.profile-screen__select-option:hover,
.profile-screen__select-option:focus-visible {
  outline: none;
}

.profile-screen__input--time {
  width: 100%;
  padding-left: 14px;
  padding-right: 38px;
  letter-spacing: 0.02em;
}

.profile-screen__time-picker-host {
  padding: 0;
  overflow: visible;
}

#profile-timepicker-root {
  width: 100%;
}

#profile-timepicker-root .ant-picker {
  width: 100%;
  min-height: 56px;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 8px 10px 8px 12px;
  font-family: "Inder", system-ui, sans-serif;
}

#profile-timepicker-root .ant-picker-input > input {
  color: var(--profile-red);
  font-size: 20px;
  font-family: "Inder", system-ui, sans-serif;
  font-weight: 400;
}

#profile-timepicker-root .ant-picker-suffix {
  color: var(--profile-red);
}

#profile-timepicker-root .ant-picker-focused {
  box-shadow: none;
}

.ant-picker-dropdown .ant-picker-time-panel-column > li {
  color: var(--profile-red);
  font-family: "Inder", system-ui, sans-serif;
  font-size: 20px;
}

.ant-picker-dropdown .ant-picker-time-panel-cell-inner {
  color: var(--profile-red);
  font-family: "Inder", system-ui, sans-serif;
  font-size: 20px;
}

.ant-picker-dropdown .ant-picker-panel-container {
  background: var(--dropdown-menu-bg);
  border-radius: 16px;
  box-shadow: var(--dropdown-menu-shadow);
}

.ant-picker-dropdown .ant-picker-time-panel {
  background: var(--dropdown-menu-bg);
}

.ant-picker-dropdown .ant-picker-time-panel-column {
  background: var(--dropdown-menu-bg);
  scrollbar-color: color-mix(in srgb, var(--dropdown-menu-text) 70%, transparent) transparent;
}

.ant-picker-dropdown .ant-picker-time-panel-column::-webkit-scrollbar {
  width: 8px;
}

.ant-picker-dropdown .ant-picker-time-panel-column::-webkit-scrollbar-track {
  background: transparent;
}

.ant-picker-dropdown .ant-picker-time-panel-column::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--dropdown-menu-text) 70%, transparent);
  border-radius: 999px;
}

.ant-picker-dropdown .ant-picker-time-panel-column > li.ant-picker-time-panel-cell-selected .ant-picker-time-panel-cell-inner {
  color: var(--profile-red);
  font-weight: 700;
}

.profile-screen__status {
  min-height: 0;
  font-size: 20px;
  font-weight: 400;
  margin: 4px 0 0;
  display: none;
}

.profile-screen__status--visible {
  display: block;
}

.profile-screen__status--error {
  color: var(--button);
}

.profile-screen__status--ok {
  color: #145d14;
}

.profile-screen__actions {
  display: flex;
  justify-content: center;
  margin-top: 8px;
}

.profile-screen__submit {
  border: none;
  min-width: 240px;
  min-height: 62px;
  line-height: 1;
  font-weight: 400;
  transition: filter 0.2s ease;
}

.profile-screen__submit:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.profile-screen__cabinet-links {
  margin-top: 20px;
  display: grid;
  gap: 10px;
}

.profile-screen__cabinet-link {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--profile-radius);
  background: var(--profile-field);
  color: var(--profile-red);
  font-size: 24px;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--profile-shadow);
}

.profile-screen__cabinet-link:hover,
.profile-screen__cabinet-link:focus-visible {
  background: color-mix(in srgb, var(--button) 16%, var(--profile-field));
}

.profile-screen__input:focus-visible,
.profile-screen__submit:focus-visible,
.profile-screen__avatar:focus-visible,
.profile-screen__dropdown-link:focus-visible,
.profile-screen__help-btn:focus-visible,
.profile-screen__cabinet-link:focus-visible,
.profile-screen__back-link:focus-visible {
  outline: 2px solid var(--profile-red);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .profile-screen__time-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-screen__card {
    padding: 20px 14px 18px;
  }

  .profile-screen__input {
    min-height: 52px;
  }

  .profile-screen__submit {
    min-width: 220px;
    min-height: 54px;
  }

  .profile-screen__status {
    font-size: 20px;
  }

  .profile-screen__avatar {
    width: 56px;
    height: 56px;
  }

  .profile-screen__avatar-letter {
    font-size: 24px;
  }

  .profile-screen__cabinet-link {
    font-size: 20px;
  }
}
