:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0f172a;
  --muted: #536176;
  --line: #d9e1ec;
  --line-strong: #b9c6d8;
  --accent: #2563eb;
  --accent-soft: #eaf2ff;
  --dark: #111827;
  --success: #137a4b;
  --danger: #b42318;
  --shadow: 0 20px 55px rgba(15, 23, 42, .08);
  --shadow-soft: 0 10px 28px rgba(15, 23, 42, .06);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 8%, rgba(37, 99, 235, .08), transparent 26rem),
    linear-gradient(180deg, #fbfdff 0, var(--bg) 42rem, #f7f9fc 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}
button, select, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; max-width: 100%; }

.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 99; background: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
.visually-small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 253, 255, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(217, 225, 236, .9);
}
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: var(--dark); box-shadow: 0 8px 18px rgba(15, 23, 42, .16); }
.main-nav { display: flex; gap: 20px; flex-wrap: wrap; }
.main-nav a { text-decoration: none; color: var(--muted); font-size: .95rem; font-weight: 600; }
.main-nav a:hover, .main-nav a:focus-visible { color: var(--accent); }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { list-style: none; cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 11px; font-weight: 800; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav nav { position: absolute; right: 0; top: calc(100% + 8px); width: 190px; display: grid; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.mobile-nav nav a { padding: 8px 9px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 700; }
.mobile-nav nav a:hover, .mobile-nav nav a:focus-visible { background: var(--accent-soft); color: var(--accent); }

.hero { padding: 68px 0 34px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.17fr) minmax(330px, .83fr); gap: 44px; align-items: center; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: .82rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; line-height: 1.14; }
h1 { max-width: 780px; font-size: clamp(2.2rem, 5vw, 4.3rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.75rem, 3vw, 2.65rem); letter-spacing: -.025em; }
h3 { font-size: 1.15rem; }
.lead { max-width: 790px; margin: 22px 0 0; color: var(--muted); font-size: 1.08rem; }
.hero-actions { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.trust-list { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 18px; color: var(--muted); font-size: .94rem; }
.trust-list li::before { content: "✓"; margin-right: 7px; color: var(--success); font-weight: 900; }

.hero-demo { position: relative; display: grid; gap: 16px; justify-items: center; }
.demo-sheet { width: min(100%, 380px); aspect-ratio: 210 / 297; background: #fff; border-radius: 10px; box-shadow: 0 28px 70px rgba(15, 23, 42, .18); border: 1px solid #e5e7eb; padding: 30px 26px; transform: rotate(1.5deg); }
.demo-title { font-weight: 900; letter-spacing: .12em; text-align: center; font-size: .8rem; }
.demo-colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 28px; }
.demo-colors span { height: 38px; border-radius: 4px; }.demo-colors .c{background:#00bfe8}.demo-colors .m{background:#ec008c}.demo-colors .y{background:#ffe500}.demo-colors .k{background:#111}
.demo-gradient { height: 34px; margin-top: 20px; background: linear-gradient(90deg, #000, #fff); border: 1px solid #111; }
.demo-lines { height: 92px; margin-top: 22px; background: repeating-linear-gradient(180deg, #111 0 1px, transparent 1px 13px); }
.demo-copy { margin-top: 20px; border-top: 1px solid #cbd5e1; padding-top: 16px; font-family: Georgia, serif; font-size: .78rem; line-height: 1.75; }
.hero-demo-note { max-width: 440px; padding: 14px 16px; border: 1px solid #cfe0fb; background: rgba(234, 242, 255, .8); border-radius: 14px; color: #334155; font-size: .91rem; }

.button { border: 1px solid transparent; border-radius: 13px; min-height: 44px; padding: 11px 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.button:hover, .button:focus-visible { transform: translateY(-1px); }
.button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, [data-template-shortcut]:focus-visible { outline: 3px solid rgba(37, 99, 235, .2); outline-offset: 2px; }
.button-primary { color: #fff; background: var(--accent); box-shadow: 0 12px 24px rgba(37, 99, 235, .22); }
.button-secondary { background: #fff; border-color: var(--line); box-shadow: var(--shadow-soft); }
.button-dark { background: var(--dark); color: #fff; box-shadow: 0 12px 25px rgba(15, 23, 42, .2); }
.button-ghost { background: transparent; border-color: var(--line); }

.quick-intents { padding: 10px 0 34px; }
.quick-intents h2 { margin: 0 0 8px; font-size: clamp(1.35rem, 2.3vw, 1.8rem); }
.quick-intro { margin: 0 0 18px; max-width: 850px; color: var(--muted); }
.quick-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.quick-grid button { background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 12px; padding: 12px 10px; cursor: pointer; color: #334155; font-weight: 700; box-shadow: var(--shadow-soft); }
.quick-grid button:hover { border-color: #9bbaf4; background: #fff; }

.app-section, .diagnostics-section, .templates-section, .howto-section, .seo-answer-section, .faq-section { padding: 64px 0; }
.section-heading { max-width: 820px; margin-bottom: 28px; }
.section-heading > p:not(.eyebrow) { color: var(--muted); margin: 13px 0 0; }
.split-heading { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 30px; }
.privacy-chip { flex: none; border: 1px solid #cce9d9; background: #eefbf4; color: #17623f; border-radius: 999px; padding: 8px 12px; font-size: .84rem; font-weight: 700; }

.panel { background: rgba(255,255,255,.96); border: 1px solid rgba(217,225,236,.95); border-radius: var(--radius); box-shadow: var(--shadow); }
.app-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 22px; align-items: start; }
.controls-panel { padding: 20px; position: sticky; top: 86px; }
.controls-form { display: grid; gap: 17px; }
.field { display: grid; gap: 7px; }
.field label, .checks legend { font-size: .91rem; font-weight: 800; color: #27364a; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
select { width: 100%; min-height: 44px; padding: 10px 36px 10px 12px; color: var(--text); background: #fff; border: 1px solid var(--line-strong); border-radius: 11px; }
.checks { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 9px; }
.checks label { display: flex; gap: 9px; align-items: flex-start; color: #405067; font-size: .9rem; }
.checks input { margin-top: 3px; }
.context-hint { padding: 12px 13px; background: var(--accent-soft); border: 1px solid #cfe0fb; border-radius: 12px; color: #334b70; font-size: .87rem; }
.button-stack { display: grid; gap: 9px; }

.preview-panel { padding: 20px; min-width: 0; }
.preview-toolbar { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 16px; }
.toolbar-kicker { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.preview-meta span { padding: 5px 9px; border-radius: 999px; border: 1px solid #d5e2f4; background: #f4f8fe; color: #405574; font-size: .78rem; font-weight: 700; }
.preview-summary { max-width: 690px; margin: 10px 0 0; color: var(--muted); font-size: .88rem; }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.toolbar-actions .button { min-height: 38px; padding: 8px 11px; font-size: .82rem; }
.status-message { min-height: 24px; margin: -2px 0 8px; color: var(--success); font-size: .88rem; font-weight: 700; }
.status-message[data-type="error"] { color: var(--danger); }
.sheet-stage { min-height: 500px; padding: 20px; border: 1px solid #d8e2ef; border-radius: 18px; background: linear-gradient(135deg, #e8eef6, #f0f4f9); overflow: auto; }
.sheet-surface { width: min(100%, 820px); margin: 0 auto; background: #fff; box-shadow: 0 22px 50px rgba(15,23,42,.18); overflow: hidden; border-radius: 4px; }
.sheet-preview, .sheet-preview svg { width: 100%; height: 100%; }
.noscript-note { margin-top: 14px; padding: 12px; border-radius: 10px; background: #fff7ed; color: #9a3412; }

.diagnostics-section { background: #fff; border-top: 1px solid #e5ebf2; border-bottom: 1px solid #e5ebf2; }
.diagnostic-wizard { display: grid; grid-template-columns: .8fr 1.2fr; gap: 24px; padding: 22px; align-items: stretch; }
.diagnostic-controls { display: grid; gap: 14px; align-content: start; }
.diagnostic-result { padding: 20px; border-radius: 16px; background: #f7faff; border: 1px solid #d9e6fa; }
.diagnostic-result p { color: var(--muted); }
.diagnostic-static-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.diagnostic-static-grid article { padding: 16px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--line); }
.diagnostic-static-grid p { color: var(--muted); font-size: .91rem; margin-bottom: 0; }

.template-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.template-card { position: relative; min-height: 240px; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-soft); display: flex; flex-direction: column; }
.template-card h3 { margin-top: 22px; }
.template-card p { color: var(--muted); font-size: .91rem; flex: 1; }
.template-card button { align-self: flex-start; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 800; cursor: pointer; }
.template-number { position: absolute; top: 16px; right: 16px; font-size: .78rem; color: #8fa0b6; font-weight: 800; }

.howto-section { background: var(--dark); color: #f8fafc; }
.howto-section .eyebrow { color: #8bb3ff; }
.steps-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.steps-grid li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; padding: 18px; border: 1px solid rgba(148,163,184,.22); border-radius: 16px; background: rgba(255,255,255,.045); }
.steps-grid li > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #dbeafe; background: #1d4ed8; font-weight: 900; }
.steps-grid p { color: #bdc8d8; margin-bottom: 0; }

.answer-layout { display: grid; grid-template-columns: .65fr 1.35fr; gap: 44px; align-items: start; }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.answer-grid article { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.answer-grid p { color: var(--muted); }
.answer-lead { color: var(--muted); margin: 12px 0 0; }

.faq-list { display: grid; gap: 12px; max-width: 960px; }
details { padding: 16px 18px; border-radius: 15px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-soft); }
summary { cursor: pointer; font-weight: 800; }
details p { color: var(--muted); margin-bottom: 0; }

.site-footer { padding: 42px 0; background: #eef2f7; border-top: 1px solid #dfe6ef; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; color: #44546b; }
.footer-grid p { margin: 7px 0 0; }

@media (max-width: 1100px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .template-grid { grid-template-columns: repeat(3, 1fr); }
  .diagnostic-static-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .hero-grid, .app-grid, .diagnostic-wizard, .answer-layout { grid-template-columns: 1fr; }
  .controls-panel { position: static; }
  .demo-sheet { width: 280px; }
  .split-heading { align-items: start; flex-direction: column; }
  .preview-toolbar { flex-direction: column; }
  .toolbar-actions { justify-content: flex-start; }
  .main-nav { display: none; }
  .mobile-nav { display: block; }
  .template-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .container { width: min(100% - 20px, 1180px); }
  .hero { padding-top: 36px; }
  h1 { font-size: clamp(2rem, 11vw, 3rem); }
  .hero-actions, .hero-actions .button { width: 100%; }
  .quick-grid, .template-grid, .diagnostic-static-grid, .answer-grid, .footer-grid, .field-grid { grid-template-columns: 1fr; }
  .quick-grid { gap: 7px; }
  .app-section, .diagnostics-section, .templates-section, .howto-section, .seo-answer-section, .faq-section { padding: 44px 0; }
  .controls-panel, .preview-panel { padding: 14px; }
  .sheet-stage { min-height: 380px; padding: 10px; }
  .toolbar-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .toolbar-actions .button { width: 100%; }
}

@media print {
  .site-header, .hero, .quick-intents, .controls-panel, .preview-toolbar, .preview-meta, .preview-summary, .status-message,
  .diagnostics-section, .templates-section, .howto-section, .seo-answer-section, .faq-section, .site-footer, .section-heading { display: none !important; }
  body, .app-section, .container, .app-grid, .preview-panel, .sheet-stage, .sheet-surface, .sheet-preview { margin: 0 !important; padding: 0 !important; width: auto !important; max-width: none !important; background: #fff !important; border: 0 !important; box-shadow: none !important; }
}
