/* ============================================================
 * historyInventoryV2.css — 履歴タブ / 在庫タブ (v1.33.0、master 2026-11-26)
 *
 * 「AI っぽくなく、今っぽく、シンプルで直感的」「めちゃめちゃたまった時を想定」:
 *   - 検索は左の列のいちばん上。絞り込みの右に件数
 *   - 角丸 + 影の大きいカード → 白い台の上の細い線の行
 *   - 操作ボタンはカーソルを乗せた行だけ。色の付いた札は使わない
 *   - 履歴は右に中身のパネル、在庫は種類 → 規格でまとめる
 *
 * 旧 CSS (overrideLayers / themeSidebar / calcSettingsPanel …) が #hip に !important を多く
 * 持っているので、この file は最後のほう (colorMode.css の前) で読み、同じか強い指定で上書きする。
 * スマホの旧レイアウト (body.mobile-shell) は mobile.css のほうが強いので、そちらが勝つ。
 * ============================================================ */

/* ── 左の列 (両タブ共通) ─────────────────────────────── */
#hip .hx-sb{
  display:flex !important;
  flex-direction:column;
  gap:20px;
}
#hip .hx-sb .hi-sb-sec{ margin:0 !important; display:flex; flex-direction:column; gap:1px; }
#hip .hx-sb .hi-sb-sec[hidden]{ display:none !important; }
#hip .hx-sb .hi-sb-lbl{
  font-size:11px !important;
  font-weight:700 !important;
  color:#5f6569 !important;
  letter-spacing:0 !important;
  text-transform:none !important;
  padding:0 8px 4px !important;
  margin:0 !important;
}
#hip .hx-sb .hi-sb-item{
  display:flex !important;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
  min-height:32px !important;
  height:auto;
  padding:5px 8px !important;
  margin:0 !important;
  border:0 !important;
  border-radius:7px !important;
  background:transparent !important;
  color:#171819 !important;
  font:inherit;
  font-size:13px !important;
  font-weight:400 !important;
  text-align:left;
  cursor:pointer;
  box-shadow:none !important;
}
#hip .hx-sb .hi-sb-item:hover{ background:#eef2f4 !important; }
#hip .hx-sb .hi-sb-item.on{ background:#e5ebee !important; font-weight:700 !important; color:#171819 !important; }
#hip .hx-sb .hi-sb-item .hi-sb-dot{ display:none !important; }
#hip .hx-sb .hi-sb-item:focus-visible{ outline:2px solid #1d1e1f; outline-offset:1px; }
#hip .hx-sb .hx-sb-l{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:flex; align-items:center; gap:8px; }
#hip .hx-sb .hx-sb-n{ flex:0 0 auto; font-size:12px; color:#6d7277; font-weight:400; font-variant-numeric:tabular-nums; }
#hip .hx-sb .hx-sb-link{
  align-self:flex-start;
  border:0; background:transparent; padding:4px 8px; margin:0;
  font:inherit; font-size:12px; color:#4f5457; text-decoration:underline; text-underline-offset:2px; cursor:pointer;
}
#hip .hx-sb .hx-sb-link:hover{ color:#171819; }

/* 検索 */
#hip .hx-search{ display:flex; flex-direction:column; gap:6px; }
#hip .hx-search-box{
  position:relative;
  display:flex; align-items:center; gap:8px;
  height:38px; padding:0 8px 0 10px;
  border:1px solid #d0d6da; border-radius:8px; background:#ffffff;
}
#hip .hx-search-box:focus-within{ border-color:#1d1e1f; box-shadow:0 0 0 1px #1d1e1f; }
#hip .hx-search-ico{ width:16px; height:16px; flex:0 0 auto; color:#6d7277; }
#hip .hx-search-input{
  flex:1 1 auto; min-width:0; height:100% !important;
  border:0 !important; outline:none !important; box-shadow:none !important; background:transparent !important;
  padding:0 !important; margin:0 !important;
  font:inherit; font-size:13px !important; color:#171819;
}
#hip .hx-search-input::placeholder{ color:#80868a; }
#hip .hx-search-clear{
  flex:0 0 auto; width:24px; height:24px; border:0; border-radius:6px; background:transparent;
  color:#6d7277; font-size:16px; line-height:1; cursor:pointer;
}
#hip .hx-search-clear:hover{ background:#eef2f4; color:#171819; }

/* 種別 (すべて / 取り合い / 重量) は切り替えボタン */
#hip .hx-sb .hx-seg{
  display:grid !important;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:2px; padding:3px; background:#eef2f4; border-radius:9px;
}
#hip .hx-sb .hx-seg .hi-sb-item{
  justify-content:center; flex-direction:column; gap:0;
  min-height:40px !important; padding:3px 4px !important;
  font-size:12px !important; color:#4f5457 !important; text-align:center;
}
#hip .hx-sb .hx-seg .hi-sb-item:hover{ background:rgba(255,255,255,.6) !important; }
#hip .hx-sb .hx-seg .hi-sb-item.on{ background:#ffffff !important; color:#171819 !important; box-shadow:0 1px 2px rgba(23,24,25,.08) !important; }
#hip .hx-sb .hx-seg .hx-sb-n{ font-size:11px; }

/* 詳しく絞り込む */
#hip .hx-more-filter{ border-top:1px solid #eef2f4; padding-top:12px; }
#hip .hx-more-filter > summary{
  list-style:none; cursor:pointer; padding:4px 8px; border-radius:7px;
  font-size:12px; font-weight:700; color:#3a3d40;
}
#hip .hx-more-filter > summary::-webkit-details-marker{ display:none; }
#hip .hx-more-filter > summary::after{ content:'＋'; float:right; color:#6d7277; font-weight:400; }
#hip .hx-more-filter[open] > summary::after{ content:'－'; }
#hip .hx-more-filter > summary:hover{ background:#eef2f4; }
#hip .hx-mf-grid{ display:flex; flex-direction:column; gap:10px; padding:10px 8px 6px; }
#hip .hx-mf-field{ display:flex; flex-direction:column; gap:4px; font-size:12px; color:#5f6569; }
#hip .hx-mf-field input,
#hip .hx-mf-field select{
  height:34px !important; padding:0 8px !important; border:1px solid #d0d6da !important; border-radius:7px !important;
  background:#ffffff !important; font:inherit; font-size:13px !important; color:#171819 !important; box-shadow:none !important;
}

/* ── 履歴タブ: 一覧 + 右の中身 ─────────────────────────── */
html:not(.nav-top) body:not(.mobile-app):not(.mobile-shell) #hip #hiPanelH .hi-sb-main.hx-main{
  display:grid !important;
  grid-template-columns:minmax(0, 1fr) 380px;
  padding:0 !important;
  overflow:hidden !important;
  margin:calc(var(--toriai-panel-gap, 8px) * -1) calc(var(--toriai-panel-gap, 8px) * -1) calc(var(--toriai-panel-gap, 8px) * -1) 0 !important;
  height:calc(100vh - var(--toriai-header-h, 0px)) !important;
  max-height:calc(100vh - var(--toriai-header-h, 0px)) !important;
}
#hip .hx-listcol{
  min-width:0; height:100%; box-sizing:border-box;
  overflow-y:auto; padding:18px 20px 32px;
}
#hip .hx-pane{
  height:100%; box-sizing:border-box; overflow-y:auto;
  background:#ffffff; border-left:1px solid #e1e6e9;
  padding:24px 22px 28px;
  display:flex; flex-direction:column; gap:20px;
}
@media (max-width:1180px){
  html:not(.nav-top) body:not(.mobile-app):not(.mobile-shell) #hip #hiPanelH .hi-sb-main.hx-main{ grid-template-columns:minmax(0, 1fr); }
  #hip .hx-pane{ display:none; }
}
body.mobile-shell #hip .hx-pane{ display:none !important; }

#hip .hx-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  padding:2px 4px 12px;
}
#hip .hx-title{ display:flex; align-items:baseline; gap:10px; }
#hip .hx-title h2,
#hip .iv-title h2{ margin:0; font-size:18px; font-weight:700; color:#171819; letter-spacing:0; }
#hip .hx-head .hi-count,
#hip .iv-toolbar .hi-count{ font-size:13px !important; color:#5f6569 !important; font-weight:400 !important; font-variant-numeric:tabular-nums; }
#hip .hx-head-right{ display:flex; align-items:center; gap:10px; }
#hip .hx-sort{ display:flex; align-items:center; gap:6px; font-size:12px; color:#5f6569; }
#hip .hx-sort .hi-sort{
  height:30px !important; padding:0 6px !important;
  border:1px solid #d0d6da !important; border-radius:7px !important; background:#ffffff !important;
  font:inherit; font-size:12px !important; font-weight:400 !important; color:#171819 !important;
}

#hip .hx-list-card{
  background:#ffffff; border:1px solid #e3e8eb; border-radius:12px;
  padding:0 6px 6px;
}
#hip .hx-cols,
#hip .hx-row-main{
  display:grid;
  /* 部材の列は「1,234.5 kg」が入る幅 (52px だと納期に食い込んでいた、2026-11-28) */
  grid-template-columns:68px minmax(0, 1fr) minmax(0, 180px) 84px 56px;
  gap:12px; align-items:center;
}
#hip .hx-cols{
  padding:10px 12px 8px; border-bottom:1px solid #eef2f4;
  font-size:11px; font-weight:700; color:#5f6569;
}
#hip .hx-cols .hx-c-qty{ text-align:right; }
#hip #hiPanelH #histList.hx-list{ display:flex !important; flex-direction:column !important; gap:1px !important; background:transparent !important; padding:0 !important; }
#hip .hx-month{
  position:sticky; top:0; z-index:2;
  display:flex; align-items:baseline; gap:8px;
  margin:6px 0 2px; padding:10px 12px 6px;
  background:#ffffff;
  font-size:12px; font-weight:700; color:#3a3d40;
}
#hip .hx-month-n{ font-weight:400; color:#6d7277; font-variant-numeric:tabular-nums; }
#hip .hx-row{ position:relative; border-radius:8px; }
#hip .hx-row:hover{ background:#f1f4f6; }
#hip .hx-row.is-sel{ background:#e8edf0; }
#hip .hx-row-main{
  width:100%; min-height:44px; padding:0 12px; box-sizing:border-box;
  border:0; border-radius:8px; background:transparent;
  font:inherit; font-size:13px; color:#171819; text-align:left; cursor:pointer;
}
#hip .hx-row-main:focus-visible{ outline:2px solid #1d1e1f; outline-offset:-2px; }
#hip .hx-c-date{ color:#3a3d40; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .hx-dow{ margin-left:4px; font-size:12px; color:#6d7277; }
/* 顧客 (1 段目) と 工事名 (2 段目) の 2 段 (2026-11-28 master「小さい窓だと詰まって見えにくい」) */
#hip .hx-c-name{ display:flex; flex-direction:column; justify-content:center; gap:1px; min-width:0; padding:6px 0; white-space:nowrap; overflow:hidden; }
#hip .hx-name-l1{ display:flex; align-items:center; gap:6px; min-width:0; overflow:hidden; }
#hip .hx-c-name .hi-card-client{ font-weight:700; flex:0 1 auto; min-width:0; max-width:none; overflow:hidden; text-overflow:ellipsis; color:#171819; font-size:13px; line-height:1.4; }
#hip .hx-c-name .hi-card-name{ display:block; color:#5f6569; min-width:0; max-width:100%; overflow:hidden; text-overflow:ellipsis; font-size:12px; font-weight:400; line-height:1.4; }
#hip .hx-c-spec{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; }
#hip .hx-c-qty{ text-align:right; color:#3a3d40; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .hx-c-dl{ color:#3a3d40; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .hx-c-dl.is-near{ color:#9a3412; font-weight:700; }
#hip .hx-tag{
  flex:0 0 auto; display:inline-block;
  padding:0 5px; border:1px solid #c9d0d4; border-radius:4px; background:transparent !important;
  font-size:11px; font-weight:400; line-height:18px; color:#4f5457 !important;
}
#hip .hx-tag-cancel{ border-color:#e5b4b4; color:#9b1c1c !important; }

/* カーソルを乗せた行だけに出る操作 */
#hip .hx-act,
#hip .iv-act{
  position:absolute; right:6px; top:50%; transform:translateY(-50%);
  display:flex; align-items:center; gap:2px;
  padding-left:16px; background:inherit; border-radius:8px;
  opacity:0; pointer-events:none; transition:opacity .12s ease;
}
#hip .hx-row:hover .hx-act,
#hip .hx-row.is-sel .hx-act,
#hip .hx-row:focus-within .hx-act,
#hip .iv-prow:hover .iv-act,
#hip .iv-prow:focus-within .iv-act,
#hip .iv-frow:hover .iv-act,
#hip .iv-frow:focus-within .iv-act{ opacity:1; pointer-events:auto; }
#hip .hx-qbtn,
#hip .iv-qbtn{
  height:30px; padding:0 10px; border:0; border-radius:7px; background:transparent;
  font:inherit; font-size:12px; font-weight:700; color:#3a3d40; cursor:pointer; white-space:nowrap;
  display:inline-flex; align-items:center; justify-content:center;
}
#hip .hx-qbtn:hover,
#hip .iv-qbtn:hover{ background:#dfe5e8; color:#171819; }
#hip .hx-qbtn-icon{ width:30px; padding:0; }
#hip .hx-qbtn:focus-visible,
#hip .iv-qbtn:focus-visible{ outline:2px solid #1d1e1f; outline-offset:1px; }

#hip .hx-more{
  display:block; width:100%; margin:8px 0 2px; padding:10px;
  border:0; border-radius:8px; background:transparent;
  font:inherit; font-size:12px; color:#4f5457; cursor:pointer;
}
#hip .hx-more:hover{ background:#f1f4f6; color:#171819; }
#hip .hx-empty{ text-align:center; color:#80868a; padding:48px 0; font-size:13px; }

/* 「…」のメニュー (body 直下) */
.hx-menu{
  position:fixed; z-index:9500; min-width:180px; padding:4px;
  background:#ffffff; border:1px solid #d8dee1; border-radius:10px;
  box-shadow:0 8px 24px rgba(23,24,25,.12);
  display:flex; flex-direction:column;
}
.hx-menu button{
  height:36px; padding:0 12px; border:0; border-radius:7px; background:transparent;
  font:inherit; font-size:13px; color:#171819; text-align:left; cursor:pointer;
}
.hx-menu button:hover,
.hx-menu button:focus-visible{ background:#eef2f4; outline:none; }
.hx-menu button.is-danger{ color:#b91c1c; }

/* 右の中身パネル */
#hip .hx-d-empty{ color:#6d7277; font-size:13px; line-height:1.7; padding-top:40px; text-align:center; }
#hip .hx-d-head{ display:flex; flex-direction:column; gap:3px; }
#hip .hx-d-kicker{ font-size:12px; color:#5f6569; font-variant-numeric:tabular-nums; }
#hip .hx-d-client{ font-size:20px; font-weight:700; line-height:1.35; color:#171819; word-break:break-word; }
#hip .hx-d-name{ font-size:14px; color:#3a3d40; word-break:break-word; }
#hip .hx-d-tags{ display:flex; flex-wrap:wrap; gap:6px; margin-top:4px; }
#hip .hx-d-deadline{ margin-top:6px; font-size:13px; font-weight:700; color:#3a3d40; font-variant-numeric:tabular-nums; }
#hip .hx-d-deadline.is-near{ color:#9a3412; }
#hip .hx-d-deadline span{ margin-left:8px; font-weight:400; }
#hip .hx-d-actions{ display:flex; gap:8px; }
#hip .hx-btn{
  height:40px; padding:0 14px; border:1px solid #d0d6da; border-radius:8px; background:#ffffff;
  font:inherit; font-size:13px; font-weight:500; color:#171819; cursor:pointer; white-space:nowrap;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
}
#hip .hx-btn:hover{ background:#f1f4f6; }
#hip .hx-btn-primary{ flex:1 1 auto; border-color:#1d1e1f; background:#1d1e1f; color:#ffffff; font-weight:700; }
#hip .hx-btn-primary:hover{ background:#3a3d40; border-color:#3a3d40; }
#hip .hx-btn-icon{ width:40px; padding:0; color:#4f5457; }
#hip .hx-btn:focus-visible{ outline:2px solid #1d1e1f; outline-offset:2px; }
#hip .hx-d-sec{ display:flex; flex-direction:column; gap:8px; }
#hip .hx-d-h{ margin:0; font-size:12px; font-weight:700; color:#3a3d40; }
#hip .hx-d-sub{ font-size:12px; color:#5f6569; }
#hip .hx-d-parts{ display:flex; flex-direction:column; border-top:1px solid #eef2f4; }
#hip .hx-d-part,
#hip .hx-d-wrow,
#hip .hx-d-total{
  display:flex; justify-content:space-between; gap:8px;
  padding:6px 2px; border-bottom:1px solid #eef2f4;
  font-size:13px; font-variant-numeric:tabular-nums;
}
#hip .hx-d-part span:last-child{ color:#3a3d40; }
#hip .hx-d-wrow{ display:grid; grid-template-columns:minmax(0, 1fr) 56px 44px 72px; }
#hip .hx-d-wrow span:not(:first-child){ text-align:right; color:#3a3d40; }
#hip .hx-d-wspec{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#hip .hx-d-total{ border-bottom:0; font-weight:700; }
#hip .hx-d-bars{ display:flex; flex-direction:column; gap:5px; }
#hip .hx-d-bar{
  display:flex; height:22px; border-radius:4px; overflow:hidden;
  background:repeating-linear-gradient(-45deg, #f1f4f6 0 4px, #e1e6e9 4px 6px);
}
#hip .hx-d-seg{
  flex:0 0 auto; box-sizing:border-box; border-right:2px solid #ffffff;
  background:#cfd7dc; color:#171819; font-size:10px; line-height:22px; text-align:center;
  overflow:hidden; white-space:nowrap; font-variant-numeric:tabular-nums;
}
#hip .hx-d-rem{ font-size:12px; color:#3a3d40; font-variant-numeric:tabular-nums; }
#hip .hx-d-meta{ margin:0; display:grid; grid-template-columns:72px minmax(0, 1fr); row-gap:6px; font-size:13px; }
#hip .hx-d-meta dt{ color:#5f6569; }
#hip .hx-d-meta dd{ margin:0; color:#171819; word-break:break-word; }
#hip .hx-d-keys{ margin-top:auto; display:flex; flex-wrap:wrap; gap:12px; font-size:11px; color:#6d7277; }
#hip .hx-d-keys kbd{
  font:inherit; font-size:11px; padding:0 4px; border:1px solid #d0d6da; border-radius:4px; background:#ffffff;
}

/* ── 在庫タブ ───────────────────────────────────────── */
#hip .iv-head{
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;
  padding:2px 4px 12px;
}
#hip .iv-title{ display:flex; align-items:baseline; gap:14px; flex-wrap:wrap; }
#hip .iv-totals{ font-size:13px; color:#3a3d40; font-variant-numeric:tabular-nums; }
#hip .iv-totals #invSummaryCount,
#hip .iv-totals #invSummaryWeight{ font-size:13px !important; font-weight:400 !important; color:#3a3d40 !important; }
#hip .iv-sep{ color:#9aa0a4; margin:0 8px; }
#hip .iv-stale-link{
  display:inline-flex; align-items:center; gap:6px;
  border:0; background:transparent; padding:2px 6px; border-radius:6px;
  font:inherit; font-size:13px; color:#9a3412; cursor:pointer; font-variant-numeric:tabular-nums;
}
#hip .iv-stale-link:hover{ background:#fbefe6; }
#hip .iv-stale-link.on{ background:#fbe4d5; font-weight:700; }
#hip .iv-stale-link #invSummaryStale{ font-size:13px !important; font-weight:inherit !important; color:inherit !important; }
#hip .iv-stale-link:not(:has(.is-stale)):not(.on){ display:none; }
#hip .iv-dot{ display:inline-block; width:7px; height:7px; border-radius:99px; background:#c2410c; flex:0 0 auto; }
#hip .iv-head-actions{ display:flex; align-items:center; gap:8px; }
#hip .iv-head-actions .srn-head-actions{ display:flex; align-items:center; gap:8px; }
#hip .iv-add,
#hip .iv-head-actions .srn-btn-primary{
  display:inline-flex !important; align-items:center; justify-content:center; gap:6px;
  height:38px !important; min-width:0 !important; width:auto !important; padding:0 16px !important; margin:0 !important;
  border:0 !important; border-radius:8px !important; background:#1d1e1f !important; color:#ffffff !important;
  font:inherit; font-size:13px !important; font-weight:700 !important; cursor:pointer; box-shadow:none !important;
}
#hip .iv-add:hover,
#hip .iv-head-actions .srn-btn-primary:hover{ background:#3a3d40 !important; }
/* ログイン中は営業所の「＋ 残材を追加」(#shareRemnantHead) だけ。旧ボタンは hidden で隠す (2026-11-28 二重表示の修正) */
#hip .iv-add[hidden]{ display:none !important; }
#hip .iv-head-actions .srn-btn-ghost{
  height:38px; padding:0 14px; border:1px solid #d0d6da; border-radius:8px; background:#ffffff;
  font:inherit; font-size:13px; color:#171819; cursor:pointer;
}

#hip .iv-toolbar{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding:0 4px 12px; }
#hip .iv-toolbar .hx-sort{ margin-left:auto; }
#hip .iv-seg{ display:inline-grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:2px; padding:3px; background:#e8edf0; border-radius:9px; }
#hip .iv-seg button{
  height:28px; padding:0 14px; border:0; border-radius:7px; background:transparent;
  font:inherit; font-size:12px; font-weight:700; color:#4f5457; cursor:pointer; white-space:nowrap;
}
#hip .iv-seg button.on{ background:#ffffff; color:#171819; box-shadow:0 1px 2px rgba(23,24,25,.08); }
#hip .iv-seg button:focus-visible{ outline:2px solid #1d1e1f; outline-offset:1px; }

#hip #hiPanelI .iv-list-area{ overflow:visible !important; padding:0 !important; }
#hip .iv-root{ display:flex; flex-direction:column; }
#hip .iv-table{ background:#ffffff; border:1px solid #e3e8eb; border-radius:12px; overflow:hidden; }
#hip .iv-cols,
#hip .iv-fcols{
  display:grid; gap:12px; align-items:center;
  padding:10px 14px; border-bottom:1px solid #e3e8eb;
  font-size:11px; font-weight:700; color:#5f6569;
}
#hip .iv-cols{ grid-template-columns:16px 14px minmax(130px, 200px) minmax(70px, 130px) minmax(0, 1fr) 60px 84px 72px; }
#hip .iv-r{ text-align:right; }

#hip .iv-khead{
  display:flex; align-items:center; gap:10px; width:100%; min-height:40px;
  padding:0 14px; border:0; border-bottom:1px solid #e3e8eb; background:#f7f9fa;
  font:inherit; font-size:13px; font-weight:700; color:#171819; text-align:left; cursor:pointer;
}
#hip .iv-khead:hover{ background:#eef2f4; }
#hip .iv-ksum{ font-weight:400; color:#5f6569; font-variant-numeric:tabular-nums; }
#hip .iv-chev{ flex:0 0 auto; color:#6d7277; transform:rotate(90deg); transition:transform .15s ease; }
#hip .iv-kind.is-closed .iv-khead .iv-chev,
#hip .iv-spec:not(.is-open) .iv-srow .iv-chev{ transform:none; }

#hip .iv-srow{
  display:grid; grid-template-columns:16px minmax(0, 1fr); gap:12px; align-items:center;
  padding-left:14px; border-bottom:1px solid #eef2f4;
}
#hip .iv-srow:hover{ background:#f6f8f9; }
#hip .iv-spec.is-open > .iv-srow{ background:#eef2f4; }
#hip .iv-srow-main{
  display:grid; grid-template-columns:14px minmax(130px, 200px) minmax(70px, 130px) minmax(0, 1fr) 60px 84px 72px;
  gap:12px; align-items:center; width:100%; min-height:44px;
  padding:0 14px 0 0; border:0; background:transparent;
  font:inherit; font-size:13px; color:#171819; text-align:left; cursor:pointer;
}
#hip .iv-srow-main:focus-visible{ outline:2px solid #1d1e1f; outline-offset:-2px; }
#hip .iv-c-spec{ font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-variant-numeric:tabular-nums; }
#hip .iv-c-attr{ color:#5f6569; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#hip .iv-c-lens{ display:flex; gap:12px; white-space:nowrap; overflow:hidden; color:#3a3d40; font-variant-numeric:tabular-nums; }
#hip .iv-c-lens small{ margin-left:2px; font-size:11px; color:#6d7277; }
#hip .iv-c-qty{ text-align:right; font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .iv-c-kg{ text-align:right; color:#3a3d40; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .iv-c-age{ text-align:right; color:#5f6569; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .iv-c-age.is-stale{ color:#9a3412; font-weight:700; }
#hip .iv-muted{ color:#9aa0a4; }

#hip .iv-pieces{ background:#fbfcfd; border-bottom:1px solid #e3e8eb; padding:2px 0; }
#hip .iv-prow,
#hip .iv-frow{ position:relative; display:grid; gap:12px; align-items:center; }
#hip .iv-prow{
  grid-template-columns:16px 104px 52px minmax(0, 1fr) minmax(0, 1.3fr) 64px 72px;
  min-height:36px; padding:0 14px 0 42px; font-size:13px;
}
#hip .iv-prow:hover,
#hip .iv-frow:hover{ background:#f3f6f8; }
#hip .iv-prow .iv-c-qty{ font-weight:400; color:#3a3d40; }
#hip .iv-c-len{ font-weight:700; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .iv-c-len small{ margin-left:3px; font-size:11px; font-weight:400; color:#6d7277; }
#hip .iv-c-who{ color:#3a3d40; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#hip .iv-c-note{ color:#5f6569; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#hip .iv-c-date{ color:#5f6569; font-variant-numeric:tabular-nums; white-space:nowrap; }
#hip .iv-photo{ margin-left:8px; font-size:11px; color:#4f5457; border:1px solid #c9d0d4; border-radius:4px; padding:0 4px; }
#hip .iv-act{ right:10px; }

#hip .iv-fcols,
#hip .iv-frow{ grid-template-columns:16px 92px minmax(110px, 170px) minmax(70px, 120px) 52px 76px minmax(0, 1fr) minmax(0, 1fr) 64px 64px; }
#hip .iv-frow{ min-height:40px; padding:0 14px; border-bottom:1px solid #eef2f4; font-size:13px; }
#hip .iv-frow .iv-c-spec{ font-weight:400; }
#hip .iv-frow .iv-c-qty{ font-weight:400; }

#hip .iv-chk{ width:16px; height:16px; margin:0; accent-color:#1d1e1f; cursor:pointer; }

/* まとめて削除のバー (一覧の下に浮く) */
#hip .iv-bulk{
  position:sticky; bottom:16px; z-index:5;
  align-self:center; margin:12px auto 0;
  display:flex; align-items:center; gap:6px;
  padding:6px 6px 6px 16px;
  background:#1d1e1f; color:#ffffff; border-radius:12px;
  box-shadow:0 6px 20px rgba(23,24,25,.18);
  font-size:13px;
}
#hip .iv-bulk-n{ margin-right:8px; font-variant-numeric:tabular-nums; }
#hip .iv-bulk-del{
  height:34px; padding:0 12px; border:1px solid #5b6064; border-radius:8px; background:transparent;
  font:inherit; font-size:12px; font-weight:700; color:#ffffff; cursor:pointer;
}
#hip .iv-bulk-del:hover{ background:#3a3d40; }
#hip .iv-bulk-x{
  width:34px; height:34px; border:0; border-radius:8px; background:transparent; color:#ffffff; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center;
}
#hip .iv-bulk-x:hover{ background:#3a3d40; }
#hip .iv-bulk button:focus-visible{ outline:2px solid #ffffff; outline-offset:1px; }

/* 左の列: 材質・表面の札、端材として残す長さ */
#hip .iv-chips{ display:flex; flex-wrap:wrap; gap:6px; padding:2px 8px 0; }
#hip .iv-chip{
  display:inline-flex; align-items:center; gap:6px;
  height:28px; padding:0 10px; border:1px solid #d0d6da; border-radius:99px; background:#ffffff;
  font:inherit; font-size:12px; color:#171819; cursor:pointer;
}
#hip .iv-chip span{ color:#6d7277; font-variant-numeric:tabular-nums; }
#hip .iv-chip:hover{ background:#f1f4f6; }
#hip .iv-chip.on{ background:#1d1e1f; border-color:#1d1e1f; color:#ffffff; }
#hip .iv-chip.on span{ color:#d0d6da; }
#hip .iv-chip:focus-visible{ outline:2px solid #1d1e1f; outline-offset:1px; }

#hip .iv-minlen{ margin-top:auto; padding:12px 8px 0; border-top:1px solid #eef2f4; font-size:12px; color:#3a3d40; }
#hip .iv-minlen-view{ display:flex; align-items:center; justify-content:space-between; gap:6px; }
#hip .iv-minlen-view > span{ min-width:0; line-height:1.5; }
#hip .iv-minlen-view strong{ font-variant-numeric:tabular-nums; }
#hip .iv-minlen button{
  flex:0 0 auto; white-space:nowrap;
  height:28px; padding:0 8px; border:0; border-radius:6px; background:transparent;
  font:inherit; font-size:12px; font-weight:700; color:#3a3d40; cursor:pointer;
}
#hip .iv-minlen button:hover{ background:#eef2f4; color:#171819; }
#hip .iv-minlen-edit{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
#hip .iv-minlen-edit label{ width:100%; }
#hip .iv-minlen-edit input{
  width:96px; height:30px; padding:0 8px; border:1px solid #d0d6da; border-radius:7px; font:inherit; font-size:13px;
}

/* 営業所の在庫の空・エラー表示を一覧の幅にそろえる */
#hip #shareRemnantList .srn-empty{ border-radius:10px; }

/* 狭い PC 幅 (アプリを小さい窓で使うとき): 履歴の列を詰めて 顧客・工事名に幅を回す (2026-11-28) */
@media (max-width:1100px){
  #hip .hx-cols,
  #hip .hx-row-main{ grid-template-columns:52px minmax(0, 1fr) minmax(0, 132px) 76px 44px; gap:10px; }
  #hip .hx-dow{ display:none; }
}
@media (max-width:860px){
  #hip .hx-cols,
  #hip .hx-row-main{ grid-template-columns:48px minmax(0, 1fr) minmax(0, 104px) 72px 40px; gap:8px; padding-left:8px; padding-right:8px; }
}

/* 狭い PC 幅: 在庫の列を間引く */
@media (max-width:1100px){
  #hip .iv-cols, #hip .iv-srow-main{ grid-template-columns:16px 14px minmax(110px, 170px) minmax(0, 1fr) 56px 76px 64px; }
  #hip .iv-srow-main{ grid-template-columns:14px minmax(110px, 170px) minmax(0, 1fr) 56px 76px 64px; }
  #hip .iv-cols > span:nth-child(4), #hip .iv-srow-main .iv-c-attr{ display:none; }
  #hip .iv-fcols > span:nth-child(8), #hip .iv-frow .iv-c-note,
  #hip .iv-fcols > span:nth-child(4), #hip .iv-frow .iv-c-attr{ display:none; }
  #hip .iv-fcols, #hip .iv-frow{ grid-template-columns:16px 84px minmax(100px, 160px) 52px 72px minmax(0, 1fr) 60px 60px; }
}

/* タッチの画面 (マウスを乗せられない) と スマホの旧レイアウトでは、行の操作ボタンを常に出す
   (2026-11-26 code-reviewer: 乗せたときだけだと 編集・削除・計算し直す に届かない) */
@media (hover:none), (pointer:coarse){
  #hip .hx-row{ display:flex; align-items:center; }
  #hip .hx-row .hx-row-main{ flex:1 1 auto; min-width:0; }
  #hip .hx-act,
  #hip .iv-act{ position:static; transform:none; opacity:1; pointer-events:auto; padding-left:0; background:transparent; }
  #hip .iv-prow{ grid-template-columns:16px 96px 48px minmax(0, 1fr) minmax(0, 1fr) 56px 56px auto; }
  #hip .iv-fcols,
  #hip .iv-frow{ grid-template-columns:16px 84px minmax(100px, 160px) minmax(60px, 110px) 48px 72px minmax(0, 1fr) minmax(0, 1fr) 56px 56px auto; }
  #hip .iv-fcols::after{ content:''; }
}
body.mobile-shell #hip .hx-row{ display:flex; align-items:center; }
body.mobile-shell #hip .hx-row .hx-row-main{ flex:1 1 auto; min-width:0; grid-template-columns:52px minmax(0, 1fr); }
body.mobile-shell #hip .hx-row .hx-c-spec,
body.mobile-shell #hip .hx-row .hx-c-qty,
body.mobile-shell #hip .hx-row .hx-c-dl,
body.mobile-shell #hip .hx-cols{ display:none; }
body.mobile-shell #hip .hx-act,
body.mobile-shell #hip .iv-act{ position:static; transform:none; opacity:1; pointer-events:auto; padding-left:0; background:transparent; }
body.mobile-shell #hip .hx-act .hx-qbtn:not(.hx-qbtn-icon){ display:none; }
body.mobile-shell #hip .iv-cols,
body.mobile-shell #hip .iv-fcols{ display:none; }
body.mobile-shell #hip .iv-srow-main{ grid-template-columns:14px minmax(0, 1fr) 48px 64px; }
body.mobile-shell #hip .iv-srow-main .iv-c-attr,
body.mobile-shell #hip .iv-srow-main .iv-c-lens,
body.mobile-shell #hip .iv-srow-main .iv-c-age{ display:none; }
body.mobile-shell #hip .iv-prow{ grid-template-columns:16px 80px 40px minmax(0, 1fr) auto; padding-left:20px; }
body.mobile-shell #hip .iv-prow .iv-c-note,
body.mobile-shell #hip .iv-prow .iv-c-date,
body.mobile-shell #hip .iv-prow .iv-c-age{ display:none; }
body.mobile-shell #hip .iv-frow{ grid-template-columns:16px 72px minmax(0, 1fr) 40px auto; }
body.mobile-shell #hip .iv-frow .iv-c-attr,
body.mobile-shell #hip .iv-frow .iv-c-kg,
body.mobile-shell #hip .iv-frow .iv-c-who,
body.mobile-shell #hip .iv-frow .iv-c-note,
body.mobile-shell #hip .iv-frow .iv-c-date,
body.mobile-shell #hip .iv-frow .iv-c-age{ display:none; }
