:root {
  --red: #c8423b; --red-d: #a8322c; --green: #2f6f55; --gold: #e9a93a;
  --ink: #2b2a33; --muted: #77737f; --bg: #f7f1e8; --card: #fff; --line: #e7ddcf;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: 'Nunito', 'Segoe UI', Arial, sans-serif; font-size: 16px; }
h2 { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 30px; color: var(--red); text-shadow: 0 .04em 0 #fff, 0 -.04em 0 #fff, .04em 0 0 #fff, -.04em 0 0 #fff, 0 .1em 0 #f1c9c4, 0 .16em .25em rgba(200, 66, 59, .25); margin: 0 0 8px; }
small { color: var(--muted); }
.hint { color: var(--muted); margin: 0 0 20px; }

#app { max-width: 980px; margin: 0 auto; padding: 0 20px 110px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 0; flex-wrap: wrap; }
.logo { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 24px; text-shadow: 0 .04em 0 #fff, 0 -.04em 0 #fff, .04em 0 0 #fff, -.04em 0 0 #fff, 0 .1em 0 #f1c9c4; color: var(--red); }
.top-note { font-size: 13px; color: var(--muted); }

.stepper { display: flex; gap: 6px; margin-bottom: 16px; }
.stepper button { flex: 1; border: 0; background: #ebe2d4; color: var(--muted); padding: 10px 6px; border-radius: 10px; font: inherit; font-size: 14px; cursor: pointer; }
.stepper button.on { background: var(--red); color: #fff; font-weight: 700; }
.stepper button.done { background: #d9eadf; color: var(--green); }
.stepper button:disabled { cursor: default; opacity: .6; }

.panel { background: var(--card); border-radius: 20px; padding: 32px; box-shadow: 0 4px 24px rgba(80, 60, 30, .07); }
.step { display: none; }
.step.on { display: block; }

.field { display: block; margin-bottom: 20px; font-weight: 700; }
.field input, .field select { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; font: inherit; font-weight: 400; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }
.field small { display: block; font-weight: 400; margin-top: 6px; }
.seg { display: flex; gap: 8px; margin-top: 6px; }
.seg button { flex: 1; padding: 12px; font: inherit; border: 2px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; }
.seg button.on { border-color: var(--red); background: #fdeceb; font-weight: 700; }

.child-grid { display: grid; grid-template-columns: 1fr 240px; gap: 32px; }
.photo-box { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.photo-preview { width: 200px; height: 200px; border-radius: 50%; background: #eef4f9; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--gold); display: flex; align-items: center; justify-content: center; font-size: 72px; overflow: hidden; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--red); color: #fff; padding: 12px 22px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--red-d); }
.btn--ghost { background: #f1e9dc; color: var(--ink); }
.btn--ghost:hover { background: #e7dccb; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }

.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.chip { display: flex; align-items: center; gap: 10px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; text-align: left; }
.chip span { font-size: 26px; }
.chip.on { border-color: var(--red); background: #fdeceb; font-weight: 700; }
.chip:disabled { opacity: .45; cursor: not-allowed; }

.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.theme { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; cursor: pointer; text-align: left; }
.theme .ico { font-size: 30px; }
.theme b { display: block; margin-bottom: 2px; }
.theme small { display: block; }
.theme.on { border-color: var(--green); background: #e8f4ec; }

.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.days-count { grid-column: 1 / -1; margin: -6px 0 18px; padding: 12px 16px; background: #fff6e2; border-radius: 12px; font-weight: 700; }
.days-count.bad { background: #fdeceb; color: var(--red); }
.toggles { display: grid; gap: 10px; }
.toggle { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--red); }

.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.plan { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 46px 130px 1fr auto 44px; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #faf6ef; }
.row.we { background: #f3f8f3; }
.row .n { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 20px; color: var(--red); text-align: center; }
.row .d { font-size: 14px; line-height: 1.2; }
.row .d small { display: block; }
.row .t b { display: block; }
.row .t small { display: block; line-height: 1.3; }
.row .tag-time { font-size: 13px; color: var(--muted); white-space: nowrap; }
.row .swap { width: 40px; height: 40px; border-radius: 10px; border: 0; background: #fff; cursor: pointer; font-size: 18px; }
.row .swap:hover { background: #ffe9c4; }
.row.flash { animation: flash .6s; }
@keyframes flash { from { background: #ffe9c4; } }

.preview { margin-top: 24px; padding: 20px; background: #6d6a73; border-radius: 16px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; max-height: 80vh; overflow: auto; }
.preview .page { zoom: .42; box-shadow: 0 4px 20px rgba(0, 0, 0, .3); flex: none; }
.pdf-help { margin-top: 16px; padding: 14px 16px; background: #fff6e2; border-radius: 12px; font-size: 15px; }

.nav { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255, 255, 255, .95); border-top: 1px solid var(--line); padding: 14px 20px; display: flex; justify-content: center; gap: 16px; align-items: center; backdrop-filter: blur(6px); }
.nav .btn { min-width: 140px; justify-content: center; }
.nav-error { flex: 0 1 560px; text-align: center; color: var(--red); font-weight: 700; font-size: 14px; }

a.logo { text-decoration: none; }
.btn:disabled { opacity: .6; cursor: wait; }

.progress { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 12px 16px; background: #fff6e2; border-radius: 12px; font-weight: 700; }
.progress-bar { flex: 0 0 200px; height: 10px; background: #f0e3cb; border-radius: 6px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }

/* Водяной знак в бесплатном предпросмотре */
.preview--locked .page::after { content: 'ОБРАЗЕЦ'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-35deg); font: 900 90pt 'Nunito', sans-serif; color: rgba(200, 66, 59, .16); letter-spacing: 8px; pointer-events: none; z-index: 5; }

.modal { border: 0; border-radius: 20px; padding: 28px; max-width: 440px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal::backdrop { background: rgba(30, 25, 40, .45); }
.modal h3 { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 22px; margin: 0 0 10px; }
.modal-what { color: var(--muted); margin: 0 0 16px; }
.modal-price { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 36px; color: var(--red); margin-bottom: 14px; }
.modal-demo { background: #fff6e2; border-radius: 10px; padding: 10px 12px; font-size: 14px; margin-bottom: 14px; }
.modal-agree { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 18px; }
.modal-agree a { color: var(--ink); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

#print-root { display: none; }

@media (max-width: 720px) {
  .panel { padding: 20px; }
  .child-grid, .settings { grid-template-columns: 1fr; }
  .photo-box { order: -1; }
  .stepper button { font-size: 0; padding: 8px; }
  .stepper button::before { content: attr(data-n); font-size: 14px; }
  .row { grid-template-columns: 34px 1fr 40px; }
  .row .d, .row .tag-time { display: none; }
  .preview .page { zoom: .3; }
}

@media print {
  body { background: #fff; }
  #app { display: none !important; }
  #print-root { display: block; }
}
