/* なめらかムーブ マニュアル 共通スタイル */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #24262b;
  --text-muted: #5f636b;
  --border: #e3e0d8;
  --accent: #2f8f83;
  --accent-strong: #226d63;
  --accent-soft: #e2f2ef;
  --tip-bg: #e9f3fb;
  --tip-border: #4b8fc7;
  --warn-bg: #fdf3e2;
  --warn-border: #d99a2b;
  --ng-bg: #fbeceb;
  --ng-border: #cf5a4f;
  --code-bg: #efece5;
  --shadow: 0 1px 2px rgba(30, 30, 40, .05), 0 4px 16px rgba(30, 30, 40, .05);
  --radius: 10px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --font-head: "Zen Maru Gothic", var(--font);
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Menlo", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191d;
    --surface: #1f2227;
    --surface-2: #262a30;
    --text: #e6e7ea;
    --text-muted: #a3a7b0;
    --border: #353a42;
    --accent: #5cc4b5;
    --accent-strong: #7fd6ca;
    --accent-soft: #1f3632;
    --tip-bg: #1c2a36;
    --tip-border: #5c9fd6;
    --warn-bg: #33291a;
    --warn-border: #d9a441;
    --ng-bg: #36211f;
    --ng-border: #e0776c;
    --code-bg: #2a2e35;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

a { color: var(--accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

/* ---------- ヘッダー ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 8px 24px;
  flex-wrap: wrap;
}

.brand {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.brand small { font-family: var(--font); font-weight: 500; font-size: .75rem; color: var(--text-muted); }

.site-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -16px;
  padding: 0 16px;
  flex: 1 1 auto;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); font-weight: 600; }

@media (min-width: 720px) {
  .site-nav { margin: 0; padding: 0; justify-content: flex-end; }
}

/* ---------- 本文 ---------- */

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

.page-title {
  font-family: var(--font-head);
  font-size: clamp(1.6rem, 4.5vw, 2.1rem);
  line-height: 1.4;
  margin: 8px 0 8px;
}
.lead { color: var(--text-muted); font-size: 1.02rem; margin: 0 0 24px; }

h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  line-height: 1.5;
  margin: 56px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
h3 {
  font-size: 1.12rem;
  line-height: 1.5;
  margin: 36px 0 12px;
}
h4 { font-size: 1rem; margin: 24px 0 8px; }

p { margin: 0 0 16px; }
ul, ol { padding-left: 1.4em; margin: 0 0 16px; }
li + li { margin-top: 4px; }

code, .param {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--code-bg);
  padding: 1px 6px;
  border-radius: 5px;
}

/* 画面上の表記 (ボタン・項目名) */
.ui {
  display: inline-block;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 7px;
  line-height: 1.6;
  font-size: .92em;
  white-space: nowrap;
}

/* メニューの経路: なめらかムーブ › センサー › … */
.path {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  font-size: .92em;
  vertical-align: baseline;
}
.path span {
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 6px;
  padding: 0 7px;
  line-height: 1.6;
}
.path span + span { position: relative; margin-left: 16px; }
.path span + span::before {
  content: "›";
  position: absolute;
  left: -13px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ---------- このページの内容 ---------- */

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin: 0 0 32px;
  box-shadow: var(--shadow);
}
.toc strong { font-size: .85rem; color: var(--text-muted); letter-spacing: .05em; }
.toc ol { margin: 6px 0 0; padding-left: 1.3em; }
.toc li { margin: 2px 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* ---------- 手順 ---------- */

ol.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 24px;
}
ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 20px 48px;
  margin: 0;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .95rem;
  display: grid;
  place-items: center;
}
@media (prefers-color-scheme: dark) {
  ol.steps > li::before { color: #10201d; }
}
ol.steps > li::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 38px;
  bottom: 4px;
  width: 2px;
  background: var(--border);
}
ol.steps > li:last-child::after { display: none; }
ol.steps > li > strong:first-child { display: block; font-size: 1.02rem; line-height: 32px; margin-bottom: 4px; }

/* ---------- 注意書き ---------- */

.callout {
  border-left: 4px solid var(--tip-border);
  background: var(--tip-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  margin: 0 0 20px;
}
.callout > :last-child { margin-bottom: 0; }
.callout .label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 2px; }
.callout.warn { border-color: var(--warn-border); background: var(--warn-bg); }
.callout.ng { border-color: var(--ng-border); background: var(--ng-bg); }
.callout.good { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- 画像の置き場所 ---------- */

figure { margin: 0 0 24px; }
figure img { border-radius: var(--radius); border: 1px solid var(--border); display: block; }
figcaption { font-size: .85rem; color: var(--text-muted); margin-top: 6px; }

.shot {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-muted);
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  font-size: .88rem;
}
.shot code { background: var(--surface); }

/* ---------- 表 ---------- */

.table-wrap { overflow-x: auto; margin: 0 0 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; line-height: 1.65; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-size: .85rem; color: var(--text-muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody th { font-weight: 600; white-space: nowrap; color: var(--text-muted); font-size: .88rem; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.hl { color: var(--accent-strong); font-weight: 700; }

/* ---------- カード ---------- */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0 0 32px; }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.card .num { font-size: .78rem; font-weight: 700; color: var(--accent-strong); letter-spacing: .08em; }
.card h3 { margin: 4px 0 6px; font-size: 1.08rem; }
.card p { margin: 0; font-size: .9rem; color: var(--text-muted); line-height: 1.7; }

/* ---------- 設定の解説 ---------- */

.setting {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px 4px;
  margin: 0 0 14px;
  box-shadow: var(--shadow);
}
.setting h4 { margin: 0 0 4px; font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.setting h4 .en { font-weight: 400; font-size: .82rem; color: var(--text-muted); font-family: var(--mono); }
.setting .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.setting .meta span { font-size: .78rem; background: var(--surface-2); border-radius: 999px; padding: 1px 10px; color: var(--text-muted); }
.setting .meta span.where { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.setting .meta span.exp { background: var(--warn-bg); color: var(--text); }
.setting p, .setting ul { font-size: .96rem; }

/* ---------- FAQ ---------- */

details.faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 10px;
  box-shadow: var(--shadow);
}
details.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 44px 14px 18px;
  font-weight: 600;
  position: relative;
  line-height: 1.6;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 12px;
  font-size: 1.3rem;
  color: var(--text-muted);
  font-weight: 400;
}
details.faq[open] summary::after { content: "−"; }
details.faq[open] summary { border-bottom: 1px solid var(--border); }
details.faq .answer { padding: 14px 18px 4px; }

/* ---------- 前後のページ ---------- */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pager a {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  text-decoration: none;
  background: var(--surface);
}
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--text-muted); font-size: .78rem; }
.pager .next { text-align: right; grid-column: 2; }

/* ---------- 図 (C 字 / S 字) ---------- */

.shapes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin: 0 0 24px; }
.shape {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  box-shadow: var(--shadow);
}
.shape svg { width: 120px; height: 150px; display: block; margin: 0 auto 6px; }
.shape svg .body { stroke: var(--text); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.shape svg .head { fill: var(--surface); stroke: var(--text); stroke-width: 5; }
.shape svg .guide { stroke: var(--border); stroke-width: 2; stroke-dasharray: 4 5; }
.shape svg .curve { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; fill: none; }
.shape strong { display: block; font-size: 1.02rem; }
.shape p { font-size: .86rem; color: var(--text-muted); margin: 2px 0 0; line-height: 1.6; }

/* ---------- ヒーロー (トップ) ---------- */

.hero { padding: 16px 0 8px; }
.hero .kicker { color: var(--accent-strong); font-weight: 700; font-size: .85rem; letter-spacing: .08em; margin: 0; }
.hero h1 { font-family: var(--font-head); font-size: clamp(2rem, 7vw, 2.8rem); line-height: 1.3; margin: 6px 0 12px; }
.hero h1 small { display: block; font-size: .45em; color: var(--text-muted); font-weight: 500; letter-spacing: .04em; }
.hero p { font-size: 1.05rem; }

.req { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 24px; font-size: .95rem; }
.req dt { font-weight: 600; color: var(--text-muted); }
.req dd { margin: 0; }
@media (max-width: 480px) {
  .req { grid-template-columns: 1fr; gap: 0; }
  .req dd { margin-bottom: 8px; }
}

/* ---------- フッター ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: .82rem;
  text-align: center;
  padding: 24px 16px 40px;
}
.site-footer a { color: var(--text-muted); }
