/* ── Calc Result Final Overrides (normal screen only) ── */
body:not(.print-mode) #rp,
body:not(.print-mode) .mn{
  background:#f5fafc !important; /* v1.31.0: --toriai-app-bg と同じ */
}
body:not(.print-mode) #rp{
  padding:24px !important;
}
body:not(.print-mode) #rp > .an,
body:not(.print-mode) #rp > .print-job-header{
  background:transparent !important;
}
body:not(.print-mode) #rp .cc,
body:not(.print-mode) #rp .calc-result-toolbar,
body:not(.print-mode) #rp .ph{
  background:#ffffff !important;
}
body:not(.print-mode) #rp .ph{
  background:transparent !important; /* v1.31.0: 方眼紙を見せる */
  border:none !important;
  box-shadow:none !important;
}
body:not(.print-mode) #rp .cc{
  border:1px solid #dbe0e4 !important;
  box-shadow:0 4px 20px rgba(15,16,17,.05) !important;
}
body:not(.print-mode) #rp .cc-hd,
body:not(.print-mode) #rp .yield-card .cc-hd,
body:not(.print-mode) #rp .cc-pat,
body:not(.print-mode) #rp .cut-diagram,
body:not(.print-mode) #rp .rem-strip{
  background:#ffffff !important;
}
body:not(.print-mode) #rp .calc-result-toolbar{
  border:1px solid #d7dce0 !important;
  border-radius:16px !important;
}
body:not(.print-mode) #rp .calc-result-title{
  font-size:12px !important;
  font-weight:600 !important;
  color:#1a1c1d !important;
}
body:not(.print-mode) #rp .calc-result-cell:first-child{
  justify-content:center !important;
}
body:not(.print-mode) #rp .calc-result-cell:first-child .calc-result-cell-label{
  display:none !important;
}
body:not(.print-mode) #rp .calc-result-edit{
  border-left:1px solid #e6ebed !important;
}
body:not(.print-mode) #rp .calc-result-input{
  background:#ffffff !important;
  color:#1a1c1d !important;
  min-height:40px !important;
  height:40px !important;
  border:1px solid #dce2e5 !important;
  border-radius:10px !important;
  padding:0 12px !important;
}
body:not(.print-mode) #rp .calc-result-input:focus{
  background:#fafcfd !important;
}
body:not(.print-mode) #rp .bar-track{
  height:36px !important;
  background:#fff !important;
  border:1.5px solid #555 !important;
}
body:not(.print-mode) #rp .b-piece:not([class*="piece-color-"]){
  background:#d8d8d8 !important;
  color:#000 !important;
  font-size:12px !important;
  font-weight:700 !important;
  border-left:1px solid #555 !important;
}
/* T13 (2026-06-06 master): 色で識別 → hatch(斜線)と濃いボーダー線を除去 (solid + 白セパレータ) */
body:not(.print-mode) #rp .b-piece[class*="piece-color-"]{
  background-color:var(--piece-fill,#d8d8d8) !important;
  background-image:none !important;
  color:#111 !important;
  font-size:12px !important;
  font-weight:700 !important;
  border-left:1px solid rgba(255,255,255,.75) !important;
}
body:not(.print-mode) #rp .b-piece:first-of-type{
  border-left:none !important;
}
/* M1 + N5 (2026-06-06 master): 端材バー。 当初 solid 薄青(#dbeafe)にしたが piece-color-0(同じ薄青)と
   かぶるため、 塗りを白に変更し「青の破線枠 + 濃紺太字」で再利用材を表す(枠は青で master 承認)。
   端材(b-rem)=白塗り+青破線枠+濃紺数値 / ロス(b-loss)=グレー斜線。 これで端材 vs ロス vs 各部材色 が一目で区別できる。 */
body:not(.print-mode) #rp .b-rem{
  background:#fff !important;
  background-image:none !important;
  color:#13357a !important;
  font-size:10px !important;
  font-weight:700 !important;
  border:2px dashed #2563eb !important;
  box-sizing:border-box !important;
}
body:not(.print-mode) #rp .b-loss{
  background:repeating-linear-gradient(-45deg,#d8d8d8,#d8d8d8 1px,#fff 1px,#fff 5px) !important;
  color:#9a9a9a !important;
  font-size:10px !important;
}
body:not(.print-mode) #rp .cc-desc,
body:not(.print-mode) #rp .r1 .cc-desc,
body:not(.print-mode) #rp .r2 .cc-desc,
body:not(.print-mode) #rp .r3 .cc-desc{
  color:#1a1c1d !important;
}

/* ── App Sidebar Layout ── */
body.sidebar-layout-active{
  background:#eff4f6;
}
body.sidebar-layout-active,
body.sidebar-layout-active input,
body.sidebar-layout-active select,
body.sidebar-layout-active textarea,
body.sidebar-layout-active button{
  font-family:var(--toriai-font);
}
body.sidebar-layout-active header{
  justify-content:space-between;
  gap:12px;
  padding:0 20px;
}
body.sidebar-layout-active .hdr-right{
  width:0;
  min-width:0;
  margin-left:auto;
  overflow:visible;
}
body.sidebar-layout-active #guideBtn,
body.sidebar-layout-active #cartBadge,
body.sidebar-layout-active #hamBtn{
  display:none !important;
}
body.sidebar-layout-active .app-shell{
  display:grid;
  grid-template-columns:232px minmax(0,1fr);
  min-height:calc(100vh - 54px);
}
body.sidebar-layout-active .app-sidebar{
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  background:#ffffff;
  border-right:1px solid #e4e9eb;
  padding:16px 12px 18px;
  min-width:232px;
}
body.sidebar-layout-active .app-sidebar-main,
body.sidebar-layout-active .app-sidebar-footer{
  display:flex;
  flex-direction:column;
  gap:6px;
}
body.sidebar-layout-active .app-sidebar-footer{
  padding-top:16px;
  border-top:1px solid #eaeff1;
}
body.sidebar-layout-active .app-nav-item{
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
  min-height:46px;
  padding:0 12px;
  border:none;
  border-radius:14px;
  background:transparent;
  color:#1b1c1d;
  text-align:left;
  cursor:pointer;
  transition:background .15s ease;
}
body.sidebar-layout-active .app-nav-item:hover{
  background:#f3f8fa;
}
body.sidebar-layout-active .app-nav-item.active{
  background:#e8edef;
}
body.sidebar-layout-active .app-nav-item--sub{
  color:#454a4d;
}
body.sidebar-layout-active .app-nav-icon{
  width:22px;
  height:22px;
  flex:0 0 22px;
  stroke:#0e0f0f;
  stroke-width:1.9;
  fill:none;
  stroke-linecap:square;
  stroke-linejoin:miter;
}
body.sidebar-layout-active .app-nav-label{
  font-size:14px;
  line-height:1.2;
  font-weight:600;
  letter-spacing:.01em;
}
body.sidebar-layout-active .app-main{
  min-width:0;
  background:#eff4f6;
}
body.sidebar-layout-active .app-main > .pg{
  min-height:calc(100vh - 54px);
}
body.sidebar-layout-active #cp{
  background:#eff4f6;
}
body.sidebar-layout-active #pageCalcLayout{
  height:calc(100vh - 54px);
}
body.sidebar-layout-active #wpp,
body.sidebar-layout-active #dpp,
body.sidebar-layout-active #hip,
body.sidebar-layout-active #cop{
  background:#eff4f6;
}

@media (max-width: 900px){
  body.sidebar-layout-active .app-shell{
    grid-template-columns:1fr;
  }
  body.sidebar-layout-active .app-sidebar{
    min-width:0;
    border-right:none;
    border-bottom:1px solid #e4e9eb;
  }
}

/* ── History / Inventory Final Overrides ── */
#hip,
#hip .hi-panel{
  background:#f6fafc !important;
}
#hip .hi-panel-layout{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  min-height:calc(100vh - 118px);
  background:linear-gradient(90deg,#ffffff 0 280px,#f6fafc 280px 100%);
  align-items:stretch;
}
#hip .hi-sb{
  background:#fff !important;
  border-right:1px solid #e6ebed;
  padding:20px 16px 32px;
  min-width:280px;
  min-height:100%;
  box-shadow:1px 0 0 rgba(230,235,237,.9);
}
#hip .hi-sb-main{
  padding:20px 24px 28px;
  min-width:0;
}
#hip #hiPanelI .hi-sb,
#hip #hiPanelH .hi-sb{
  background:#fff !important;
}
#hip #hiPanelH,
#hip #hiPanelH .hi-panel-layout,
#hip #hiPanelH .hi-sb-main{
  background:#f6fafc !important;
}
#hip #hiPanelH .hi-panel-layout{
  background:linear-gradient(90deg,#ffffff 0 280px,#f6fafc 280px 100%) !important;
}
#hip #hiPanelI .hi-panel-layout{
  background:linear-gradient(90deg,#ffffff 0 280px,#f6fafc 280px 100%) !important;
}
#hip .inv-head-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:start;
  gap:16px;
  margin-bottom:16px;
}
#hip .inv-summary-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(180px,220px));
  column-gap:16px;
  row-gap:16px;
  justify-content:start;
  width:100%;
  max-width:100%;
  margin-left:14px;
}
#hip .inv-summary-card{
  box-sizing:border-box;
  background:#fff;
  border:1px solid #e4e9eb;
  border-radius:16px;
  padding:16px 18px 16px 40px;
  box-shadow:0 6px 18px rgba(14,15,15,.03);
  height:92px;
}
#hip button.inv-summary-card{
  appearance:none;
  cursor:pointer;
  text-align:left;
  font-family:inherit;
}
#hip .inv-summary-label{
  font-size:11px;
  font-weight:700;
  color:#8b9094;
  margin-bottom:8px;
  letter-spacing:.04em;
}
#hip .inv-summary-value{
  font-size:20px;
  line-height:1.2;
  font-weight:800;
  color:#131415;
}
#hip .hi-sb-sec{
  margin-bottom:28px;
}
#hip .hi-sb-lbl{
  font-size:11px;
  font-weight:700;
  color:#888d91;
  letter-spacing:.08em;
  margin-bottom:12px;
  padding:0 12px;
}
#hip .hi-sb-item{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  min-height:40px;
  padding:9px 12px;
  margin-bottom:6px;
  border-radius:12px;
  color:#4d5255;
  font-size:13px;
  font-weight:600;
  background:transparent;
  border:1px solid transparent;
  text-align:left;
}
#hip .hi-sb-item:hover{
  background:#fafdfd;
  border-color:#e9eef0;
}
#hip .hi-sb-item.on{
  background:#f3f8fa;
  border-color:#dee4e7;
  color:#1b1c1d;
}
#hip .hi-sb-dot{
  width:6px;
  height:6px;
  border-radius:999px;
  background:#dbe1e4;
  flex:0 0 6px;
}
#hip .hi-sb-item.on .hi-sb-dot{
  background:#1b1c1d;
}
#hip .hi-topbar{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}
#hip .hi-search-wrap{
  position:relative;
  flex:1;
}
#hip .hi-search-wrap input,
#hip .hi-sb-kinput{
  height:48px;
  border:1px solid #e1e6e9 !important;
  border-radius:14px !important;
  background:#fff !important;
  padding:0 16px 0 40px !important;
  font-size:14px !important;
  color:#1b1c1d !important;
  box-shadow:0 1px 2px rgba(14,15,15,.02);
}
#hip .hi-detail-toggle{
  width:44px;
  height:44px;
  border:1px solid #e1e6e9;
  border-radius:12px;
  background:#fff;
  color:#5e6367;
}
#hip .hi-detail-panel{
  background:#fff;
  border:1px solid #e5eaec;
  border-radius:16px;
  padding:14px 16px;
  margin-bottom:14px;
  box-shadow:0 6px 20px rgba(14,15,15,.04);
}
#hip .hi-sort-row{
  padding:0 2px 10px;
  margin-bottom:10px;
}
#hip .hi-count{
  font-size:12px;
  color:#888d91;
  font-weight:600;
}
#hip .hi-sort,
#hip #invSort{
  height:42px;
  border:1px solid #e1e6e9;
  border-radius:12px;
  background:#fff;
  padding:0 14px;
  font-size:13px;
  font-weight:600;
  color:#3e4245;
}
#hip .hi-list-area{
  min-width:0;
}
#hip .inv-add-open-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:128px;
  height:40px;
  margin-bottom:0;
  padding:0 14px;
  background:#171819;
  border:1px solid #171819;
  border-radius:12px;
  color:#fff;
  font-size:12px;
  font-weight:700;
  box-shadow:none;
  white-space:nowrap;
  font-family:inherit;
  cursor:pointer;
}
#hip .inv-add-open-btn:hover{
  background:#171819;
  border-color:#171819;
}
#hip .inv-min-remnant-field{
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:8px;
  box-sizing:border-box;
}
#hip .inv-min-remnant-view{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
#hip .inv-min-remnant-field small{
  font-size:11px;
  font-weight:700;
  color:#8b9094;
}
#hip .inv-min-remnant-field button{
  height:28px;
  padding:0 10px;
  border:1px solid #e0e6e9;
  border-radius:8px;
  background:#fff;
  color:#131415;
  font-family:inherit;
  font-size:11px;
  font-weight:700;
  cursor:pointer;
}
#hip .inv-min-remnant-field button:hover{
  background:#fafdfd;
}
#hip .inv-min-remnant-edit{
  align-items:center;
  gap:8px;
}
#hip .inv-min-remnant-edit input{
  min-width:0;
  flex:1;
}
#hip .inv-min-remnant-field input[type="number"]{
  width:100%;
  height:32px;
  box-sizing:border-box;
  border:1px solid #e0e6e9;
  border-radius:8px;
  background:#fbfdfe;
  color:#131415;
  font-family:inherit;
  font-size:13px;
  font-weight:700;
  padding:0 10px;
}
#hip #hiPanelI .inv-add-open-btn{
  min-width:128px !important;
  height:40px !important;
  padding:0 14px !important;
  border:1px solid #171819 !important;
  background:#171819 !important;
  color:#fff !important;
  font-size:12px !important;
  box-shadow:none !important;
}
#hip .hist-row,
#hip .inv-row{
  background:#fff;
  border:1px solid #e5eaec;
  border-radius:16px;
  margin-bottom:10px;
  padding:18px 16px;
  box-shadow:0 6px 18px rgba(14,15,15,.03);
}
#hip .hist-row:last-child,
#hip .inv-row:last-child{
  border-bottom:1px solid #e5eaec;
}
#hip .hist-row:hover,
#hip .inv-row:hover{
  background:#fff;
  border-color:#d9dfe2;
}
#hip #hiPanelH .hist-row,
#hip #hiPanelH .hist-job-group,
#hip #hiPanelH .hist-job-body{
  background:#fff !important;
}
#hip #hiPanelH .hist-row,
#hip #hiPanelH .hist-job-group{
  border:1px solid #dfe5e8 !important;
  box-shadow:0 10px 24px rgba(14,15,15,.06) !important;
}
#hip #hiPanelH .hi-list-area,
#hip #hiPanelH #histList{
  background:transparent !important;
}
#hip #hiPanelH .hi-list-area{
  padding-top:4px;
}
#hip #hiPanelH #histList{
  display:flex;
  flex-direction:column;
  gap:14px;
}
#hip #hiPanelH .hist-row{
  margin-bottom:0 !important;
  padding:20px 18px !important;
  border:1px solid #d8dee1 !important;
  border-radius:18px !important;
  box-shadow:0 12px 28px rgba(14,15,15,.08) !important;
}
#hip #hiPanelH .hi-topbar,
#hip #hiPanelH .hi-sort-row{
  background:transparent !important;
}
#hip #hiPanelH .hist-row:hover{
  background:#fff !important;
  border-color:#d2d8dc !important;
}
#hip #hiPanelH #histList{
  display:flex;
  flex-direction:column;
  gap:14px;
}
#hip .hist-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}
#hip .hist-row-main{
  flex:1;
  min-width:0;
}
#hip .hist-row-head{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
}
#hip .hist-title-group{
  min-width:0;
}
#hip .hist-client{
  display:block;
  font-size:17px;
  font-weight:700;
  color:#131415;
  line-height:1.35;
}
#hip .hist-name{
  display:block;
  margin-top:3px;
  font-size:12px;
  color:#777c81;
  line-height:1.45;
}
#hip .hist-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
#hip .hist-rem{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:0 10px;
  border-radius:999px;
  background:#f6fafc;
  color:#6a6f73;
  font-size:11px;
  font-weight:600;
}
#hip .hist-type-badge,
#hip .inv-kind-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:22px;
  padding:0 8px;
  border-radius:999px;
  background:#eff4f6;
  color:#606569;
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
#hip .hist-row-side{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
  min-width:86px;
  padding-top:2px;
}
#hip .hist-date{
  font-size:11px;
  color:#8a8f93;
  font-weight:600;
  white-space:nowrap;
}
#hip .hist-del-btn,
#hip .inv-del-btn--quiet{
  height:32px;
  padding:0 12px;
  border:1px solid #e0e6e9;
  border-radius:999px;
  background:#fff;
  color:#8b9094;
  font-size:11px;
  font-weight:600;
}
#hip .hist-job-group{
  margin-bottom:12px;
  border:1px solid #e5eaec;
  border-radius:16px;
  background:#fff;
  box-shadow:0 6px 18px rgba(14,15,15,.03);
  overflow:hidden;
}
#hip .hist-job-hd{
  display:flex;
  align-items:center;
  gap:12px;
  padding:16px 18px;
  cursor:pointer;
}
#hip .hist-job-title{
  font-size:16px;
  font-weight:700;
  color:#131415;
}
#hip .hist-job-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px 10px;
  margin-top:6px;
  color:#7d8287;
  font-size:11px;
}
#hip .hist-job-body{
  padding:0 12px 12px;
  background:#fff;
}
#hip .inv-table-card{
  background:#fff;
  border:1px solid #e4e9eb;
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 8px 24px rgba(14,15,15,.03);
}
#hip .inv-col-header--table,
#hip .inv-row--table{
  display:grid;
  grid-template-columns:48px minmax(220px,1.3fr) minmax(120px,.8fr) 76px 108px minmax(120px,.9fr) minmax(150px,1fr) 72px;
  align-items:center;
  gap:14px;
}
#hip .inv-col-header--table{
  padding:14px 18px;
  border-bottom:1px solid #e9eef0;
  color:#888d91;
  font-size:11px;
  font-weight:700;
  letter-spacing:.06em;
  background:#fdfcfa;
}
#hip .inv-row--table{
  margin:0;
  border:none;
  border-bottom:1px solid #f1f6f8;
  border-radius:0;
  box-shadow:none;
  padding:20px 18px;
}
#hip .inv-row--table:last-child{
  border-bottom:none;
}
#hip .inv-no{
  font-size:14px;
  color:#888d91;
  font-variant-numeric:tabular-nums;
}
#hip .inv-spec-cell{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
#hip .inv-spec-main{
  font-size:14px;
  font-weight:700;
  color:#131415;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
#hip .inv-len--single{
  min-width:0;
  font-size:15px;
  font-weight:700;
  color:#131415;
}
#hip .inv-qty--plain{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:28px;
  padding:0 10px;
  border-radius:999px;
  background:#ecfff2;
  border:none;
  color:#23a35a;
  font-size:12px;
  font-weight:700;
}
#hip .inv-company,
#hip .inv-note,
#hip .inv-date{
  font-size:13px;
  color:#5e6367;
}
#hip .inv-action{
  display:flex;
  justify-content:flex-end;
}
#hip .inv-del-btn--quiet{
  min-width:54px;
}
#hip .pager{
  margin-top:18px;
}
@media (max-width: 900px){
  #hip .hi-panel-layout{
    grid-template-columns:1fr;
    background:#f6fafc;
  }
  #hip .hi-sb{
    border-right:none;
    border-bottom:1px solid #e4e9eb;
    min-width:0;
  }
  #hip .inv-head-row{
    grid-template-columns:1fr;
  }
  #hip .inv-summary-grid{
    grid-template-columns:repeat(2,minmax(0,1fr));
    width:100%;
    margin-left:0;
  }
  #hip .inv-col-header--table,
  #hip .inv-row--table{
    grid-template-columns:48px minmax(180px,1.2fr) minmax(110px,.8fr) 70px 96px minmax(110px,.8fr) minmax(130px,1fr) 68px;
  }
}
@media (max-width: 820px){
  #hip .hi-sb-main{
    padding:16px 14px 20px;
  }
  #hip .hist-row{
    flex-direction:column;
    align-items:stretch;
  }
  #hip .hist-row-side{
    flex-direction:row;
    align-items:center;
    justify-content:space-between;
    min-width:0;
    padding-top:0;
  }
  #hip .inv-summary-grid{
    grid-template-columns:1fr;
  }
  #hip .inv-col-header--table{
    display:none;
  }
  #hip .inv-row--table{
    grid-template-columns:1fr auto;
    gap:8px 12px;
  }
  #hip .inv-no,
  #hip .inv-company,
  #hip .inv-note,
  #hip .inv-date,
  #hip .inv-qty--plain,
  #hip .inv-action{
    grid-column:1 / -1;
    justify-content:flex-start;
  }
}

/* ── Unified Sidebar Width + Modern Typography (except contact/onboarding) ── */
:root{
  --app-sidebar-w:320px;
  --app-font-sans:var(--toriai-font); /* v1.31.0: 画面の字は Noto Sans JP に統一 (旧 Segoe UI 優先) */
  --app-gap-main:18px;
  --app-pad-main:18px;
  --app-pad-side:18px;
}

header,
nav,
nav a,
#cp,
#wpp,
#dpp,
#hip{
  font-family:var(--app-font-sans);
}

nav{
  gap:8px;
  font-family:var(--app-font-sans);
  font-size:11px;
  font-weight:600;
  letter-spacing:.01em;
  text-transform:none;
}

nav a{
  font-family:var(--app-font-sans);
  font-size:12px;
  font-weight:600;
  letter-spacing:.01em;
  text-transform:none;
  padding:4px 10px;
}

#cp .layout,
#wpp .layout{
  grid-template-columns:var(--app-sidebar-w) minmax(0,1fr);
}

#cp .sb,
#wpp .sb{
  width:var(--app-sidebar-w);
  min-width:var(--app-sidebar-w);
  padding:var(--app-pad-side);
  gap:16px;
}

#hip .hi-panel-layout{
  grid-template-columns:var(--app-sidebar-w) minmax(0,1fr);
  background:linear-gradient(90deg,#ffffff 0 var(--app-sidebar-w),#f6fafc var(--app-sidebar-w) 100%);
}

#hip .hi-sb{
  width:var(--app-sidebar-w);
  min-width:var(--app-sidebar-w);
}

#hip #hiPanelH .hi-panel-layout{
  background:linear-gradient(90deg,#ffffff 0 var(--app-sidebar-w),#f6fafc var(--app-sidebar-w) 100%) !important;
}

#hip #hiPanelI .hi-panel-layout{
  background:linear-gradient(90deg,#ffffff 0 var(--app-sidebar-w),#f6fafc var(--app-sidebar-w) 100%) !important;
}

#cp,
#wpp,
#dpp,
#hip{
  font-size:13px;
  letter-spacing:0;
}

#cp button,
#cp input,
#cp select,
#cp textarea,
#wpp button,
#wpp input,
#wpp select,
#wpp textarea,
#dpp button,
#dpp input,
#dpp select,
#dpp textarea,
#hip button,
#hip input,
#hip select,
#hip textarea,
#cp table,
#wpp table,
#dpp table,
#hip table{
  font-family:var(--app-font-sans);
  letter-spacing:0;
}

#cp .mn,
#wpp .mn{
  padding:var(--app-pad-main);
  gap:var(--app-gap-main);
}

#cp .shd,
#cp .field label,
#wpp .shd,
#wpp .field label,
#hip .hi-sb-lbl,
#hip .hi-sb-item,
#dpp .group-title,
#dpp .eyebrow,
#dpp .dt-sel-label,
#dpp .dp2-sec-lbl,
#dpp .dp2-note-lbl{
  font-family:var(--app-font-sans);
  letter-spacing:.03em !important;
}

#cp input[type=number],
#cp input[type=text],
#cp input[type=date],
#cp select,
#wpp input[type=number],
#wpp input[type=text],
#wpp input[type=date],
#wpp select{
  font-family:var(--app-font-sans);
  font-size:12px;
  font-weight:500;
}

#cp .field label,
#wpp .field label{
  font-size:10px;
  margin-bottom:4px;
}

#cp .shd,
#wpp .shd{
  font-size:10px;
  margin-bottom:6px;
}

/* master 仕様 (2026-05-10): pill 形式に伴い 28px に統一 */
#cp .calc-steel-input,
#cp .calc-browse-btn,
#wpp #wCmdInput,
#wpp #wCmdWrap button.calc-browse-btn{
  height:28px;
}

#cp .run,
#wpp .run{
  min-height:46px;
  font-size:11px;
  letter-spacing:.08em;
  padding:12px;
}

#cp .sm-btn,
#wpp .sm-btn,
#hip .hi-filter-btn,
#hip .hi-sort,
#hip .hist-del-btn,
#hip .inv-del-btn--quiet{
  font-size:10px;
}

#cp .cc-hd,
#cp .yield-card .cc-hd{
  padding:9px 12px;
}

#cp .pc-row{
  padding:5px 10px;
  font-size:11px;
}

#cp .detail-toggle,
#cp .diag-toggle{
  padding:8px 12px;
  font-size:10px;
}

#cp .calc-result-toolbar{
  padding:10px 14px;
  margin-bottom:12px;
}

#cp .calc-result-title{
  font-size:12px;
  font-weight:600;
  line-height:1.25;
}

@media (max-width: 1100px){
  #cp .calc-result-toolbar{
    align-items:stretch;
  }

  #cp .calc-result-toolbar-main{
    grid-template-columns:repeat(2,minmax(0,1fr));
    grid-template-areas:
      "job-title job-title"
      "job-client job-name"
      "job-deadline job-memo";
    gap:10px 12px;
  }

  #cp .calc-result-toolbar-main > .calc-result-cell:nth-child(1){
    grid-area:job-title;
    min-height:20px;
    justify-content:flex-start !important;
    align-self:end;
  }

  #cp .calc-result-toolbar-main > .calc-result-edit:nth-child(2){ grid-area:job-client; }
  #cp .calc-result-toolbar-main > .calc-result-edit:nth-child(3){ grid-area:job-name; }
  #cp .calc-result-toolbar-main > .calc-result-edit:nth-child(4){ grid-area:job-deadline; }
  #cp .calc-result-toolbar-main > .calc-result-edit:nth-child(5){ grid-area:job-memo; }

  #cp .calc-result-edit{
    padding:0 !important;
    border-left:none !important;
  }

  #cp .calc-result-input{
    height:42px !important;
    min-height:42px !important;
  }

  #cp .calc-toolbar-cart{
    align-self:center;
  }
}

#hip .hi-sb{
  padding:18px 14px 24px;
}

#hip .hi-sb-main{
  padding:16px 18px 22px;
}

#hip .hi-sb-lbl{
  font-size:10px;
}

#hip .hi-sb-item{
  font-size:12px;
  padding:8px 10px;
}

#hip .hi-search-wrap input,
#hip .hi-sb-kinput{
  padding:10px 12px 10px 34px;
  font-size:12px;
}

#hip .hi-topbar,
#hip .hi-sort-row{
  margin-bottom:12px;
}

#hip .hist-row,
#hip .inv-row--table{
  border-radius:14px;
}

#cp .pt-row input,
#cp .stk-nm,
#cp .stk-mx,
#cp .pt-n,
#cp .pt-kg,
#cp .tot-v,
#cp .pc-row,
#cp .bar-vis-label,
#cp .bar-piece,
#cp .bar-loss,
#cp .bar-rem,
#wpp #wTable.w-table tbody td.w-r,
#wpp #wTable.w-table tfoot td.w-r,
#dpp .mono,
#dpp .data-sb-item .cnt{
  font-family:var(--app-font-sans) !important;
  font-variant-numeric:tabular-nums;
}

@media (max-width: 1100px){
  #cp .layout,
  #wpp .layout{
    grid-template-columns:var(--app-sidebar-w) minmax(0,1fr);
  }
}

@media (max-width: 1280px){
  :root{
    --app-sidebar-w:300px;
    --app-gap-main:14px;
    --app-pad-main:14px;
    --app-pad-side:16px;
  }

  #cp .mn,
  #wpp .mn{
    padding:14px;
    gap:14px;
  }

  #cp .cc,
  #cp .yield-card,
  #cp .r1,
  #cp .r2,
  #cp .r3{
    border-radius:14px;
  }

  #cp .res-hd{
    margin-bottom:10px;
    padding-bottom:9px;
  }

  #cp .res-ttl{
    font-size:16px;
  }

  #cp .cc-hd,
  #cp .yield-card .cc-hd{
    gap:8px;
    padding:8px 10px;
  }

  #cp .cc-desc{
    font-size:12px;
  }

  #cp .cs .cl{
    font-size:10px;
  }

  #cp .cs .cv{
    font-size:12px;
  }

  #cp .rem-strip,
  #cp .cc-detail-body{
    padding-left:10px;
    padding-right:10px;
  }

  #hip .hi-sb{
    padding:16px 12px 20px;
  }

  #hip .hi-sb-main{
    padding:14px 16px 20px;
  }

  #hip .inv-head-row{
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    align-items:start;
  }

  #hip .inv-summary-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
    column-gap:12px;
    row-gap:14px;
    width:100%;
    margin-left:0;
  }

  #hip .inv-min-remnant-field{
    grid-column:auto;
    padding-left:12px;
    padding-right:12px;
  }

  #hip .inv-summary-card{
    height:84px;
    padding:14px 16px 14px 34px;
  }

  #hip .inv-min-remnant-field .inv-summary-label{
    font-size:9px;
    line-height:1.25;
    margin-bottom:4px;
  }

  #hip .inv-min-remnant-field .inv-summary-value{
    font-size:17px;
  }

  #hip .inv-min-remnant-field button{
    height:26px;
    padding:0 8px;
    font-size:10px;
  }

  #hip #hiPanelI .inv-add-open-btn{
    height:40px !important;
  }

  #hip .inv-min-remnant-view{
    gap:6px;
  }

  #hip .hi-topbar{
    gap:10px;
    margin-bottom:12px;
  }
}

#cp .bar-vis-label .bar-count,
#rp .bar-vis-label .bar-count{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  background:#000 !important;
  color:#fff !important;
  border:1px solid #000 !important;
  border-radius:999px !important;
  padding:2px 10px !important;
  font-size:10px !important;
  font-weight:700 !important;
  line-height:1 !important;
}
