/* Homebear · примерочная по макету «заполнение профиля» | legume
   Работает вместе с hb-fitting.js на profile.php?section=fields. Переменные берутся из стилей форума, у каждой есть запасное значение. */
form#profile8.hbf {
  --hbf-bg: var(--gray, #eee);
  --hbf-line: rgba(0, 0, 0, .05);
  --hbf-strip: rgba(0, 0, 0, .05);
  --hbf-dim: var(--06black, rgba(0, 0, 0, .5));
  --hbf-acc: #d76b62;
  --hbf-acc-soft: var(--brand, #d99fa6);
  --hbf-btn: #d5d5d5;
  --hbf-btn-line: rgba(174, 174, 174, .2);
  --hbf-font: var(--font-family-jost, 'Jost', sans-serif);
  display: grid; grid-template-columns: 180px minmax(0, 459px) 237px; gap: 24px; align-items: start;
  font-family: var(--hbf-font); text-transform: lowercase; box-sizing: border-box;
}
form#profile8.hbf *, form#profile8.hbf *::before, form#profile8.hbf *::after { box-sizing: border-box; }
form#profile8.hbf > input[type="hidden"] { display: none; }
form#profile8.hbf > p.formsubmit { display: none; }
form#profile8.hbf fieldset.hbf-off { display: none; }

/* перебиваем старые правила форума, написанные под прежний вид формы:
   #profile .container { padding-left: 200px }, #profilenav { float; margin-left: -200px },
   form#profile8 fieldset { width: 490px }, #profile_preview { position: absolute; top: 500px; left: 744px } */
#profile form#profile8.hbf { padding-left: 0; width: auto; }
form#profile8.hbf #profilenav { float: none; display: block; width: auto; margin: 0; }
form#profile8.hbf #profilenav h2 { display: none; }

/* колонка 2: карточки */
.hbf-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.hbf-card { background: var(--hbf-bg); border: 1px solid var(--hbf-line); padding: 4px 16px 12px; }
.hbf-h { margin: 0 0 8px; padding: 4px; background: var(--hbf-strip); font: 400 12px/12px var(--hbf-font); color: #000; }
.hbf-body { display: block; }

.hbf-tiles { display: flex; flex-wrap: wrap; gap: 14px; }
.hbf-tile { position: relative; width: 59px; height: 60px; padding: 0; margin: 0; border: 1px solid transparent; background: rgba(0, 0, 0, .04) center / cover no-repeat;
  cursor: pointer; overflow: hidden; transition: .2s; font: inherit; color: inherit; }
.hbf-tile img { display: block; width: 100%; height: 100%; object-fit: cover; margin: 0; }
.hbf-tile:hover { border-color: rgba(215, 107, 98, .5); }
.hbf-tile.on { border-color: var(--hbf-acc); }
.hbf-ck { display: none; position: absolute; right: 4px; top: 4px; width: 10px; height: 10px; background: var(--hbf-acc); color: #fff; font: 700 8px/10px sans-serif; text-align: center; font-style: normal; }
.hbf-tile.on .hbf-ck { display: block; }
.hbf-none { background: transparent; border-color: #dedede; display: flex; align-items: center; justify-content: center; }
.hbf-none span { font: 400 10px/12px var(--hbf-font); color: rgba(0, 0, 0, .6); text-align: center; }
.hbf-none.on { border-color: var(--hbf-acc); }

/* стикеры: две колонки по 198×64 */
.hbf-wide { display: grid; grid-template-columns: repeat(2, 198px); gap: 5px 30px; }
.hbf-wide .hbf-tile { width: 198px; height: 64px; background: rgba(0, 0, 0, .02); border-color: transparent; display: flex; gap: 8px; padding: 2px; }
.hbf-wide .hbf-tile img { width: 59px; height: 60px; object-fit: contain; flex: none; }
.hbf-wide .hbf-tile.on { background: rgba(0, 0, 0, .2); border-color: var(--hbf-acc); }
.hbf-wide .hbf-none { background: transparent; border-color: #dedede; }
.hbf-wide .hbf-none.on { background: rgba(0, 0, 0, .2); }
.hbf-wide .hbf-ck { right: 4px; top: 4px; }

.hbf-note { margin: 6px 0 0; font: 400 11px/1.4 var(--hbf-font); color: var(--hbf-dim); text-transform: none; }

/* текст плашки */
.hbf-text { margin-top: 10px; background: rgba(0, 0, 0, .04); padding-bottom: 8px; }
.hbf-sub { padding: 2px 5px; background: var(--hbf-strip); font: 400 12px/12px var(--hbf-font); margin-bottom: 8px; }
.hbf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 10px; }
.hbf-two label { display: block; font: 400 10px/12px var(--hbf-font); color: var(--hbf-dim); }
.hbf-two input { display: block; width: 100%; margin: 2px 0 0; padding: 6px 8px; border: 1px solid rgba(0, 0, 0, .12); background: #fdfdfd; color: #000; font: 400 12px var(--hbf-font); text-transform: none; }

/* личное звание: конструктор живёт внутри карточки, лишние рамки формы убираем */
.hbf-lz { background: var(--hbf-bg); }
form#profile8.hbf .hbf-lz fieldset.hbf-moved { margin: 0; padding: 0; border: 0; background: rgba(0, 0, 0, .04); width: auto !important; max-width: 100%; }
form#profile8.hbf .hbf-lz fieldset.hbf-moved > legend { display: none; }
form#profile8.hbf .hbf-lz fieldset.hbf-moved .fs-box { margin: 0; padding: 8px; }
form#profile8.hbf .hbf-lz fieldset.hbf-moved input[type="text"], form#profile8.hbf .hbf-lz fieldset.hbf-moved span.input input, form#profile8.hbf .hbf-lz fieldset.hbf-moved textarea { width: 100% !important; max-width: 100%; text-transform: none; }

/* колонка 3: предпросмотр и кнопки */
.hbf-side { min-width: 0; display: flex; flex-direction: column; }
form#profile8.hbf .hbf-side #profile_preview { position: static !important; top: auto !important; left: auto !important; margin: 0; order: 1; }
form#profile8.hbf .hbf-side #profile_preview ul { margin-top: 0; }
.hbf-side .hbf-bar { order: 2; }
.hbf-bar { display: flex; justify-content: center; gap: 20px; margin-top: 8px; }
.hbf-btn { cursor: pointer; padding: 8px 10px 9px; border: 2px solid var(--hbf-btn-line); background: var(--hbf-btn); background-clip: padding-box; font: 400 12px/8px var(--hbf-font); color: #000; text-transform: lowercase; transition: .3s; }
.hbf-btn:hover { box-shadow: -4px 4px 12px 0 rgba(217, 159, 166, .6); }
.hbf-save { background: var(--hbf-acc); border-color: rgba(215, 107, 98, .4); color: #fff; }

@media (max-width: 900px) {
  form#profile8.hbf { grid-template-columns: 1fr; }
  .hbf-wide { grid-template-columns: 1fr; }
}
