:root {
  --ink: #1d2433;
  --muted: #5d6576;
  --line: #e3e6ec;
  --paper: #f6f7f9;
  --card: #ffffff;
  --accent: #2457d6;
  --accent-dark: #1b44ab;
  --accent-soft: #e9effd;
  --green: #1f7a4d;
  --green-soft: #e7f5ee;
  --amber: #8a5a00;
  --amber-soft: #fff5dc;
  --red: #b3261e;
  --red-soft: #fdecea;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
[id] { scroll-margin-top: 84px; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, 0.94); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 820px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 650; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.lang { display: flex; align-items: center; gap: 4px; }
.lang-icon { font-size: 15px; }
.lang select { font: inherit; font-size: 15px; padding: 7px 28px 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: 40px; }
.help-button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 7px 14px; border-radius: 999px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 650; font-size: 15px; white-space: nowrap; }
.help-button span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.22); font-size: 13px; }
.help-button:hover { background: var(--accent-dark); }

/* Page */
.page { max-width: 820px; margin: 0 auto; padding: 28px 20px 80px; }
h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.18; letter-spacing: -0.02em; margin: 6px 0 14px; }
h2 { line-height: 1.3; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.eyebrow { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.back { display: inline-block; margin-bottom: 18px; font-size: 15px; text-decoration: none; }

.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px 20px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--accent-dark); }
.button:focus-visible, .help-button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid #9db7f5; outline-offset: 2px; }

/* Product list */
.products { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.product-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; gap: 12px; }
.product-card h2 { margin: 0; font-size: 21px; }
.product-card .button { width: 100%; }
.product-card p { margin: 0; }

/* Guide */
.translated-note { background: var(--accent-soft); border-radius: 10px; padding: 10px 14px; font-size: 15px; color: #243b73; }
.intro { font-size: 19px; }
.toc { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 20px; margin: 22px 0; }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { padding: 3px 0; }
.toc a { text-decoration: none; }
.guide { display: grid; gap: 18px; margin-top: 24px; }
.rich p { margin: 0 0 12px; }
.rich p:last-child { margin-bottom: 0; }
.section-heading { font-size: 24px; margin: 18px 0 0; }

.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: grid; grid-template-columns: 44px 1fr; gap: 16px; }
.step-number { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.step-body { min-width: 0; display: grid; gap: 12px; }
.step-body h2 { margin: 6px 0 0; font-size: 21px; }
.step.stage { grid-template-columns: 1fr; }
.step.stage .step-body h2 { margin: 0; }

.image-link { display: block; }
.image-link img, figure img { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
figure { margin: 0; }
figcaption { color: var(--muted); font-size: 15px; margin-top: 8px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.note { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 14px 16px; border-radius: 12px; border: 1px solid; }
.note.info { background: var(--accent-soft); border-color: #cbd9fa; }
.note.warning { background: var(--amber-soft); border-color: #f0d596; }
.note-icon { font-size: 20px; line-height: 1.4; }

.list { margin: 0; padding: 0; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.list li { padding: 12px 16px 12px 46px; border-top: 1px solid var(--line); position: relative; }
.list li:first-child { border-top: 0; }
.list li::before { content: "•"; position: absolute; left: 18px; top: 12px; color: var(--muted); font-weight: 700; }
.action { margin: 0; }
.action .button { width: 100%; justify-content: center; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.guide-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.guide-table th, .guide-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; }
.guide-table th:last-child, .guide-table td:last-child { border-right: 0; }
.guide-table tbody tr:last-child td { border-bottom: 0; }
.guide-table thead th { background: var(--bg-soft, rgba(0,0,0,0.03)); font-weight: 650; }

/* Help and questions */
.help { margin-top: 48px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.help h2 { margin: 0 0 4px; font-size: 24px; }
.support-notice { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: #243b73; font-weight: 600; }
.question-form { display: grid; gap: 14px; margin-top: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-weight: 600; font-size: 15px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
input, textarea, select { font: inherit; }
.field input, .field textarea, .field select { width: 100%; padding: 12px 14px; border: 1px solid #cfd4de; border-radius: 10px; background: #fff; color: var(--ink); min-height: 48px; }
.field textarea { resize: vertical; min-height: 120px; }
.question-form .button { justify-self: start; }
.alert { border-radius: 10px; padding: 12px 14px; margin: 14px 0 0; background: var(--paper); }
.alert p { margin: 0; }
.alert.success { background: var(--green-soft); color: #145c38; }
.alert.error { background: var(--red-soft); color: #8c1d18; }
.questions { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 18px; }
.questions h3 { margin: 0 0 12px; }
.question { padding: 14px 0; border-top: 1px solid var(--line); }
.question:first-of-type { border-top: 0; padding-top: 0; }
.question-meta { margin: 0; font-size: 14px; color: var(--muted); }
.question-body { margin: 4px 0 10px; white-space: pre-line; }
.answer { background: var(--green-soft); border-radius: 10px; padding: 12px 14px; }
.answer p { margin: 0; white-space: pre-line; }
.answer .answer-label { font-weight: 700; font-size: 14px; color: #145c38; margin-bottom: 4px; }
.waiting { margin: 0; font-size: 15px; color: var(--amber); }

/* Messages */
.message { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 24px; text-align: center; margin-top: 8vh; }
.message h1 { font-size: 28px; }
.message p { color: var(--muted); max-width: 520px; margin: 0 auto 10px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .page { padding: 20px 14px 64px; }
  .step { grid-template-columns: 1fr; gap: 10px; padding: 16px; }
  .step-number { width: 38px; height: 38px; font-size: 18px; }
  .help { padding: 18px; }
  .brand { max-width: 38vw; }
  .lang-icon { display: none; }
  .question-form .button { justify-self: stretch; }
}

@media print {
  .topbar, .help, .toc, .back, .translated-note { display: none !important; }
  body { background: #fff; }
  .step, .product-card, .list { border-color: #bbb; break-inside: avoid; }
  .video { display: none; }
}
