:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f5f5f5;
  --line: #e4e4e4;
  /* 2026/6 顧客要望: 全体的に文字が細く色が薄く見難い → 濃くする
     ただし データ部 と 見出し の 濃淡差 が 大きすぎる ('データ部だけ濃く見える'
     違和感) ので 両方 黒寄りに 統一して 差を 抑える
       --text  : #222222 → #111111 (本文)
       --muted : #666666 → #222222 (見出し/補足も ほぼ黒に近づけ 統一感) */
  --text: #111111;
  --muted: #222222;
  --accent: #222222;
  --accent-strong: #000000;
  --accent-soft: #f5f5f5;
  --brand: #a22222;
  --brand-soft: #f8eeee;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  /* 2026/6 顧客要望: 旧版は font-family を 指定しておらず ブラウザ既定 (Win なら
     MS PGothic 等) で 太字 が しっかり見えていた。 新版で 指定していた
     "Hiragino Kaku Gothic ProN", "Yu Gothic" は Mac/iOS で 綺麗 だが Windows
     では Yu Gothic Regular が 細く 表示されて 「文字が細く見難い」 原因に
     なっていた。 指定を 外し OS 既定の Gothic 系に 戻す。 これに合わせ
     weight 500 や -webkit-font-smoothing も 不要 (Win の MS PGothic は
     subpixel 時点で十分太く見える) なので 除去 */
  color: var(--text);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  /* 旧: rgba(255,255,255,0.97) + backdrop-filter:blur で ガラス調の 3% 透過。
     sticky 化された tbody が スクロール時に 透けて見える事象あり → 完全不透明に */
  background: #ffffff;
  border-bottom: 1px solid rgba(31, 26, 23, 0.08);
}
.site-header-inner {
  width: min(100%, calc(100% - 32px));
  margin: 0 auto;
}
.login-header-inner {
  width: min(1120px, calc(100% - 40px));
}
.site-main,
.site-footer-inner {
  width: min(992px, calc(100% - 40px));
  margin: 0 auto;
}
/* テーブル系ページ (bhhyou/bhbuhi/bhsyos/bhsyoy/bhkisy/bhkiki/bhshio/bherror) は
   横幅広めにして列の折返しを抑制。条件入力 (bhmain/bhlogin/noritz_index) は 992px のまま。 */
.site-main.result-shell {
  width: min(1360px, calc(100% - 40px));
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
}
.brand-lockup { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand-lockup:hover { opacity: 0.88; }
.brand-logo-link { display: inline-flex; align-items: center; }
.login-brand-lockup .brand-copy { margin-left: 18px; }
.brand-lockup img { width: 129px; height: 40px; }
.login-brand-lockup img { width: 164px; height: auto; }
.brand-copy { display: grid; gap: 3px; }
.brand-overline {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.brand-title { font-size: 22px; font-weight: 700; letter-spacing: 0.02em; }
.user-menu {
  position: relative;
}
.user-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  list-style: none;
  cursor: pointer;
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 14px;
  font-weight: 700;
}
.user-menu summary::-webkit-details-marker {
  display: none;
}
.user-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  display: grid;
  gap: 4px;
}
.user-menu-name {
  padding: 8px 10px 10px;
  font-size: 13px;
  color: var(--muted);
}
.user-menu-pop a {
  display: block;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
}
.user-menu-pop a:hover {
  background: var(--surface-soft);
}
.site-main {
  padding: 12px 0 20px;
  flex: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 8px;
}
.hero.login-hero {
  grid-template-columns: 1fr;
  gap: 18px;
  max-width: 920px;
  margin: 0 auto 28px;
}
.login-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-radius: 12px;
  background: #f5f5f5;
  width: 100%;
}
.login-banner h1 {
  margin: 0;
  font-size: 28px;
}
.login-banner p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.login-banner-status {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text);
}
.hero-copy-card,
.hero-search-card,
.section-card,
.result-card,
.modal-sheet {
  background: var(--surface);
  border: none;
  box-shadow: none;
}
.hero-copy-card {
  border-radius: 12px;
  padding: 34px 34px 30px;
  background: #ffffff;
}
.eyebrow {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  border: 1px solid rgba(31, 26, 23, 0.08);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.hero-title { margin: 18px 0 12px; font-size: clamp(34px, 4vw, 52px); line-height: 1.12; }
.hero-lead { margin: 0; max-width: 42rem; color: var(--muted); line-height: 1.9; font-size: 15px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.hero-stat { padding: 16px 14px; border-radius: 18px; background: var(--surface-soft); border: 1px solid var(--line); }
.hero-stat strong { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.hero-stat span { font-size: 22px; font-weight: 700; }

.hero-search-card { border-radius: 12px; padding: 14px 20px 14px; display: grid; gap: 10px; }
.hero-search-card.login-card {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 18px;
}
.hero-search-card.login-card .actions {
  grid-column: 1;
}
.login-card-message {
  color: var(--text);
  font-size: 18px;
  line-height: 1.8;
}
.hero-search-card.login-card label {
  font-size: 18px;
  font-weight: 700;
}
.hero-search-card.login-card input {
  width: min(100%, 680px);
  padding: 18px 20px;
  font-size: 20px;
  border-radius: 16px;
}
.hero-search-card.login-card .field-stack {
  gap: 10px;
}
.mode-switch { display: inline-flex; padding: 4px; gap: 4px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); }
.mode-switch a,
.mode-switch button {
  padding: 10px 18px;
  border-radius: 7px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.mode-switch a.active,
.mode-switch button.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}
.mode-switch a:hover:not(.active),
.mode-switch button:hover:not(.active) {
  color: var(--accent);
  background: var(--accent-soft);
}

.field-stack,
.search-row { display: grid; gap: 8px; }
.field-stack label,
.search-row label { font-size: 13px; font-weight: 700; color: var(--muted); }
.field-stack input,
.search-row input,
.search-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  background: #fff;
  color: var(--text);
  font-size: 16px;
}
.search-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 14px; }
.search-grid-wide {
  grid-template-columns: minmax(320px, 1.5fr) 180px 220px;
  align-items: end;
}
.search-panel {
  display: none;
}
.search-panel.active {
  display: grid;
}
.search-keyword {
  min-width: 0;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions.right { justify-content: flex-end; }
.actions.center { justify-content: center; }
.actions-inline {
  justify-content: flex-start;
  align-items: end;
}
.btn,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 13px 22px;
  line-height: 1.2;
  font-weight: 700;
  cursor: pointer;
}
.btn:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  background: var(--brand);
  border-color: var(--brand);
}
.btn.sub,
button.sub { background: #fff; color: var(--accent-strong); border-color: var(--line); }
.btn.sub:hover,
button.sub:hover { background: var(--surface-soft); border-color: var(--accent); }

/* 無効状態 (展開図/技術資料 等が 0 件・該当無しのときに使う) */
.btn:disabled,
button:disabled,
.btn.sub:disabled,
button.sub:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--surface-soft, #f3f5f8);
  color: var(--muted, #888);
  border-color: var(--line, #d0d4da);
}
.btn:disabled:hover,
button:disabled:hover,
.btn.sub:disabled:hover,
button.sub:disabled:hover {
  background: var(--surface-soft, #f3f5f8);
  border-color: var(--line, #d0d4da);
  color: var(--muted, #888);
}

.section-card { border-radius: 12px; padding: 14px 16px; }
.section-header,
.result-toolbar { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 10px; }
.section-header > div {
  width: 100%;
}
.section-title { margin: 0; font-size: 24px; }
.section-title-plain {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 8px;
  text-align: center;
}
.section-copy { margin: 8px 0 0; color: var(--muted); line-height: 1.8; font-size: 14px; }
.condition-grid {
  display: grid;
  gap: 6px;
}
.condition-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 2fr;
  gap: 6px 10px;
  align-items: stretch;
}
.condition-row--with-stack {
  grid-template-columns: 1fr 2fr 1fr 2fr;
}
.condition-stack {
  grid-column: 3 / 5;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 6px 10px;
  align-items: stretch;
  align-content: start;
}
.condition-group {
  display: contents;
}
.condition-title {
  margin: 0;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f5f5f5;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.condition-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
}
.condition-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 1 1 auto;
  min-height: 30px;
  padding: 3px 12px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  line-height: 1.3;
}
.condition-option:hover {
  background: #f5f5f5;
  border-color: var(--text);
}

.result-shell { display: grid; gap: 18px; }
.result-count { color: var(--muted); font-size: 14px; }
.result-list-table {
  width: 100%;
  border-collapse: collapse;
  /* table-layout: fixed で td の width 指定を厳守する。 auto だと
     コンテンツ自然幅が width を超えたとき テーブルごと広がってしまい、
     全角空白の連続 (旧 csv の埋め文字) が下線突き抜けの原因になる */
  table-layout: fixed;
}
.result-list-table th,
.result-list-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  /* 2026/6 顧客要望: 一回り大きくを 試したが (15/16)、 部品名称 280px に 全角19文字
     が 入らず 18文字目 で 折返す 副作用が出たため 元の 14px に戻す。
     視認性は font-family 既定化 (Yu Gothic 解除) + 色濃く (--text:#111) で 担保 */
  font-size: 14px;
  /* 旧 csv の埋め文字 (部品名称/特記の連続空白) は CJK 慣例で 改行不可 と
     扱われ、 セル width を 突き抜けて 隣セルに描画される (= anchor の
     下線も延びる)。
     - word-break + overflow-wrap で 全角空白でも 折返し
     - overflow:hidden で 折返しが効かないケースでも 強制カット
       (一部値が見えなくなるが 突き抜け 隣セル侵食より マシ) */
  word-break: break-all;
  overflow-wrap: anywhere;
  overflow: hidden;
  white-space: normal;
}
/* anchor (result-link) は inline で 親 td の word-break を継承するはず
   だが、 全角空白の連続 では 効かない / 古いブラウザで効かない 事例があり、
   inline-block + max-width:100% + overflow:hidden で 親 td 幅に 縛る */
.result-list-table td .result-link {
  display: inline-block;
  max-width: 100%;
  word-break: break-all;
  overflow-wrap: anywhere;
  overflow: hidden;
  white-space: normal;
  vertical-align: top;
}
.result-list-table th {
  background: #f5f5f5;
  /* 2026/6 td を 14 に戻したのに合わせ 見出しも 元 12 に戻す */
  font-size: 12px;
  color: var(--muted);
}
/* 技術資料モーダル内 タブの 左右スクロールボタン (◀▶)。
   ホバー時のみ表示で タブの左右端の上に absolute オーバーレイ。 空白を作らない。
   スクロールバーは 常時表示、 長押し中は JS で連続スクロール */
.modal-tabs-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  min-width: 0;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
}
.modal-tabs-nav {
  position: absolute;
  top: 0;
  bottom: 8px;  /* スクロールバー (8px) の上に置く */
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 2;
  font-size: 14px;
  color: var(--muted);
  padding: 0;
  user-select: none;
}
.modal-tabs-wrap:hover .modal-tabs-nav,
.modal-tabs-nav:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
.modal-tabs-nav:hover {
  background: #fff;
  color: var(--brand, #333);
}
.modal-tabs-nav-prev { left: 4px; }
.modal-tabs-nav-next { right: 4px; }
/* タブ部分のスクロールバーは 常時表示 */
.modal-tabs-wrap .modal-tabs {
  width: 100%;
  min-width: 0;
  overflow-x: scroll;
  scrollbar-width: thin;
}
.modal-tabs-wrap .modal-tabs::-webkit-scrollbar {
  height: 8px;
}
.modal-tabs-wrap .modal-tabs::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
}
.modal-tabs-wrap .modal-tabs::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

/* sticky-result-header.js を読み込んだ画面のみ thead を sticky 化。
   body.has-sticky-result-header は install() で動的付与。
   bhshio / bhsyos / bhsyoy 等の モーダル系 / 詳細画面では thead は 通常配置 */
body.has-sticky-result-header .result-list-table th {
  position: sticky;
  top: var(--thead-top, 78px);
  z-index: 5;
}
.result-link {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.result-card { border-radius: 26px; overflow: hidden; }
.result-card-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
.result-visual {
  min-height: 230px;
  background: linear-gradient(180deg, #fafafa, #f5f5f5);
  position: relative;
}
.result-visual::after {
  content: "";
  position: absolute;
  inset: 28px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.24)), url("../../00_original_html/main_app/assets/imgs/h.gif") no-repeat center 26px / 72px 72px;
  border: 1px solid rgba(255,255,255,0.7);
}
.result-detail { padding: 22px 22px 20px; display: grid; gap: 16px; }
.result-kicker { color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 2px solid var(--line); font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumb .sep { font-size: 16px; line-height: 1; color: var(--muted); opacity: 0.6; }
.breadcrumb .current { color: var(--brand); font-weight: 700; }
.result-title { margin: 0; font-size: 26px; }
.result-specs { display: flex; flex-wrap: wrap; gap: 6px 28px; }
.result-specs div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.result-specs strong { color: var(--muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.result-specs strong::after { content: "："; }
.result-specs span { font-weight: 700; overflow-wrap: break-word; word-break: break-all; min-width: 0; }
.result-summary { margin: 0; color: var(--muted); line-height: 1.8; font-size: 14px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 27, 23, 0.48);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
  z-index: 40;
}
.modal-backdrop.active { display: flex; }
.modal-sheet {
  width: min(1120px, 100%);
  max-height: calc(100vh - 56px);
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  /* 2026/6 顧客要望: ヘッダ ドラッグで モーダルを 移動可能に. ヘッダ余白を
     掴んで動かす. 子要素 button (閉じる等) は 個別 mousedown で 動作 維持 */
  cursor: move;
  user-select: none;
}
.modal-header button { cursor: pointer; }
.modal-title { font-size: 28px; margin: 0; }
.modal-content { overflow: auto; padding: 24px; background: #fff; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-panel { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--surface-soft); }
.detail-panel h3 { margin: 0 0 12px; font-size: 20px; }
.modal-product-visual {
  min-height: 280px;
  border-radius: 10px;
  background: #f5f5f5 var(--visual-image) no-repeat center / cover;
  position: relative;
}
.modal-product-visual::after {
  content: none;
}
.document-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.document-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}
.document-thumb {
  min-height: 140px;
  border-radius: 10px;
  background: #f5f5f5 var(--doc-image) no-repeat center / cover;
}
.document-body {
  display: grid;
  align-content: start;
  gap: 10px;
}
.document-body strong {
  font-size: 18px;
}
.document-body span {
  color: var(--muted);
  font-size: 13px;
}
.tab-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab-row button { background: #fff; color: var(--muted); border-color: var(--line); }
.tab-row button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.parts-table { width: 100%; border-collapse: collapse; }
/* 2026/6 列幅副作用回避で size は 元の 14/12 に戻す (詳細パネル側も統一) */
.parts-table th,
.parts-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.parts-table th { color: var(--muted); font-size: 12px; }

.site-footer { border-top: 1px solid var(--line); background: #ffffff; }
.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 13px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }

@media (max-width: 1100px) {
  .hero,
  .hero.login-hero,
  .hero-search-card.login-card,
  .detail-grid,
  .document-grid,
  .result-card-body,
  .search-grid,
  .condition-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }
  .search-grid-wide {
    grid-template-columns: 1fr;
  }
  .condition-row {
    display: block;
  }
  .condition-group {
    display: grid;
    grid-template-columns: minmax(110px, 1fr) 2fr;
    gap: 4px 8px;
    margin-bottom: 6px;
  }
  .document-card {
    grid-template-columns: 1fr;
  }
  .site-header-inner,
  .site-main,
  .site-footer-inner {
    width: min(100%, calc(100% - 28px));
  }
  .login-banner {
    align-items: flex-start;
  }
  .user-menu-pop {
    left: auto;
    right: 0;
  }
}

/* ========================
   Maintenance Layout
   ======================== */
.mente-layout {
  display: flex;
  flex: 1;
  align-items: stretch;
}
.mente-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: var(--surface-soft);
  border-right: 1px solid var(--line);
  padding: 20px 0 40px;
}
.mente-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .07em;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.mente-menu-group {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 12px 16px 4px;
  letter-spacing: .04em;
}
.mente-menu-link {
  display: block;
  padding: 7px 16px 7px 26px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.mente-menu-link:hover {
  color: var(--brand);
  background: rgba(162, 34, 34, .06);
}
.mente-menu-link.active {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
.mente-content {
  flex: 1;
  min-width: 0;
  padding: 18px 24px 48px;
}

/* Form field table for edit / addnew pages */
.field-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 0;
}
.field-table th {
  background: var(--surface-soft);
  width: 180px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: left;
  border: 1px solid var(--line);
  white-space: nowrap;
  vertical-align: middle;
}
.field-table td {
  padding: 7px 14px;
  border: 1px solid var(--line);
  font-size: 13px;
  vertical-align: middle;
}
.field-table td.ro {
  background: var(--surface-soft);
  font-weight: 700;
  color: var(--accent);
}
.field-table input[type="text"],
.field-table select,
.field-table textarea {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}
.field-table input[type="text"]:focus,
.field-table select:focus,
.field-table textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(162, 34, 34, .12);
}
.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-left: 6px;
}
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
.form-actions-right { display: flex; gap: 8px; }


/* ========================
   Maintenance Layout: テーブル内側スクロール (B 案 wrapper div方式)
   - 左メニュー: sticky で固定
   - section-card 内の見出し・ボタン: 上に並ぶ (通常配置だが table-scroll-wrap の外)
   - .table-scroll-wrap: max-height + overflow-y で 内側スクロール
   - table の thead: position:sticky で wrapper 内側上部に貼り付き
   - table display は触らない (rowspan/field-table 等のレイアウト維持)
   ======================== */
.mente-sidebar {
  position: sticky;
  top: 78px;
  align-self: flex-start;
  max-height: calc(100vh - 78px);
  overflow-y: auto;
}
.table-scroll-wrap {
  max-height: calc(100vh - 320px);
  min-height: 200px;
  overflow-y: auto;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 16px;
}
.table-scroll-wrap > table {
  margin-bottom: 0;
  border: none;
}
.table-scroll-wrap > table thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface-soft);
}



/* ========================
   Maintenance Pagination + Sort
   ======================== */
.sort-th {
  cursor: pointer;
  user-select: none;
}
.sort-th .sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  color: var(--muted);
  vertical-align: middle;
  line-height: 1;
}
.sort-th.sort-asc .sort-icon::before { content: "▲"; color: var(--brand); }
.sort-th.sort-desc .sort-icon::before { content: "▼"; color: var(--brand); }
.sort-th .sort-icon::before { content: "▲▼"; }
.sort-th:hover { background: rgba(0,0,0,0.03); }


/* ========================
   Pagination (PHP $page_html 出力に対応)
   ======================== */
.pagination {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  margin: 0;
  flex-wrap: wrap;
}
.pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  background: #fff;
  transition: background .15s, color .15s;
}
.pagination a:hover {
  background: var(--surface-soft);
}
.pagination a.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 600;
}
.result-count {
  /* 2026/6 元の 13 に戻す (color 濃く で 視認性 確保) */
  font-size: 13px;
  color: var(--muted);
}
.result-count strong {
  color: var(--text);
  font-weight: 600;
}

/* Pagination jump 入力 (ページ番号直接指定) */
.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.pagination-jump input {
  width: 50px;
  height: 28px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}
.pagination-jump button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
}
.pagination-jump button:hover {
  background: var(--surface-soft);
}

/* ========================
   Maintenance Tab Navigation
   ======================== */
.tab-nav {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.tab-item {
  padding: 10px 20px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab-item:hover { color: var(--accent); }
.tab-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* IP 分類 badge */
.ip-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.ip-badge.internal-harman { background: #e6f4ea; color: #1e7e34; }
.ip-badge.internal-noritz { background: #e7f0fe; color: #1a73e8; }
.ip-badge.contact-c       { background: #fff3e0; color: #e65100; }
.ip-badge.external        { background: #f1f3f4; color: #5f6368; }
.ip-badge.unknown         { background: #fce8e6; color: #c5221f; }

/* 詳細モーダル */
.detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
}
.detail-modal.active { display: flex; }
.detail-modal-card {
  background: #fff;
  border-radius: 8px;
  width: min(640px, 90vw);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.detail-modal-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.detail-modal-title { font-size: 15px; font-weight: 600; margin: 0; }
.detail-modal-close { background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; }
.detail-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
}
.detail-modal-body dt {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.detail-modal-body dd {
  margin: 0;
  padding: 6px 10px;
  background: var(--surface-soft);
  border-radius: 4px;
  word-break: break-all;
  font-family: ui-monospace, "SFMono-Regular", monospace;
  font-size: 12.5px;
}
.detail-row-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.detail-row-link:hover { text-decoration: underline; }

/* ステータス badge (利用者アクセス: 成功/失敗) */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge.ok     { background:#e6f4ea; color:#1e7e34; }
.status-badge.failed { background:#fce8e6; color:#c5221f; }

/* HTTPステータスコード badge (サーバーアクセス) */
.status-code-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: ui-monospace, "SFMono-Regular", monospace;
}
.status-code-badge.code-2xx { background:#e6f4ea; color:#1e7e34; }
.status-code-badge.code-3xx { background:#fff8e1; color:#bf6900; }
.status-code-badge.code-4xx { background:#fce8e6; color:#c5221f; }
.status-code-badge.code-5xx { background:#f3e8fd; color:#5b21b6; }

/* パラメータ有無 indicator (一覧のパス列で表示) */
.param-indicator {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  font-family: ui-monospace, "SFMono-Regular", monospace;
  vertical-align: middle;
  cursor: help;
}
.param-indicator.get  { background: #e7f0fe; color: #1a73e8; }
.param-indicator.post { background: #fff3e0; color: #e65100; }

/* 操作 badge (メンテ履歴) */
.op-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.op-badge.insert  { background:#e6f4ea; color:#1e7e34; }   /* 緑 */
.op-badge.update  { background:#e7f0fe; color:#1a73e8; }   /* 青 */
.op-badge.delete  { background:#fce8e6; color:#c5221f; }   /* 赤 */
.op-badge.upload  { background:#fff3e0; color:#e65100; }   /* 橙 */
.op-badge.login   { background:#f1f3f4; color:#5f6368; }   /* 灰 */
.op-badge.logout  { background:#f3e8fd; color:#5b21b6; }   /* 紫 */

/* 資料ビューアーモーダル 内のタブ (技術資料切替用)
   1 列横並び + 横スクロール (タブが多い場合に縦積みせず横にスクロール) */
.modal-tabs {
    display: flex;
    flex-wrap: nowrap !important;     /* inline style と二重で wrap 抑止 */
    scrollbar-width: thin;
    scroll-behavior: smooth;
}
.modal-tab-btn {
    flex-shrink: 0;                   /* 横スクロール時に縮まない */
    min-width: 110px;                 /* ラベル長によって 幅がバラバラになるのを防ぐ */
    padding: 10px 16px;
    margin: 0;
    border: none;
    border-right: 1px solid var(--line);    /* タブ間の区切り線 */
    border-bottom: 2px solid transparent;   /* active 時の下線ハイライト用 */
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.2;
    color: var(--muted);
    text-align: center;
    white-space: nowrap;              /* タブ内テキスト改行禁止 */
    transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
/* 最後のタブの右側区切り線は不要 */
.modal-tab-btn:last-child {
    border-right: none;
}
.modal-tab-btn:hover {
    color: var(--text);
    background: #f5f7fa;
}
.modal-tab-btn.active {
    color: var(--accent, #1a73e8);
    border-bottom-color: var(--accent, #1a73e8);
    font-weight: 600;
    background: transparent;
}
/* 横スクロールバーを薄く目立たなく (WebKit) */
.modal-tabs::-webkit-scrollbar {
    height: 4px;
}
.modal-tabs::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 2px;
}

/* 2026/6 顧客要望: モーダルから 右クリック → 印刷 で 画像だけ 出るように
   ヘッダ/フッタ/モーダル枠/閉じるボタン/タブ を 印刷時 全て 非表示。
   iframe (image_viewer.php) だけ を 全幅で残す。 viewer 側の @media print
   と セットで 「画像 だけ」 の 印刷紙面 になる */
@media print {
  html, body { background: #ffffff !important; }
  .site-header, .site-footer, .site-main { display: none !important; }
  /* 全 .modal-backdrop を まず hide.  active な モーダル (= 今 開いている
     resource viewer) だけ block で 残す.
     これを行わないと 同じページに 同居している 別モーダル (例: 共通部品
     #kyou-modal) まで 印刷に出てしまう */
  .modal-backdrop { display: none !important; }
  .modal-backdrop.active {
    display: block !important;
    position: static !important;
    background: none !important;
    padding: 0 !important;
  }
  .modal-backdrop.active .modal-sheet {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: block !important;
    /* ヘッダドラッグで移動した位置をリセットして 印刷紙面が崩れないように */
    transform: none !important;
  }
  .modal-backdrop.active .modal-header,
  .modal-backdrop.active .modal-tabs-wrap,
  .modal-backdrop.active .modal-tabs,
  .modal-backdrop.active .modal-tabs-nav { display: none !important; }
  .modal-backdrop.active .modal-content {
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }
  .modal-backdrop.active .modal-content iframe {
    width: 100% !important;
    height: 90vh !important;
    border: none !important;
  }
}

/* 検索キーワードの入力ガイド (半角大文字) */
.hankaku-note { color: #c0392b; font-weight: 700; }
p.hankaku-note { margin: 10px 0 0; font-size: 14px; }
span.hankaku-note { margin-left: .6em; font-size: 13px; }

