/* ===== AIを使う前に — 共通スタイル ===== */

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

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #1f2430;
  --muted: #5b6475;
  --line: #e2dfd8;
  --link: #2449b5;
  --primary: #2f5bd3;
  --primary-weak: #e8eefc;
  --on-primary: #ffffff;
  --accent: #c2410c;
  --accent-weak: #fff1e6;
  --ok: #2b8a3e;
  --ok-weak: #e7f5ea;
  --warn: #c92a2a;
  --warn-weak: #fdecec;
  --footer-bg: #1f2430;
  --footer-text: #e8eaf0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .05);
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161b;
    --surface: #1c1f26;
    --surface-2: #181b21;
    --text: #e8eaf0;
    --muted: #a4acbd;
    --line: #2f343e;
    --link: #93b1ff;
    --primary: #86a2ff;
    --primary-weak: #222b47;
    --on-primary: #0d1530;
    --accent: #ff9a5a;
    --accent-weak: #37261a;
    --ok: #62cf7e;
    --ok-weak: #19301f;
    --warn: #ff8080;
    --warn-weak: #3a1d1d;
    --footer-bg: #0e1014;
    --footer-text: #d7dbe4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  }
}

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  font-family: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.85;
  letter-spacing: .02em;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4 {
  font-family: "Zen Maru Gothic", "BIZ UDPGothic", "Hiragino Sans", "Meiryo", sans-serif;
  line-height: 1.45;
  letter-spacing: .03em;
}

img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
strong { font-weight: 700; }
mark { background: linear-gradient(transparent 60%, #ffe066 60%); color: inherit; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 820px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--surface); color: var(--text);
  padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* ===== ヘッダー ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.logo {
  display: flex; align-items: center; gap: 8px;
  font-family: "Zen Maru Gothic", sans-serif; font-weight: 700; font-size: 1.2rem;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.logo-mark { font-size: 1.5rem; }

.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 6px 12px; border-radius: 999px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: .92rem;
}
.site-nav a:hover { background: var(--primary-weak); }
.site-nav a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }

.nav-toggle {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  color: var(--text); cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  display: block; width: 20px; height: 2px; border-radius: 2px;
  background: currentColor; position: relative; transition: .2s;
}
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

.site-header .header-inner { max-width: 1280px; }

.nav-icon { display: none; }
.nav-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .4); }

@media (max-width: 1180px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 12px 16px 16px; box-shadow: 0 16px 24px rgba(0, 0, 0, .15);
    max-height: calc(100dvh - 56px); overflow-y: auto; overscroll-behavior: contain;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 640px; margin-inline: auto; }
  .site-nav a {
    display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px 12px;
    border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
    font-size: .95rem; line-height: 1.35;
  }
  .site-nav a[href="trouble.html"]:not([aria-current]) { border-color: var(--warn); }
  .nav-icon { display: inline-block; flex: none; font-size: 1.2rem; }
  body.menu-open { overflow: hidden; }
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
@media (hover: hover) { .btn:hover { transform: translateY(-1px); } }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); }
.btn-outline { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ===== ヒーロー(トップ) ===== */
.hero {
  padding-block: 64px 56px;
  background:
    radial-gradient(circle at 85% 20%, var(--primary-weak), transparent 45%),
    radial-gradient(circle at 10% 90%, var(--accent-weak), transparent 40%);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.9rem); margin: 14px 0 16px; }
.hero-lead { font-size: 1.1rem; color: var(--muted); margin: 0; }
.eyebrow {
  display: inline-block; padding: 4px 14px; border-radius: 999px;
  background: var(--primary-weak); color: var(--primary); font-weight: 700; font-size: .9rem;
}
@media (max-width: 820px) { .hero-inner { grid-template-columns: 1fr; } }

/* チャット風の図 */
.chat-mock {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px;
  position: relative;
}
.bubble { max-width: 85%; padding: 10px 16px; border-radius: 18px; font-size: .98rem; line-height: 1.6; }
.bubble-user { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.bubble-ai { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble-label { display: block; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.sticker {
  align-self: center; margin-top: 4px; padding: 8px 16px; border-radius: 12px;
  background: var(--accent-weak); color: var(--accent); border: 2px dashed var(--accent);
  font-weight: 700; transform: rotate(-2deg);
}

/* ===== セクション ===== */
.section { padding-block: 56px; }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.section-title { font-size: clamp(1.45rem, 3.5vw, 2rem); margin: 0 0 8px; }
.section-lead { color: var(--muted); margin: 0 0 28px; }
.center { text-align: center; }

.page-hero { padding-block: 48px 32px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.page-hero h1 { margin: 6px 0 8px; font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.page-hero p { margin: 0; color: var(--muted); font-size: 1.05rem; }
.breadcrumb { font-size: .88rem; color: var(--muted); }
.breadcrumb a { color: var(--muted); }

/* ===== カード ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); color: inherit; text-decoration: none;
  transition: transform .15s, border-color .15s;
}
@media (hover: hover) { a.card:hover { transform: translateY(-3px); border-color: var(--primary); } }
.card-icon { font-size: 2rem; line-height: 1; }
.card-num { font-size: .85rem; font-weight: 700; color: var(--primary); }
.card h3 { margin: 0; font-size: 1.12rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.7; }
.card-more { margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--primary); font-size: .92rem; }

/* 3つの合言葉 */
.motto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.motto {
  text-align: center; padding: 28px 18px; border-radius: 20px;
  background: var(--surface); border: 2px solid var(--line);
}
.motto-icon { font-size: 2.6rem; }
.motto .motto-word { font-family: "Zen Maru Gothic", sans-serif; font-size: 1.6rem; font-weight: 700; margin: 6px 0; color: var(--primary); }
.motto p { margin: 0; color: var(--muted); font-size: .95rem; }
@media (max-width: 700px) { .motto-grid { grid-template-columns: 1fr; } }

/* CTA 2列 */
.cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cta {
  padding: 28px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface);
  box-shadow: var(--shadow);
}
.cta h2 { margin: 0 0 8px; font-size: 1.4rem; }
.cta p { margin: 0; color: var(--muted); }
.cta-warn { border-top: 6px solid var(--warn); }
.cta-ok { border-top: 6px solid var(--ok); }
@media (max-width: 760px) { .cta-grid { grid-template-columns: 1fr; } }

/* ===== 本文 ===== */
.prose h2 { font-size: clamp(1.35rem, 3vw, 1.65rem); margin: 48px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--line); }
.prose h3 { font-size: 1.15rem; margin: 28px 0 8px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-block: 4px; }
.prose > *:first-child { margin-top: 0; }

.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.toc-title { margin: 0 0 8px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.5em; columns: 2; column-gap: 32px; }
.toc li { break-inside: avoid; margin-block: 2px; }
@media (max-width: 640px) { .toc ol { columns: 1; } }

/* 注意点ブロック */
.point {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(20px, 4vw, 32px); margin-block: 28px; box-shadow: var(--shadow);
  scroll-margin-top: 84px;
}
.point-head { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.point-num {
  flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary);
  font-family: "Zen Maru Gothic", sans-serif; font-weight: 700; font-size: 1.35rem;
}
.point h2 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.6rem); border: 0; padding: 0; }
.point-lead { font-size: 1.08rem; font-weight: 700; margin: 12px 0; }
.point-link { margin: 16px 0 0; font-size: .95rem; }

.box { border-radius: 12px; padding: 16px 20px; margin-block: 16px; border-left: 6px solid; }
.box h3 { margin: 0 0 6px; font-size: 1.05rem; }
.box p { margin: 0 0 6px; }
.box p:last-child { margin-bottom: 0; }
.box ul, .box ol { margin: 0; padding-left: 1.3em; }
.box-ok { background: var(--ok-weak); border-color: var(--ok); }
.box-ng { background: var(--warn-weak); border-color: var(--warn); }
.box-tip { background: var(--primary-weak); border-color: var(--primary); }
.box-case { background: var(--accent-weak); border-color: var(--accent); }
.box-note { background: var(--surface-2); border-color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-block: 16px; }
.two-col > .box { margin: 0; }
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* 次の言葉予測の図 */
.predict {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin-block: 20px;
}
.predict-prompt { font-weight: 700; font-size: 1.15rem; margin: 0 0 12px; }
.predict-row { display: grid; grid-template-columns: 5em 1fr 3.5em; align-items: center; gap: 10px; margin-block: 6px; }
.predict-bar { height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.predict-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.predict-pct { text-align: right; color: var(--muted); font-size: .9rem; }
.predict-caption { margin: 12px 0 0; font-size: .88rem; color: var(--muted); }

/* プロンプト例 */
.prompt-example {
  font-family: inherit; background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 10px; padding: 12px 16px; margin: 8px 0; white-space: pre-wrap;
}

/* ===== 困ったとき ===== */
.emergency {
  display: flex; gap: 16px; align-items: flex-start; padding: 20px 24px; border-radius: var(--radius);
  background: var(--warn-weak); border: 2px solid var(--warn); margin-block: 24px;
}
.emergency-icon { font-size: 2rem; line-height: 1; }
.emergency p { margin: 0; }
.emergency strong { color: var(--warn); }

.trouble-item {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  margin-block: 12px; box-shadow: var(--shadow); scroll-margin-top: 84px;
}
.trouble-item summary {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none;
}
.trouble-item summary::-webkit-details-marker { display: none; }
.trouble-item summary::after {
  content: "+"; margin-left: auto; flex: none; display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary-weak); color: var(--primary);
  font-size: 1.2rem;
}
.trouble-item[open] summary::after { content: "−"; }
.trouble-emoji { font-size: 1.5rem; }
.trouble-body { padding: 0 20px 20px; }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 8px 0; }
.steps li { counter-increment: step; position: relative; padding-left: 44px; margin-block: 14px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem;
}

.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.contact { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.contact-tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--primary-weak); color: var(--primary); }
.contact-name { font-weight: 700; margin: 8px 0 0; }
.contact-tel { display: inline-block; margin: 2px 0; font-size: 1.5rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.contact-meta { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.7; }

/* ===== クイズ ===== */
.quiz {
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: clamp(20px, 4vw, 32px); box-shadow: var(--shadow);
}
.quiz-count { font-weight: 700; color: var(--muted); font-size: .95rem; }
.quiz-progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 20px; }
.quiz-progress-bar { height: 100%; background: var(--primary); border-radius: 999px; transition: width .3s; }
.quiz-question { font-size: clamp(1.15rem, 3vw, 1.35rem); margin: 0 0 20px; word-break: normal; text-wrap: pretty; }
.quiz-question:focus { outline: none; }
.quiz-options { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.quiz-option {
  width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left;
  padding: 14px 18px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--surface); color: inherit; font: inherit; line-height: 1.6; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-weak); }
.quiz-option:disabled { cursor: default; }
.quiz-option.is-correct { border-color: var(--ok); background: var(--ok-weak); }
.quiz-option.is-wrong { border-color: var(--warn); background: var(--warn-weak); }
.quiz-letter {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--line); font-weight: 700; font-size: .9rem;
}
.quiz-verdict { font-size: 1.2rem; font-weight: 700; }
.quiz-feedback .btn { margin-top: 12px; }
.quiz-result { text-align: center; }
.quiz-score { font-family: "Zen Maru Gothic", sans-serif; font-size: 3.4rem; font-weight: 700; color: var(--primary); margin: 0; line-height: 1.2; }
.quiz-result .btn-row { justify-content: center; }

/* ===== チェックリスト ===== */
.checklist-bar {
  position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: 12px;
  padding: 12px 16px 12px 20px; margin-block: 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.checklist-status { flex: 1; min-width: 0; }
.checklist-progress { display: block; font-weight: 700; font-size: .95rem; line-height: 1.4; }
.checklist-meter { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.checklist-meter span { display: block; width: 0; height: 100%; border-radius: 999px; background: var(--ok); transition: width .3s; }
.checklist-actions { display: flex; flex: none; gap: 8px; }
.checklist-bar .btn { padding: 8px 16px; font-size: .92rem; }
.checklist-group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin-block: 20px;
}
.checklist-group h2 { margin: 0 0 8px; font-size: 1.25rem; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px dashed var(--line); }
.check-item:first-of-type { border-top: 0; }
.check-item input { flex: none; width: 22px; height: 22px; margin-top: 5px; accent-color: var(--primary); cursor: pointer; }
.check-item label { cursor: pointer; }
.check-item small { display: block; color: var(--muted); font-size: .88rem; line-height: 1.6; }

/* ===== 用語集 ===== */
.glossary dt { font-weight: 700; font-size: 1.12rem; margin-top: 28px; scroll-margin-top: 84px; }
.glossary dt span { font-weight: 400; font-size: .88rem; color: var(--muted); margin-left: 8px; }
.glossary dd { margin: 6px 0 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.glossary-index { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.glossary-index a {
  display: inline-block; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; font-size: .92rem;
}

/* ===== 流れ図(フロー) ===== */
.flow { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-block: 20px; }
.flow-step {
  padding: 8px 16px; border-radius: 999px; background: var(--primary-weak); color: var(--text);
  border: 1px solid var(--line); font-weight: 700; font-size: .95rem;
}
.flow-arrow { color: var(--muted); font-weight: 700; }
.flow-big { margin-block: 0 28px; }
.flow-big .flow-step { font-size: 1.1rem; padding: 12px 22px; background: var(--surface); border: 2px solid var(--primary); }

/* ===== SNS投稿風の練習問題 ===== */
.mock-post {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 18px; margin-block: 20px; box-shadow: var(--shadow);
}
.mock-label {
  display: inline-block; margin-bottom: 10px; padding: 2px 10px; border-radius: 6px;
  background: var(--accent-weak); color: var(--accent); font-size: .8rem; font-weight: 700;
}
.mock-post-head { display: flex; align-items: center; gap: 10px; }
.mock-avatar {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 1.3rem;
}
.mock-name { display: block; font-weight: 700; line-height: 1.3; }
.mock-handle { display: block; font-size: .85rem; color: var(--muted); line-height: 1.4; }
.mock-post-body { margin: 12px 0; }
.mock-image {
  display: grid; place-items: center; text-align: center; min-height: 150px; padding: 16px;
  border-radius: 12px; color: #fff; font-size: 1.8rem; line-height: 1.5;
  background: linear-gradient(160deg, #5b7aa6, #2c4666);
}
.mock-image small { font-size: .85rem; opacity: .9; }
.mock-image-alt { background: linear-gradient(160deg, #6b5b95, #3b2f5c); }
.mock-meta { display: flex; gap: 18px; margin-top: 8px; color: var(--muted); font-size: .9rem; }
.mock-reveal { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.mock-reveal summary { cursor: pointer; font-weight: 700; color: var(--primary); }
.mock-reveal ul { padding-left: 1.3em; }
.mock-reveal p { margin: 0; }

/* ===== テーブル ===== */
.table-wrap { overflow-x: auto; margin-block: 16px; }
table { border-collapse: collapse; width: 100%; min-width: 480px; background: var(--surface); }
th, td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); }

/* ===== フッター ===== */
.site-footer { margin-top: 64px; padding-block: 40px; background: var(--footer-bg); color: var(--footer-text); }
.site-footer a { color: var(--footer-text); }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.footer-title { font-family: "Zen Maru Gothic", sans-serif; font-weight: 700; font-size: 1.15rem; margin: 0 0 6px; }
.footer-inner p { margin: 0; }
.footer-inner .footer-operator { margin-top: 6px; font-size: .9rem; opacity: .85; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-block: 4px; }
.footer-note { grid-column: 1 / -1; font-size: .85rem; opacity: .8; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .15); }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }

.updated { font-size: .88rem; color: var(--muted); }

/* ===== 日本語の改行・タッチ操作の微調整 ===== */
h1, h2, h3 { word-break: auto-phrase; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
.contact-meta { overflow-wrap: anywhere; }
a, button, summary, label { -webkit-tap-highlight-color: transparent; }
.btn:active, a.card:active, .quiz-option:active:not(:disabled), .trouble-item summary:active { transform: scale(.98); }

/* ページの先頭へ戻るボタン */
.to-top {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--primary);
  box-shadow: var(--shadow); font: inherit; font-size: 1.3rem; font-weight: 700; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }

/* ===== スマホ ===== */
@media (max-width: 600px) {
  body { font-size: 1rem; line-height: 1.8; }
  .container { padding-inline: 16px; }
  .header-inner { min-height: 56px; }
  .logo { font-size: 1.1rem; }
  .point, .trouble-item, .glossary dt, #contacts { scroll-margin-top: 68px; }

  .section { padding-block: 40px; }
  .section-lead { margin-bottom: 20px; }
  .page-hero { padding-block: 24px 20px; }
  .page-hero p { font-size: .95rem; }
  .breadcrumb { font-size: .8rem; }

  .btn { padding: 14px 20px; }
  .btn-row { flex-direction: column; gap: 10px; }
  .btn-row .btn { width: 100%; }

  /* トップ */
  .hero { padding-block: 28px 36px; }
  .hero-inner { gap: 28px; }
  .hero h1 { margin-top: 12px; }
  .hero-lead { font-size: 1rem; }
  .chat-mock { padding: 16px; }
  .bubble { font-size: .92rem; }

  .motto-grid { gap: 10px; }
  .motto {
    display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; align-items: center;
    padding: 16px 18px; border-radius: 16px; text-align: left;
  }
  .motto-icon { grid-row: span 2; font-size: 2rem; text-align: center; }
  .motto .motto-word { font-size: 1.25rem; margin: 0; }
  .motto p { font-size: .9rem; }

  /* リンクカードは横並びのコンパクトな行に */
  .card-grid { gap: 10px; }
  .card { padding: 16px; }
  a.card {
    display: grid; grid-template-columns: 40px 1fr 14px; column-gap: 12px; row-gap: 2px; align-items: start;
    grid-template-areas: "icon num more" "icon title more" "icon desc more";
  }
  a.card .card-icon { grid-area: icon; padding-top: 4px; font-size: 1.7rem; }
  a.card .card-num { grid-area: num; font-size: .78rem; }
  a.card h3 { grid-area: title; font-size: 1.02rem; }
  a.card p { grid-area: desc; font-size: .86rem; line-height: 1.6; }
  a.card .card-more { grid-area: more; align-self: center; padding: 0; font-size: 0; }
  a.card .card-more::after { content: "›"; font-size: 1.6rem; color: var(--muted); }

  .cta { padding: 22px 20px; }
  .cta h2 { font-size: 1.2rem; }

  /* 本文 */
  .prose h2 { margin-top: 36px; }
  .toc { padding: 16px 18px; }
  .point { padding: 20px 16px; margin-block: 20px; border-radius: 16px; }
  .point-head { align-items: flex-start; gap: 10px; }
  .point-num { width: 36px; height: 36px; margin-top: 1px; font-size: 1.05rem; }
  .point h2 { font-size: 1.2rem; }
  .point-lead { font-size: 1rem; }
  .box { padding: 14px 14px 14px 16px; border-left-width: 4px; }
  .box ul, .box ol, .prose ul, .prose ol, .mock-reveal ul { padding-left: 1.2em; }
  table { min-width: 0; }
  th, td { padding: 8px 10px; }

  .flow { flex-direction: column; align-items: stretch; gap: 2px; }
  .flow-step { text-align: center; }
  .flow-arrow { text-align: center; line-height: 1; transform: rotate(90deg); }
  .flow-big .flow-step { font-size: 1rem; padding: 10px 16px; }

  /* 困ったとき */
  .emergency { padding: 16px; gap: 12px; }
  .trouble-item summary { padding: 16px; gap: 10px; font-size: 1rem; }
  .trouble-body { padding: 0 16px 16px; }
  .steps li { padding-left: 40px; }
  .contact { padding: 16px; }

  /* クイズ */
  .quiz { padding: 20px 16px; }
  .quiz-option { padding: 12px 14px; }

  /* チェックリスト:進み具合は画面の下に固定 */
  .checklist-page { padding-bottom: 120px; }
  .checklist-bar {
    position: fixed; top: auto; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 40; margin: 0; padding: 10px 10px 10px 16px;
  }
  .checklist-bar .btn { padding: 8px 12px; font-size: .85rem; }
  .checklist-group { padding: 16px; }
  .check-item { gap: 10px; }
  body:has(.checklist-bar) .to-top { bottom: calc(96px + env(safe-area-inset-bottom)); }

  /* 練習問題 */
  .mock-post { padding: 14px; }
  .mock-image { min-height: 120px; font-size: 1.5rem; }

  /* フッター */
  .site-footer { margin-top: 48px; padding-block: 32px calc(32px + env(safe-area-inset-bottom)); }
  .footer-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
  .footer-links a { display: inline-block; padding-block: 6px; }
}

/* ===== 印刷 ===== */
@media print {
  .site-header, .site-footer, .no-print, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .page-hero { background: none; border: 0; padding-block: 0 12px; }
  .checklist-group, .point, .box, .contact { box-shadow: none; break-inside: avoid; }
  .trouble-item:not([open]) .trouble-body { display: block; }
  a { color: #000; }
}
