:root {
  --navy: #1b3a5c;
  --navy-dark: #12293f;
  --blue: #2d6da3;
  --teal: #1f8a70;
  --orange: #e07b39;
  --bg: #f7f9fb;
  --card: #ffffff;
  --text: #2b3440;
  --muted: #64748b;
  --border: #e2e8f0;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.9;
}

/* ===== Header ===== */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.logo { font-weight: 700; color: var(--navy); font-size: 1.05rem; text-decoration: none; }
.logo span { color: var(--orange); }
nav ul { display: flex; gap: 4px; list-style: none; }
nav a {
  text-decoration: none; color: var(--text); font-size: .82rem;
  padding: 8px 9px; border-radius: 6px; transition: background .2s; white-space: nowrap;
}
nav a:hover { background: #eef3f8; color: var(--blue); }
nav a.active { background: #eef3f8; color: var(--blue); }
nav a.nav-tool { color: var(--orange); font-weight: 700; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border); border-radius: 8px;
  font-size: .9rem; font-weight: 700; padding: 6px 12px; cursor: pointer; color: var(--navy);
  font-family: inherit;
}
.fw-tag {
  display: inline-block; background: #eef3f8; color: var(--blue);
  font-size: .75rem; font-weight: 700; padding: 3px 12px;
  border-radius: 999px; margin-bottom: 10px;
}

/* ===== Page hero (step pages) ===== */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 60%, #0d3b4f 100%);
  color: #fff; padding: 50px 20px 56px;
}
.page-hero-inner { max-width: 1080px; margin: 0 auto; }
.page-hero .step-badge {
  display: inline-block; background: var(--orange); color: #fff;
  font-weight: 700; font-size: .8rem; letter-spacing: .1em;
  padding: 4px 16px; border-radius: 999px; margin-bottom: 14px;
}
.page-hero h1 { font-size: clamp(1.4rem, 3.5vw, 2.1rem); line-height: 1.5; margin-bottom: 12px; }
.page-hero p { max-width: 720px; opacity: .9; font-size: .95rem; }

/* ===== Breadcrumb ===== */
.breadcrumb {
  max-width: 1080px; margin: 0 auto; padding: 14px 20px 0;
  font-size: .8rem; color: var(--muted);
}
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== Layout ===== */
main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
section { padding: 56px 0 6px; }
.section-label {
  color: var(--orange); font-weight: 700; letter-spacing: .15em;
  font-size: .8rem; text-transform: uppercase;
}
h2 {
  font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--navy);
  margin: 6px 0 18px; line-height: 1.5;
}
h3 { color: var(--navy); font-size: 1.1rem; margin-bottom: 10px; }
.lead { color: var(--muted); max-width: 780px; margin-bottom: 32px; }
.muted { color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 28px 24px;
  box-shadow: 0 2px 8px rgba(20,40,70,.05);
  margin-bottom: 20px;
}
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.card p, .card li { font-size: .92rem; }

/* ===== Sub-step heading ===== */
.substep {
  display: flex; align-items: center; gap: 12px;
  margin: 44px 0 14px;
}
.substep .num {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #2d6da3, #1b3a5c);
  color: #fff; font-weight: 700; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}
.substep h3 { font-size: 1.15rem; margin: 0; }

/* ===== Boxes ===== */
.question-box {
  border-left: 4px solid var(--orange);
  background: #fff7ef; border-radius: 0 10px 10px 0;
  padding: 14px 20px; margin: 20px 0; font-size: .95rem;
}
.question-box strong { color: var(--orange); }

.example-box {
  background: #f0f7f4; border: 1px dashed var(--teal);
  border-radius: 12px; padding: 20px 24px; margin: 24px 0;
}
.example-box h4 { color: var(--teal); font-size: .95rem; margin-bottom: 8px; }
.example-box h4::before { content: "🍞 "; }
.example-box p, .example-box li { font-size: .9rem; }

.fail-box {
  background: #fdf2f2; border: 1px solid #f0c8c8;
  border-radius: 12px; padding: 20px 24px; margin: 24px 0;
}
.fail-box h4 { color: #c0504d; font-size: .95rem; margin-bottom: 8px; }
.fail-box h4::before { content: "⚠ "; }
.fail-box p, .fail-box li { font-size: .9rem; }
.fail-box dt { font-weight: 700; color: #c0504d; margin-top: 12px; font-size: .92rem; }
.fail-box dd { margin-left: 0; font-size: .9rem; }
.fail-box dd::before { content: "→ 対策:"; font-weight: 700; color: var(--teal); margin-right: 4px; }

ul.check { list-style: none; }
ul.check li { padding-left: 1.6em; position: relative; margin-bottom: 8px; }
ul.check li::before { content: "✔"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; margin: 20px 0; }
table {
  width: 100%; border-collapse: collapse; background: #fff;
  border-radius: 12px; overflow: hidden; font-size: .88rem;
  box-shadow: 0 2px 8px rgba(20,40,70,.05); min-width: 620px;
}
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--navy); color: #fff; font-weight: 600; white-space: nowrap; }
tbody th { background: #eef3f8; color: var(--navy); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
td strong { color: var(--navy); }
.table-caption { font-size: .82rem; color: var(--muted); margin-top: 6px; }

table.sample thead th { background: var(--teal); }
table.worksheet thead th { background: var(--blue); }
table.worksheet td.blank { color: #b6c2cf; font-style: italic; }

/* ===== Checklist ===== */
.checklist {
  background: #fff; border: 2px solid var(--navy); border-radius: 14px;
  padding: 24px 28px; margin: 30px 0;
}
.checklist h3::before { content: "☑ "; color: var(--teal); }
.checklist ul { list-style: none; }
.checklist li {
  padding: 8px 0 8px 2em; position: relative;
  border-bottom: 1px dashed var(--border); font-size: .92rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: "□"; position: absolute; left: 0; color: var(--navy);
  font-size: 1.1rem;
}

/* ===== Pager ===== */
.pager {
  display: flex; justify-content: space-between; gap: 12px;
  margin: 56px 0 40px; flex-wrap: wrap;
}
.pager a {
  text-decoration: none; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 20px; color: var(--navy);
  font-size: .88rem; font-weight: 700; flex: 1; min-width: 220px;
  transition: box-shadow .2s, transform .2s;
  box-shadow: 0 2px 8px rgba(20,40,70,.05);
}
.pager a:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(20,40,70,.12); }
.pager a small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.pager .next { text-align: right; }
.pager .top { text-align: center; flex: 0 1 auto; min-width: 160px; align-self: stretch; display: flex; align-items: center; justify-content: center; }

/* ===== Footer ===== */
footer {
  border-top: 1px solid var(--border); background: #fff;
  text-align: center; padding: 32px 20px 28px; color: var(--muted); font-size: .8rem;
  margin-top: 40px;
}
.footer-nav {
  display: flex; gap: 48px; justify-content: center; flex-wrap: wrap;
  text-align: left; margin-bottom: 24px;
}
.footer-nav h4 { color: var(--navy); font-size: .85rem; margin-bottom: 8px; }
.footer-nav a {
  display: block; font-size: .82rem; color: var(--muted);
  text-decoration: none; padding: 3px 0;
}
.footer-nav a:hover { color: var(--blue); text-decoration: underline; }

@media (max-width: 1040px) {
  .header-inner { position: relative; }
  .nav-toggle { display: block; }
  nav {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: 0 12px 24px rgba(20,40,70,.12); z-index: 99;
  }
  nav.open { display: block; }
  nav ul { flex-direction: column; padding: 10px 16px; gap: 2px; }
  nav a { display: block; padding: 12px 10px; font-size: .9rem; }
}
@media (max-width: 720px) {
  section { padding: 44px 0 6px; }
}
