.book-toggle { color: #ffe6a8; border-color: #9d895c; }
.book-toggle[aria-pressed="true"] { color: #fff1c7; background: #3d3323; border-color: #e6c373; }
.book-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 1px 0 19px;
}
.book-heading h2 { font-size: clamp(1.75rem, 4vw, 3.25rem); letter-spacing: -.065em; line-height: 1.05; }
.book-heading h2:focus { outline: none; }
.book-heading p { color: #b9cdcd; margin-top: 7px; }
.book-workspace { display: grid; grid-template-columns: minmax(265px, .82fr) minmax(0, 1.35fr); gap: 14px; align-items: start; }
.book-catalog, .book-recipe {
  min-width: 0;
  border: 1px solid #445951;
  border-radius: 8px;
  box-shadow: 0 16px 42px #0005;
  overflow: hidden;
  background: #101d21;
}
.book-filters, .book-recipe-head {
  border-bottom: 1px solid #45584f;
  background: linear-gradient(125deg, #29342f, #152126 73%);
  padding: 14px;
}
.book-search { margin: 0; }
.book-selects {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 11px;
}
.book-selects label, #recipe-variants { display: grid; gap: 3px; font-size: .875rem; color: #caddd5; }
.book-selects select, #recipe-variant { min-width: 0; width: 100%; }
.book-count { padding: 8px 14px 0; color: #bdcdc6; font-size: .875rem; }
.book-results {
  list-style: none;
  padding: 8px 12px 12px;
  margin: 0;
  max-height: clamp(195px, 58svh, 548px);
  overflow: auto;
  scrollbar-color: #60796f #101b1d;
}
.book-results li + li { margin-top: 4px; }
.book-results button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 8px 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid #34494b;
  border-radius: 4px;
  text-align: left;
  background: #142328;
  font-size: .9rem;
}
.book-results button[aria-pressed="true"] { border-color: #e0c380; background: #3b3526; }
.book-results button:hover:not([aria-pressed="true"]) { border-color: #9abcd1; }
.recipe-badge { color: #b9ccc3; flex: none; font: .74rem var(--mono); }
.book-results .is-ready .recipe-badge { color: #a4f4cf; }
.book-empty { padding: 5px 2px; color: #bfd0cc; line-height: 1.45; }
.book-recipe-head, .book-recipe-body { padding: clamp(14px, 3vw, 24px); }
.recipe-identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
  min-height: 65px;
}
.recipe-identity .emblem { width: 64px; height: 64px; }
.recipe-identity h3 {
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -.04em;
}
.recipe-identity p { color: #bcdacf; margin: 5px 0 0; line-height: 1.4; }
#recipe-back { margin-bottom: 6px; }
#recipe-variants { max-width: 540px; margin-top: 12px; }
.book-recipe-body { display: grid; justify-items: start; gap: 14px; }
#recipe-pattern { width: 100%; max-width: 560px; }
.book-pattern {
  display: grid;
  grid-template-columns: repeat(var(--book-columns), minmax(0, 1fr));
  gap: 7px;
}
.book-part {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 91px;
  height: 100%;
  min-width: 0;
  width: 100%;
  padding: 7px 4px;
  color: #e7f3ef;
  background: #152c2d;
  border: 1px solid #4f746d;
  border-radius: 5px;
  text-align: center;
  overflow-wrap: anywhere;
  font-size: .85rem;
}
.book-part .emblem { width: 39px; height: 39px; }
.book-part span:last-child { color: #c9ddd6; font-size: .76rem; }
.book-part.missing { background: #302927; border-color: #8b7064; }
.book-part.missing:hover { border-color: #ffe0b9; }
.book-part.empty { color: #91a9ab; background: #101a1d; border: 1px dashed #405552; }
.recipe-warning { color: #f9d1a9; font-size: .9rem; line-height: 1.45; }
#recipe-instructions, #recipe-empty { color: #cad8d3; line-height: 1.45; }
@media (max-width: 830px) {
  .topbar .settings { flex-wrap: wrap; justify-content: flex-end; }
  .book-workspace { grid-template-columns: minmax(0, 1fr); }
  .book-results { max-height: 235px; }
}
@media (max-width: 420px) {
  .book-heading { align-items: start; }
  .book-selects { grid-template-columns: minmax(0, 1.14fr) minmax(0, .86fr); }
  .book-part { min-height: 82px; }
  .book-part .emblem { width: 33px; height: 33px; }
}
