/* Tsunagi — product site styles (W5). Design tokens = briefs/00-COMMON.md.
   No external fonts, no inline styles needed (CSP default-src 'self'). */

:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --text: #1F2328;
  --muted: #5C6670;
  --accent: #2F6F5E;
  --accent-strong: #245848;
  --accent-soft: #E7F1EC;
  --border: #E4E0DA;
  --crisis-surface: #FFF4E5;
  --crisis-text: #8A3B00;
  --radius: 12px;
  --measure: 720px;
  --wide: 1040px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
  overflow-wrap: break-word;
  word-break: normal;
  line-break: strict;
}

html[lang="en"] body { line-height: 1.65; }

@media (min-width: 720px) {
  body { font-size: 17px; }
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-strong); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -200px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 10;
}
.skip-link:focus { top: 8px; }

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

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + 40px);
  margin: 0 auto;
  padding: 0 20px;
}

.wrap--wide { max-width: calc(var(--wide) + 40px); }

main { display: block; }

section { padding: 40px 0; }
section + section { border-top: 1px solid var(--border); }

@media (min-width: 720px) {
  section { padding: 56px 0; }
}

h1, h2, h3 { line-height: 1.45; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: 1.75rem; letter-spacing: 0.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }

@media (min-width: 720px) {
  h1 { font-size: 2.2rem; }
  h2 { font-size: 1.55rem; }
}

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.4em; }
li + li { margin-top: 0.35em; }

.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 14px;
}

.lead { font-size: 1.08rem; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* ---------- header ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}
.brand:hover { color: var(--text); }
.brand svg { width: 28px; height: 28px; flex: none; }
.brand small { font-weight: 400; color: var(--muted); font-size: 0.8rem; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.9rem;
}
.site-nav li + li { margin-top: 0; }
.site-nav a { color: var(--text); text-decoration: none; padding: 4px 0; display: inline-block; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.site-nav .nav-help a { color: var(--crisis-text); font-weight: 700; }

/* ---------- hero ---------- */

.hero { padding: 40px 0 32px; }
@media (min-width: 720px) { .hero { padding: 64px 0 48px; } }

.hero-figure {
  margin: 24px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.hero-figure svg { display: block; width: 100%; height: auto; }
.flow-labels {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.flow-labels li + li { margin-top: 0; }
.hero-figure figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid var(--accent);
  font-family: inherit;
  line-height: 1.4;
}
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #FFFFFF; }
.btn-secondary { background: var(--surface); color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn[disabled],
.btn[aria-disabled="true"] {
  background: #EDEAE5;
  border-color: #D3CEC6;
  color: var(--muted);
  cursor: not-allowed;
}

/* ---------- content blocks ---------- */

.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 14px 64px;
}
.steps > li + li { margin-top: 12px; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.steps h3 { margin-bottom: 0.3em; }
.steps p:last-child { margin-bottom: 0; }

.cards { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card h3 svg { width: 24px; height: 24px; flex: none; }
.card p:last-child { margin-bottom: 0; }

.callout {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0;
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin: 16px 0;
}
.box > :last-child { margin-bottom: 0; }

.sources { font-size: 0.85rem; color: var(--muted); padding-left: 1.2em; }
.sources li + li { margin-top: 0.2em; }

.cite { font-size: 0.85rem; color: var(--muted); }

.quote {
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 16px;
  margin: 16px 0;
  color: var(--text);
}

/* sample memo (fictional) */
.memo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  font-size: 0.95rem;
}
.memo h3 { font-size: 1rem; margin: 1em 0 0.3em; }
.memo h3:first-child { margin-top: 0; }
.memo ul { margin-bottom: 0.4em; }
.memo .memo-foot { border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 12px; color: var(--muted); font-size: 0.88rem; }
.memo-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 10px;
  margin-bottom: 8px;
}

/* FAQ (no JS: details/summary) */
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 18px;
}
.faq details + details { margin-top: 10px; }
.faq summary {
  cursor: pointer;
  font-weight: 700;
  padding: 14px 0 14px 30px;
  position: relative;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "+";
  position: absolute;
  left: 0;
  top: 13px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}
.faq details[open] summary::before { content: "−"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.faq details > :last-child { margin-bottom: 14px; }

/* draft banner (survey preview) — neutral, not crisis colours */
.draft-banner {
  background: var(--surface);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
}
.draft-banner strong { color: var(--accent-strong); }
.draft-banner p:last-child { margin-bottom: 0; }

/* ---------- survey preview ---------- */

.survey fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 18px 8px;
  margin: 0 0 14px;
  min-width: 0;
}
.survey legend {
  float: left;
  width: 100%;
  font-weight: 700;
  padding: 0;
  margin: 0 0 8px;
  line-height: 1.6;
}
.survey legend + * { clear: both; }
.nb { display: inline-block; }
.survey .q-help { font-size: 0.88rem; color: var(--muted); margin: 6px 0 10px; }
.survey .opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 0;
}
.survey .opt input { margin-top: 0.45em; flex: none; width: 18px; height: 18px; accent-color: var(--accent); }
.survey label.block { display: block; font-weight: 700; margin: 10px 0 6px; }
.survey textarea,
.survey input[type="text"],
.survey input[type="email"],
.survey select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  border: 1px solid #CFC9C1;
  border-radius: 8px;
  padding: 10px 12px;
  background: #FFFFFF;
  color: var(--text);
}
.survey textarea { min-height: 96px; resize: vertical; }
.survey .section-title { margin-top: 28px; }
.survey .scale { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.survey .submit-row { margin: 24px 0 8px; }

/* ---------- crisis block (footer) ---------- */

.crisis {
  background: var(--crisis-surface);
  border-top: 1px solid #F1D9B8;
  padding: 32px 0;
  color: var(--text);
}
.crisis h2 { color: var(--crisis-text); font-size: 1.2rem; }
.crisis .crisis-emergency { font-weight: 700; color: var(--crisis-text); }
.crisis ul.crisis-list { list-style: none; padding: 0; margin: 16px 0 12px; display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 720px) { .crisis ul.crisis-list { grid-template-columns: 1fr 1fr; } }
.crisis ul.crisis-list li { margin: 0; background: #FFFFFF; border: 1px solid #F1D9B8; border-radius: 10px; padding: 12px 14px; }
.crisis .c-name { font-weight: 700; display: block; line-height: 1.5; }
.crisis .c-phone { font-size: 1.15rem; font-weight: 700; color: var(--crisis-text); display: inline-block; margin: 2px 0; }
.crisis .c-hours, .crisis .c-note { display: block; font-size: 0.88rem; color: var(--text); }
.crisis .c-note { color: var(--muted); }
.crisis .c-src { font-size: 0.8rem; color: var(--muted); }
.crisis a { color: var(--crisis-text); }

/* ---------- footer ---------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  font-size: 0.9rem;
  color: var(--muted);
}
.site-footer .notice { color: var(--text); font-weight: 700; }
.site-footer ul.footer-links { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer ul.footer-links li + li { margin-top: 0; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ---------- print ---------- */

@media print {
  .site-header nav, .actions, .skip-link { display: none !important; }
  body { background: #FFFFFF; }
  section + section { border-top: none; }
}
