.date-input {
  width: 160px;
  min-width: 140px;
  max-width: 200px;
}

.metric-input {
  width: 80px;
  text-align: right;
}

textarea[data-autoresize] {
  overflow: hidden;         /* отключает полосу прокрутки */
  resize: none;             /* отключает ручное изменение */
  min-height: 5em;          /* начальная высота */
  line-height: 1.4;
  padding: 0.6em;
  box-sizing: border-box;
}

/* Стандартная строка формы */
.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 8px;
  gap: 6px;
}

/* Только если в строке есть <textarea>, располагаем элементы вертикально */
.form-row:has(textarea) {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.form-label {
  flex: 1 1 auto;
  font-weight: bold;
  margin-bottom: 4px;
}

.form-input {
  min-width: 200px;
}

.form-input input,
.form-input textarea,
.form-input select {
  width: 100%;
  padding: 4px;
  box-sizing: border-box;
  font: inherit;
}

.form-note {
  color: #888;
  font-size: 0.9em;
  margin-left: 8px;
  white-space: nowrap;
}

/* Мобильная адаптация — всё в столбик */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
    align-items: stretch;
  }

  .form-label {
    margin-bottom: 4px;
  }

  .form-note {
    margin-left: 0;
    margin-top: 4px;
  }
}

form {
  margin-top: 0;
  padding-top: 0;
}

form h2 {
  margin-bottom: 0.3em;
}

.form-label {
  margin-bottom: 2px;
}

/* Поле ввода оценки уверенности по цели */
.goal-confidence-input {
  width: 6ch;
  min-width: 6ch;
  max-width: 6ch;
  text-align: center;
}

/* Контейнер с названием цели */
.goal-label {
  min-width: 300px; /* одинаковая ширина текста */
  flex: 1;
}

/* Поле для метрик — ширина в символах */
.metric-input {
  width: 9ch;
  min-width: 5ch;
  max-width: 10ch;
  text-align: right;
}

.form-row.inline-flex {
  flex-wrap: nowrap;
  align-items: center;
}

  #readonly-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.7); /* полупрозрачный */
    z-index: 10;
    pointer-events: none; /* ⚠️ даёт доступ к тексту под ним */
  }

  #readonly-overlay .message {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    color: #444;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    pointer-events: auto; /* ⬅️ разрешает мышь именно на сообщение */
  }

  button[disabled] {
    background-color: #ccc !important;
    color: #666 !important;
    cursor: not-allowed;
    border-color: #bbb !important;
    opacity: 1 !important;
  }

  .logout-link {
    background: none;
    border: none;
    color: #0645AD; /* синий, как у ссылок */
    cursor: pointer;
    padding: 3px;
    font: inherit;
    text-decoration: underline;
  }
  
  .logout-link:hover {
    color: #d7d7d8;
    text-decoration: none;
  }
  