/* Редизайн 2026-11, фаза 2 — /app/family «Близкие» (сторона владельца,
   app/family_manage.js) в стиле Settings/Profile. Только var(--…),
   токены — tokens.css, блок screens:family (--fm-*). Подключается в
   layouts/app.php и SHELL_ASSETS sw.js. */

.fm .kp-overline { margin-top: var(--fam-sp-22); }
.fm-h2 { margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-sheet-title); font-weight: 700; }
.fm-sub { margin: 0 0 var(--sp-4); font-size: var(--fs-callout); line-height: 1.5; color: var(--text-secondary); }
.fm-note { margin: var(--sp-2) 0 0; font-size: var(--fs-caption); line-height: 1.5; color: var(--text-secondary); text-align: center; }
.fm-note:empty { display: none; }
.fm-skel { height: 220px; border-radius: var(--r-l); }
.fm .kp-btn--cta + .fm-note, .fm .kp-btn + .kp-btn { margin-top: var(--sp-3); }
.fm .kp-btn--ghost { width: 100%; }

/* Группа строк — как карточки настроек: строки 56 px с разделителями. */
.fm-group { padding: 0; overflow: hidden; }
.fm-member, .fm-level, .fm-feature {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 56px; padding: var(--sp-2) var(--sp-4);
  border: 0; border-top: 1px solid var(--border); background: transparent;
  color: var(--text); font: 400 var(--fs-callout) var(--font-text); text-align: left;
}
.fm-member:first-child, .fm-level:first-child, .fm-feature:first-child { border-top: 0; }
.fm-member, .fm-level { cursor: pointer; }
.fm-member:focus-visible, .fm-level:focus-visible { outline: 2px solid var(--accent-light); outline-offset: -2px; }
.fm-chevron { flex-shrink: 0; fill: none; stroke: var(--text-secondary); stroke-width: 1.75; stroke-linecap: round; }

.fm-avatar {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: var(--fm-avatar); height: var(--fm-avatar); border-radius: var(--r-full);
  background: var(--bg-alt); color: var(--text-secondary); font-weight: 600;
}
.fm-avatar.is-active { background: var(--accent-a15); color: var(--accent-light); }
.fm-member__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fm-member__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-member__status { font-size: var(--fs-small); color: var(--text-secondary); }
.fm-member__status.is-active { color: var(--success); }
.fm-pill {
  flex-shrink: 0; padding: var(--sp-1) var(--fam-sp-10); border-radius: var(--r-full);
  background: var(--bg-alt); color: var(--text-secondary); font-size: var(--fs-small); font-weight: 500;
}
.fm-pill.is-accent { background: var(--accent-a15); color: var(--accent-light); }

/* Код приглашения */
.fm-code { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); }
.fm-code__value { font-size: var(--fm-fs-code); font-weight: 700; letter-spacing: .08em; color: var(--text); }
.fm-qr {
  width: var(--fm-qr); height: var(--fm-qr); margin: var(--sp-2) 0; padding: var(--sp-2);
  border-radius: var(--r-m);
  /* QR сканируется только тёмным по светлому — в обеих темах. */
  background: var(--on-primary); color: var(--primary-dark);
}

/* Приглашение */
.fm-invite { display: flex; flex-direction: column; gap: var(--sp-3); }
.fm-label { font-size: var(--fs-caption); font-weight: 600; color: var(--text-secondary); }
.fm-input {
  width: 100%; min-height: var(--control-h); padding: 0 var(--sp-4);
  border: 1px solid var(--border); border-radius: var(--r-m); background: var(--bg-alt);
  color: var(--text); font: 400 var(--fs-body) var(--font-text);
}
.fm-input::placeholder { color: var(--text-secondary); }
.fm-input:focus { outline: none; border-color: var(--accent-light); box-shadow: 0 0 0 4px var(--accent-a15); }

/* Увидит / не увидит */
.fm-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--fam-sp-10); }
.fm-split .kp-card { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--fam-sp-14); }
.fm-split__never { background: var(--accent-a12); border-color: var(--accent-light-a30); }
.fm-split__head { display: flex; align-items: center; gap: var(--fam-sp-6); font-size: var(--fs-caption); font-weight: 600; color: var(--accent-light); }
.fm-split__see .fm-split__head { color: var(--text-secondary); }
.fm-split__head svg, .fm-never svg { flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
.fm-split__list { font-size: var(--fs-caption); line-height: 1.6; color: var(--text); }

/* Уровень доступа */
.fm-level { align-items: flex-start; padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.fm-radio {
  position: relative; flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px;
  border: 2px solid var(--border); border-radius: var(--r-full);
  transition: border-color var(--dur) var(--ease);
}
.fm-radio::after {
  content: ""; position: absolute; inset: 4px; border-radius: var(--r-full); background: var(--accent);
  transform: scale(0); transition: transform var(--dur) var(--ease);
}
.fm-level[aria-checked="true"] .fm-radio { border-color: var(--accent); }
.fm-level[aria-checked="true"] .fm-radio::after { transform: scale(1); }
.fm-level__text { display: flex; flex-direction: column; gap: var(--sp-1); }
.fm-level__title { font-weight: 600; }
.fm-level__sub { font-size: var(--fs-caption); line-height: 1.45; color: var(--text-secondary); }
.fm-never { display: flex; gap: var(--fam-sp-10); margin: var(--sp-4) 0 0; font-size: var(--fs-caption); line-height: 1.5; color: var(--text-secondary); }
.fm-actions { margin-top: var(--sp-6); }
.fm-revoke { color: var(--danger); }

/* Витрина */
.fm-feature__icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: var(--r-full); background: var(--accent-a15); color: var(--accent-light);
}
.fm-feature__icon svg { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.fm .fm-group + .fm-price, .fm .fm-split + .fm-group { margin-top: var(--sp-4); }
.fm-price { display: flex; flex-direction: column; align-items: center; gap: var(--sp-1); margin: var(--sp-5) 0 var(--sp-3); }
.fm-price__value { font-size: var(--fs-sheet-title); font-weight: 700; }
