/* ============================================================
   Oraku マニュアル共通CSS
   LP（index.html）のデザイントークンを継承した文書レイアウト。
   構成: ヘッダー（LP系統） + 2カラム（章ナビ / 本文） + フッター。
   ブレークポイントは LP と同じ 768px の1セットのみ。
   ============================================================ */
:root {
  --accent: #4d56c6;
  --accent-deep: #3a42a8;
  --accent-bright: #6470e8;
  --accent-tint: #eef0fb;
  --accent-tint-2: #e4e7fa;
  --mint: #1f9d76;
  --mint-tint: #e3f5ef;
  --sky: #2563c9;
  --sky-tint: #e2ecfb;
  --amber: #b45f06;
  --amber-tint: #fdf3e3;
  --red: #d24b4b;
  --red-tint: #fdecec;

  --ink: #15171f;
  --ink-2: #4a5060;
  --ink-3: #828a99;
  --bg: #f6f7fa;
  --bg-deep: #eef0f5;
  --surface: #ffffff;
  --line: #e6e9f0;
  --line-soft: #eef0f5;

  --font-sans: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-jp: 'Noto Sans JP', 'Inter', sans-serif;

  --sh-sm: 0 1px 2px rgba(21,23,31,0.04), 0 1px 3px rgba(21,23,31,0.06);
  --sh-md: 0 4px 12px rgba(21,23,31,0.05), 0 12px 28px rgba(21,23,31,0.06);

  --r-sm: 10px;
  --r-md: 16px;
  --maxw: 1120px;
  --pad-x: 28px;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-jp);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
  word-break: keep-all;
}
img { display: block; max-width: 100%; height: auto; }
::selection { background: var(--accent-tint-2); color: var(--accent-deep); }

/* ---------- Header（LP系統の簡略版） ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246,247,250,0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px var(--pad-x);
}
.header-logo { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); }
.header-logo .mark { width: 30px; height: 30px; border-radius: 8px; }
.header-logo span { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.03em; }
.header-logo .manual-tag {
  font-family: var(--font-sans); font-size: .68rem; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  background: var(--accent-tint); padding: 3px 9px; border-radius: 100px;
}
.header-back { color: var(--ink-2); text-decoration: none; font-size: .88rem; font-weight: 600; }
.header-back:hover { color: var(--accent); }

/* ---------- 2カラムレイアウト ---------- */
.doc-shell {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 48px;
  padding: 40px var(--pad-x) 88px;
  align-items: start;
}

/* 章ナビ */
.doc-nav { position: sticky; top: 76px; }
.doc-nav h2 {
  font-family: var(--font-sans); font-size: .72rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  margin-bottom: 10px;
}
.doc-nav ol { list-style: none; counter-reset: chap -1; }
.doc-nav li { counter-increment: chap; }
.doc-nav a {
  display: flex; align-items: baseline; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: .88rem; font-weight: 500;
  line-height: 1.5;
}
.doc-nav a::before {
  content: counter(chap);
  font-family: var(--font-sans); font-size: .72rem; font-weight: 700;
  color: var(--ink-3); min-width: 1.2em; text-align: right; flex-shrink: 0;
}
.doc-nav a:hover { background: var(--bg-deep); color: var(--ink); }
.doc-nav li.current a { background: var(--accent-tint); color: var(--accent-deep); font-weight: 700; }
.doc-nav li.current a::before { color: var(--accent); }

/* ---------- 本文 ---------- */
.doc-main { min-width: 0; }
.doc-crumb { font-size: .82rem; color: var(--ink-3); margin-bottom: 14px; }
.doc-crumb a { color: var(--ink-3); text-decoration: none; }
.doc-crumb a:hover { color: var(--accent); }
.doc-main > h1 {
  font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 900;
  letter-spacing: -0.02em; line-height: 1.35; margin-bottom: 14px;
  font-feature-settings: "palt" 1; text-wrap: balance;
}
.doc-lead { font-size: 1.02rem; color: var(--ink-2); margin-bottom: 40px; max-width: 640px; }

.doc-main h2 {
  font-size: 1.32rem; font-weight: 800; letter-spacing: -0.01em;
  margin: 56px 0 16px; padding-top: 24px; border-top: 1px solid var(--line);
  font-feature-settings: "palt" 1;
}
.doc-main h3 { font-size: 1.05rem; font-weight: 700; margin: 32px 0 10px; }
.doc-main p { margin-bottom: 14px; color: var(--ink-2); font-size: .96rem; }
.doc-main p strong, .doc-main li strong { color: var(--ink); }
.doc-main ul { margin: 0 0 14px 1.4em; color: var(--ink-2); font-size: .96rem; }
.doc-main ul li { margin-bottom: 6px; }
.doc-main a { color: var(--accent); }

/* UIラベル表記（長いラベルは折り返す。nowrap 禁止 — 320px幅ではみ出す） */
.ui {
  display: inline; padding: 1px 8px; border-radius: 6px;
  background: var(--bg-deep); border: 1px solid var(--line);
  font-size: .88em; font-weight: 600; color: var(--ink);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* 手順ステップ */
.steps { list-style: none; counter-reset: step; margin: 20px 0 28px; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 22px 46px;
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-tint); color: var(--accent-deep);
  font-family: var(--font-sans); font-size: .88rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 14.5px; top: 36px; bottom: 4px;
  width: 1.5px; background: var(--line);
}
.steps > li > p:first-child { color: var(--ink); font-weight: 600; font-size: .97rem; }
.steps > li > p { margin-bottom: 8px; }

/* 注意・補足ボックス */
.note, .warn {
  border-radius: var(--r-sm); padding: 14px 18px; margin: 18px 0 24px;
  font-size: .92rem; line-height: 1.85;
}
.note { background: var(--sky-tint); color: var(--ink-2); }
.warn { background: var(--amber-tint); color: var(--ink-2); }
.note strong, .warn strong { display: block; font-size: .8rem; font-weight: 800; letter-spacing: .06em; margin-bottom: 4px; }
.note strong { color: var(--sky); }
.warn strong { color: var(--amber); }

/* βバッジ */
.beta-badge {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle;
  padding: 3px 11px; border-radius: 100px; margin-left: 10px;
  background: var(--sky-tint); color: var(--sky);
  font-family: var(--font-sans); font-size: .7rem; font-weight: 800; letter-spacing: .05em;
}

/* スクリーンショット枠（プレースホルダ兼用） */
.shot { margin: 18px 0 26px; }
.shot img, .shot .ph {
  width: 100%; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg-deep); box-shadow: var(--sh-sm);
}
.shot .ph {
  aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); font-size: .85rem; font-weight: 600;
  /* 長文プレースホルダを最小コンテンツ幅ごと折り返す（flex匿名アイテムは min-width:0 が効かない） */
  text-align: center; padding: 0 16px; overflow-wrap: anywhere; word-break: normal;
}
.shot.phone img, .shot.phone .ph { max-width: 320px; margin: 0 auto; }
.shot.phone .ph { aspect-ratio: 9/16; }
.shot figcaption { text-align: center; font-size: .8rem; color: var(--ink-3); margin-top: 8px; }

/* 表（セル内はCJKでも折り返し許可。keep-all のままだと表がはみ出す） */
.doc-main table {
  width: 100%; border-collapse: collapse; margin: 18px 0 26px;
  font-size: .92rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden;
}
.doc-main th, .doc-main td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: top;
  word-break: normal; overflow-wrap: anywhere;
}
.doc-main th { background: var(--bg-deep); font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.doc-main tr:last-child td { border-bottom: none; }

/* 前後章ナビ */
.doc-pager {
  display: flex; justify-content: space-between; gap: 14px;
  margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line);
}
.doc-pager a {
  flex: 1; max-width: 48%;
  display: block; padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  text-decoration: none; box-shadow: var(--sh-sm);
}
.doc-pager a:hover { border-color: var(--accent); }
.doc-pager .dir { font-family: var(--font-sans); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: block; }
.doc-pager .ttl { font-size: .92rem; font-weight: 700; color: var(--ink); }
.doc-pager a.next { text-align: right; margin-left: auto; }

/* ---------- 目次ページ（index） ---------- */
.toc-body { max-width: 880px; margin: 0 auto 48px; }
.toc-body h2:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

.toc-hero { text-align: center; max-width: 640px; margin: 24px auto 48px; }
.toc-hero h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 900; letter-spacing: -0.02em; margin-bottom: 14px; }
.toc-hero p { color: var(--ink-2); font-size: 1rem; }
.toc-grid {
  max-width: 880px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px;
}
.toc-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px 22px; text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.toc-card:hover { transform: translateY(-2px); box-shadow: var(--sh-md); border-color: var(--accent-tint-2); }
.toc-card .tc { min-width: 0; }
.toc-card .num {
  font-family: var(--font-sans); font-size: .95rem; font-weight: 800;
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--accent-tint); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
}
.toc-card h2 { font-size: 1.02rem; font-weight: 800; color: var(--ink); margin-bottom: 3px; letter-spacing: -0.01em; }
.toc-card p { font-size: .86rem; color: var(--ink-3); line-height: 1.7; }
.toc-wrap { max-width: var(--maxw); margin: 0 auto; padding: 32px var(--pad-x) 88px; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: rgba(255,255,255,.55);
  padding: 32px var(--pad-x); font-size: .84rem;
}
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a { color: rgba(255,255,255,.7); text-decoration: none; }
.site-footer a:hover { color: #fff; }

/* ---------- 768px ---------- */
@media (max-width: 768px) {
  :root { --pad-x: 20px; }
  .doc-shell { grid-template-columns: 1fr; gap: 28px; padding-top: 24px; }
  .doc-nav { position: static; }
  .doc-nav ol { display: none; }
  .doc-nav.open ol { display: block; }
  .doc-nav h2 {
    cursor: pointer; user-select: none;
    display: flex; align-items: center; justify-content: space-between;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
    padding: 12px 16px; margin-bottom: 8px; font-size: .8rem; color: var(--ink-2);
  }
  .doc-nav h2::after { content: "▾"; color: var(--ink-3); }
  .doc-nav.open h2::after { content: "▴"; }
  .doc-pager { flex-direction: column; }
  .doc-pager a { max-width: none; }
}
