/* =====================================================================
   DENTIOS 利用者マニュアル — 共通スタイル
   ブランド: #1d80ff（DENTIOSブルー）+ インク #17191f
   ===================================================================== */
:root {
  --brand: #1d80ff;
  --brand-dark: #1568e0;
  --brand-light: #eaf3ff;
  --brand-tint: #f4f8ff;
  --ink: #17191f;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: #e5e8ee;
  --border-strong: #d3d8e0;
  --text: #1a1d23;
  --text-soft: #545b66;
  --text-mute: #8a919c;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(23,25,31,.05);
  --shadow-lg: 0 4px 16px rgba(23,25,31,.08);
  /* ロール色 */
  --admin: #f0872a;
  --clinic: #1d80ff;
  --lab: #0f9d58;
  --outsource: #7c5cff;
  --common: #0d9488;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  /* 日本語サイトで一般的なシステムフォント（外部読み込みなし） */
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "BIZ UDPGothic",
    "Yu Gothic", "YuGothic", "Meiryo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---- トップバー ---- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px;
  padding: 12px 22px;
}
.topbar__logo { height: 24px; width: auto; display: block; }
.topbar__home { font-size: 13px; color: var(--text-soft); }
.topbar__spacer { flex: 1; }
.topbar__tag { font-size: 12px; color: var(--text-mute); }

/* ---- ヘッダー見出し（平坦・資料的） ---- */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  /* 本文（最大幅1080px・左右22px＝内側1036px）と左端をそろえる */
  padding: 34px max(22px, calc(50% - 518px)) 30px;
}
.hero__eyebrow {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  color: var(--brand-dark); margin: 0 0 10px;
}
.hero__logo { height: 24px; margin: 0 0 14px; display: block; }
.hero h1 { font-size: clamp(22px, 3.4vw, 30px); margin: 0 0 8px; font-weight: 700; letter-spacing: 0; }
.hero p { font-size: clamp(14px, 1.9vw, 15.5px); color: var(--text-soft); margin: 0; line-break: strict; text-wrap: pretty; word-break: auto-phrase; }
.hero p + p { margin-top: 5px; }

/* ---- レイアウト（本文＋目次） ---- */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 34px; align-items: start; padding: 40px 22px 80px; max-width: 1080px; margin: 0 auto; }
.toc {
  position: sticky; top: 78px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 14px; box-shadow: var(--shadow);
  font-size: 13.5px;
}
.toc__title { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--text-mute); margin: 0 0 8px; }
.toc a { display: block; color: var(--text-soft); padding: 6px 10px; border-radius: 7px; }
.toc a:hover { background: var(--brand-tint); color: var(--brand-dark); text-decoration: none; }
.content { min-width: 0; }

/* ---- 見出し ---- */
h2.sec {
  font-size: 22px; font-weight: 800; margin: 46px 0 16px; padding-top: 8px;
  display: flex; align-items: center; gap: 12px; scroll-margin-top: 78px;
}
h2.sec:first-of-type { margin-top: 6px; }
h2.sec .num {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  background: var(--brand-light); color: var(--brand-dark);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
}
h3.sub { font-size: 17px; font-weight: 700; margin: 28px 0 10px; color: var(--ink); }
p { margin: 0 0 14px; }
.lead { font-size: 16px; color: var(--text-soft); }

/* ---- カード ---- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 24px; margin: 0 0 18px; box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }

/* ---- ステップ（手順） ---- */
.steps { list-style: none; counter-reset: step; margin: 8px 0 18px; padding: 0; }
.steps > li {
  position: relative; padding: 0 0 20px 46px; counter-increment: step;
}
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand-dark); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid #c7ddff;
}
.steps > li::after {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 4px;
  width: 1px; background: var(--border);
}
.steps > li:last-child::after { display: none; }
.steps > li strong { display: block; font-size: 15.5px; margin-bottom: 2px; color: var(--ink); }
.steps > li p { margin: 4px 0 0; font-size: 14px; color: var(--text-soft); }

/* ---- コールアウト ---- */
.callout {
  border-radius: var(--radius-sm); padding: 14px 18px; margin: 0 0 18px;
  border-left: 4px solid; font-size: 14.5px;
}
.callout strong { display: block; margin-bottom: 3px; }
.callout--tip  { background: #f0fdf7; border-color: var(--lab); }
.callout--info { background: var(--brand-tint); border-color: var(--brand); }
.callout--warn { background: #fff8ed; border-color: #f0872a; }

/* ---- バッジ / ステータス表 ---- */
.badge {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
}
.b-gray { background:#eef1f6; color:#586173; }
.b-blue { background:#eaf3ff; color:#1568e0; }
.b-amber{ background:#fff4e0; color:#b45309; }
.b-green{ background:#e9f9f0; color:#0c7d46; }
.b-teal { background:#effaf9; color:#0f766e; }
.b-red  { background:#fdecec; color:#c02626; }

.statustable { width:100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 14px; background: var(--surface); border:1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.statustable th, .statustable td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
.statustable th { background: #f7f9fc; font-size: 12.5px; color: var(--text-soft); font-weight: 700; }
.statustable tr:last-child td { border-bottom: none; }
.statustable td:first-child { white-space: nowrap; }

/* ---- ナビ説明（サイドバーの見かた） ---- */
.navlist { list-style: none; margin: 8px 0 18px; padding: 0; }
.navlist li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.navlist li:last-child { border-bottom: none; }
.navlist .nl-name { flex: 0 0 148px; font-weight: 700; color: var(--ink); }
.navlist .nl-desc { color: var(--text-soft); font-size: 14px; }

/* ---- FAQ ---- */
.faq { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px; overflow: hidden; }
.faq > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq > summary::-webkit-details-marker { display: none; }
.faq > summary::before { content: "Q"; flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: var(--brand-light); color: var(--brand-dark); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.faq[open] > summary { border-bottom: 1px solid var(--border); }
.faq__body { padding: 14px 18px; color: var(--text-soft); font-size: 14.5px; }
.faq__body > :last-child { margin-bottom: 0; }

/* ---- 役割カード（トップページ） ---- */
.rolegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin: 8px 0 30px; }
.rolecard {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, border-color .12s; color: inherit;
}
.rolecard:hover { transform: none; box-shadow: var(--shadow-lg); text-decoration: none; border-color: var(--accent, var(--brand)); }
.rolecard__ic { width: 42px; height: 42px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 13px; }
.rolecard h3 { margin: 0 0 6px; font-size: 18px; }
.rolecard p { margin: 0; font-size: 14px; color: var(--text-soft); }
.rolecard__go { display: inline-block; margin-top: 14px; font-weight: 700; font-size: 14px; color: var(--accent, var(--brand)); }

/* ---- キーワード用インライン装飾 ---- */
kbd { background:#f2f4f8; border:1px solid var(--border-strong); border-bottom-width:2px; border-radius:6px; padding:1px 7px; font-size:13px; font-family: inherit; font-weight:700; color:var(--ink); white-space:nowrap; }
.menu-chip { display:inline-block; background:var(--brand-light); color:var(--brand-dark); border-radius:6px; padding:1px 8px; font-weight:700; font-size:13.5px; white-space:nowrap; }

/* ---- フッター ---- */
.footer { border-top: 1px solid var(--border); padding: 30px 22px; text-align: center; color: var(--text-mute); font-size: 13px; background: var(--surface); }
.footer a { color: var(--text-soft); }

/* ロール別アクセント（見出しラベルの色） */
.role-admin    .hero__eyebrow { color: var(--admin); }
.role-clinic   .hero__eyebrow { color: var(--clinic); }
.role-lab      .hero__eyebrow { color: var(--lab); }
.role-outsource .hero__eyebrow { color: var(--outsource); }
.role-common   .hero__eyebrow { color: var(--common); }

/* ---- レスポンシブ ---- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding: 24px 18px 70px; }
  .toc { position: static; margin-bottom: 22px; }
  .toc__list { display: flex; flex-wrap: wrap; gap: 4px; }
  .toc a { font-size: 12.5px; padding: 5px 10px; background: var(--brand-tint); }
  h2.sec { font-size: 19px; }
  .navlist .nl-name { flex-basis: 110px; }
  .card { padding: 18px; }
}

/* =====================================================================
   図解（UIモックアップ / フロー図）
   ===================================================================== */
.figure { margin: 6px 0 20px; }
.figcap { font-size: 13px; color: var(--text-mute); margin-top: 8px; text-align: center; }

/* 疑似アプリ画面（外枠） */
.mock {
  border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-lg); background: var(--surface);
}
.mock__chrome { display: flex; align-items: center; gap: 6px; padding: 9px 12px; background: #eef1f6; border-bottom: 1px solid var(--border); }
.mock__dot { width: 10px; height: 10px; border-radius: 50%; background: #cbd2dc; flex: 0 0 auto; }
.mock__dot:nth-child(1){ background:#f2777a; } .mock__dot:nth-child(2){ background:#f5c451; } .mock__dot:nth-child(3){ background:#63c98b; }
.mock__url { margin-left: 10px; font-size: 11.5px; color: var(--text-mute); }
.mock__app { display: grid; grid-template-columns: 150px 1fr; min-height: 232px; }

/* 疑似サイドバー */
.mside { border-right: 1px solid var(--border); padding: 12px 10px; background: var(--surface); }
.mside__brand { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.mside__logo { font-weight: 800; font-size: 15px; color: var(--ink); letter-spacing: .02em; }
.mside__logo span { color: var(--brand); }
.mside__chip { font-size: 8.5px; font-weight: 700; color: #fff; background: var(--lab); border-radius: 999px; padding: 1px 7px; }
.mside__group { font-size: 9px; font-weight: 700; color: var(--text-mute); letter-spacing: .05em; margin: 10px 4px 4px; }
.mside__item { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-soft); padding: 5px 8px; border-radius: 6px; margin-bottom: 1px; }
.mside__item.on { background: var(--brand-light); color: var(--brand-dark); font-weight: 700; box-shadow: inset 3px 0 0 var(--brand); }
.mside__ic { width: 13px; height: 13px; border-radius: 4px; background: currentColor; opacity: .35; flex: 0 0 auto; }
.mside__item.on .mside__ic { opacity: .9; }

/* 疑似トップバー＋本文 */
.mmain { display: flex; flex-direction: column; min-width: 0; }
.mtop { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.mtop__title { font-weight: 700; font-size: 13px; color: var(--ink); }
.mtop__sp { flex: 1; }
.mbell { position: relative; width: 24px; height: 24px; border-radius: 6px; background: #f2f4f8; display: inline-flex; align-items: center; justify-content: center; color: var(--text-soft); }
.mbell__badge { position: absolute; top: -4px; right: -4px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 9px; font-weight: 800; line-height: 15px; text-align: center; }
.mavatar { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mbody { padding: 14px; background: var(--bg); flex: 1; }

/* 注釈マーカー（丸数字） */
.anno { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 800; box-shadow: 0 1px 3px rgba(29,128,255,.5); vertical-align: middle; }
.annolegend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 6px 18px; }
.annolegend li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--text-soft); }
.annolegend b { color: var(--ink); }

/* フロー図（横並びのステップ／ステータス） */
.flow { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.flow__step { flex: 1 1 auto; min-width: 92px; text-align: center; border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px; background: var(--surface); position: relative; }
.flow__step .fs-num { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 12px; align-items: center; justify-content: center; margin-bottom: 5px; }
.flow__step .fs-t { font-size: 12.5px; font-weight: 700; color: var(--ink); display: block; }
.flow__step .fs-d { font-size: 11px; color: var(--text-mute); display: block; margin-top: 2px; }
.flow__arrow { align-self: center; color: var(--border-strong); font-weight: 800; font-size: 16px; flex: 0 0 auto; }

/* ステータスの流れ（色つきピル） */
.sflow { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 4px; margin: 8px 0 8px; }
.sflow .badge { position: relative; }
.sflow__arw { color: var(--border-strong); font-weight: 800; }

/* ワークボード ミニ */
.wbmini { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.wblane { background: #f7f9fc; border: 1px solid var(--border); border-radius: 9px; padding: 7px; min-width: 0; }
.wblane__h { font-size: 10.5px; font-weight: 700; color: var(--text-soft); margin: 0 2px 6px; display: flex; justify-content: space-between; }
.wblane__h span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 5px; color: var(--text-mute); }
.wbc { background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 6px 7px; margin-bottom: 5px; box-shadow: var(--shadow); }
.wbc__t { font-size: 10.5px; font-weight: 700; color: var(--ink); }
.wbc__chip { display: inline-block; font-size: 9px; font-weight: 700; border-radius: 999px; padding: 0 6px; margin-top: 4px; }
.chip-over { background:#fbeaea; color:#b03a2e; } .chip-today { background:#fff4e0; color:#b45309; } .chip-soon { background:#eef1f6; color:#586173; }

/* 案件ビュー ミニ / KPIタイル */
.mcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 8px; }
.mcard { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; box-shadow: var(--shadow); border-left: 3px solid var(--brand); }
.mcard--amber { border-left-color: #f0872a; } .mcard--green { border-left-color: var(--lab); }
.mcard__t { font-size: 11.5px; font-weight: 700; color: var(--ink); }
.mcard__s { font-size: 10px; color: var(--text-mute); margin-top: 2px; }
.mkpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 8px; }
.mkpi { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.mkpi__l { font-size: 10.5px; color: var(--text-soft); }
.mkpi__v { font-size: 20px; font-weight: 800; color: var(--ink); margin-top: 1px; }
.mkpi__v.warn { color: #b03a2e; }

/* 歯式チャート ミニ（凡例つき） */
.tooth-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-soft); justify-content: center; }
.tooth-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tooth-legend i { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }

@media (max-width: 620px) {
  .mock__app { grid-template-columns: 118px 1fr; }
  .mside__item { font-size: 10.5px; }
  .wbmini { grid-auto-flow: row; grid-auto-columns: auto; }
  .flow__arrow { display: none; }
}

/* ---- 印刷（PDF化にも配慮） ---- */
@media print {
  .topbar, .toc, .footer, .hero::after { display: none !important; }
  body { background: #fff; }
  .layout { display: block; padding: 0; }
  .card, .callout, .statustable, .faq { break-inside: avoid; box-shadow: none; }
  .hero { background: #fff; color: var(--ink); padding: 10px 0 20px; text-align: left; }
  .hero p { color: var(--text-soft); }
  a { color: var(--ink); }
}

/* =====================================================================
   追補: ページ内検索 / もくじ追従 / トップへ戻る（manual.js 連動）
   ===================================================================== */
.toc__search { position: relative; margin: 0 0 12px; }
.toc__search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--text-mute); pointer-events: none; }
.toc__search input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 7px 10px 7px 30px; font-size: 13px; font-family: inherit; color: var(--text);
  background: var(--surface); outline: none;
}
.toc__search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.toc a.is-current {
  background: var(--brand-light); color: var(--brand-dark); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--brand);
}
.manual-nohit {
  margin: 24px 0; padding: 18px; text-align: center; color: var(--text-soft);
  background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--brand-dark); box-shadow: var(--shadow-lg);
  display: grid; place-items: center; cursor: pointer;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: .18s ease;
}
.to-top.is-show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--brand-tint); }

/* もくじを少し見やすく（追従時の視認性） */
.toc { max-height: calc(100vh - 96px); overflow: auto; padding-right: 4px; }
.toc__list a { transition: background .12s, color .12s; }

@media (max-width: 860px) {
  .toc { max-height: none; overflow: visible; }
  .toc__search { max-width: 100%; }
  .to-top { right: 14px; bottom: 76px; } /* モバイル下部タブと干渉しない位置 */
}
@media print { .to-top, .toc__search { display: none !important; } }

/* 実画面スクリーンショット */
.figure .shot { display:block; width:100%; height:auto; border:1px solid var(--border-strong); border-radius:var(--radius); box-shadow: var(--shadow-lg); }
