/* Кроки — майстер «одне питання на екрані» (core/steps.js, docs/15-design.md). */
.steps { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Смужка поступу: сегменти, пройдені — кольору дії, поточний — наполовину. */
.steps-bar { display: flex; gap: 6px; }
.steps-bar i { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--fill); overflow: hidden; }
.steps-bar i::after { content: ""; position: absolute; inset: 0; width: 0; border-radius: 2px; background: var(--action);
  transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.steps-bar i.done::after { width: 100%; }
.steps-bar i.on::after { width: 50%; }

/* Чіпи відповідей: що вже сказано; натиск — змінити. */
.steps-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.steps-chips:empty { display: none; }
.steps-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; height: 32px; padding: 0 8px 0 12px;
  border: 1px solid var(--line-str); border-radius: 999px; background: none; color: var(--ink);
  font: 500 13.5px var(--sans); cursor: pointer; animation: steps-pop .25s ease-out; }
.steps-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-chip .ico { width: 15px; height: 15px; color: var(--dim); flex: none; }

.steps-q { margin: 0 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; outline: none; }
.steps-card { display: flex; flex-direction: column; gap: 10px; }
/* Кнопка кроку — липка внизу аркуша (довгі кроки гортаються під нею). */
.steps-foot { position: sticky; bottom: calc(-1 * var(--gap)); z-index: 2; margin: 4px calc(-1 * var(--gap)) calc(-1 * var(--gap));
  padding: var(--gap-sm) var(--gap) var(--gap); background: var(--surface); border-top: 1px solid var(--line); }
/* Перехід між кроками: стара картка йде (0,15 с), нова входить з легкою пружиною. */
.steps-card.in-next { animation: steps-in-next .34s cubic-bezier(.2, .9, .3, 1.08); }
.steps-card.in-prev { animation: steps-in-prev .34s cubic-bezier(.2, .9, .3, 1.08); }
.steps-card.out-next { animation: steps-out-next .15s ease-in forwards; }
.steps-card.out-prev { animation: steps-out-prev .15s ease-in forwards; }
@keyframes steps-out-next { to { opacity: 0; transform: translateX(-24px) scale(.98); } }
@keyframes steps-out-prev { to { opacity: 0; transform: translateX(24px) scale(.98); } }
/* Питання й варіанти входять по черзі знизу. */
.steps-card.in-next .steps-q, .steps-card.in-prev .steps-q { animation: steps-rise .3s ease-out both; }
.steps-card [style*="--i"] { animation: steps-rise .32s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(60ms + var(--i) * 35ms); }
@keyframes steps-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* Вибраний варіант коротко «відгукується» перед переходом. */
.choice.picked, .tile.picked { border-color: var(--action); background: var(--action-soft); animation: steps-picked .17s ease-out; }
@keyframes steps-picked { 50% { transform: scale(.965); } }
@keyframes steps-in-next { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes steps-in-prev { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes steps-pop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }

/* Великий рядок-вибір на всю ширину (мінімум --touch, у рукавиці). */
.choice { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px 10px 16px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink);
  text-align: left; font: inherit; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.choice:hover { border-color: var(--line-str); }
.choice:active { transform: scale(.985); }
.choice.on { border-color: var(--action); background: var(--action-soft); }
.choice.quiet { background: none; }
.choice-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.choice-t b { font-size: 16.5px; font-weight: 600; }
.choice-t small { font-size: 13px; color: var(--muted); }
.choice .ico { width: 18px; height: 18px; color: var(--dim); flex: none; }
.choice .ico.lead { width: 22px; height: 22px; color: var(--action); }
.choice .ico.mine { width: 19px; height: 19px; color: var(--mine); margin-right: -4px; }
.steps-card > .grp-label { margin: 6px 0 -4px; }
.steps-card > .grp-label:first-child { margin-top: 0; }

.steps-up { align-self: flex-start; }

/* Рамка майбутнього кадру: розмита веселка й камера; потім — сам знімок. */
.steps-shot { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; max-height: 46vh;
  padding: 0; overflow: hidden; border: 1px solid var(--line-str); border-radius: var(--r-lg); background: var(--card); cursor: pointer; }
.steps-shot::before { content: ""; position: absolute; inset: -30%; background: var(--shot-bg); filter: blur(42px) saturate(1.1); opacity: .55; }
.steps-shot.has::before { display: none; }
.steps-shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: steps-pop .3s ease-out; }
.steps-shot-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink); }
.steps-shot-in .ico { width: 64px; height: 64px; padding: 16px; border-radius: 50%; background: var(--raised); box-shadow: var(--shadow-sm); }
.steps-shot-in small { font: 600 14px var(--sans); text-shadow: 0 1px 6px var(--bg); }

/* Плитки — короткі варіанти сіткою по дві. */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 92px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card);
  color: var(--ink); font: 600 16px var(--sans); text-align: center; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.tile:hover { border-color: var(--line-str); }
.tile .ico { width: 30px; height: 30px; color: var(--action); }
.tile.on .ico { color: var(--ink); }
.tile:active { transform: scale(.97); }
.tile.on { border-color: var(--action); background: var(--action-soft); }

/* Перемикач на три (важливість): вибране — як вибраний сегмент (--seg-on). */
.steps-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: var(--r); background: var(--fill); }
.steps-seg button { min-height: 44px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted);
  font: 600 14.5px var(--sans); cursor: pointer; }
.steps-seg button.on { background: var(--seg-on); color: var(--ink); box-shadow: var(--seg-shadow); transition: background .2s, color .2s; }
/* Важливість: вибране — кольору стану (колір стану тут означає стан, не дію). */
.steps-seg button.p-low.on { background: var(--fill); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--off); }
.steps-seg button.p-normal.on { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); }
.steps-seg button.p-critical.on { background: var(--crit-bg); color: var(--crit); box-shadow: inset 0 0 0 1.5px var(--crit); }

/* Велика кнопка кроку (фото, надіслати). */
.steps .btn.huge { width: 100%; min-height: 56px; font-size: 17px; }
.steps-photo { display: block; width: 100%; max-height: 140px; object-fit: cover; border-radius: var(--r); }
.steps textarea { min-height: 120px; font-size: 16px; }

/* Готово: позначка з'являється, людина бачить, що все пішло. */
.steps-done { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 0 10px; text-align: center; }
.steps-done .steps-mark { position: relative; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ok-bg); color: var(--ok); animation: steps-pop .35s cubic-bezier(.2, .9, .3, 1.3); }
/* Хвиля від позначки — «надіслано» відчувається. */
.steps-done .steps-mark::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ok);
  animation: steps-wave .9s .15s ease-out both; }
@keyframes steps-wave { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.9); } }
.steps-done h2, .steps-done .btn { animation: steps-rise .35s .25s ease-out both; }
.steps-done .steps-mark svg { width: 40px; height: 40px; }
.steps-done .steps-mark path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: steps-draw .4s .2s ease-out forwards; }
.steps-done h2 { margin: 0; font-size: 22px; }
@keyframes steps-draw { to { stroke-dashoffset: 0; } }

/* Аркуш майстра виїжджає знизу, як екран застосунку. */
.sheet.wiz { animation: steps-sheet .32s cubic-bezier(.2, .8, .2, 1); }
@keyframes steps-sheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Майстер на телефоні — на весь екран: менше відволікає. */
@media (max-width: 760px) { .sheet.wiz { max-height: 100dvh; height: 100dvh; border-radius: 0; } }

@media (prefers-reduced-motion: reduce) {
  .steps-card, .steps-card *, .steps-chip, .steps-done *, .steps-done .steps-mark::after, .sheet.wiz { animation: none !important; }
  .steps-bar i::after { transition: none; }
  .steps-done .steps-mark path { animation: none; stroke-dashoffset: 0; }
}
