.ebook-generator {
  --ebook-ink: #17212b;
  --ebook-muted: #5e6b75;
  --ebook-border: #d7dde2;
  --ebook-surface: #ffffff;
  --ebook-action: #0f766e;
  color: var(--ebook-ink);
  font-family: Inter, system-ui, sans-serif;
  max-width: 760px;
  margin: 2rem auto;
}
.ebook-progress { height: 6px; background: #e8ecef; margin-bottom: 2rem; overflow: hidden; }
.ebook-progress span { display: block; height: 100%; width: 25%; background: var(--ebook-action); transition: width .25s ease; }
.ebook-generator [hidden] { display: none !important; }
.ebook-step { border-top: 1px solid var(--ebook-border); padding-top: 1.5rem; }
.ebook-step h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); line-height: 1.15; margin: 0 0 1.5rem; }
.ebook-step label { display: grid; gap: .45rem; margin: 1rem 0; font-weight: 650; }
.ebook-step input, .ebook-step select {
  width: 100%; min-height: 46px; border: 1px solid var(--ebook-border); border-radius: 4px;
  padding: .7rem .8rem; background: var(--ebook-surface); color: var(--ebook-ink); font: inherit;
}
.ebook-step button {
  min-height: 44px; border: 1px solid var(--ebook-action); border-radius: 4px; padding: .65rem 1rem;
  background: var(--ebook-action); color: white; font: inherit; font-weight: 700; cursor: pointer;
}
.ebook-step button:disabled { cursor: wait; opacity: .65; }
.ebook-mode, .ebook-actions { display: flex; flex-wrap: wrap; gap: .65rem; }
.ebook-mode button:not(.is-active), .ebook-actions .ebook-back { color: var(--ebook-action); background: transparent; }
.ebook-actions { justify-content: space-between; margin-top: 1.5rem; }
.ebook-live { color: #a12a2a; min-height: 1.5rem; }
.ebook-preview, .ebook-reader { font-family: Georgia, serif; font-size: 1.08rem; line-height: 1.72; }
.ebook-result header > p:first-child { color: var(--ebook-action); font: 700 .8rem/1 Inter, sans-serif; text-transform: uppercase; }
.ebook-unlock { border-top: 3px solid var(--ebook-action); margin-top: 2rem; padding-top: 1rem; font-family: Inter, sans-serif; }
.ebook-check { grid-template-columns: 22px 1fr !important; font-weight: 400 !important; }
.ebook-check input { min-height: auto; width: 18px; }
.ebook-toc { display: grid; gap: .4rem; border-block: 1px solid var(--ebook-border); padding-block: 1rem; margin-block: 1.5rem; }
.ebook-toc a { color: var(--ebook-action); }
.ebook-reader section { scroll-margin-top: 2rem; }
@media (max-width: 600px) {
  .ebook-generator { margin: 1rem 0; }
  .ebook-mode button { width: 100%; }
}
@media print {
  .ebook-progress, .ebook-live, .ebook-toc, .ebook-print, .ebook-unlock { display: none !important; }
  .ebook-generator, .ebook-reader { max-width: none; margin: 0; font-size: 11pt; color: #000; }
  .ebook-reader section { break-before: page; }
  h2, h3 { break-after: avoid; }
  table, blockquote, figure { break-inside: avoid; }
  @page { size: A4; margin: 20mm 18mm; }
}
