/* ============================================================
   イチグチ販売管理システム 共通スタイル
   Navisia / 奉行シリーズ風 (ネイビータイトルバー + 淡青グレー背景)
   ============================================================ */
:root {
  --navy: #1a2a6c;
  --navy-dark: #101c4e;
  --panel: #d6d9e8;
  --panel-light: #e4e6f0;
  --btn-face: #f0f0f4;
  --btn-border: #8a8fa8;
  --accent: #2b4bb5;
  --yellow: #ffff99;
  --red: #cc0000;
  --green: #0a7a2a;
  --orange: #c8760a;
  --grid-line: #b8bcd0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Yu Gothic UI", "Meiryo UI", "MS UI Gothic", sans-serif;
  font-size: 13px;
  background: #c8ccdc;
  color: #111;
  height: 100%;
}

/* ---------- アプリ全体枠 ---------- */
.app-frame {
  display: flex;
  flex-direction: column;
  height: 100vh;
  border: 2px solid #9aa0b8;
  background: var(--panel);
}

/* ---------- タイトルバー ---------- */
.title-bar {
  background: linear-gradient(to bottom, #3a4a8c, var(--navy));
  color: #fff;
  padding: 5px 12px;
  font-weight: bold;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.title-bar .logo { color: #7ec8ff; font-size: 16px; }
.title-bar .tb-sub { font-weight: normal; font-size: 11.5px; color: #b8c8f0; }

/* ---------- ヘッダー (MEMO / DATE / USER / TERM) ---------- */
.app-header {
  display: flex;
  background: var(--panel-light);
  border-bottom: 2px solid #9aa0b8;
  padding: 6px 10px;
  gap: 10px;
  align-items: stretch;
}
.memo-box { flex: 1; display: flex; gap: 6px; }
.memo-label {
  background: var(--navy);
  color: #fff;
  padding: 8px 10px;
  font-weight: bold;
  display: flex;
  align-items: center;
}
.memo-rows { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.memo-row { display: flex; align-items: center; gap: 4px; flex: 1; }
.memo-tag {
  background: var(--navy);
  color: #fff;
  font-size: 10.5px;
  font-weight: bold;
  padding: 2px 6px;
  min-width: 34px;
  text-align: center;
}
.memo-tag.personal { background: #0a6a3a; }
.memo-input {
  flex: 1;
  border: 1px solid var(--btn-border);
  background: #fff;
  padding: 3px 8px;
  font-size: 12.5px;
  font-family: inherit;
}
.memo-input.dirty { background: #fff8dc; }
.memo-save {
  border: 1px solid var(--btn-border);
  background: linear-gradient(to bottom, #fff, #d8d8e0);
  border-radius: 3px;
  cursor: pointer;
  padding: 2px 7px;
  font-size: 12px;
  visibility: hidden;
}
.memo-row:hover .memo-save, .memo-save.show { visibility: visible; }
.info-box { min-width: 220px; }
.info-box table { border-collapse: collapse; width: 100%; }
.info-box td { border: 1px solid var(--btn-border); padding: 2px 8px; background: #fff; }
.info-box td.k {
  background: var(--navy);
  color: #fff;
  font-weight: bold;
  width: 52px;
  text-align: center;
}

/* ---------- 本体レイアウト ---------- */
.app-body { display: flex; flex: 1; overflow: hidden; }

.side-menu {
  width: 185px;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
  border-right: 2px solid #9aa0b8;
  overflow-y: auto;
}
.side-menu .m-btn {
  display: block;
  width: 100%;
  padding: 9px 6px;
  text-align: center;
  background: linear-gradient(to bottom, #ffffff, var(--btn-face) 45%, #d8d8e0);
  border: 1px solid var(--btn-border);
  border-radius: 3px;
  box-shadow: 1px 1px 2px rgba(0,0,0,.25);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  color: #111;
  text-decoration: none;
}
.side-menu .m-btn:hover { background: #fdf6d8; }
.side-menu .m-btn.active {
  background: linear-gradient(to bottom, #dce8ff, #b8ccf5);
  border: 2px solid var(--accent);
}
.side-menu .m-btn.quit { margin-top: auto; }
.fiscal-badge {
  background: var(--yellow);
  border: 1px solid #b8a800;
  text-align: center;
  padding: 4px;
  font-weight: bold;
  margin-top: 6px;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel-light);
}
.content-title {
  background: var(--navy);
  color: #fff;
  font-weight: bold;
  font-size: 15px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
}
.content-title .ct-text { flex: 1; text-align: center; letter-spacing: .5em; }
.fs-btn {
  background: linear-gradient(to bottom, #4a5a9c, #2a3a7c);
  color: #fff;
  border: 1px solid #7a8ac0;
  border-radius: 3px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.fs-btn:hover { background: #5a6aac; }

/* ---------- 全画面モード ---------- */
body.fullscreen-mode .title-bar,
body.fullscreen-mode .app-header,
body.fullscreen-mode .side-menu { display: none; }
body.fullscreen-mode .app-frame { border: none; }
.content-inner { flex: 1; overflow: auto; padding: 14px; }

/* ---------- メニューボタン群 ---------- */
.menu-grid { display: flex; flex-direction: column; gap: 10px; }
.menu-row { display: flex; gap: 10px; flex-wrap: wrap; }
.menu-btn {
  min-width: 190px;
  padding: 9px 14px;
  background: linear-gradient(to bottom, #ffffff, var(--btn-face) 45%, #d8d8e0);
  border: 1px solid var(--btn-border);
  border-radius: 3px;
  box-shadow: 1px 1px 3px rgba(0,0,0,.3);
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: none;
  color: #111;
  text-align: center;
}
.menu-btn:hover { background: #fdf6d8; }
.menu-btn:active { box-shadow: inset 1px 1px 3px rgba(0,0,0,.3); }
.menu-cat-title { font-weight: bold; margin-bottom: 8px; color: var(--navy); }
.flow-box {
  background: #fff;
  border: 1px solid var(--grid-line);
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.9;
}
.flow-box b { color: var(--navy); }

/* ---------- フォーム部品 ---------- */
.form-section {
  background: var(--panel-light);
  border: 1px solid var(--grid-line);
  padding: 10px;
  margin-bottom: 10px;
}
.frm-row { display: flex; gap: 14px; margin-bottom: 6px; flex-wrap: wrap; align-items: center; }
.fld { display: flex; align-items: center; gap: 4px; }
.fld > label {
  background: var(--navy);
  color: #fff;
  font-weight: bold;
  padding: 4px 8px;
  min-width: 74px;
  text-align: center;
  font-size: 12px;
}
.fld input[type=text], .fld input[type=date], .fld input[type=number],
.fld input[type=password], .fld input[type=month], .fld select, .fld textarea {
  border: 1px solid var(--btn-border);
  padding: 4px 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
}
.fld input:read-only { background: #eef0f6; }
.fld textarea.mail-input { font-family: "Consolas", "Yu Gothic UI", monospace; font-size: 12.5px; line-height: 1.5; }
.fld .mail-count { min-width: 60px; }
.fld .code-input { width: 90px; }
.fld .name-display {
  min-width: 220px; background: #eef0f6; padding: 5px 6px;
  border: 1px solid var(--btn-border); min-height: 26px;
}

.search-btn {
  padding: 3px 9px;
  background: linear-gradient(to bottom, #fff, #d8d8e0);
  border: 1px solid var(--btn-border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
}
.search-btn:hover { background: #fdf6d8; }

.btn {
  padding: 6px 18px;
  background: linear-gradient(to bottom, #ffffff, var(--btn-face) 45%, #d8d8e0);
  border: 1px solid var(--btn-border);
  border-radius: 3px;
  box-shadow: 1px 1px 2px rgba(0,0,0,.25);
  font-weight: bold;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  color: #111;
  display: inline-block;
}
.btn:hover { background: #fdf6d8; }
.btn.primary { background: linear-gradient(to bottom, #dce8ff, #9fbcf0); border-color: var(--accent); }
.btn.danger { background: linear-gradient(to bottom, #ffe0e0, #f0a8a8); border-color: #c06060; }
.btn.print { background: linear-gradient(to bottom, #e0ffe8, #a8e0b8); border-color: #4c9a60; }
.btn.mail { background: linear-gradient(to bottom, #fde8e6, #f4b8b2); border-color: #c5372c; color: #7a1a12; }
.btn.mail:hover { background: #fff3d8; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 一覧テーブル ---------- */
.grid-wrap {
  overflow: auto;
  background: #fff;
  border: 1px solid var(--grid-line);
  resize: vertical;
}
table.grid {
  border-collapse: collapse;
  width: max-content;
  min-width: 100%;
  font-size: 12.5px;
}
table.grid th {
  background: linear-gradient(to bottom, #eef1fa, #cfd5ea);
  border: 1px solid var(--grid-line);
  padding: 5px 8px;
  white-space: nowrap;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 2;
}
table.grid th.sortable-th { cursor: pointer; }
table.grid th.sortable-th:hover { background: #dde5f5; }
table.grid th .sort-mark { color: var(--accent); font-size: 11px; margin-left: 3px; }
table.grid td {
  border: 1px solid var(--grid-line);
  padding: 4px 8px;
  white-space: nowrap;
  background: #fff;
}
table.grid tbody tr:nth-child(even) td { background: #eef1fa; }
table.grid tbody tr:hover td { background: #fdf6d8; }
table.grid tbody tr.selected td { background: #cce0ff; }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid tfoot td {
  border: 1px solid var(--grid-line);
  padding: 5px 8px;
  background: #f5f5fa;
  font-weight: bold;
  white-space: nowrap;
  position: sticky;
  bottom: 0;
}
table.grid tfoot td.num { text-align: right; }
table.grid td.minus, table.grid td .minus { color: var(--red); }

/* ---------- 検索モーダル ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-overlay.open { display: flex; }
.modal-win {
  width: 760px;
  max-width: 94vw;
  max-height: 84vh;
  background: var(--panel-light);
  border: 2px solid var(--navy);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 4px 16px rgba(0,0,0,.5);
}
.modal-title {
  background: linear-gradient(to bottom, #3a4a8c, var(--navy));
  color: #fff;
  font-weight: bold;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title .close-x { cursor: pointer; padding: 0 6px; font-size: 15px; }
.modal-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.modal-search-row { display: flex; gap: 6px; }
.modal-search-row input { flex: 1; border: 1px solid var(--btn-border); padding: 6px 8px; font-size: 14px; }
.modal-result { flex: 1; overflow: auto; border: 1px solid var(--grid-line); background: #fff; min-height: 260px; max-height: 55vh; }
.modal-hint { color: #555; font-size: 11.5px; }

/* 検索モーダルの一覧: いま選んでいる行 (Enterで確定する行) をはっきり見せる */
.modal-result tbody tr { cursor: pointer; }
.modal-result tbody tr:focus { outline: none; }
.modal-result table.grid tbody tr.selected td,
.modal-result table.grid tbody tr:focus td { background: #b9d5ff; font-weight: bold; }
.modal-result table.grid tbody tr.selected td:first-child,
.modal-result table.grid tbody tr:focus td:first-child { box-shadow: inset 3px 0 0 var(--navy); }

/* ---------- 明細グリッド ---------- */
.detail-grid input, .detail-grid select {
  width: 100%;
  border: 1px solid #ccc;
  padding: 3px 4px;
  font-size: 12.5px;
  font-family: inherit;
}
.detail-grid input.num { text-align: right; }
.detail-grid td { padding: 2px 3px; }
.detail-grid td.rowno { text-align: center; background: #eef1fa; }
.detail-grid tr.linked td.rowno { background: #d8f0d8; }

/* ---------- ツールバー・ページャ ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; align-items: center; flex-wrap: wrap; }
.pager { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.status-bar {
  background: var(--navy);
  color: #9fd0ff;
  padding: 3px 12px;
  font-size: 11.5px;
  text-align: right;
}
.total-box {
  background: #fff; border: 1px solid var(--btn-border);
  padding: 4px 12px; font-weight: bold; text-align: right; min-width: 120px;
}
.err-msg { color: var(--red); font-weight: bold; }
.ok-msg { color: var(--green); font-weight: bold; }
.warn-msg { color: var(--orange); font-weight: bold; }

/* ---------- バッジ ---------- */
.badge { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: bold; border: 1px solid; }
.badge.open { background: #fff3d0; border-color: #c8a020; color: #7a5c00; }
.badge.done { background: #dff0df; border-color: #4c9a60; color: #14601f; }
.badge.part { background: #e0e8ff; border-color: #4a6ac0; color: #1a2a6c; }
.badge.cancel { background: #fde8e6; border-color: #c5372c; color: #7a1a12; }
.badge.short { background: #fde8e6; border-color: #c5372c; color: #7a1a12; }

/* ---------- 一括処理 ---------- */
.bulk-bar {
  background: #eef3ff; border: 1px solid var(--accent);
  padding: 6px 10px; margin-bottom: 8px;
}
.bulk-bar .bulk-count { font-weight: bold; }
.bulk-bar .bulk-count b { color: var(--accent); font-size: 15px; }
.bulk-result { border: 2px solid var(--navy); background: var(--panel-light); margin-top: 10px; }
.bulk-result .bulk-head {
  background: linear-gradient(to bottom, #3a4a8c, var(--navy));
  color: #fff; font-weight: bold; padding: 6px 10px;
  display: flex; gap: 14px; align-items: center;
}
.bulk-result .bulk-head span { font-size: 12.5px; }
.bulk-result .bulk-progress { height: 8px; background: #fff; border-bottom: 1px solid var(--grid-line); }
.bulk-result .bulk-progress > div { height: 100%; width: 0; background: linear-gradient(to right, #4a6ac0, #2b4bb5); transition: width .25s; }
.bulk-result .grid-wrap { border: none; }
.bulk-result .toolbar { padding: 0 10px; margin-bottom: 0; }

/* ---------- 構成表ツリー ---------- */
.bom-tree { background: #fff; border: 1px solid var(--grid-line); padding: 8px; font-size: 12.5px; overflow: auto; }
.bom-tree ul { list-style: none; margin: 0; padding-left: 18px; }
.bom-tree > ul { padding-left: 2px; }
.bom-node { display: flex; align-items: center; gap: 6px; padding: 2px 0; white-space: nowrap; }
.bom-node .tw { cursor: pointer; width: 15px; text-align: center; color: var(--accent); font-weight: bold; user-select: none; }
.bom-node .cd { font-weight: bold; }
.bom-node .qty { color: var(--navy); }
.bom-node .zk { color: #555; }
.bom-node .short { color: var(--red); font-weight: bold; }
.bom-node.lv0 { font-size: 13.5px; }

/* ---------- 在庫の過不足 ---------- */
tr.row-short td { background: #fff3f2 !important; }
tr.row-ok td { background: #f4fbf4 !important; }

/* ---------- エラーの対処ガイド ---------- */
.err-help { border: 2px solid var(--red); background: #fff; margin-bottom: 12px; }
.err-help .eh-title { background: var(--red); color: #fff; font-weight: bold; padding: 5px 10px; }
.err-help .eh-body { padding: 10px 12px; }
.err-help .eh-detail { line-height: 1.7; }

/* ---------- 社印プレビュー ---------- */
.seal-preview { border: 1px dashed var(--btn-border); background: #fff; padding: 8px; display: inline-block; }
.seal-preview img { max-width: 120px; max-height: 120px; }

/* ---------- 印刷プレビューの案内 ---------- */
.print-hint { background: #fff8dc; border: 1px solid #c8a020; padding: 6px 10px; margin-bottom: 8px; }

/* ---------- 在庫ポップアップ (明細の在庫欄) ---------- */
.stock-pop {
  position: absolute;
  z-index: 80;
  min-width: 560px;
  max-width: 94vw;
  background: var(--panel-light);
  border: 2px solid var(--navy);
  border-radius: 4px;
  box-shadow: 4px 4px 16px rgba(0,0,0,.35);
  font-size: 12.5px;
}
.stock-pop .sp-head {
  background: linear-gradient(to bottom, #3a4a8c, var(--navy));
  color: #fff; font-weight: bold; padding: 4px 10px;
  display: flex; justify-content: space-between; align-items: center;
}
.stock-pop .sp-x { cursor: pointer; padding: 0 4px; }
.stock-pop .sp-body { padding: 8px 10px; }
.stock-pop .sp-title { font-weight: bold; margin-bottom: 5px; }
.stock-pop .sp-need {
  background: #fff8dc; border: 1px solid #c8a020;
  padding: 3px 8px; margin-bottom: 6px;
}
.stock-pop table.sp-tbl { border-collapse: collapse; width: 100%; background: #fff; }
.stock-pop table.sp-tbl th {
  background: linear-gradient(to bottom, #eef1fa, #cfd5ea);
  border: 1px solid var(--grid-line); padding: 3px 6px; white-space: nowrap;
}
.stock-pop table.sp-tbl td {
  border: 1px solid var(--grid-line); padding: 2px 6px; white-space: nowrap;
}
.stock-pop table.sp-tbl td.num, .stock-pop table.sp-tbl th.num { text-align: right; }
.stock-pop table.sp-tbl tr.sp-now td { background: #fff8dc; }
.stock-pop table.sp-tbl tr.sp-minus td { background: #fff3f2; }
.stock-pop table.sp-tbl tfoot td { background: #eef1fa; font-weight: bold; }
.stock-pop table.sp-tbl .btn { padding: 0 8px; font-size: 11px; box-shadow: none; }
.stock-pop .sp-foot { margin-top: 6px; }
.stock-pop .sp-links { margin-top: 8px; display: flex; gap: 6px; align-items: center; }
.stock-pop .sp-links .btn { padding: 2px 10px; font-size: 11.5px; }

/* 在庫欄 (読み取り専用だがカーソルは入る) */
.detail-grid input.zk-cell {
  text-align: right;
  background: #eef4ff;
  border: 1px solid #b8c8e8;
  cursor: help;
  font-weight: bold;
}
.detail-grid input.zk-cell:focus { background: #fffbe6; outline: 2px solid var(--accent); }
.detail-grid input.zk-cell.zk-short { background: #fdeceb; color: var(--red); }
.detail-grid input.zk-cell.zk-ok { color: var(--green); }

/* ---------- ファンクションキー ドック (画面下部のフッター) ----------
   本文 (.content-inner) の外に置くので、明細をスクロールしても隠れない。
   全画面モードでもタイトル・メニューが消えるだけで、この位置は変わらない。
   ・固定表示 … バーを常に出す (従来どおり)
   ・自動表示 … つまみだけ残してバーを隠し、下端にマウスを近づけたときや
                F1〜F12 を押したときに本文へ重ねて出す (明細をいちばん広く使える) */
.fn-dock {
  position: relative;
  flex: 0 0 auto;
  background: var(--panel);
  border-top: 2px solid #9aa0b8;
  z-index: 7;
}
.fn-handle {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 21px;
  padding: 0 8px;
  font-size: 11.5px;
  font-weight: bold;
  color: var(--navy);
  background: linear-gradient(to bottom, #eaecf6, #d2d6e6);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
}
.fn-handle:hover { background: #fdf6d8; }
.fn-handle .fh-ico { font-size: 13px; }
.fn-handle .fh-keys {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: normal;
  color: #555;
}
.fn-handle .fh-state {
  background: var(--navy);
  color: #fff;
  border-radius: 2px;
  padding: 1px 8px;
  white-space: nowrap;
}
.fn-bar {
  display: flex;
  gap: 4px;
  background: var(--panel);
  padding: 5px 6px;
  flex: 0 0 auto;
}
/* 自動表示: バーは普段隠れ、必要なときだけ本文の上へ浮かせる (レイアウトを動かさない) */
.fn-dock.auto .fn-bar {
  display: none;
  position: absolute;
  left: 0; right: 0; bottom: 21px;
  border-top: 2px solid #9aa0b8;
  box-shadow: 0 -5px 14px rgba(0,0,0,.28);
}
.fn-dock.auto.peek .fn-bar { display: flex; }

/* 設定画面の表示イメージ (押せないバー) */
.fn-dock.fn-preview { border: 1px solid var(--grid-line); }
.fn-dock.fn-preview .fn-key { cursor: default; }
.fn-key {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 2px;
  background: linear-gradient(to bottom, #ffffff, var(--btn-face) 45%, #d8d8e0);
  border: 1px solid var(--btn-border);
  border-radius: 3px;
  box-shadow: 1px 1px 2px rgba(0,0,0,.2);
  cursor: pointer;
  font-family: inherit;
  color: #111;
}
.fn-key .fk {
  font-size: 10.5px;
  font-weight: bold;
  color: #fff;
  background: var(--navy);
  border-radius: 2px;
  padding: 0 6px;
  line-height: 1.5;
}
.fn-key .fl {
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-height: 17px;
}
.fn-key:hover:not(:disabled) { background: #fdf6d8; }
.fn-key:active:not(:disabled), .fn-key.pressed { background: #dce8ff; box-shadow: inset 1px 1px 3px rgba(0,0,0,.3); }
.fn-key.empty, .fn-key:disabled {
  background: #e6e6ec;
  box-shadow: none;
  cursor: default;
  opacity: .55;
}
.fn-key.empty .fk { background: #9aa0b8; }

/* 伝票入力の明細 — 画面の残りいっぱいまで広げる (高さは JS の fitDetailGrid で調整) */
.grid-wrap.detail-wrap {
  resize: none;
  min-height: 160px;
  flex: 1 1 auto;
}

/* Enterキー送りで登録ボタンへ来たときの強調 */
.btn.key-ready, .key-ready {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
  background: linear-gradient(to bottom, #dce8ff, #9fbcf0) !important;
}

/* 入力中の項目を分かりやすく (Enterキー送りで目が追えるように) */
.form-section input:focus, .form-section select:focus,
.detail-grid input:focus, .detail-grid select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
  background: #fffbe6;
}
.detail-grid tr:focus-within td.rowno { background: #ffe9a8; }

/* ---------- 操作説明・短縮設定のダイアログ ---------- */
.key-help { font-size: 12.5px; line-height: 1.9; }
.key-help table { border-collapse: collapse; width: 100%; }
.key-help th, .key-help td { border: 1px solid var(--grid-line); padding: 3px 8px; text-align: left; }
.key-help th { background: #eef1fa; white-space: nowrap; width: 96px; }

/* ============================================================
   ヘルプ (取扱説明書)
   ============================================================ */
.m-btn.help { background: linear-gradient(to bottom, #3a6a4a, #24482f); }
.fs-btn.help-btn { text-decoration: none; margin-right: 6px;
  background: linear-gradient(to bottom, #3a6a4a, #24482f); border-color: #6aa07c; }
.fs-btn.help-btn:hover { background: #47805a; }

.hp-bar .hp-count { font-weight: bold; color: var(--navy); margin-left: 4px; }

.hp-wrap { display: flex; gap: 12px; align-items: flex-start; }

/* 目次 */
.hp-toc {
  flex: 0 0 258px; position: sticky; top: 0; align-self: flex-start;
  max-height: calc(100vh - 210px); overflow: auto;
  background: #fff; border: 1px solid var(--grid-line); padding: 8px 6px 12px; font-size: 12px;
}
.hp-toc-title { background: var(--navy); color: #fff; font-weight: bold; text-align: center;
  letter-spacing: .4em; padding: 4px; margin: -8px -6px 8px; }
.hp-toc-ch { margin-bottom: 6px; }
.hp-toc-chlink { display: block; font-weight: bold; color: var(--navy); text-decoration: none;
  padding: 3px 5px; border-left: 4px solid transparent; }
.hp-toc-chlink:hover { background: var(--panel-light); }
.hp-toc-ch.now > .hp-toc-chlink { border-left-color: var(--accent); background: #e8ecfa; }
.hp-toc ul { list-style: none; margin: 2px 0 0; padding: 0 0 0 10px; }
.hp-toc li a { display: block; color: #333; text-decoration: none; padding: 2px 5px; line-height: 1.5; }
.hp-toc li a:hover { background: var(--panel-light); color: var(--navy); }
.hp-ico { margin-right: 4px; }

/* 本文 */
.hp-main { flex: 1 1 auto; min-width: 0; background: #fff;
  border: 1px solid var(--grid-line); padding: 4px 18px 18px; }
.hp-ch-title { font-size: 16px; letter-spacing: .2em; background: var(--navy); color: #fff;
  padding: 6px 12px; margin: 16px -18px 12px; }
.hp-ch:first-child .hp-ch-title { margin-top: 6px; }
.hp-topic { padding: 2px 0 10px; margin-bottom: 12px; border-bottom: 1px dashed #ccd; scroll-margin-top: 10px; }
.hp-topic:last-child { border-bottom: none; }
.hp-topic-title { font-size: 14.5px; color: var(--navy); margin: 10px 0 6px;
  border-left: 5px solid var(--navy); border-bottom: 1px solid var(--navy); padding: 3px 0 3px 8px; }
.hp-topic-title .hp-num { color: var(--accent); margin-right: 8px; font-family: Consolas, monospace; }
.hp-anchor { font-size: 12px; text-decoration: none; margin-left: 6px; opacity: .45; }
.hp-anchor:hover { opacity: 1; }
.hp-focus { background: #fffbe6; box-shadow: 0 0 0 3px #ffe07a; border-radius: 3px; }

.hp-links { margin: 0 0 8px; }
.hp-open { display: inline-block; background: var(--panel-light); border: 1px solid var(--btn-border);
  border-radius: 3px; padding: 2px 10px; font-size: 12px; text-decoration: none;
  color: var(--navy); font-weight: bold; margin-right: 6px; }
.hp-open:hover { background: #fff; border-color: var(--accent); }

.hp-body { font-size: 13px; line-height: 1.85; }
.hp-body h4 { font-size: 13px; margin: 12px 0 4px; padding-left: 8px;
  border-left: 4px solid var(--btn-border); color: #24305e; }
.hp-body p { margin: 0 0 7px; }
.hp-body ul, .hp-body ol { margin: 0 0 8px; padding-left: 24px; }
.hp-body li { margin-bottom: 3px; }
.hp-body b { color: #101c4e; }
.hp-body code { font-family: Consolas, monospace; background: var(--btn-face); padding: 0 4px; }
table.hp-tbl { border-collapse: collapse; width: 100%; margin: 4px 0 10px; font-size: 12.5px; }
table.hp-tbl th { background: #e8ebf5; border: 1px solid var(--grid-line); padding: 4px 7px;
  text-align: left; white-space: nowrap; }
table.hp-tbl td { border: 1px solid var(--grid-line); padding: 4px 7px; vertical-align: top; }
table.hp-index td { white-space: normal; }
.hp-dim { color: #999; }
.hp-note { border-left: 5px solid var(--accent); background: #eef2ff; padding: 6px 12px; margin: 8px 0; }
.hp-warn { border-left: 5px solid var(--red); background: #fff0ef; padding: 6px 12px; margin: 8px 0; }
pre.hp-flow { background: #f4f5fa; border: 1px solid var(--grid-line); padding: 8px 10px;
  font-size: 12px; line-height: 1.7; overflow-x: auto; margin: 4px 0 10px; }

.hp-hits { background: #f7f9ff; border: 1px solid var(--accent); padding: 8px 14px; margin: 8px 0 14px; }
.hp-hits ol { margin: 6px 0 2px; padding-left: 22px; }
.hp-hits li { margin-bottom: 6px; }
.hp-hits a { color: var(--navy); }
.hp-snip { color: #444; font-size: 12px; line-height: 1.6; }
.hp-body mark, .hp-snip mark { background: #ffec8b; }
.hp-foot { text-align: center; color: #777; font-size: 11.5px; margin-top: 18px;
  border-top: 1px solid var(--grid-line); padding-top: 8px; }

@media print {
  .side-menu, .app-header, .title-bar, .status-bar, .hp-bar, .hp-toc, .content-title { display: none !important; }
  .hp-main { border: none; padding: 0; }
  .hp-anchor { display: none; }
}

/* ---------- 商品画像 ---------- */
img.item-thumb { width: 40px; height: 40px; object-fit: contain; background: #fff;
  border: 1px solid var(--grid-line); border-radius: 2px; vertical-align: middle; }
.item-img-box { display: inline-flex; align-items: center; justify-content: center;
  width: 132px; height: 132px; background: #fff; border: 1px solid var(--grid-line); padding: 4px; }
.item-img-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.item-img-box.empty { color: #999; font-size: 11.5px; text-align: center; background: var(--btn-face); }
