/* ============================================================
   components.css — повторяющиеся элементы интерфейса:
   заголовки, карточки-группы, строки, чипы, кнопки, бейджи,
   сегмент-переключатель, поля ввода, скелетоны, пустые состояния.
   Минимальный шрифт везде 14px, нажимаемые зоны ≥ 44px.
   Отклик на касание: .tap (фон при нажатии) и .press (лёгкое «вдавливание»).
   ============================================================ */

/* ---------- Заголовки ---------- */
.title { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -.3px; padding: 4px var(--gutter) 14px; }
.h2 { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter) 6px; }
.section-head .link { min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: flex-end; padding-left: 12px; color: var(--accent-text); font-weight: 500; }
.hint { color: var(--hint); font-size: 14px; }

/* ---------- Отклик на касание ---------- */
.tap { transition: background-color .15s ease; }
.tap:active { background: var(--press); }
.press { transition: transform .14s ease, filter .14s ease; }
.press:active { transform: scale(.97); filter: brightness(.96); }

/* ---------- Карточка-группа ---------- */
.group {
  margin: 0 var(--gutter);
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.group + .group, .group + .note, .note + .group { margin-top: 12px; }
.note { margin: 10px calc(var(--gutter) + 6px) 0; color: var(--hint); font-size: 14px; line-height: 1.4; }
.note a, .note .link { color: var(--accent-text); }

/* ---------- Строка ---------- */
.row {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 54px; padding: 8px 16px;
  position: relative;
}
.row + .row::before {                       /* разделитель, не доходит до иконки */
  content: ""; position: absolute; top: 0; right: 0; left: 62px; height: 1px; background: var(--sep);
}
.row.no-icon + .row::before, .row.no-icon::before { left: 16px; }
.row__icon {
  flex: none; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff;
}
.row__icon svg { width: 20px; height: 20px; }
.row__icon.soft { background: var(--accent-soft); color: var(--accent-text); }
.row__body { flex: 1; min-width: 0; }
.row__title { font-size: 16px; font-weight: 500; }
.row__sub { font-size: 14px; color: var(--hint); margin-top: 1px; }
.row__end { flex: none; color: var(--hint); display: flex; align-items: center; gap: 6px; font-size: 15px; }
.row__end svg { width: 20px; height: 20px; opacity: .6; }
.row--danger .row__title { color: var(--danger); }

/* ---------- Чипы-фильтры ---------- */
/* Фильтры переносятся на новую строку — без прокрутки вбок */
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px var(--gutter) 12px; }
.chip {
  flex: none; height: 44px; padding: 0 18px; border-radius: 22px;
  display: flex; align-items: center;
  background: var(--card); color: var(--text); font-weight: 500; font-size: 15px;
  box-shadow: var(--shadow);
  transition: background-color .18s ease, color .18s ease, transform .14s ease;
}
.chip:active { transform: scale(.96); }
.chip.is-active { background: var(--accent); color: var(--on-accent); }
/* Чипы, которые прилипают к верху при прокрутке */
.sticky { position: sticky; top: 0; z-index: 5; padding-top: 6px; background: var(--bg); }

/* ---------- Кнопки внутри экрана (не главные) ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-btn);
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 16px; font-weight: 600;
  transition: transform .14s ease, filter .14s ease;
}
.btn:active { transform: scale(.97); filter: brightness(.95); }
.btn svg { width: 20px; height: 20px; }
.btn--fill { background: var(--accent); color: var(--on-accent); }
.btn--danger { background: rgba(217, 58, 58, .1); color: var(--danger); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- Бейдж статуса ---------- */
.badge { flex: none; height: 28px; padding: 0 11px; border-radius: 14px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; white-space: nowrap; }
.badge--ok { background: var(--accent-soft); color: var(--accent-text); }
.badge--muted { background: var(--press); color: var(--hint); }
.badge--bad { background: rgba(217, 58, 58, .12); color: var(--danger); }

/* ---------- Сегмент-переключатель ---------- */
.segment {
  margin: 0 var(--gutter) 14px; padding: 3px; height: 50px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: var(--press); border-radius: 12px; position: relative;
}
.segment button { position: relative; z-index: 1; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: var(--hint); transition: color .2s ease; }
.segment button.is-active { color: var(--text); }
.segment__thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 9px;
  background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
  transition: transform .22s cubic-bezier(.22, .8, .26, 1);
}

/* ---------- Поля ввода ---------- */
.field { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 6px 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; top: 0; right: 0; left: 62px; height: 1px; background: var(--sep); }
.field__input {
  flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; outline: none;
  font-size: 17px;                       /* ≥ 16px — чтобы iOS не увеличивал страницу при вводе */
}
.field__input::placeholder { color: var(--hint); opacity: .85; }
textarea.field__input { resize: none; padding: 11px 0; line-height: 1.35; min-height: 44px; overflow: hidden; }
.field--area { align-items: flex-start; padding-top: 10px; }
.field--area .row__icon { margin-top: 4px; }
.field__aside { flex: none; }
.field__aside .btn { min-height: 44px; padding: 0 14px; font-size: 15px; }

/* ---------- Скелетон и пустые состояния ---------- */
.skel { background: linear-gradient(100deg, var(--press) 30%, rgba(255, 255, 255, .0) 50%, var(--press) 70%), var(--press); background-size: 220% 100%; animation: skel 1.3s linear infinite; border-radius: 12px; }
@keyframes skel { from { background-position: 120% 0; } to { background-position: -120% 0; } }

.empty { text-align: center; padding: 56px 32px 24px; }
.empty__icon { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.empty__icon svg { width: 36px; height: 36px; }
.empty__title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.empty__text { color: var(--hint); font-size: 15px; margin-bottom: 20px; }
.empty .btn { display: inline-flex; }
