/* KEDA Frontend Enhancements 1.2.0. All overrides require the opt-in body class. */
body.kfe-active { --kfe-blue:#004ea2; --kfe-ink:#10263d; --kfe-muted:#526579; --kfe-pale:#f2f4f6; --kfe-line:#dce3eb; --kfe-anchor-offset:148px; }
body.kfe-active :is(.keda-home,.keda-contact,.keda-solutions,.keda-about,.keda-catalog) { line-height:1.6; }
body.kfe-active :is(.keda-section,.keda-enquiry,.keda-home[id],.kc-section[id],.keda-section-nav~section,[id="product-enquiry"],[id="technical-parameters"],[id="usage-instructions"],[id="tips-limitations"],[id="application-packaging"]) { scroll-margin-top:var(--kfe-anchor-offset); }
body.kfe-active :is(.keda-section h2,.keda-article h2,.ka-content h2,.ka-content h3,.keda-article-content h2,.keda-article-content h3) { scroll-margin-top:var(--kfe-anchor-offset); }
body.kfe-active .kb-post-body :is(h2,h3,h4,h5,h6) { scroll-margin-top:var(--kfe-anchor-offset); }

/* Retain native TranslatePress URLs and remove the floating UI only after its replacement exists. */
body.kfe-active:has(.kfe-language) :is(.trp-floating-switcher,#trp-floater-ls) { display:none!important; }
body.kfe-active .kfe-language { position:relative; flex:none; color:#fff; }
body.kfe-active .kfe-language summary { display:flex; align-items:center; justify-content:center; gap:8px; min-width:60px; min-height:44px; padding:10px; border:1px solid #ffffff80; list-style:none; cursor:pointer; font-size:13px; font-weight:700; line-height:1.2; }
body.kfe-active .kfe-language summary::-webkit-details-marker { display:none; }
body.kfe-active .kfe-chevron { width:7px; height:7px; border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); margin-top:-4px; }
body.kfe-active .kfe-language[open] .kfe-chevron { transform:rotate(225deg); margin-top:3px; }
body.kfe-active .kfe-language nav { position:absolute; inset-inline-end:0; top:calc(100% + 10px); z-index:60; display:grid; width:204px; max-height:min(440px,70vh); overflow:auto; padding:8px; background:#fff; border:1px solid var(--kfe-line); box-shadow:0 12px 28px #10263d22; }
body.kfe-active .kfe-language nav a { display:flex; align-items:center; min-height:44px; padding:10px 12px; color:#10263d!important; font-size:14px!important; line-height:1.4; white-space:normal; }
body.kfe-active .kfe-language nav a:hover,body.kfe-active .kfe-language nav a[aria-current] { background:var(--kfe-pale); color:var(--kfe-blue)!important; }
body.kfe-active .kfe-language :is(summary,a):focus-visible { outline:3px solid #76a9dd; outline-offset:3px; }
body.kfe-active .ks-header-actions { gap:10px; }
body.kfe-active .ks-header-row { grid-template-columns:114px minmax(0,1fr) auto; gap:18px; }
body.kfe-active .ks-menu { gap:20px; }
body.kfe-active .ks-header :is(.ks-inquire,.ks-search>summary,.ks-menu-toggle,.ks-products>summary) { min-height:44px; }
body.kfe-active .ks-header :is(.ks-search>summary,.ks-menu-toggle,.ks-products>summary) { min-width:44px; }
body.kfe-active .ks-header .ks-product-links a { min-height:44px; display:flex; align-items:center; }

/* One arrow shape, no icon tile, predictable alignment. */
body.kfe-active .kfe-arrow { display:inline-flex!important; align-items:center; justify-content:center; flex:0 0 auto!important; align-self:center; width:auto!important; height:auto!important; min-width:0!important; min-height:0!important; padding:0!important; margin:0!important; color:inherit!important; background:none!important; border:0!important; border-radius:0!important; box-shadow:none!important; font-family:Arial,Helvetica,sans-serif!important; font-size:20px!important; line-height:1!important; transform:none; transition:transform .16s ease; }
body.kfe-active :is(.kh-btn,.kh-card-link,.kc-btn,.ksol-btn,.ka-btn,.keda-button,.keda-card-view,.kc-focus-action) { align-items:center; gap:14px; }
body.kfe-active :is(.kh-btn,.kc-btn,.ksol-btn,.ka-btn,.keda-button,.keda-card-view,.kc-focus-action)>.kfe-arrow { margin-inline-start:auto!important; }
body.kfe-active :is(a,button):hover>.kfe-arrow,body.kfe-active a:hover .kh-card-link>.kfe-arrow { transform:translateX(2px); }
body.kfe-active .kh-range-jump { gap:12px!important; min-height:44px; font-size:13px!important; }
body.kfe-active .kh-range-jump>.kfe-arrow { transform:rotate(90deg); }
body.kfe-active :is(.kh-text-link,.kc-inline-link,.keda-card-view,.keda-section-nav a,.keda-catalog-pagination>a,.kbl-pagination a,.ka-pagination a,.keda-catalog-button,.kc-btn,.kh-btn,.keda-button) { min-height:44px; }
body.kfe-active :is(.keda-catalog-pagination>a,.kbl-pagination a) { min-width:44px; }
body.kfe-active :is(.kc-faq,.kh-faq-list,.ka-faq,.ksol-faq,.kfab-faq) summary { min-height:48px; display:flex; align-items:center; }
body.kfe-active .ks-footer a { padding-block:4px; }

/* Existing 16:9 blog covers must retain titles at both edges. */
body.kfe-active #keda-home-guides .kh-guide-image { aspect-ratio:16/9; height:auto; min-height:0; }
body.kfe-active #keda-home-guides .kh-guide-image img { width:100%; height:100%; object-fit:contain; }

/* Hero: authentic facility photo plus the existing core product packs. */
body.kfe-active .kh-hero-visual.kfe-scene-layout { padding:0 0 68px; border-top:0; }
body.kfe-active .kfe-hero-scene { position:relative; margin:0; aspect-ratio:4/3; overflow:hidden; background:var(--kfe-pale); }
body.kfe-active .kfe-hero-scene img { display:block; width:100%!important; height:100%!important; object-fit:cover!important; }
body.kfe-active .kfe-hero-scene figcaption { position:absolute; inset-inline-start:16px; top:16px; padding:9px 12px; background:#082c50e8; color:#fff; font-size:12px; line-height:1.4; max-width:calc(100% - 32px); }
body.kfe-active .kfe-scene-layout .kh-visual-top { display:none; }
body.kfe-active .kfe-scene-layout .kh-visual-line { display:none; }
body.kfe-active .kfe-scene-layout .kh-hero-products { position:absolute; inset-inline-end:16px; bottom:0; width:79%; display:grid; grid-template-columns:1fr 1fr; align-items:end; gap:12px; min-height:0; padding:15px 16px 14px; border:1px solid var(--kfe-line); background:#fff; box-shadow:0 8px 22px #10263d0d; }
body.kfe-active .kfe-scene-layout .kh-hero-products img { height:162px!important; width:100%; object-fit:contain!important; }
body.kfe-active .kfe-scene-layout .kh-hero-label { font-size:12px; line-height:1.4; margin-top:7px; }
body.kfe-active .kfe-scene-layout .kh-visual-bottom { display:none; }

/* Improve small labels without changing product names, figures or claims. */
body.kfe-active .keda-home :is(.kh-index,.kh-hero-label,.kh-feature-number,.kh-fact-label,.kh-fact-note,.kh-visual-bottom) { color:var(--kfe-muted); font-size:12px; }
body.kfe-active .keda-home :is(.kh-eyebrow,.kh-core-tag,.kh-guide-label,.kh-card-link) { font-size:12px; }
body.kfe-active .keda-catalog :is(.keda-card-category,.keda-card-values li,.kc-focus-task,.kc-step-number,.keda-card-model,.keda-catalog-eyebrow) { font-size:12px!important; color:var(--kfe-muted); }
body.kfe-active .keda-catalog .keda-catalog-enquiry .keda-catalog-eyebrow { color:#d8e8fc!important; }
body.kfe-active :is(.kc-eyebrow,.ksol-eyebrow,.kfab-eyebrow,.ka-eyebrow,.kbl-eyebrow,.ka-meta,.kbl-meta,.keda-eyebrow) { font-size:12px!important; }
body.kfe-active :is(.kb-meta,.kb-category,.kb-date,.kbl-post-meta,.ka-fact-label,.ka-fact-note) { font-size:12px!important; }

/* Three spacing levels and two neutral surfaces. */
body.kfe-active.kfe-editorial .keda-home { --kh-pale:#f2f4f6; --kh-muted:#526579; }
body.kfe-active.kfe-editorial .keda-home h1 { font-size:clamp(34px,3.6vw,54px); line-height:1.08; letter-spacing:-.045em; }
body.kfe-active.kfe-editorial .keda-home h2 { font-size:clamp(28px,2.7vw,40px); line-height:1.15; letter-spacing:-.035em; }
body.kfe-active.kfe-editorial .keda-home .kh-hero-intro { font-size:17px; line-height:1.6; }
body.kfe-active.kfe-editorial .keda-home.kh-hero { padding-block:48px 58px; }
body.kfe-active.kfe-editorial .keda-home.kh-range { padding-block:56px 64px; }
body.kfe-active.kfe-editorial .keda-home.kh-core { padding-block:80px; }
body.kfe-active.kfe-editorial .keda-home.kh-applications { padding-block:64px; }
body.kfe-active.kfe-editorial #keda-home-company { padding-block:112px; }
body.kfe-active.kfe-editorial .keda-home.kh-guides { padding-block:64px; }
body.kfe-active.kfe-editorial .keda-home.kh-partnership { padding-block:80px; }
body.kfe-active.kfe-editorial .keda-home.kh-faq { padding-block:48px 64px; }
body.kfe-active.kfe-editorial .kh-fact-grid { padding-block:17px; }
body.kfe-active.kfe-editorial .kh-fact { display:grid; grid-template-columns:auto 1fr; gap:2px 14px; align-items:center; }
body.kfe-active.kfe-editorial .kh-fact strong { grid-column:1; grid-row:1/3; font-size:25px; margin:0; }
body.kfe-active.kfe-editorial .kh-fact-label { grid-column:2; grid-row:1; letter-spacing:0; }
body.kfe-active.kfe-editorial .kh-fact-note { grid-column:2; grid-row:2; }
body.kfe-active.kfe-editorial #keda-home-applications .kh-section-head { display:block; max-width:790px; }
body.kfe-active.kfe-editorial #keda-home-applications .kh-head-aside { margin-top:20px; max-width:640px; }
body.kfe-active.kfe-editorial #keda-home-applications .kh-head-aside .kh-text-link { margin-top:12px; }
body.kfe-active.kfe-editorial #keda-home-guides .kh-section-head { display:grid; grid-template-columns:1fr; justify-items:center; text-align:center; gap:18px; margin-bottom:32px; }
body.kfe-active.kfe-editorial #keda-home-guides .kh-head-aside { max-width:550px; }
body.kfe-active.kfe-editorial .kh-range-card { padding:20px 22px 24px; }
body.kfe-active.kfe-editorial .kh-range-image { height:auto; aspect-ratio:4/3; padding:14px 0 18px; background:#fff; align-items:flex-end; }
body.kfe-active.kfe-editorial .kh-range-image img { height:100%; max-height:240px; object-position:center bottom; }
body.kfe-active.kfe-editorial .kh-range-image-epoxy img { width:100%; }
body.kfe-active.kfe-editorial .kh-card-copy .kfe-pack-caption { font-size:12px; line-height:1.5; color:var(--kfe-muted); margin:0 0 9px; }
body.kfe-active.kfe-editorial .kh-card-copy p:not(.kfe-pack-caption) { font-size:14px; line-height:1.6; }

/* Give the three catalog focus products the same image-led language as the main cards. */
body.kfe-active .keda-catalog .kc-focus-card.kfe-focus-with-image { padding:0 0 20px; border:1px solid var(--kfe-line); background:#fff; }
body.kfe-active .kfe-focus-media { aspect-ratio:4/3; display:flex; align-items:center; justify-content:center; background:var(--kfe-pale); padding:22px; margin-bottom:18px; border-bottom:1px solid var(--kfe-line); }
body.kfe-active .kfe-focus-media img { display:block; width:100%; height:100%; object-fit:contain; max-height:220px; }
body.kfe-active .kc-focus-card.kfe-focus-with-image>:not(.kfe-focus-media) { margin-inline:20px; }
body.kfe-active .keda-catalog .kc-focus-card.kfe-focus-with-image h3 { font-size:19px!important; margin-bottom:20px; }
body.kfe-active .keda-catalog .kc-focus-card:hover { background:#fff; border-color:var(--kfe-blue); }
body.kfe-active .keda-card-image-link { background:var(--kfe-pale); }
body.kfe-active :is(.kc-check-grid article,.kc-focus-card,.keda-catalog-empty) { background-color:var(--kfe-pale); }

@media(max-width:1180px) and (min-width:981px) {
 body.kfe-active .ks-header-row { grid-template-columns:100px minmax(0,1fr) auto; gap:12px; }
 body.kfe-active .ks-menu { gap:12px; }
 body.kfe-active .ks-header .ks-menu>li>a { font-size:13px!important; }
 body.kfe-active .ks-header .ks-products>summary { min-width:28px; }
 body.kfe-active .ks-header .ks-inquire { padding-inline:13px; }
}
@media(max-width:980px) {
 body.kfe-active .ks-header-row { grid-template-columns:minmax(80px,1fr) auto 44px; }
 body.kfe-active .ks-header .ks-navigation>nav { max-height:calc(100dvh - 100px); overflow-y:auto; }
 body.kfe-active .ks-header .ks-menu>li>a { min-height:48px; padding-block:13px!important; }
 body.kfe-active .ks-header .ks-products { min-width:44px; }
 body.kfe-active.kfe-editorial #keda-home-company { padding-block:80px; }
 body.kfe-active.kfe-editorial .kh-fact { display:flex; flex-direction:column; align-items:flex-start; gap:3px; }
 body.kfe-active.kfe-editorial .kh-fact strong { order:-1; }
 body.kfe-active .kh-hero-visual.kfe-scene-layout { max-width:620px; width:100%; margin-inline:auto; }
}
@media(max-width:767px) {
 body.kfe-active :is(.keda-home,.keda-contact,.keda-solutions,.keda-about,.keda-catalog) { font-size:16px; }
 body.kfe-active .keda-home .kh-wrap { width:calc(100% - 40px); }
 body.kfe-active.kfe-editorial .keda-home.kh-hero { padding-block:36px 42px; }
 body.kfe-active.kfe-editorial .keda-home h1 { font-size:clamp(32px,8.7vw,40px); letter-spacing:-.035em; }
 body.kfe-active.kfe-editorial .keda-home h2 { font-size:30px; }
 body.kfe-active.kfe-editorial .keda-home .kh-hero-intro { font-size:16px; }
 body.kfe-active.kfe-editorial :is(.keda-home.kh-range,.keda-home.kh-applications,.keda-home.kh-guides,.keda-home.kh-core,.keda-home.kh-partnership,.keda-home.kh-faq) { padding-block:48px; }
 body.kfe-active.kfe-editorial #keda-home-company { padding-block:64px; }
 body.kfe-active .kh-hero-visual.kfe-scene-layout { padding-bottom:54px; }
 body.kfe-active .kfe-scene-layout .kh-hero-products { width:88%; inset-inline-end:0; gap:8px; padding:12px; }
 body.kfe-active .kfe-scene-layout .kh-hero-products img { height:124px!important; }
 body.kfe-active .kfe-scene-layout .kh-hero-label { font-size:12px; }
 body.kfe-active .kfe-hero-scene figcaption { top:12px; inset-inline-start:12px; font-size:12px; padding:7px 12px; }
 body.kfe-active .kfe-scene-layout .kh-visual-top { inset-inline-start:12px; top:12px; padding:7px 10px; font-size:12px; }
 body.kfe-active.kfe-editorial .kh-fact-grid { gap:15px; padding-block:18px; }
 body.kfe-active.kfe-editorial .kh-fact { padding-inline:15px; }
 body.kfe-active.kfe-editorial .kh-fact strong { font-size:23px; }
 body.kfe-active .keda-section-nav { scroll-padding-inline:16px; }
 body.kfe-active .keda-section-nav a { display:inline-flex; align-items:center; }
 body.kfe-active .ks-footer a { display:inline-flex; align-items:center; min-height:44px; }
}
@media(max-width:600px) {
 body.kfe-active .ks-header-row { padding:8px 16px; gap:8px; grid-template-columns:minmax(64px,1fr) auto 44px; }
 body.kfe-active .keda-shell .ks-brand { width:76px; }
 body.kfe-active .keda-shell .ks-brand img { width:76px!important; height:48px!important; }
 body.kfe-active .ks-header-actions { gap:6px; }
 body.kfe-active .ks-header .ks-inquire { min-height:44px; padding:10px; font-size:12px!important; }
 body.kfe-active .kfe-language summary { min-width:48px; padding:8px; gap:5px; }
 body.kfe-active .kfe-language nav { inset-inline-end:-46px; }
 body.kfe-active .ks-header .ks-search>summary,body.kfe-active .ks-navigation>.ks-menu-toggle { width:44px; height:44px; }
 body.kfe-active.kfe-editorial .kh-fact-grid { grid-template-columns:1fr; gap:0; }
 body.kfe-active.kfe-editorial .kh-fact { display:grid; grid-template-columns:minmax(140px,max-content) minmax(0,1fr); gap:0 12px; padding:9px 0; border-left:0; border-top:1px solid var(--kfe-line); }
 body.kfe-active.kfe-editorial .kh-fact:first-child { border-top:0; }
 body.kfe-active.kfe-editorial .kh-fact strong { grid-column:1; grid-row:1/3; font-size:22px; }
 body.kfe-active .keda-catalog .kc-focus-grid { grid-template-columns:1fr; }
 body.kfe-active .kfe-focus-media { aspect-ratio:4/3; max-height:250px; }
}
@media(prefers-reduced-motion:reduce) { body.kfe-active .kfe-arrow { transition:none!important; } }

/* 1.1.0: keep all package artwork inside its frame; tune visual weight with room to spare. */
body.kfe-active.kfe-editorial .kh-manufacturing { background:var(--kfe-pale); }
body.kfe-active.kfe-editorial .kh-range-image { --kfe-pack-size:92%; overflow:hidden; }
body.kfe-active.kfe-editorial .kh-range-image-marble { --kfe-pack-size:88%; }
body.kfe-active.kfe-editorial .kh-range-image-epoxy { --kfe-pack-size:96%; }
body.kfe-active.kfe-editorial :is(.kh-range-image-silicone,.kh-range-image-foam) { --kfe-pack-size:100%; }
body.kfe-active.kfe-editorial .kh-range-image-tile { --kfe-pack-size:90%; }
body.kfe-active.kfe-editorial .kh-range-image img { width:var(--kfe-pack-size); height:var(--kfe-pack-size); max-width:100%; max-height:100%; object-fit:contain; object-position:center bottom; transform:none; }
body.kfe-active.kfe-editorial .kh-feature-media { padding:58px 32px 28px; }
body.kfe-active.kfe-editorial .kh-feature-media img { width:100%; height:clamp(280px,27vw,372px); object-fit:contain; transform:none; }
body.kfe-active.kfe-editorial .kh-feature-number { inset:18px auto auto 20px; max-width:calc(100% - 40px); padding:6px 10px; background:var(--kfe-pale); color:var(--kfe-muted); line-height:1.4; letter-spacing:.06em; }
@media(max-width:767px) {
 body.kfe-active.kfe-editorial .kh-feature-media { padding:54px 22px 24px; min-height:0; }
 body.kfe-active.kfe-editorial .kh-feature-media img { height:clamp(210px,60vw,280px); }
 body.kfe-active.kfe-editorial .kh-feature-number { inset-inline-start:16px; max-width:calc(100% - 32px); font-size:11px; }
}
@media(max-width:600px) {
 body.kfe-active.kfe-editorial .kh-range-grid { grid-template-columns:minmax(0,1fr); gap:16px; }
 body.kfe-active.kfe-editorial .kh-range-image { height:auto; aspect-ratio:4/3; max-height:290px; }
 body.kfe-active .ks-header-row { padding-inline:14px; gap:8px; }
 body.kfe-active .kfe-language summary { min-width:48px; min-height:44px; }
 body.kfe-active .ks-header :is(.ks-search>summary,.ks-menu-toggle) { width:44px; height:44px; min-width:44px; min-height:44px; }
}
/* Compact screens keep each control tappable, with space taken from the logo and gaps. */
@media(max-width:359px) {
 body.kfe-active .ks-header-row { grid-template-columns:minmax(48px,1fr) auto 44px; padding-inline:10px; gap:5px; }
 body.kfe-active .ks-header-actions { gap:4px; }
 body.kfe-active .keda-shell .ks-brand { width:60px; }
 body.kfe-active .keda-shell .ks-brand img { width:60px!important; height:40px!important; }
 body.kfe-active .ks-header .ks-inquire { padding-inline:7px; font-size:11px!important; }
}

/* 1.2.0: desktop navigation stays visible even before its script runs.
   On mobile, the closed native <details> is immediately usable without JavaScript. */
@media(min-width:981px) {
 body.kfe-active.kfe-performance .kfe-navigation::details-content { display:block; content-visibility:visible; }
}
@supports not selector(::details-content) {
 @media(min-width:981px) {
  body.kfe-active.kfe-performance .kfe-navigation:not([open])>.ks-menu-toggle { display:grid; place-items:center; width:44px; height:44px; }
 }
}
