:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #1d2430;
  --text-soft: #5b6675;
  --line: #e2e6ec;
  --accent: #17607a;
  --accent-soft: #e6f1f5;
  --accent-strong: #0f4459;
  --mark: #fff2b2;
  --danger: #a3341f;
  --warn-line: #d99b3d;
  --warn-bg: #fdf6ea;
  --warn-text: #8a5a10;
  --info-line: #4a90a8;
  --info-bg: #eef5f8;
  --info-text: #0f4459;
  --term-bg: #eef1f4;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .06);
  --maxw: 900px;
  color-scheme: light; /* 閲覧者の設定にかかわらず白基調で表示する */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Meiryo", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; padding: 8px 0; }
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-title { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--text-soft); }

.version-tabs { display: flex; gap: 6px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.version-tab {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.version-tab[aria-selected="true"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.version-tab[disabled] { cursor: not-allowed; opacity: .55; }
.tab-badge { font-size: 10px; margin-left: 5px; padding: 1px 6px; border-radius: 999px; background: var(--bg); color: var(--text-soft); }

/* ---------- hero ---------- */
.hero { padding: 40px 0 28px; text-align: center; }
.hero-title { font-size: 28px; margin: 0 0 8px; letter-spacing: .02em; }
.hero-lead { margin: 0 0 22px; color: var(--text-soft); font-size: 15px; }

.search-box { position: relative; max-width: 560px; margin: 0 auto; }
.search-box input {
  width: 100%;
  padding: 14px 44px 14px 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  box-shadow: var(--shadow);
}
.search-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--text-soft); pointer-events: none;
}
.search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--text-soft);
  font-size: 14px; cursor: pointer; padding: 8px;
}

/* ---------- category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 8px 0 40px; }
.cat-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease;
}
.cat-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.cat-card .cat-icon { width: 26px; height: 26px; color: var(--accent); display: block; margin-bottom: 12px; }
.cat-card .cat-title { display: block; font-weight: 700; }
.cat-card .cat-count { display: block; font-size: 12px; color: var(--text-soft); margin-top: 4px; }

.section-title { font-size: 20px; margin: 28px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title .cat-icon { width: 22px; height: 22px; color: var(--accent); flex: none; }
.back-link { display: inline-block; margin: 8px 0 16px; font-size: 14px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ---------- faq items ---------- */
.faq-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 40px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: 90px;
}
.faq-item.open { border-color: var(--accent); box-shadow: var(--shadow); }
.faq-question {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left;
  background: transparent; border: 0; color: inherit;
  font: inherit; font-weight: 600;
  padding: 16px 18px; cursor: pointer; line-height: 1.6;
}
.faq-question:hover { background: var(--surface-2); }
.faq-question .q-mark { color: var(--accent); font-weight: 700; flex: none; }
.faq-question .chevron { margin-left: auto; flex: none; color: var(--text-soft); transition: transform .15s ease; }
.faq-item.open .chevron { transform: rotate(180deg); }
.faq-answer { display: none; padding: 4px 18px 18px 46px; font-size: 15.5px; line-height: 1.9; }
.faq-item.open .faq-answer { display: block; }
.faq-answer > *:first-child { margin-top: 0; }
.faq-answer p { margin: 0 0 14px; }

/* 小見出し（行全体が太字の行） */
.faq-answer .sub-head {
  margin: 20px 0 10px;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-strong);
  padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.5;
}
.faq-answer .sub-head strong { font-weight: 700; }

/* 補足（※で始まる段落） */
.faq-answer .side-note {
  font-size: 13.5px;
  color: var(--text-soft);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
}

/* 注意・ポイントの囲み */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 14px;
  font-size: 15px;
  border: 1px solid transparent;
}
.callout-label {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-top: 3px;
}
.callout-body { flex: 1; }
.callout-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-line) 40%, transparent); color: var(--warn-text); }
.callout-warn .callout-label { background: var(--warn-line); color: #fff; }
.callout-warn strong { color: var(--warn-text); }
.callout-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info-line) 35%, transparent); color: var(--info-text); }
.callout-info .callout-label { background: var(--info-line); color: #fff; }

/* リスト */
.faq-answer ul, .faq-answer ol { margin: 0 0 14px; padding-left: 22px; }
.faq-answer li { margin-bottom: 7px; }
.faq-answer li > ul, .faq-answer li > ol { margin: 8px 0 4px; }

/* 手順（トップレベルの番号リスト） */
.faq-answer ol.steps {
  list-style: none;
  padding-left: 0;
  margin: 0 0 16px;
  counter-reset: step;
  border-left: 2px solid var(--line);
}
.faq-answer ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 34px;
  margin: 0 0 14px;
}
.faq-answer ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -13px;
  top: 1px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.faq-answer ol.steps > li:last-child { margin-bottom: 0; }

/* 「用語 … 説明」形式の箇条書き */
.faq-answer li .term { font-weight: 700; }
.faq-answer li .term::after { content: "："; font-weight: 400; color: var(--text-soft); }
.faq-answer li .desc { color: var(--text); }

/* キートップ */
kbd {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  padding: 1px 7px;
  margin: 0 1px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--accent-strong);
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  white-space: nowrap;
}

/* 画面名・項目名 */
.ui-term {
  background: var(--term-bg);
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 500;
  white-space: nowrap;
}
.faq-answer code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: .9em;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
.faq-answer strong { font-weight: 700; }

.table-wrap { overflow-x: auto; margin: 0 0 14px; }
.faq-answer table { border-collapse: collapse; width: 100%; font-size: 14px; }
.faq-answer th, .faq-answer td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.faq-answer th { background: var(--surface-2); font-weight: 600; white-space: nowrap; color: var(--accent-strong); }
.faq-answer tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.faq-answer tbody td:first-child { font-weight: 600; }
.faq-answer table .ui-term { background: transparent; padding: 0; }

.answer-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.copy-link { border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); font: inherit; font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer; }
.copy-link:hover { border-color: var(--accent); color: var(--accent); }
.cat-tag { font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 9px; }

mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 2px; }

.result-head { color: var(--text-soft); font-size: 14px; margin: 10px 0 14px; }
.no-result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--text-soft); }
.loading { color: var(--text-soft); text-align: center; padding: 40px 0; }
.notice { background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 24px; font-size: 14px; }

/* ---------- footer ---------- */
.contact-cta { background: var(--surface); border-top: 1px solid var(--line); padding: 32px 0; text-align: center; margin-top: 20px; }
.contact-cta h2 { font-size: 18px; margin: 0 0 8px; }
.contact-cta p { margin: 0; color: var(--text-soft); font-size: 14px; }
.site-footer { padding: 24px 0 40px; text-align: center; color: var(--text-soft); font-size: 12px; }
.site-footer p { margin: 4px 0; }

@media (max-width: 600px) {
  .version-tabs { width: 100%; justify-content: center; }
  .version-tab { font-size: 12px; padding: 5px 10px; }
  .hero { padding: 28px 0 20px; }
  .hero-title { font-size: 22px; }
  .faq-answer { padding-left: 18px; }
  .header-inner { min-height: 56px; }
}

@media print {
  .site-header, .hero, .contact-cta, .copy-link, .back-link { display: none; }
  .faq-answer { display: block !important; }
  .faq-item { break-inside: avoid; border-color: #ccc; }
}
