/* CPGCBL EMD R11.5.7 — reference-inspired, single-scroll, NO TABS.
   Styles only read-only detail drawers; never Daily Work or edit forms.
   Base detail CSS is R11.5.6. No photographs, image elements or facts are generated here. */
body.r107-ui #drawer.r1157-active{
  --r1155-bg:#f5f8fc;
  --r1155-panel:#fff;
  --r1155-alt:#f3f7fb;
  --r1155-text:#102d4a;
  --r1155-muted:#58718b;
  --r1155-line:rgba(60,105,151,.12);
  --r1155-accent:#087bdd;
  --r1155-accent-soft:rgba(9,112,215,.045);
  --r1155-shadow:none;
}
body.r107-ui[data-theme="dark"] #drawer.r1157-active,
body.r107-ui[data-theme="hybrid"] #drawer.r1157-active,
body.r107-ui[data-theme="slate"] #drawer.r1157-active{
  --r1155-bg:#061a2a;
  --r1155-panel:#09263c;
  --r1155-alt:#0c2c42;
  --r1155-text:#edf8ff;
  --r1155-muted:#afc8da;
  --r1155-line:rgba(116,174,210,.12);
  --r1155-accent:#30c6e7;
  --r1155-accent-soft:rgba(22,183,225,.035);
  --r1155-shadow:none;
}
body.r107-ui #drawer.r1157-active .drawerpanel{width:min(900px,88vw)!important;background:var(--r1155-bg)!important}
body.r107-ui #drawer.r1157-active .drawerbody{padding:9px 12px 16px!important}
body.r107-ui #drawer.r1157-active .drawerhead{min-height:56px!important}
#drawer.r1157-active .r1157-shell,
#drawer.r1157-active .r1157-sections{gap:8px!important}
#drawer.r1157-active .r1156-group{gap:8px!important}
#drawer.r1157-active .r1155-top .r5-actions{display:flex!important;flex-wrap:wrap!important;gap:6px!important;padding:0!important}
#drawer.r1157-active .r1155-actions :is(.btn,button){min-height:31px!important;padding:6px 11px!important;font-size:11.5px!important}
#drawer.r1157-active .r1156-group>.detail-hero{padding:6px 10px!important;min-height:31px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;background:var(--r1155-panel)!important}
/* The work/asset title is already in the drawer's sticky header. Avoid double titles. */
#drawer.r1157-active .r1156-group>.detail-hero h2{display:none!important}
#drawer.r1157-active .r1156-group>.detail-hero p{margin:0!important;font-size:11px!important;line-height:1.4!important;color:var(--r1155-muted)!important}
#drawer.r1157-active .r1156-group>.r79-bearing-hero{padding:8px 10px!important;min-height:46px!important}
#drawer.r1157-active .r1156-group>.r79-bearing-hero :is(h2,.r79-eyebrow){display:none!important}
#drawer.r1157-active .r1156-group>.r79-bearing-hero p{font-size:11px!important;margin:0!important}
#drawer.r1157-active .r1157-media-details,
#drawer.r1157-active .r1156-group-overview>.r79-bearing-top{
  display:grid!important;
  grid-template-columns:minmax(235px,.88fr) minmax(0,1.35fr)!important;
  align-items:stretch!important;
  gap:8px!important;
  margin:0!important;
}
#drawer.r1157-active .r1157-media-details>*,
#drawer.r1157-active .r1156-group-overview>.r79-bearing-top>*{min-width:0!important;max-width:100%!important}
#drawer.r1157-active .r1157-media-details>.r5-drawer-section,
#drawer.r1157-active .r1156-group-overview>.r79-bearing-top>*{
  border:1px solid var(--r1155-line)!important;
  border-radius:10px!important;
  background:var(--r1155-panel)!important;
  padding:9px!important;
  box-shadow:none!important;
  margin:0!important;
}
/* IMAGE-ONCE RULE: use the existing R9.3 photo gallery, not a cloned preview. */
#drawer.r1157-active .r1157-photo-card{display:flex!important;flex-direction:column!important;gap:6px!important;justify-content:flex-start!important}
#drawer.r1157-active .r1157-photo-card>h3{margin:0!important;padding:0!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-gallery{display:flex!important;flex-direction:column!important;gap:6px!important;margin:0!important;width:100%!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-gallery-head{justify-content:flex-end!important;min-height:0!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-gallery-head strong{display:none!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-gallery-count{font-size:10px!important;color:var(--r1155-muted)!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-main-photo{
  height:188px!important;min-height:160px!important;max-height:210px!important;
  overflow:hidden!important;border:1px solid var(--r1155-line)!important;
  border-radius:8px!important;background:var(--r1155-alt)!important;
}
#drawer.r1157-active .r1157-photo-card .emd-r93-main-photo>a{height:100%!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-main-photo img{height:100%!important;width:100%!important;object-fit:contain!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-thumb-rail{
  display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;gap:5px!important;
  max-width:100%!important;padding:1px 0 4px!important;scrollbar-width:thin!important;
}
#drawer.r1157-active .r1157-photo-card .emd-r93-thumb{
  min-width:49px!important;max-width:54px!important;flex:0 0 52px!important;height:47px!important;
  border:1px solid var(--r1155-line)!important;border-radius:7px!important;padding:2px!important;
  background:var(--r1155-alt)!important;box-shadow:none!important;
}
#drawer.r1157-active .r1157-photo-card .emd-r93-thumb.selected{border-color:var(--r1155-accent)!important;box-shadow:inset 0 0 0 1px var(--r1155-accent)!important}
#drawer.r1157-active .r1157-photo-card .emd-r93-thumb img{object-fit:contain!important}
#drawer.r1157-active .r1157-photo-card .r5-image-grid.emd-r93-source-hidden{display:none!important}
#drawer.r1157-active .r1157-photo-card .btn{font-size:11px!important;min-height:28px!important;padding:5px 8px!important}
/* No second large photo/gallery below the top panel.  Any later media section
   still retains its original clickable buttons, but has no cloned image viewer. */
#drawer.r1157-active .r1156-group-documents .emd-r93-gallery{max-height:0!important;overflow:hidden!important;margin:0!important;padding:0!important}
#drawer.r1157-active .r1156-group-documents .r5-image-grid.emd-r93-source-hidden{display:none!important}
/* Compact nameplate/specifications, clear label/value separation. */
#drawer.r1157-active .r1157-media-details .r5-detail-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0 8px!important}
#drawer.r1157-active .r1157-media-details .r5-detail{
  display:grid!important;grid-template-columns:minmax(74px,.46fr) minmax(0,1fr)!important;
  padding:6px 3px!important;min-height:30px!important;align-items:center!important;
  gap:4px!important;border-bottom:1px solid var(--r1155-line)!important;
}
#drawer.r1157-active .r1157-media-details .r5-detail small{font-size:10.4px!important;color:var(--r1155-muted)!important}
#drawer.r1157-active .r1157-media-details .r5-detail b{font-size:11.7px!important;line-height:1.3!important;color:var(--r1155-text)!important}
#drawer.r1157-active .r1157-real-kpis{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;
}
#drawer.r1157-active .r1157-real-kpis .r5-detail{
  display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:3px!important;
  min-height:52px!important;padding:7px 10px!important;background:var(--r1155-panel)!important;
  border:1px solid var(--r1155-line)!important;border-radius:8px!important;
}
#drawer.r1157-active .r1157-real-kpis .r5-detail small{font-size:10px!important;color:var(--r1155-muted)!important}
#drawer.r1157-active .r1157-real-kpis .r5-detail b{font-size:16px!important;color:var(--r1155-text)!important;letter-spacing:-.015em!important}
/* Existing inventory numbers are the only source of truth. */
#drawer.r1157-active .r1156-metrics,
#drawer.r1157-active .r1157-stock-kpis{gap:6px!important;margin:0!important}
#drawer.r1157-active .r1156-metrics>*{
  padding:7px 9px!important;min-height:52px!important;background:var(--r1155-panel)!important;
  border:1px solid var(--r1155-line)!important;border-radius:8px!important;box-shadow:none!important;
}
#drawer.r1157-active .r1156-metrics>* :is(strong,b,.num){font-size:16px!important}
/* Sections: flat, compact, readable. No tab bar, shadow-heavy borders or duplicate cards. */
#drawer.r1157-active .r1156-group>.r5-drawer-section,
#drawer.r1157-active .r1156-group>.r1155-card,
#drawer.r1157-active .r1156-group>.r79-tech-grid{
  border:1px solid var(--r1155-line)!important;background:var(--r1155-panel)!important;
  border-radius:9px!important;margin:0!important;box-shadow:none!important;
}
#drawer.r1157-active .r1156-group>.r5-drawer-section{padding:9px 10px!important}
#drawer.r1157-active .r1156-group :is(.r5-drawer-section h3,.r1155-section-title,.r79-section-head h3){
  margin:0 0 6px!important;color:var(--r1155-accent)!important;font-size:12px!important;font-weight:800!important;
}
#drawer.r1157-active .r1156-group .r5-detail-grid{gap:0 10px!important}
#drawer.r1157-active .r1156-group .r5-detail{padding:5px 3px!important;min-height:31px!important}
#drawer.r1157-active .r1156-group .r5-detail small{font-size:10.3px!important}
#drawer.r1157-active .r1156-group .r5-detail b{font-size:11.7px!important}
#drawer.r1157-active .r1156-group .r1156-stock-fields .r79-tech-grid>*{min-height:42px!important;padding:6px 8px!important}
#drawer.r1157-active .r1156-group .r1156-stock-fields .r79-tech-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
#drawer.r1157-active .r1156-group .r1155-empty{padding:9px!important;border-style:dashed!important}
#drawer.r1157-active .r1156-group :is(.tablewrap,.r5-tablewrap){max-height:240px!important;border-radius:7px!important;overflow:auto!important}
#drawer.r1157-active .r1156-group :is(.table,.r5-table) :is(th,td){padding:5px 7px!important;font-size:10.9px!important;line-height:1.35!important}
#drawer.r1157-active .r1156-group-history .r711-maint-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
#drawer.r1157-active .r1156-group-history .r711-maint-grid>div{min-width:0!important}
#drawer.r1157-active .r1156-group-documents{gap:7px!important}
/* Status chips keep semantics; borders remain subtle in both themes. */
#drawer.r1157-active :is(button,a.btn):focus-visible{outline:2px solid var(--r1155-accent)!important;outline-offset:2px!important}
body.r107-ui[data-theme="light"] #drawer.r1157-active :is(.r1157-photo-card,.r1157-media-details .r5-drawer-section){color:#102d4a!important}
@media(max-width:920px){
 body.r107-ui #drawer.r1157-active .drawerpanel{width:min(860px,95vw)!important}
 #drawer.r1157-active .r1157-media-details,#drawer.r1157-active .r1156-group-overview>.r79-bearing-top{grid-template-columns:minmax(185px,.9fr) minmax(0,1.4fr)!important}
 #drawer.r1157-active .r1157-media-details .r5-detail-grid{grid-template-columns:1fr!important}
}
@media(max-width:650px){
 body.r107-ui #drawer.r1157-active .drawerpanel{width:100vw!important;max-width:100vw!important}
 body.r107-ui #drawer.r1157-active .drawerbody{padding:8px!important}
 #drawer.r1157-active .r1157-media-details,#drawer.r1157-active .r1156-group-overview>.r79-bearing-top{grid-template-columns:1fr!important}
 #drawer.r1157-active .r1157-photo-card .emd-r93-main-photo{height:190px!important;max-height:190px!important}
 #drawer.r1157-active .r1157-real-kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #drawer.r1157-active .r1156-group-history .r711-maint-grid{grid-template-columns:1fr!important}
 #drawer.r1157-active .r1156-group .r1156-stock-fields .r79-tech-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
}
@media(prefers-reduced-motion:reduce){#drawer.r1157-active *{animation:none!important;scroll-behavior:auto!important}}
/* R9.3 hides original source grids. R11.5.6 had a later display:flex!important
   rule for catalog grids, making the same photos appear AGAIN below the hero. */
#drawer.r1157-active :is(.r79-catalog-grid,.r7-media-grid,.r5-image-grid,.final-gallery).emd-r93-source-hidden{display:none!important}
#drawer.r1157-active .r79-media-card .emd-r93-gallery-head strong{display:none!important}
#drawer.r1157-active .r79-media-card .emd-r93-gallery-head{justify-content:flex-end!important}
#drawer.r1157-active .r79-media-card .emd-r93-gallery{display:flex!important;flex-direction:column!important;gap:6px!important;margin:0!important}
#drawer.r1157-active .r79-media-card .emd-r93-main-photo{height:195px!important;min-height:170px!important;max-height:215px!important;background:var(--r1155-alt)!important;border-color:var(--r1155-line)!important}
#drawer.r1157-active .r79-media-card .emd-r93-main-photo img{width:100%!important;height:100%!important;object-fit:contain!important}
#drawer.r1157-active .r79-media-card .emd-r93-thumb-rail{gap:5px!important;padding:1px 0 4px!important}
#drawer.r1157-active .r79-media-card .emd-r93-thumb{flex:0 0 50px!important;width:50px!important;height:46px!important;min-width:50px!important;padding:2px!important;border:1px solid var(--r1155-line)!important;box-shadow:none!important}
#drawer.r1157-active .r79-media-card .emd-r93-thumb.selected{border-color:var(--r1155-accent)!important;box-shadow:inset 0 0 0 1px var(--r1155-accent)!important}
/* Exact layout polish based on motor/bearing field QA: no blank full-height spec
   card and no merged label/value text in stock widgets. */
#drawer.r1157-active .r1157-media-details,
#drawer.r1157-active .r1156-group-overview>.r79-bearing-top{align-items:start!important}
#drawer.r1157-active .r1156-stock-fields .r79-tech-grid>*,
#drawer.r1157-active .r1156-group .r1156-stock-fields .r79-tech-grid>*{
 display:flex!important;flex-direction:column!important;align-items:flex-start!important;
 gap:5px!important;min-height:47px!important;word-break:break-word!important;
}
#drawer.r1157-active .r1156-stock-fields .r79-tech-grid>* :is(small,span){display:block!important;font-size:10px!important;line-height:1.25!important;color:var(--r1155-muted)!important}
#drawer.r1157-active .r1156-stock-fields .r79-tech-grid>* :is(strong,b){display:block!important;font-size:13px!important;line-height:1.25!important;color:var(--r1155-text)!important}
#drawer.r1157-active .r1157-media-details:not(:has(.r1157-photo-card)){grid-template-columns:1fr!important}
