/* かんたんCRM 運営者マニュアル 共通スタイル */
:root {
  --ink: #1f2a30;
  --ink-soft: #55636b;
  --line: #dde4e7;
  --bg: #ffffff;
  --bg-soft: #f4f7f8;
  --accent: #3f55a8;
  --accent-dark: #2b3b7d;
  --accent-soft: #eaeef9;
  --go: #a3154f;
  --note-bg: #eef6fb;
  --note-line: #4d9ecb;
  --caution-bg: #fdf6e3;
  --caution-line: #d9a514;
  --important-bg: #fdecee;
  --important-line: #c9364a;
  --todo-bg: #f3effa;
  --todo-line: #7a57c4;
  --side-w: 290px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 16px; }

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

a { color: var(--accent-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
}

/* ---------- レイアウト ---------- */
.layout { display: flex; align-items: flex-start; min-height: 100vh; }

.side {
  position: sticky;
  top: 0;
  flex: 0 0 var(--side-w);
  width: var(--side-w);
  height: 100vh;
  overflow-y: auto;
  padding: 28px 20px 32px;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
}

.main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 44px 48px 72px;
}

.content { max-width: 820px; margin: 0 auto; }

/* ---------- サイドバー ---------- */
.brand {
  display: block;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.brand-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.5; }
.brand-name small { font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.brand-sub {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.nav-button { display: none; }

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list a {
  display: block;
  padding: 7px 12px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  text-decoration: none;
}
.nav-list a:hover { background: #e7edef; }
.nav-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-links {
  margin: 20px 0 0;
  padding: 16px 12px 0;
  border-top: 1px solid var(--line);
  list-style: none;
  font-size: 13px;
}
.side-links li + li { margin-top: 4px; }

/* ---------- 見出し・本文 ---------- */
.draft-banner {
  margin: 0 0 28px;
  padding: 8px 14px;
  border: 1px dashed var(--todo-line);
  border-radius: 6px;
  background: var(--todo-bg);
  color: #4b3590;
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

h1 {
  margin: 0 0 18px;
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.lead { margin: 0 0 32px; color: var(--ink-soft); font-size: 18px; }

.content { counter-reset: sec; }

h2 {
  counter-increment: sec;
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 56px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
  font-size: 22px;
  line-height: 1.5;
}
h2::before {
  content: counter(sec);
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  transform: translateY(-2px);
}

h3 {
  margin: 36px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  font-size: 18px;
  line-height: 1.5;
}

p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 1.5em; }
li + li { margin-top: 4px; }
strong { font-weight: 700; }

/* ---------- 表記ルール(ボタン名・入力値) ---------- */
.ui {
  display: inline-block;
  margin: 0 2px;
  padding: 0 8px;
  border: 1px solid #b9c6cb;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 0.9em;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.ui-go { border-color: var(--go); background: var(--go); color: #fff; }

code {
  padding: 1px 6px;
  border-radius: 4px;
  background: #eef1f3;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}
.eg { white-space: nowrap; }
.eg code { overflow-wrap: normal; }

/* ---------- 道順 ---------- */
.route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  margin: 0 0 20px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--accent-soft);
  font-size: 14px;
}
.route-label {
  margin-right: 8px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--accent-dark);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.route span:not(.route-label) { font-weight: 700; }
.route span:not(.route-label) + span:not(.route-label)::before {
  content: "›";
  margin: 0 8px 0 4px;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 手順 ---------- */
.steps { list-style: none; margin: 0 0 24px; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 0 0 20px 52px;
}
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #fff;
  color: var(--accent-dark);
  font-weight: 700;
}
.steps > li::after {
  content: "";
  position: absolute;
  left: 16px;
  top: 38px;
  bottom: 2px;
  width: 2px;
  background: var(--line);
}
.steps > li:last-child::after { display: none; }
.step-title { display: block; margin-bottom: 4px; font-size: 18px; line-height: 1.9; }
.steps p:last-child, .steps ul:last-child { margin-bottom: 0; }

/* ---------- 画面例 ---------- */
figure { margin: 20px 0 28px; }
figure img {
  display: block;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 2px 10px rgba(31, 42, 48, 0.08);
}
figcaption { margin-top: 8px; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.shot-narrow img { max-width: min(640px, 100%); }

.shot-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 20px;
  border: 2px dashed #b9a6e2;
  border-radius: 6px;
  background: var(--todo-bg);
  color: #4b3590;
  font-size: 14px;
  text-align: center;
}

/* ---------- 補足・注意・重要 ---------- */
.note, .caution, .important, .todo {
  margin: 20px 0 24px;
  padding: 14px 18px;
  border-left: 5px solid;
  border-radius: 0 6px 6px 0;
}
.note { border-color: var(--note-line); background: var(--note-bg); }
.caution { border-color: var(--caution-line); background: var(--caution-bg); }
.important { border-color: var(--important-line); background: var(--important-bg); }
.todo { border-color: var(--todo-line); background: var(--todo-bg); border-left-style: dashed; }

.callout-title { margin: 0 0 4px; font-weight: 700; }
.note .callout-title { color: #24678f; }
.caution .callout-title { color: #8a6500; }
.important .callout-title { color: #a11f33; }
.todo .callout-title { color: #4b3590; }
.note p:last-child, .caution p:last-child, .important p:last-child, .todo p:last-child,
.note ul:last-child, .caution ul:last-child, .important ul:last-child, .todo ul:last-child { margin-bottom: 0; }

/* ---------- 表 ---------- */
.table-wrap { margin: 0 0 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.75; }
th, td { padding: 10px 14px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
thead th { background: var(--bg-soft); font-size: 14px; white-space: nowrap; }
tbody th { background: #fafbfc; font-weight: 700; white-space: nowrap; }

/* ---------- 目次カード ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 0 0 24px; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a {
  display: block;
  height: 100%;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}
.cards a:hover { border-color: var(--accent); background: var(--accent-soft); }
.card-title { display: block; margin-bottom: 4px; color: var(--accent-dark); font-weight: 700; }
.card-desc { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }

/* ---------- 前後のページ ---------- */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager a {
  flex: 0 1 48%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.6;
}
.pager a:hover { border-color: var(--accent); background: var(--accent-soft); }
.pager .next { margin-left: auto; text-align: right; }
.pager small { display: block; color: var(--ink-soft); font-size: 12px; }

.foot { margin-top: 40px; color: var(--ink-soft); font-size: 13px; }

/* ---------- スマートフォン ---------- */
@media (max-width: 900px) {
  .layout { display: block; }
  .side {
    position: static;
    width: auto;
    height: auto;
    padding: 14px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand { margin-bottom: 10px; padding-bottom: 10px; }
  .nav-button {
    display: block;
    padding: 8px 12px;
    border: 1px solid #b9c6cb;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
  }
  .nav-toggle:focus-visible + .nav-button { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav { display: none; margin-top: 10px; }
  .nav-toggle:checked ~ .nav { display: block; }
  .main { padding: 28px 16px 56px; }
  h1 { font-size: 24px; }
  h2 { font-size: 19px; margin-top: 44px; }
  .lead { font-size: 16px; }
  .cards { grid-template-columns: 1fr; }
  .steps > li { padding-left: 46px; }
  .pager { flex-direction: column; }
  .pager .next { margin-left: 0; }
  tbody th, thead th { white-space: normal; }
}

@media print {
  .side, .pager, .skip, .draft-banner { display: none; }
  .layout { display: block; }
  .main { padding: 0; }
  figure, .note, .caution, .important, .steps > li { break-inside: avoid; }
}

/* ---------- 初心者向けの部品 ---------- */
/* このページでわかること */
.goal {
  margin: 0 0 32px;
  padding: 16px 22px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: #fff;
}
.goal .callout-title { margin-bottom: 6px; color: var(--accent-dark); }
.goal ul:last-child, .goal p:last-child { margin-bottom: 0; }

/* 画面例の赤い番号と同じ番号 */
.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  margin: 0 3px;
  padding: 0 5px;
  border-radius: 12px;
  background: #d92b4b;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
}

/* キーボードのキー */
kbd {
  display: inline-block;
  margin: 0 2px;
  padding: 0 8px;
  border: 1px solid #9aa9b0;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: #fff;
  font-family: inherit;
  font-size: 0.88em;
  line-height: 1.6;
  white-space: nowrap;
}

/* 2つの画面の関係図 */
.pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
  margin: 0 0 24px;
}
.pair-box {
  padding: 16px 18px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
}
.pair-box-b { border-color: #4b4fa6; background: #eeeffa; }
.pair-name { display: block; margin-bottom: 4px; font-size: 18px; font-weight: 700; }
.pair-role { display: block; font-size: 15px; line-height: 1.7; }
.pair-arrow {
  align-self: center;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.5;
}
.pair-arrow::after { content: "→"; display: block; font-size: 26px; line-height: 1; }

/* 文例 */
.example {
  margin: 0 0 20px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 0.95em;
}
.example-label { display: block; margin-bottom: 2px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }

@media (max-width: 900px) {
  body { font-size: 16px; }
  .pair { grid-template-columns: 1fr; }
  .pair-arrow::after { content: "↓"; }
}

/* 画面例は押すと大きく表示 */
.shot-link { display: block; }

/* 準備中のページ */
.pending-page {
  margin: 0 0 28px;
  padding: 18px 22px;
  border: 2px dashed var(--todo-line);
  border-radius: 10px;
  background: var(--todo-bg);
}
.pending-page .callout-title { color: #4b3590; }
.pending-page p:last-child, .pending-page ul:last-child { margin-bottom: 0; }

/* 使う・触らないのしるし */
.tag-use, .tag-look, .tag-no {
  display: inline-block;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.7;
  white-space: nowrap;
}
.tag-use { background: #e3f4e8; color: #1c6b36; }
.tag-look { background: #eef6fb; color: #24678f; }
.tag-no { background: #fdecee; color: #a11f33; }
