/* ===================================================
   LIBRIS POS マニュアル スタイル
   =================================================== */

/* --- 色・寸法の定義（ここを変えると全体の色が変わります） --- */
:root {
  --bg:        #f6f7f9;
  --surface:   #ffffff;
  --text:      #1f2733;
  --text-weak: #5b6675;
  --line:      #e2e6ec;
  --accent:    #1b4d7a;   /* 見出し・番号などのメインカラー */
  --accent-weak: #eaf1f8;
  --shadow:    0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius:    12px;
  --header-h:  56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #12161c;
    --surface:   #1a2029;
    --text:      #e6eaf0;
    --text-weak: #a3adbb;
    --line:      #2b333f;
    --accent:    #7ab3e0;
    --accent-weak: #1f2c39;
    --shadow:    0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP",
               "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.75;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ===== ヘッダー ===== */
.site-header {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand-mark {
  font-weight: 800; letter-spacing: .08em; color: var(--accent);
  font-size: 15px;
}
.brand-title {
  font-size: 14px; color: var(--text-weak);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 6px 14px; font-size: 14px; cursor: pointer;
  font-family: inherit;
}
.nav-toggle:hover { background: var(--accent-weak); }

/* ===== レイアウト（サイドバー＋本文） ===== */
.layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 32px;
  padding-bottom: 64px;
}

/* ===== 目次 ===== */
.toc {
  position: sticky; top: calc(var(--header-h) + 24px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow);
}
.toc-heading {
  margin: 0 0 10px; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; color: var(--text-weak);
}
.toc-list { margin: 0; padding-left: 1.3em; }
.toc-list li { margin: 6px 0; }
.toc-list a {
  color: var(--text); text-decoration: none; font-size: 14.5px;
  border-bottom: 1px solid transparent;
}
.toc-list a:hover { color: var(--accent); border-bottom-color: currentColor; }
.toc-list a.current { color: var(--accent); font-weight: 700; }

/* ===== 導入部 ===== */
.intro { margin-bottom: 40px; }
.intro h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1.35;
  letter-spacing: .01em;
}
.lead { margin: 0 0 22px; color: var(--text-weak); }

.search-box input[type="search"] {
  width: 100%; max-width: 460px;
  padding: 11px 14px;
  font-size: 16px; font-family: inherit;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
}
.search-box input:focus {
  outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent;
}
.search-status {
  margin: 8px 0 0; font-size: 13px; color: var(--text-weak); min-height: 1.2em;
}

/* ===== セクション ===== */
.section { margin-bottom: 52px; }
.section h2 {
  margin: 0 0 20px;
  padding-bottom: 10px;
  font-size: clamp(20px, 3vw, 24px);
  border-bottom: 2px solid var(--accent);
  letter-spacing: .01em;
}

/* ===== 手順リスト ===== */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }

.step {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px 22px 62px;
  margin-bottom: 18px;
}
.step::before {
  content: counter(step);
  position: absolute; left: 20px; top: 20px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  font-size: 14px; font-weight: 700; line-height: 1;
}
@media (prefers-color-scheme: dark) {
  .step::before { color: #12161c; }
}

.step-text { margin: 0; font-weight: 600; font-size: 17px; }
.step-text .note {
  display: block; margin-top: 4px;
  font-weight: 400; font-size: 14.5px; color: var(--text-weak);
}

.sublist {
  margin: 10px 0 0; padding-left: 1.2em;
  font-size: 15px; color: var(--text-weak);
}
.sublist b { color: var(--text); }

.step figure { margin: 14px 0 0; }
.step figure img {
  display: block;
  width: 100%; height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: zoom-in;
  background: var(--bg);
}

/* ===== カード（プリンター） ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.card h3, .card h4 { margin: 0 0 12px; font-size: 17px; }
.links { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.links dt { color: var(--text-weak); font-size: 14.5px; }
.links dd { margin: 0; }
.links a { color: var(--accent); overflow-wrap: anywhere; }

/* ===== 検索で非表示にする ===== */
.is-hidden { display: none !important; }

/* ===== フッター ===== */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 26px 0 40px;
  color: var(--text-weak);
}
.site-footer p { margin: 0 0 4px; font-size: 14px; }
.site-footer .small { font-size: 12.5px; }

/* ===== 先頭へ戻る ===== */
.to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 20;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-size: 18px; cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }

/* ===== 画像拡大 ===== */
.lightbox {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(10, 14, 20, .88);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%; max-height: 100%;
  border-radius: 6px; background: #fff;
}
.lightbox-close {
  position: absolute; top: 14px; right: 18px;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer;
}

/* ===== ヘッダーのページ切替ナビ（nav.js から自動生成） ===== */
.site-nav { min-width: 0; overflow-x: auto; }
.site-nav-list {
  display: flex; gap: 4px;
  margin: 0; padding: 0; list-style: none;
}
.site-nav-list a {
  display: block; white-space: nowrap;
  padding: 5px 12px; border-radius: 7px;
  font-size: 14px; text-decoration: none;
  color: var(--text-weak);
}
.site-nav-list a:hover { background: var(--accent-weak); color: var(--text); }
.site-nav-list a.current {
  background: var(--accent-weak); color: var(--accent); font-weight: 700;
}

/* ===== 大見出しのグループ ===== */
.group { margin-bottom: 56px; }
.group > h2 {
  margin: 0 0 24px;
  font-size: clamp(22px, 3.4vw, 27px);
  letter-spacing: .01em;
}
.group > h2 .group-num {
  display: inline-block; margin-right: 10px;
  color: var(--accent); font-variant-numeric: tabular-nums;
}

/* グループ内のセクション見出し（h3）は、従来のh2と同じ体裁にする */
.section h3 {
  margin: 0 0 20px;
  padding-bottom: 10px;
  font-size: clamp(18px, 2.6vw, 21px);
  border-bottom: 2px solid var(--accent);
  letter-spacing: .01em;
}
.group .section { margin-bottom: 34px; }

/* ===== 入れ子の目次 ===== */
.toc-list ol {
  margin: 6px 0 10px; padding-left: 1.2em;
  list-style: decimal;
}
.toc-list > li { margin: 10px 0; }
.toc-list > li > span {
  font-size: 13px; font-weight: 700; color: var(--text-weak);
}

/* ===== 他ページへの誘導 ===== */
.crosslink {
  display: block;
  margin: 14px 0 0;
  padding: 12px 16px;
  background: var(--accent-weak);
  border-radius: 10px;
  font-size: 14.5px; text-decoration: none; color: var(--text);
}
.crosslink:hover { outline: 2px solid var(--accent); }
.crosslink b { color: var(--accent); }

/* ===== 作成中バナー ===== */
.wip {
  margin: 0 0 32px;
  padding: 16px 20px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: var(--accent-weak);
}
.wip h2 { margin: 0 0 8px; font-size: 16px; }
.wip p, .wip ul { margin: 0 0 8px; font-size: 14.5px; }
.wip ul { padding-left: 1.3em; }
.wip :last-child { margin-bottom: 0; }

/* ===== 準備中の表示 ===== */
.soon-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 13.5px; font-weight: 700; letter-spacing: .04em;
}
.coming-soon { border-style: dashed; }

/* 準備中だけを表示するページ */
.standby {
  max-width: 560px;
  margin: 90px auto 130px;
  text-align: center;
}
.standby h1 {
  margin: 0 0 18px;
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.4;
}
.standby p { margin: 0 0 10px; }
.standby .back {
  display: inline-block;
  margin-top: 26px;
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  text-decoration: none; font-size: 14.5px;
}
.standby .back:hover { background: var(--accent-weak); color: var(--accent); }

/* ===== カード内の本文 ===== */
.card p { margin: 0 0 10px; font-size: 15px; }
.card p:last-child { margin-bottom: 0; }
.card .sublist { margin-bottom: 0; }

code {
  padding: 1px 6px;
  background: var(--accent-weak);
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .92em;
}

/* ===== 表（計算式・対応表） ===== */
.table-scroll { overflow-x: auto; margin: 0 0 12px; }
.calc-table {
  width: 100%; border-collapse: collapse;
  font-size: 14.5px;
}
.calc-table th, .calc-table td {
  padding: 9px 12px;
  border: 1px solid var(--line);
  text-align: left; vertical-align: top;
}
.calc-table th {
  background: var(--accent-weak);
  font-weight: 700; white-space: nowrap;
}
.calc-table td:first-child { white-space: nowrap; }
.note-inline {
  display: block; margin-top: 2px;
  font-size: 13px; color: var(--text-weak);
}

/* ===== 未確定の箇所を示す差し込み ===== */
.todo {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-weak);
  border-radius: 0 8px 8px 0;
  font-size: 14px; color: var(--text-weak);
}
.todo b { color: var(--accent); }

/* ===== スマホ・タブレット ===== */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 20px; }
  .nav-toggle { display: block; }

  .toc {
    position: static;
    display: none;
    margin-bottom: 28px;
  }
  .toc.open { display: block; }

  .step { padding: 18px 16px 18px 52px; }
  .step::before { left: 14px; top: 18px; }
  .step-text { font-size: 16px; }

  /* ヘッダーが窮屈になるので、サービス名だけ残す */
  .brand-title { display: none; }
  .header-inner { gap: 10px; }
  .site-nav-list a { padding: 5px 9px; font-size: 13px; }
}

/* ===== 印刷 ===== */
@media print {
  .site-header, .toc, .search-box, .to-top, .nav-toggle, .lightbox,
  .site-nav, .wip, .todo, .crosslink { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .layout { display: block; padding: 0; }
  .step, .card {
    box-shadow: none; border: 1px solid #ccc;
    break-inside: avoid; page-break-inside: avoid;
  }
  .section { break-before: page; page-break-before: always; }
  .section:first-of-type { break-before: auto; page-break-before: auto; }
  a { color: inherit; text-decoration: none; }
}
