/* CPGCBL EMD R11.2 - Three deliberately distinct industrial themes.
   Shared geometry, consistent text contrast, clearer focus and compact densities.
   Existing modal, table and drawer functionality is untouched. */
body.r107-ui{--emd-radius:11px;--emd-speed:150ms;--emd-ease:cubic-bezier(.2,.7,.24,1)}
/* A / Precision white: bright data surfaces, ink navy, teal instruments. */
body.r107-ui[data-theme="light"]{
 --bg:#f0f4f6!important;--panel:#ffffff!important;--panel2:#f7fafb!important;--panel3:#e6f1f4!important;
 --side:#112b3a!important;--line:#d1dfe5!important;--text:#152d3b!important;--muted:#506b79!important;
 --accent:#047d82!important;--accent2:#166caa!important;--r109-side:#102936!important;--r109-side2:#1b4351!important;
 --r109-hero:#ffffff!important;--shadow:0 2px 12px #0a344014!important;
 --emd-hero-art:#c7e9e9;--emd-highlight:#e7f5f4;--emd-focus:#0d939a;
}
/* B / Midnight plant: deep blue instrumentation with restrained electric cyan. */
body.r107-ui[data-theme="dark"]{
 --bg:#071420!important;--panel:#132b3a!important;--panel2:#1b3547!important;--panel3:#27485c!important;
 --side:#06131f!important;--line:#38566a!important;--text:#eff8ff!important;--muted:#b6cad8!important;
 --accent:#51ddd4!important;--accent2:#8fc9ff!important;--r109-side:#061421!important;--r109-side2:#10283a!important;
 --r109-hero:#132b3a!important;--shadow:0 7px 23px #00000045!important;
 --emd-hero-art:#196d76;--emd-highlight:#193b4b;--emd-focus:#65e5df;
}
/* C / Mineral graphite: neutral graphite paneling, warm copper accent, deep ink. */
body.r107-ui[data-theme="hybrid"]{
 --bg:#e7e9e8!important;--panel:#fbfcfa!important;--panel2:#f0f2ef!important;--panel3:#e2e8e7!important;
 --side:#27373b!important;--line:#c6d4d3!important;--text:#25383a!important;--muted:#546c70!important;
 --accent:#0c747a!important;--accent2:#97622f!important;--r109-side:#24383d!important;--r109-side2:#394e50!important;
 --r109-hero:#fbfcfa!important;--shadow:0 3px 15px #153a3520!important;
 --emd-hero-art:#c7d1c9;--emd-highlight:#eef4ed;--emd-focus:#1c7f7e;
}
body.r107-ui .main{background:var(--bg)!important}
body.r107-ui .top{background:var(--panel)!important;color:var(--text)!important;border-bottom:1px solid var(--line)!important;box-shadow:0 2px 10px #00223908!important}
body.r107-ui .top :is(.title,small,b,span){color:inherit}
body.r107-ui .top .title{font-weight:830!important;letter-spacing:-.025em!important}
body.r107-ui .side{background:linear-gradient(160deg,var(--r109-side),var(--r109-side2))!important}
body.r107-ui .side .navbtn.active{background:color-mix(in srgb,var(--accent) 23%,transparent)!important;border-left-color:var(--accent)!important;color:#fff!important}
body.r107-ui[data-theme="hybrid"] .side .navbtn.active{border-left-color:#e2b37e!important}
body.r107-ui #content{background:transparent!important}
body.r107-ui #content :is(.r5-hero,.r4-hero,.daily-hero){
 background:linear-gradient(110deg,var(--panel) 0%,var(--panel) 69%,var(--emd-highlight) 100%)!important;
 border:1px solid var(--line)!important;box-shadow:var(--shadow)!important;border-radius:var(--emd-radius)!important;
 padding:12px 16px!important;min-height:83px!important;margin-bottom:10px!important;
}
body.r107-ui[data-theme="dark"] #content :is(.r5-hero,.r4-hero,.daily-hero){background:linear-gradient(105deg,#102535 0%,#172f42 65%,#1d5260 100%)!important}
body.r107-ui[data-theme="hybrid"] #content :is(.r5-hero,.r4-hero,.daily-hero){background:linear-gradient(103deg,#fafbf9 0%,#f5f8f4 62%,#e6eee6 100%)!important}
body.r107-ui #content :is(.r5-hero,.r4-hero,.daily-hero)::before{width:3px!important;background:linear-gradient(180deg,var(--accent2),var(--accent))!important}
body.r107-ui #content :is(.r5-hero h1,.r4-hero h1,.daily-hero h1){font-size:clamp(21px,1.85vw,26px)!important;letter-spacing:-.025em!important;color:var(--text)!important}
body.r107-ui #content :is(.r5-kpi,.r4-kpi,.parity-kpi,.kpi){
 background:var(--panel)!important;border:1px solid var(--line)!important;color:var(--text)!important;
 min-height:67px!important;border-radius:9px!important;padding:8px 10px!important;box-shadow:0 2px 9px #1027380b!important;
}
body.r107-ui #content :is(.r5-kpi,.r4-kpi,.parity-kpi,.kpi)::before{height:2px!important;background:linear-gradient(90deg,var(--accent),var(--accent2))!important}
body.r107-ui[data-theme="dark"] #content :is(.r5-kpi,.r4-kpi,.parity-kpi,.kpi)::before{height:2px!important;background:linear-gradient(90deg,#35c7bd,#58a9d4)!important}
body.r107-ui #content :is(.r5-kpi,.parity-kpi,.kpi) :is(.num,b){font-size:clamp(18px,1.5vw,24px)!important;line-height:1.12!important;color:var(--text)!important}
body.r107-ui #content :is(.r5-card,.r79-panel-card,.card){
 background:var(--panel)!important;border:1px solid var(--line)!important;border-radius:10px!important;
 box-shadow:0 2px 9px #102e350d!important;color:var(--text)!important;
}
body.r107-ui #content :is(.r5-tabs,.r4-tabs,.modules,.tabs,.r5-filter,.r4-filterbar,.toolbar,.work-toolbar){
 background:var(--panel)!important;border:1px solid var(--line)!important;border-radius:9px!important;
 box-shadow:0 2px 7px #16293d09!important;margin-bottom:7px!important;
}
body.r107-ui #content :is(.r5-tabs,.r4-tabs,.modules,.tabs) .active{
 background:var(--panel3)!important;color:var(--text)!important;box-shadow:inset 0 -2px 0 var(--accent)!important;
}
body.r107-ui #content :is(.r5-table,.table) thead th{background:var(--panel3)!important;color:var(--text)!important;font-weight:740!important;font-size:10.5px!important;}
body.r107-ui #content :is(.r5-table,.table) td{font-size:12px!important;line-height:1.38!important;color:var(--text)!important}
body.r107-ui #content :is(.r5-table,.table) tbody tr:hover td{background:color-mix(in srgb,var(--accent) 9%,var(--panel))!important}
body.r107-ui[data-theme="dark"] #content :is(.r5-table,.table) tbody tr:nth-child(even) td{background:#193344!important}
body.r107-ui :is(.btn,button):focus-visible,.r112-editor:focus-visible{outline:2px solid var(--emd-focus)!important;outline-offset:2px!important}
body.r107-ui #content :is(.btn.primary,.btn.good){background:var(--accent)!important;border-color:var(--accent)!important;color:#fff!important}
body.r107-ui[data-theme="dark"] #content :is(.btn.primary,.btn.good){color:#08232e!important}
body.r107-ui[data-theme="hybrid"] #content :is(.btn.primary,.btn.good){color:#fff!important}
body.r107-ui .drawer{background:#071e2b99!important;backdrop-filter:blur(8px)!important}
body.r107-ui .drawerpanel{background:var(--bg)!important;box-shadow:-16px 0 42px #0002!important}
body.r107-ui .drawerhead{background:var(--panel)!important;border-bottom:1px solid var(--line)!important}
body.r107-ui .drawerbody{background:var(--bg)!important}
body.r107-ui .drawerbody :is(.r5-drawer-section,.card,.r79-media-card,.r79-spec-card){background:var(--panel)!important;border:1px solid var(--line)!important;border-radius:9px!important}
body.r107-ui .drawerbody :is(.r5-detail,.tech-field,.detail){background:var(--panel2)!important;border-color:color-mix(in srgb,var(--line) 63%,transparent)!important;color:var(--text)!important}
body.r107-ui .drawerbody :is(.r5-detail,.tech-field,.detail) :is(b,strong){font-size:12px!important}
/* Search control is a non-credential editor; preserve focus, selection and input state. */
body.r107-ui .r112-search{position:relative!important;isolation:isolate!important;min-width:180px!important}
body.r107-ui .r112-search .r112-editor{
 min-height:36px!important;max-height:76px!important;display:block!important;padding:8px 11px!important;
 color:var(--text)!important;background:var(--panel2)!important;border:1px solid var(--line)!important;
 font-family:inherit!important;font-size:12.6px!important;line-height:19px!important;box-sizing:border-box!important;
 box-shadow:inset 0 1px 1px #00000005!important;overflow-x:auto!important;white-space:pre!important;border-radius:8px!important;
}
body.r107-ui .r112-search .r112-editor:focus{border-color:var(--accent)!important;box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)!important}
body.r107-ui .r112-search .r112-editor:empty::before{content:attr(data-placeholder);opacity:.82;color:var(--muted)!important}
/* In a toolbar, avoid pushing adjacent filter widgets offscreen. */
body.r107-ui #content .toolbar .r112-search{flex:1 1 330px!important;max-width:100%!important}
body.r107-ui #content .work-toolbar .r112-search{grid-column:span 3!important}
body.r107-ui .drawerbody .r79-tech-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
body.r107-ui #themeGrid .theme-choice{border-radius:12px!important;border:1px solid var(--line)!important;background:var(--panel2)!important;color:var(--text)!important;box-shadow:none!important}
body.r107-ui #themeGrid .theme-choice.active{outline:2px solid var(--accent)!important;outline-offset:1px!important}
body.r107-ui #themeGrid .theme-preview{height:54px!important;border-radius:8px!important}
body.r107-ui :is(.r5-card,.card,.drawerpanel,.theme-choice){transition:border-color var(--emd-speed) var(--emd-ease),background-color var(--emd-speed) var(--emd-ease),box-shadow var(--emd-speed) var(--emd-ease)!important}
@media(max-width:820px){body.r107-ui #content{padding:8px 8px 20px!important}body.r107-ui #content :is(.r5-hero,.r4-hero,.daily-hero){padding:10px 12px!important}body.r107-ui #content :is(.r5-kpis,.r79-bearing-kpis){gap:6px!important}body.r107-ui .r112-search{min-width:0!important}}
@media(prefers-reduced-motion:reduce){body.r107-ui :is(.r5-card,.card,.drawerpanel,.theme-choice){transition:none!important}}
/* Companion Work Form: follows A/B/C saved theme without changing its maximum width. */
body[data-theme="light"] #wfApp{--wf-bg:#f0f4f6;--wf-panel:#fff;--wf-panel2:#f7fafb;--wf-border:#d1dfe5;--wf-text:#152d3b;--wf-accent:#047d82}
body[data-theme="dark"] #wfApp{--wf-bg:#071420;--wf-panel:#132b3a;--wf-panel2:#1b3547;--wf-border:#38566a;--wf-text:#eff8ff;--wf-accent:#51ddd4}
body[data-theme="hybrid"] #wfApp{--wf-bg:#e7e9e8;--wf-panel:#fbfcfa;--wf-panel2:#f0f2ef;--wf-border:#c6d4d3;--wf-text:#25383a;--wf-accent:#0c747a}
body[data-theme] #wfApp :is(.panel-shell,.command-row,.v9-toolbar,.v9-detail,.work-card){border-radius:9px!important;border-color:var(--wf-border)!important;box-shadow:0 2px 9px #10273810!important}
body[data-theme] #wfApp :is(.panel-shell,.command-row){padding:8px 10px!important}
body[data-theme] #wfApp :is(.v9-toolbar,.r96-tools) .r112-search{min-width:160px;max-width:100%}
body[data-theme] #wfApp .r112-search .r112-editor{background:var(--wf-panel)!important;color:var(--wf-text)!important;border:1px solid var(--wf-border)!important;border-radius:8px!important;padding:8px 10px!important;min-height:34px!important;font-size:12.5px!important;white-space:pre!important;overflow-x:auto!important;outline:0!important}
body[data-theme] #wfApp .r112-search .r112-editor:focus{border-color:var(--wf-accent)!important;box-shadow:0 0 0 2px color-mix(in srgb,var(--wf-accent) 14%,transparent)!important}
body[data-theme] #wfApp .r112-search .r112-editor:empty::before{content:attr(data-placeholder);color:#667987;opacity:.8}
