:root {
  --ink: #172130;
  --muted: #5d6877;
  --paper: #fff;
  --background: #f4f6f3;
  --line: #d7ded8;
  --accent: #165c4a;
  --accent-dark: #0d4235;
  --soft: #eaf4ef;
  --warm: #fff5dc;
  --warning: #8a4b09;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Noto Sans JP", sans-serif; line-height: 1.75; }
a { color: var(--accent-dark); }
button, input { font: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible + span, [tabindex="-1"]:focus-visible { outline: 3px solid #e49135; outline-offset: 3px; }

.qa-banner { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 9px 16px; background: #4a2b13; color: #fff; font-weight: 800; }
.qa-banner[hidden] { display: none; }
.qa-banner button { border: 1px solid #fff; border-radius: 8px; padding: 4px 12px; background: #fff; color: #4a2b13; font-weight: 800; }

.site-header, .site-footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 15px max(18px, calc((100% - 1080px) / 2)); background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 1.1rem; font-weight: 900; }
.brand span { display: grid; place-items: center; width: 42px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font-size: .72rem; letter-spacing: .08em; }
.site-header small { border-radius: 999px; padding: 4px 10px; background: var(--warm); color: #70420d; font-weight: 700; }
main { width: min(1080px, calc(100% - 28px)); margin: auto; }
.narrow { width: min(840px, calc(100% - 28px)); }

.hero { padding: clamp(46px, 8vw, 88px) 0 40px; max-width: 900px; }
.hero.compact { max-width: 760px; }
.eyebrow, .step-label, .card-kicker { margin: 0; color: var(--accent); font-weight: 900; letter-spacing: .03em; }
.hero h1 { max-width: 880px; margin: .16em 0 .35em; font-size: clamp(2.2rem, 7vw, 4.7rem); line-height: 1.1; letter-spacing: -.035em; }
.hero.compact h1 { font-size: clamp(2.1rem, 6vw, 4rem); }
.lead, .hero > p:last-child { max-width: 800px; color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); }
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 28px; }
.button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; border: 0; border-radius: 13px; padding: 12px 20px; background: var(--accent); color: #fff; font-weight: 900; text-decoration: none; cursor: pointer; }
.button:hover { background: var(--accent-dark); }
.button.light { background: #fff; color: var(--accent-dark); }
.text-link { font-weight: 800; text-underline-offset: 4px; }
.promise-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.promise-list li { border: 1px solid #cddbd3; border-radius: 999px; padding: 5px 12px; background: var(--soft); color: #29473d; font-size: .88rem; font-weight: 800; }

.panel { margin-bottom: 24px; border: 1px solid var(--line); border-radius: 24px; padding: clamp(20px, 4vw, 42px); background: var(--paper); box-shadow: 0 12px 36px #1936260d; }
.panel.quiet { background: #eef2ef; }
.panel h2 { margin: .15em 0 .8em; font-size: clamp(1.55rem, 4vw, 2.3rem); line-height: 1.3; }
.numbered-cards, .method-grid, .decision-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.numbered-cards li, .method-grid article { display: grid; align-content: start; gap: 7px; border-radius: 16px; padding: 18px; background: var(--soft); }
.numbered-cards b { color: var(--accent-dark); }
.numbered-cards span, .method-grid p { color: var(--muted); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.section-heading p { margin-bottom: 0; color: var(--muted); }
.secondary-button { flex: 0 0 auto; border: 2px solid var(--line); background: #fff; color: var(--ink); }

.room-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 24px; }
.room-grid fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 17px; padding: 16px; }
.room-grid legend { padding: 0 6px; font-size: 1.08rem; font-weight: 900; }
.room-grid legend span { display: inline-grid; place-items: center; margin-right: 8px; border-radius: 8px; width: 32px; height: 28px; background: var(--accent); color: #fff; font-size: .72rem; }
.room-grid label { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 3px; }
.room-grid input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--accent); }
.room-grid input:checked + span { color: var(--muted); text-decoration: line-through; }

.method-grid article > b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; }
.method-grid h3, .method-grid p { margin: 0; }
.decision-grid article { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #f8faf8; }
.decision-grid article > b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; }
.decision-grid h3 { margin: 10px 0 5px; }
.decision-grid p { margin: 0; color: var(--muted); }
.example-box { margin-top: 18px; border-left: 5px solid var(--accent); border-radius: 10px; padding: 16px 18px; background: #f7f9f7; }
.example-box h3, .example-box p { margin: .25em 0; }
.example-box code { display: block; overflow-wrap: anywhere; border-radius: 8px; padding: 10px; background: #e8ede9; }
.timeline { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; border-bottom: 1px solid var(--line); padding: 15px 0; }
.timeline li > span { color: var(--accent); font-weight: 900; }
.timeline p { margin: 4px 0 0; color: var(--muted); }
.notice { margin-top: 20px; border-radius: 13px; padding: 15px 18px; }
.warning { border: 1px solid #ecd19b; background: var(--warm); color: #573713; }
.warning b { display: block; color: var(--warning); }

.print-panel { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--accent); color: #fff; }
.print-panel .step-label { color: #bce9d6; }
.print-panel h2, .print-panel p { margin-bottom: .2em; }
.sources ul, .plain-list { margin: 0; padding-left: 1.2em; }
.sources li { margin: 16px 0; }
.sources a { display: block; font-weight: 900; }
.sources span { display: block; color: var(--muted); font-size: .92rem; }
.source-note { border-top: 1px solid var(--line); margin: 20px 0 0; padding-top: 16px; color: var(--muted); font-size: .92rem; }
.experiment-list article { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-radius: 17px; padding: 20px; background: var(--soft); }
.experiment-list article + article { margin-top: 14px; }
.experiment-list h3 { margin: .2em 0; font-size: 1.35rem; }
.experiment-list p { margin: .2em 0; }
.site-footer { margin-top: 48px; border: 0; background: #15231d; color: #fff; }
.site-footer a { color: #fff; }
.legal-page { padding-top: 48px; }
.legal-page h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.not-found { display: grid; place-items: start; align-content: center; min-height: 100vh; max-width: 700px; }

@media (max-width: 760px) {
  .numbered-cards, .method-grid, .decision-grid { grid-template-columns: 1fr; }
  .room-grid { grid-template-columns: 1fr; }
  .section-heading, .print-panel, .experiment-list article { align-items: stretch; flex-direction: column; }
  .secondary-button, .print-panel .button { width: 100%; }
}

@media (max-width: 480px) {
  .site-header, .site-footer { align-items: flex-start; flex-direction: column; }
  .hero { padding: 38px 0 28px; }
  .hero h1 { font-size: 2.2rem; }
  .panel { border-radius: 17px; padding: 18px; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .timeline li { grid-template-columns: 1fr; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

@media print {
  body { background: #fff; font-size: 10pt; }
  .qa-banner, .site-header, .hero, #before, .hero-actions, .secondary-button, .print-panel, .sources, .site-footer { display: none !important; }
  main { width: 100%; }
  .panel { border: 0; box-shadow: none; margin: 0; padding: 4mm 0; }
  .checklist-panel { display: block; }
  .room-grid { grid-template-columns: repeat(2, 1fr); gap: 4mm; }
  .room-grid fieldset { break-inside: avoid; }
  .method-grid { grid-template-columns: repeat(3, 1fr); }
  .method-grid article { break-inside: avoid; }
  .timeline li { break-inside: avoid; }
}
