.book { container: book / inline-size; display: grid; gap: var(--s5); min-width: 0; }
.book__head { display: grid; gap: var(--s1); }
.book__title { font-size: 20px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
.book__note { font-size: 14px; color: var(--muted); }
.book__steps { display: grid; gap: var(--s5); min-width: 0; }

.step { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: var(--s2); }
.step__label { padding: 0; margin-block-end: var(--s2); font-size: 14px; font-weight: 600; }
.step__error { font-size: 14px; color: var(--danger); }

.options { display: grid; min-width: 0; }
.options--list { border-block-start: 1px solid var(--line); }

.opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 48px;
  padding-block: var(--s2);
  border-block-end: 1px solid var(--line);
  cursor: pointer;
}
.opt__input { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; margin: 0; opacity: 0; cursor: pointer; }
.opt__mark {
  flex: none;
  display: grid;
  place-items: center;
  inline-size: 18px;
  block-size: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  transition: border-color 140ms var(--ease-out);
}
.opt__mark::after { content: ""; inline-size: 8px; block-size: 8px; border-radius: 50%; background: transparent; }
.opt:has(.opt__input:checked) .opt__mark { border-color: var(--plum); }
.opt:has(.opt__input:checked) .opt__mark::after { background: var(--plum); }
.opt:has(.opt__input:focus-visible) { outline: 2px solid var(--plum); outline-offset: 2px; border-radius: var(--r1); }
.opt__text { flex: 1 1 auto; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.opt__text--stack { flex-direction: column; align-items: flex-start; gap: 0; }
.opt__name { min-width: 0; font-size: 16px; line-height: 1.3; }
.opt__meta { flex: none; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: end; }
.opt__text--stack .opt__meta { text-align: start; }

.select {
  appearance: none;
  inline-size: 100%;
  min-height: 48px;
  padding: 0 var(--s7) 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23665c6d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
  font-size: 16px;
  line-height: 1.3;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .select:hover { border-color: var(--plum); }
}

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: var(--s4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r2);
  background: var(--surface);
  font-size: 15px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), border-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 120ms var(--ease-out);
}
.chip:active { transform: scale(0.97); }
.chip:has(.opt__input:checked) { background: var(--plum); border-color: var(--plum); color: var(--on-plum); }
.chip:has(.opt__input:focus-visible) { outline: 2px solid var(--plum); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .chip:hover { border-color: var(--plum); }
  .opt:hover .opt__mark { border-color: var(--plum); }
}

.chips--days { margin-block-end: var(--s3); }
.slots { display: grid; gap: var(--s3); }
.slots__group { display: grid; gap: var(--s2); }
.slots__title { font-size: 13px; color: var(--muted); }
.slots__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: var(--s2); }
.chip--slot { padding-inline: var(--s2); }
.slots__empty { font-size: 15px; color: var(--muted); }

.more {
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--plum);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.book__foot { display: grid; gap: var(--s3); }
.book__summary { display: grid; gap: 2px; font-size: 15px; line-height: 1.45; }
.book__what { font-weight: 600; }
.book__summary.is-empty .book__when { color: var(--muted); }
.book__submit { inline-size: 100%; }
.book__done { padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--ok-soft); font-size: 15px; line-height: 1.45; }
.book__done:focus { outline: none; }
.book__done:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }

/* Три шага рядом, когда места хватает. */
@container book (min-width: 720px) {
  .book--columns .book__steps { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 1.1fr); column-gap: var(--s6); align-items: start; }
  .book--columns .book__foot { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--s6); }
  .book--columns .book__submit { inline-size: auto; min-inline-size: 200px; }
  .book--columns .slots__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Узкий виджет: мастера и дни ровной сеткой, без рваных переносов. */
@container book (max-width: 360px) {
  .step--master .chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chips--days { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .chips--days .chip { padding-inline: var(--s1); font-size: 14px; }
}
@container book (max-width: 290px) {
  .chips--days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Мышь на широком экране: плотнее, зоны 40px остаются удобными. */
@media (min-width: 1024px) and (pointer: fine) {
  .chip { min-height: 40px; }
  .opt { min-height: 40px; padding-block: 6px; }
}
