/* Printitos — общий стиль сайта, генераторов и печатных листов */
:root {
  --brand: #ff7a45;
  --brand-dark: #e8622d;
  --teal: #1fa39a;
  --sun: #ffd25a;
  --ink: #23303b;
  --muted: #5d6b78;
  --line: #e7e1d8;
  --bg: #fffaf3;
  --card: #ffffff;
  --radius: 18px;
  --head: "Fredoka", "Jua", "Nunito", system-ui, sans-serif;
  --body: "Nunito", "Gowun Dodum", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--body);
}
.lang-ko { word-break: keep-all; }
a { color: var(--brand-dark); }
img, svg { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--head); font-weight: 600; line-height: 1.2; }
h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 12px; }
h2 { font-size: clamp(24px, 3.4vw, 32px); margin: 48px 0 8px; }
.sub, .lead { color: var(--muted); }
.lead { font-size: 19px; max-width: 720px; }

/* ---------- шапка ---------- */
.top { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.top-in { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-name { font: 700 24px var(--head); letter-spacing: .2px; }
.menu { display: flex; gap: 18px; margin-left: auto; }
.menu a { color: var(--ink); text-decoration: none; font-weight: 700; }
.menu a:hover { color: var(--brand-dark); }
.langs { display: flex; gap: 4px; }
.lang { padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; color: var(--muted); }
a.lang:hover { background: #f3ede4; color: var(--ink); }
.lang.on { background: var(--ink); color: #fff; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; text-decoration: none;
  font: 700 18px var(--body); padding: 13px 24px; border-radius: 14px;
  box-shadow: 0 4px 0 var(--brand-dark); transition: transform .08s, box-shadow .08s;
}
.btn:hover { background: #ff8a5a; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--brand-dark); }
.btn-print { background: var(--teal); box-shadow: 0 4px 0 #15807a; }
.btn-print:hover { background: #25b5ab; }
.btn-print:active { box-shadow: 0 1px 0 #15807a; }

/* ---------- главная ---------- */
.hero { background: linear-gradient(180deg, #fff1e3 0%, var(--bg) 100%); padding: 40px 0 24px; }
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; gap: 32px; align-items: center; }
.kicker { display: inline-block; background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 3px 14px; font-weight: 800; font-size: 14px; color: var(--teal); margin: 0 0 14px; }
.hero-art svg { width: 100%; height: auto; }
.feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 24px; }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feat-ico { font-size: 28px; display: block; }
.feat b { display: block; font-size: 18px; margin: 6px 0 2px; }
.feat p { margin: 0; color: var(--muted); font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 18px; }
.card {
  display: flex; flex-direction: column; gap: 4px; padding: 20px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); }
.card-ico { font-size: 40px; }
.card b { font: 600 22px var(--head); }
.card span { color: var(--muted); font-size: 15px; }
.card .card-age { margin-top: auto; padding-top: 8px; color: var(--teal); font-weight: 800; font-size: 14px; }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 64px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 34px; height: 34px; border-radius: 50%; background: var(--sun); font: 700 18px/34px var(--head); text-align: center; }
.steps p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.who-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.who-i { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.who-i span { font-size: 30px; }
.who-i b { display: block; font-size: 18px; }
.who-i p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.grownups { margin: 22px 0 0; padding: 16px 20px; background: #e8f6f4; border-radius: var(--radius); font-weight: 600; }

/* ---------- текстовые страницы ---------- */
.prose { max-width: 820px; padding-top: 32px; padding-bottom: 24px; }
.prose h2 { font-size: 26px; margin-top: 32px; }
.prose li { margin: 4px 0; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin: 10px 0; }
.faq summary { font-weight: 800; cursor: pointer; }
.faq p { margin: 8px 0 0; }

/* ---------- генератор ---------- */
.gen-head { padding-top: 28px; }
.tool { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; margin-top: 8px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 84px; display: flex; flex-direction: column; gap: 14px; }
.panel fieldset { border: 0; padding: 0; margin: 0; }
.panel legend, .panel .lbl { font-weight: 800; margin-bottom: 6px; display: block; padding: 0; }
.panel label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 3px 0; }
.panel select { width: 100%; font: 16px var(--body); padding: 9px 10px; border-radius: 10px; border: 2px solid var(--line); background: #fff; }
.panel .paper { display: flex; gap: 18px; flex-wrap: wrap; }
.panel .paper legend { width: 100%; }
.panel .btn { width: 100%; }
.panel .hint { margin: 0; font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { padding: 0; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 6px 12px; border: 2px solid var(--line); border-radius: 999px; font-weight: 700; font-size: 15px; }
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chips input:focus-visible + span { outline: 3px solid var(--sun); }
.preview { background: #e9e4dc; border-radius: var(--radius); padding: 20px; min-height: 400px; overflow: hidden; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -6px 0 14px; }
.pager[hidden] { display: none; }
.pager button {
  width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--line); background: #fff;
  font: 700 24px/1 var(--head); color: var(--ink); cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--brand); }
.pager button:disabled { opacity: .35; cursor: default; }
.pager-mid { text-align: center; line-height: 1.3; }
.pager-txt { display: block; }
.pager-all { font-size: 14px; color: var(--muted); }
@media screen { .sheets .sheet:not(.on) { display: none; } }
.sheets { display: flex; flex-direction: column; align-items: center; gap: 20px; transform-origin: top left; }

/* ---------- печатный лист ---------- */
html.paper-a4 { --pw: 210mm; --ph: 297mm; }
html.paper-letter { --pw: 215.9mm; --ph: 279.4mm; }
.sheet {
  width: var(--pw, 210mm); height: var(--ph, 297mm); background: #fff;
  padding: 12mm 13mm 9mm; display: flex; flex-direction: column;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .15); color: #222; overflow: hidden; position: relative;
  font-family: var(--body);
}
.sheet-fields { display: flex; gap: 10mm; font-size: 12pt; font-weight: 700; }
.sheet-fields span { flex: 1; display: flex; gap: 2mm; align-items: flex-end; }
.sheet-fields span:last-child { flex: 0 0 50mm; }
.sheet-fields i { flex: 1; border-bottom: 1.4px solid #555; height: 1.1em; }
.sheet-title { font: 600 30pt/1.1 var(--head); text-align: center; margin: 6mm 0 1mm; color: var(--brand-dark); }
.sheet-sub { text-align: center; font-size: 13pt; margin: 0 0 5mm; color: #444; }
.sheet-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.sheet-body > svg { width: 100%; height: 100%; }
.sheet-foot { display: flex; justify-content: space-between; font-size: 8.5pt; color: #888; margin-top: 3mm; }
.sheet-tag { position: absolute; top: 12mm; right: 13mm; display: none; }
.sheet.answer .sheet-title { color: var(--teal); }

/* ---------- корень / 404 ---------- */
.root { min-height: 100vh; background: linear-gradient(180deg, #fff1e3, var(--bg)); }
.root-in { max-width: 720px; padding-top: 10vh; padding-bottom: 40px; text-align: center; }
.root-logo { display: inline-flex; align-items: center; gap: 10px; font: 700 34px var(--head); }
.root-logo svg { width: 56px; height: 56px; }
.root h1 { font-size: 26px; font-weight: 600; margin: 18px 0 22px; }
.picks { display: grid; gap: 12px; }
.pick { display: flex; flex-direction: column; padding: 18px 22px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); text-align: left; }
.pick:hover, .pick.guess { border-color: var(--brand); }
.pick b { font: 600 22px var(--head); }
.pick span { color: var(--muted); }

/* ---------- подвал ---------- */
.foot { margin-top: 56px; background: #fff; border-top: 1px solid var(--line); padding: 28px 0 22px; font-size: 15px; }
.foot-in { display: grid; gap: 14px; }
.foot-brand { display: flex; gap: 12px; align-items: flex-start; }
.foot-brand p { margin: 2px 0 0; color: var(--muted); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--ink); font-weight: 700; }
.copy { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 860px) {
  .hero-in, .tool { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; margin: 0 auto; order: -1; }
  .panel { position: static; }
  .menu { margin-left: 0; }
  .top-in { gap: 10px 16px; padding-top: 8px; padding-bottom: 8px; }
  .preview { padding: 10px; min-height: 0; }
}

/* ---------- печать: только листы ---------- */
@media print {
  body { background: #fff; }
  .top, .foot, .gen-head, .seo, .panel, .pager { display: none !important; }
  main, .tool, .preview { display: block; padding: 0; margin: 0; background: none; border-radius: 0; max-width: none; }
  .sheets { zoom: 1 !important; display: block; }
  .sheet { box-shadow: none; break-after: page; margin: 0; }
  .sheet:last-child { break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* поле «свой размер» в настройках генератора */
.custom-size { margin: 8px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 700; }
.custom-size[hidden] { display: none; }
.custom-size input { width: 64px; font: 16px var(--body); padding: 6px 8px; border: 2px solid var(--line); border-radius: 10px; }
