/* Кроковий майстер — packages/ui/first-steps.js. Вікно, шапка, тіло й панель — apparatus-wizard.css
   (той самий майстер на вигляд); тут лише те, чого там нема: картки варіантів, смуга з трьох
   кроків, «по одній дії за раз» і сторінка під вікном. */
.fs:not(:modal) { position: static; display: block; height: auto; width: auto; max-width: 1040px; margin: 16px auto; }
.fs:not([open]) { display: none; }
/* Класи ядра (.btn, .aw-res-h, сітки) задають display і перебивають атрибут. */
.fs [hidden], .fs-page [hidden] { display: none !important; }

.fs-bar { display: flex; gap: 4px; margin-top: 10px; }
.fs-bar button { flex: 1; height: 6px; padding: 0; border: 0; border-radius: 3px; background: rgba(var(--green-rgb), .16); cursor: pointer; position: relative; }
.fs-bar button::after { content: ''; position: absolute; inset: -10px 0; }
.fs-bar button.on { background: var(--green); }
.fs-bar button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.fs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fs-list { display: grid; gap: 10px; }
.fs-card { display: block; width: 100%; min-height: 44px; padding: 12px; border: 1px solid rgba(var(--green-rgb), .25); border-radius: var(--radius); background: var(--surface);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background-color var(--transition), border-color var(--transition); }
.fs-card .ico { display: block; width: 24px; height: 24px; margin-bottom: 6px; color: var(--green); }
.fs-card b { display: block; color: var(--green); font-size: var(--fs-body, 1rem); line-height: 1.25; }
.fs-card small { display: block; margin-top: 2px; color: var(--hint); font-size: var(--fs-caption); line-height: 1.35; }
.fs-card.is-idk { border-style: dashed; }
.fs-card[aria-pressed="true"] { border: 2px solid var(--green); padding: 11px; background: rgba(var(--green-rgb), .1); }
@media (hover: hover) and (pointer: fine) { .fs-card:hover { border-color: var(--green); } }
.fs-card:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fs-card:active { transform: translateY(1px); }

/* Короткий список вибору: картка = кнопка вибору + посилання окремо, бо кнопка не вміщує посилань. */
.fs-picks h4 { margin: 0 0 4px; font-size: var(--fs-body, 1rem); }
.fs-picks h4:focus { outline: none; }
.fs-pick-list { display: grid; gap: 10px; margin: 0 0 10px; padding: 0; list-style: none; }
.fs-pick { border: 1px solid rgba(var(--green-rgb), .25); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.fs-pick.is-on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: rgba(var(--green-rgb), .1); }
.fs-pick-main { display: flex; align-items: flex-start; gap: 12px; width: 100%; min-height: 44px; padding: 12px 12px 8px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.fs-pick-main:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--green); }
/* Світлини каталогу на білому, тож підкладка біла в обох темах. Розмір стоїть до завантаження. */
.fs-pick-ph { flex: none; width: 80px; height: 80px; object-fit: contain; padding: 4px; border-radius: 8px; background: #fff; }
.fs-pick-t { flex: 1; min-width: 0; }
.fs-pick-t > b { display: block; color: var(--green); line-height: 1.25; overflow-wrap: anywhere; }
.fs-pick-t > small { display: block; margin-top: 2px; color: var(--hint); font-size: var(--fs-caption); line-height: 1.35; }
.fs-pick-nums { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 8px; font-weight: 700; }
.fs-pick-nums small { display: block; color: var(--hint); font-size: var(--fs-caption); font-weight: 400; }
.fs-pick-links { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 0; padding: 0 12px 4px; font-size: var(--fs-small); }
.fs-pick-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--green); }
@media (hover: hover) and (pointer: fine) { .fs-pick:hover { border-color: var(--green); } }
.fs-picks .fs-know { margin: 6px 0 0; }
.fs-search { display: block; margin-bottom: 12px; }
/* 16 px: менший шрифт поля iOS масштабує при фокусі. */
.fs-search .input { display: block; width: 100%; min-height: 44px; margin-top: 4px; font-size: 16px; }
.fs-more { width: 100%; min-height: 44px; margin: 0 0 12px; justify-content: center; }

/* Ємності майстра ємностей: малюнок згори, дві в ряд на телефоні. */
.fs-vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.fs-vcard { display: grid; justify-items: center; gap: 6px; width: 100%; height: 100%; min-height: 44px; padding: 12px 8px; border: 1px solid rgba(var(--green-rgb), .25); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; text-align: center; cursor: pointer; transition: background-color var(--transition), border-color var(--transition); }
.fs-vcard b { color: var(--green); font-size: var(--fs-small); line-height: 1.3; }
.fs-vcard .fs-art { width: 64px; }
.fs-vcard[aria-pressed="true"] { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); background: rgba(var(--green-rgb), .1); }
.fs-vcard:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) { .fs-vcard:hover { border-color: var(--green); } }

.fs-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.aw .fs-chip { min-width: 72px; min-height: 52px; font-weight: 700; justify-content: center; }
.fs-own { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 18px; }
.fs-own .input { width: 120px; min-height: 44px; }

.fs-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 16px; }
.fs-nav .btn { min-height: 44px; }
.fs-know { margin-left: auto; min-height: 44px; display: inline-flex; align-items: center; padding: 0 4px; border: 0; background: none; color: var(--green);
  font: 600 var(--fs-small) var(--font); text-decoration: underline; cursor: pointer; }
.fs-kb { margin: 14px 0 0; font-size: var(--fs-small); }
.fs-kb a { color: var(--green); }

.fs-away, .fs-other { margin-top: 14px; padding: 12px; border: 1px dashed rgba(var(--green-rgb), .35); border-radius: var(--radius); }
.fs-other { margin: 0 0 14px; }
.fs-away p, .fs-other p { margin: 0 0 10px; font-size: var(--fs-small); }
.fs-away[hidden], .fs-other[hidden] { display: none; }

.fs-sum { display: grid; gap: 8px; margin: 0 0 14px; }
.fs-sum > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: rgba(var(--gold-rgb, 212, 175, 55), .12); }
.fs-sum dt { font-size: var(--fs-small); font-weight: 500; }
.fs-sum dd { margin: 0; color: var(--green); font-size: 1.1rem; font-weight: 800; text-align: right; }
/* Значення — кнопка на весь свій край, щоб у неї легко влучити пальцем. */
.fs-sum > .fs-row { flex-wrap: wrap; align-items: center; padding: 2px 4px 2px 12px; }
.fs-row[hidden] { display: none; }
.fs-sum > .fs-row > dt { flex: none; }
.fs-row-v { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1 1 0; min-width: 0; }
.fs-row-art { flex: none; width: 40px; }
.fs-row-art svg { max-height: 56px; }
.fs-val { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 44px; padding: 4px 8px; border: 0; border-radius: var(--radius); background: none; color: inherit; font: inherit; text-align: right; text-decoration: none; cursor: pointer; }
/* Довгі значення (назва дріжджів, ємність) — окремим рядком: так число не рветься від одиниці. */
.fs-sum > .fs-row.is-wide { flex-direction: column; align-items: stretch; gap: 0; padding: 10px 4px 6px 12px; }
.is-wide .fs-row-v { justify-content: flex-start; flex: none; }
.is-wide .fs-val { flex: 1; justify-content: space-between; padding-left: 0; font-size: 1rem; text-align: left; }
.fs-val .ico { flex: none; width: 16px; height: 16px; color: var(--hint); }
.fs-swap { flex: none; color: var(--green); font-size: var(--fs-small); font-weight: 600; text-decoration: underline; }
.fs-val:focus-visible { outline: none; box-shadow: var(--focus-ring); }
@media (hover: hover) and (pointer: fine) { .fs-val:hover { background: rgba(var(--green-rgb), .08); } }
.fs-put { width: 100%; min-height: 50px; font-size: 1rem; }

.fs-dos { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.fs-do { display: flex; gap: 12px; padding: 12px; border: 1px solid rgba(var(--green-rgb), .12); border-radius: var(--radius); }
.fs-do.is-cur { border: 2px solid var(--green); padding: 11px; }
.fs-do-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(var(--green-rgb), .1); color: var(--hint); font-size: var(--fs-small); font-weight: 700; }
.fs-do.is-cur .fs-do-mark, .fs-do.is-done .fs-do-mark { background: var(--green); color: #fff; }
.fs-do-t { margin: 3px 0 0; color: var(--green); font-weight: 700; line-height: 1.35; }
.fs-do.is-done .fs-do-t { color: var(--hint); }
.fs-do > div { flex: 1; min-width: 0; }
.fs-do-b p { margin: 4px 0 10px; font-size: var(--fs-small); }
.fs-do-b .aw-num { margin-bottom: 10px; }
.fs-do-b .aw-num .input { width: 140px; min-height: 44px; }
.fs-do-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.fs-do-acts .btn { min-height: 44px; }
.fs-do-acts [data-fs-undo] { margin-left: auto; }
.fs-undo { margin: 2px 0 0; min-height: 36px; font-weight: 500; }
.fs-undo[hidden] { display: none; }
.fs-dashed { border-style: dashed; }
/* Замір приладом: прилад чипами, далі ті самі рядки-кнопки, що в складі */
.fs-gauge { margin: 4px 0 10px; }
.fs-gauge-h { margin: 0 0 8px; font-weight: 600; }
/* Назви приладів довгі: стовпчиком, як пункти списку, а не круглі чипи */
.fs-gauge .fs-chips { display: grid; justify-items: start; gap: 8px; }
.aw .fs-gauge .fs-chip { min-height: 44px; max-width: 100%; padding: 8px 14px; border-radius: var(--radius); font-weight: 600;
  white-space: normal; text-align: left; line-height: 1.25; justify-content: flex-start; }
.fs-gauge .fs-sum { margin: 12px 0 0; }
.fs-gauge .fs-kb { margin-top: 10px; }
.fs-gauge [hidden] { display: none; }
/* Ємність у переліку, де запас під піну менший за норму */
.fs-vcard small { color: var(--hint); font-size: var(--fs-caption); }
.fs-vcard.is-own .ico { width: 40px; height: 40px; margin: 12px 0 4px; color: var(--green); }
.fs-vgrid[hidden], .fs-vgrid > li[hidden], .fs-vsizes[hidden], .fs-own[hidden] { display: none; }
.fs-vback { margin: 0 0 8px; padding-left: 0; }
.fs-vtight { color: var(--warn, #8a5a00); font-size: var(--fs-caption); font-weight: 600; line-height: 1.25; }
.fs-vtight[hidden] { display: none; }
/* Навіщо входити: дві користі, кожна зі своєю кнопкою нижче */
.fs-why { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.fs-why li { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--radius); background: rgba(var(--green-rgb), .07); }
.fs-why .ico { flex: none; width: 22px; height: 22px; color: var(--green); }
.fs-why p { margin: 0; font-size: var(--fs-small); }
.fs-why b { color: var(--green); }
.fs-offer-a .btn .ico { width: 20px; height: 20px; margin-right: 6px; }
.fs-tg-how { margin: 10px 0 0; }
.fs-err { color: var(--danger, #b3261e); }

.fs-cards { display: grid; gap: 8px; margin-bottom: 16px; }
.fs-card-s { padding: 12px; border-radius: var(--radius); background: rgba(var(--gold-rgb, 212, 175, 55), .12); }
.fs-card-s small { display: block; color: var(--hint); font-size: var(--fs-caption); font-weight: 600; }
.fs-card-s b { display: block; margin-top: 2px; color: var(--green); }
.fs-offer-t { margin: 0 0 12px; font-size: var(--fs-small); }
.fs-offer-a { display: grid; gap: 8px; }
.fs-offer-a .btn { min-height: 48px; justify-content: center; text-align: center; }

.fs-res-in { display: grid; gap: 18px; justify-items: center; }
.fs-res-t { width: 100%; min-width: 0; }
.fs-art { width: 150px; }
.fs-art svg { display: block; width: 100%; height: auto; }
/* Схема апарата (вибір апарата в /scene) висока й вузька: малюнок у межах висоти, а не на весь екран. */
.fs-art img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; }
@media (max-width: 720px) { .fs-art img { max-height: 96px; } }
/* Числа стоять поруч рядками; під малюнком вони лише повторювались би. */
.fs-art .cl-gauge-cap, .fs-art .cl-gauge-free, .fs-art .cl-over { display: none; }
.fs-art .cl-gauge { margin: 0; }
.fs-rows { display: grid; gap: 6px; margin: 0; }
.fs-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fs-rows > div[hidden], .fs-sum > div[hidden] { display: none; }
.fs-rows dt { color: var(--hint); font-size: var(--fs-small); font-weight: 500; }
.fs-rows dd { margin: 0; color: var(--green); font-weight: 700; text-align: right; }
.fs-note { margin: 8px 0 0; font-size: var(--fs-small); line-height: 1.45; }
.fs-note[hidden] { display: none; }

@media (max-width: 720px) {
  .fs .aw-body { display: flex; flex-direction: column; overflow: hidden; }
  .fs .aw-q { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
  .fs .fs-res { position: static; flex: none; max-height: 34dvh; overflow: auto; }
  .fs-res-in { grid-template-columns: 48px minmax(0, 1fr); align-items: center; justify-items: stretch; gap: 14px; }
  .fs-art { width: 48px; }
  .fs:not(:modal) { width: auto; height: auto; }
  /* Смуга внизу коротка: числа у дві колонки, щоб список лишався на екрані. */
  .fs-rows { display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .fs-rows > div { flex-direction: column; align-items: flex-start; gap: 0; }
  .fs-rows dd { text-align: left; font-size: var(--fs-small); }
  .fs-rows dt { font-size: var(--fs-caption); }
  .fs-chips .fs-chip { flex: 1 1 64px; }
  .fs-gauge .fs-chips { justify-items: stretch; }
  /* Перед «Поставити» склад уже на екрані: смуга лише забирала б місце в кнопки. */
  .fs[data-fs-at="ready"] .fs-res { display: none; }
}

/* Сторінка під вікном: те, що читає пошук і людина, яка вікно закрила. */
.fs-page { max-width: 760px; }
.fs-page h1 { margin-bottom: 8px; }
.fs-lead { margin: 0 0 16px; font-size: 1.05rem; }
/* Два входи — великими плитками з малюнком тари (власник 07.11): ліва — вікно з чотирма
   питаннями, права — одразу журнал партії. На телефоні одна під одною. */
.fs-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 28px; }
.fs-tile {
  appearance: none; font: inherit; text-align: left; cursor: pointer; text-decoration: none;
  display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px;
  border: 1px solid var(--border-control); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; min-width: 0;
}
.fs-tile-main { border-color: rgba(var(--green-rgb), .45); background: linear-gradient(180deg, rgba(var(--green-rgb), .08), var(--surface) 75%); }
@media (hover: hover) { .fs-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--green); } }
.fs-tile:active { transform: scale(.99); }
.fs-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fs-tile-art { display: flex; align-items: flex-end; gap: 16px; height: 108px; margin-bottom: 6px; }
.fs-tile-art img { height: 100%; width: auto; max-height: none; }
/* Переліки складу (комплектація, комплекти) — список посилань, як «Почитай» на сторінці. */
.fs-block { margin: 14px 0 0; }
.fs-block[hidden] { display: none; }
.fs-block h4 { margin: 0 0 6px; font-size: var(--fs-small); color: var(--hint); font-weight: 600; }
.fs-block .fs-read { font-size: var(--fs-small); line-height: 1.45; }
.fs-tile-art > .ico { width: 44px; height: 44px; align-self: center; color: var(--green); }
.fs-tile-steps { display: flex; gap: 6px; align-self: center; }
.fs-tile-steps i {
  font-style: normal; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: var(--fs-small); font-weight: 700; color: var(--green);
  border: 1.5px solid rgba(var(--green-rgb), .45); background: var(--surface);
}
.fs-tile-steps i:first-child { background: var(--green); border-color: var(--green); color: var(--surface); }
.fs-tile-h { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.fs-tile-main .fs-tile-h { color: var(--green); }
.fs-tile-p { color: var(--hint); line-height: 1.5; }
@media (max-width: 560px) {
  .fs-tiles { grid-template-columns: 1fr; }
  .fs-tile-art { height: 92px; }
  .fs-tile-art svg { height: 88px; width: auto; }
}
/* Партія вже є — повернутися до неї важливіше за новий початок: суцільна смуга над плитками. */
.fs-resume { margin: 0 0 14px; }
.fs-resume a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px;
  padding: 12px 18px; border-radius: var(--radius-md); background: var(--green); color: var(--surface);
  font-weight: 700; text-decoration: none; transition: filter var(--transition);
}
@media (hover: hover) { .fs-resume a:hover { filter: brightness(1.1); } }
.fs-resume a:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.fs-resume .ico { width: 22px; height: 22px; flex: none; }
@media (prefers-reduced-motion: reduce) {
  .fs-tile, .fs-resume a { transition: none; }
  .fs-tile:hover, .fs-tile:active { transform: none; }
}
.fs-page h2 { margin: 28px 0 10px; }
/* Сторінка й права панель «Почитай і порахуй» (readtiles.js): поруч на широкому екрані,
   на вужчому панель іде під основним. */
.fs-side { max-width: 760px; margin-top: 8px; }
@media (min-width: 1180px) {
  .fs-cols { display: grid; grid-template-columns: minmax(0, 760px) minmax(260px, 320px); gap: 40px; align-items: start; }
  .fs-side { position: sticky; top: 80px; margin-top: 64px; }
}
