.divi-visualiser-section{
  margin:0;
  background:#efefef;
  font-family:Arial,Helvetica,sans-serif;
}
.svg-visualiser-wrap{
  width:90%;
  max-width:100%;
  margin:20px auto;
  display:grid;
  grid-template-columns:60% 40%;
  gap:0;
  background:#fff;
  border:1px solid #5d8b2f;
  border-radius:14px;
  overflow:hidden;
  min-height:88vh;
}
.left-preview-column{
  position:relative;
  background:#f8f8f8;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  overflow:hidden;
  padding:18px;
  box-sizing:border-box;
}
.preview-panel{
  width:100%;
  flex:1;
  min-height:0;
  display:flex;
  align-items:center;
  justify-content:center;
}
#exactVisualiserSvg{
  width:100%;
  height:auto;
  max-height:100%;
  display:block;
}
.control-buttons{
  margin-top:16px;
  display:flex;
  flex-direction:row;
  gap:12px;
  justify-content:center;
  align-items:center;
  z-index:10;
}
.control-buttons button{
  width:52px;
  height:52px;
  border-radius:10px;
  border:0;
  background:#fff7db;
  cursor:pointer;
  font-size:18px;
  font-weight:700;
  box-shadow:0 2px 6px rgba(0,0,0,.18);
}
.right-options-layout{
  display:grid;
  grid-template-columns:220px 1fr;
  min-height:100%;
}
.options-sidebar{
  border-right:1px solid #ddd;
  background:#fafafa;
}
.sidebar-tab{
  width:100%;
  border:0;
  border-bottom:1px solid #ececec;
  background:transparent;
  padding:22px 14px;
  text-align:left;
  font-size:18px;
  font-weight:700;
  cursor:pointer;
}
.sidebar-tab.active{
  background:linear-gradient(#f4e89d,#d8bf4f);
}
.options-content{
  padding:18px 24px;
  overflow-y:auto;
  max-height:88vh;
}
.option-panel{
  display:none;
}
.option-panel.active{
  display:block;
}
.option-panel h3{
  font-size:20px;
  margin:0 0 18px;
  text-transform:uppercase;
}
.wall-type-buttons{
  display:flex;
  gap:18px;
  margin-bottom:20px;
}
.wallTypeBtn{
  width:140px;
  height:42px;
  border-radius:4px;
  border:1px solid #b9a552;
  cursor:pointer;
  font-weight:700;
  background:#f4f0d2;
}
.wallTypeBtn.active{
  outline:3px solid #111;
}
.swatches{
  display:grid;
  grid-template-columns:repeat(4,minmax(90px,1fr));
  gap:14px 18px;
}
.swatch-item{
  text-align:center;
}
.swatches button{
  width:100%;
  height:34px;
  border-radius:4px;
  border:1px solid #b9a552;
  cursor:pointer;
  position:relative;
}
.swatches button.active::after{
  content:"";
  position:absolute;
  top:4px;
  right:4px;
  width:8px;
  height:8px;
  background:red;
  border:2px solid #fff;
  border-radius:50%;
}
.swatch-label{
  margin-top:8px;
  font-size:14px;
}
@media(max-width:1100px){
  .svg-visualiser-wrap{
    grid-template-columns:1fr;
  }
  .right-options-layout{
    grid-template-columns:1fr;
  }
  .options-sidebar{
    display:flex;
    overflow:auto;
  }
  .sidebar-tab{
    white-space:nowrap;
    min-width:170px;
  }
}

#roofTint{
  mix-blend-mode:normal !important;
  opacity:1 !important;
  filter:none !important;
}
#fasciaTint{
  mix-blend-mode:normal !important;
  opacity:1 !important;
}
#wallTint{
  mix-blend-mode:color;
  opacity:.88;
}
#wallTintShade{
  mix-blend-mode:multiply;
  opacity:.16;
  pointer-events:none;
}
.partTint.light{
  mix-blend-mode:multiply;
  opacity:.42;
}
.partTint.dark{
  mix-blend-mode:multiply;
  opacity:.72;
}
#curtainGroup{
  transition:none;
}
.options-grid{
  margin-top:18px;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
}
.option-box{
  border:1px solid #e0e0e0;
  border-radius:8px;
  padding:12px;
  background:#fff;
}
.option-box h3{
  font-size:13px;
  margin:0 0 10px;
  text-transform:uppercase;
}
.swatches{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.swatches button{
  width:38px;
  height:28px;
  border-radius:4px;
  border:1px solid #b9b9b9;
  cursor:pointer;
  position:relative;
}
.swatches button.active::after{
  content:"✓";
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#111;
  font-weight:700;
  background:rgba(255,255,255,.55);
}
@media(max-width:900px){
  .options-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}
#roofTint{opacity:1 !important; mix-blend-mode:normal !important;}
#roofReferenceTexture{mix-blend-mode:multiply !important;opacity:.62 !important;}
#fasciaTint{opacity:1 !important; mix-blend-mode:normal !important;}
#headboxTint{
  opacity:1 !important;
  mix-blend-mode:normal !important;
  filter:none !important;
}
#wallTint{opacity:.88 !important; mix-blend-mode:color;}
#bottomTint{opacity:.90 !important; mix-blend-mode:multiply;}

#headboxTint{
  opacity:1 !important;
  mix-blend-mode:normal !important;
  filter:none !important;
}
#headboxTint.light{
  opacity:1 !important;
}


#wallTint{
  opacity:1 !important;
  mix-blend-mode:normal !important;
}
#wallTintShade{
  display:none !important;
}


#curtainTwelveSlats{
  mix-blend-mode:normal !important;
}
#bottomTint{
  opacity:1 !important;
  mix-blend-mode:normal !important;
}


.wallTypeBtn{
  pointer-events:auto;
  border:1px solid #b9a552;
  background:#f7f2d8;
  border-radius:6px;
  padding:9px 12px;
  cursor:pointer;
  font-weight:700;
}
.wallTypeBtn.active{
  outline:3px solid #111;
}


.wallTypeBtn.active{
  outline:3px solid #111 !important;
  border-color:#111 !important;
  background:#fff7cc !important;
}

@media(max-width:560px){
  .options-grid{grid-template-columns:1fr;}
  .control-buttons button{padding:9px 14px;}
}

#headboxVisual{
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.18));
}

/* Responsive accordion tabs */
.mobile-accordion-panel{
  display:none;
}
@media(max-width:1100px){
  body{
    overflow:auto;
  }
  .svg-visualiser-wrap{
    width:96%;
    max-width:100%;
    margin:12px auto;
    display:grid;
    grid-template-columns:1fr;
    min-height:auto;
    border-radius:10px;
  }
  .left-preview-column{
    min-height:auto;
    padding:12px;
  }
  .preview-panel{
    min-height:360px;
  }
  #exactVisualiserSvg{
    width:100%;
    height:auto;
    max-height:none;
  }
  .right-options-layout{
    display:block;
    min-height:auto;
  }
  .options-sidebar{
    display:block;
    border-right:0;
    background:#fff;
  }
  .sidebar-tab{
    width:100%;
    min-width:0;
    display:block;
    border-bottom:1px solid #ddd;
    padding:16px 18px;
    position:relative;
    background:#fff;
  }
  .sidebar-tab::after{
    content:"+";
    position:absolute;
    right:18px;
    top:50%;
    transform:translateY(-50%);
    font-size:22px;
  }
  .sidebar-tab.active::after{
    content:"-";
  }
  .sidebar-tab.active{
    background:linear-gradient(#f4e89d,#d8bf4f);
  }
  .options-content{
    display:none;
  }
  .mobile-accordion-panel{
    display:none;
    padding:16px;
    border-bottom:1px solid #ddd;
    background:#fff;
  }
  .mobile-accordion-panel.active{
    display:block;
  }
  .mobile-accordion-panel h3{
    font-size:18px;
    margin:0 0 14px;
    text-transform:uppercase;
  }
  .swatches{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
  }
  .swatches button{
    width:100%;
    height:34px;
  }
  .wall-type-buttons{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }
  .wallTypeBtn{
    width:100%;
  }
}
@media(max-width:560px){
  .preview-panel{
    min-height:260px;
  }
  .control-buttons button{
    width:44px;
    height:44px;
  }
}

/* Brand heading above visualiser */
.visualiser-brand-header{
  grid-column:1 / -1;
  width:100%;
  display:grid;
  grid-template-columns:300px 1fr 300px;
  align-items:center;
  gap:20px;
  padding:22px 34px 24px;
  box-sizing:border-box;
  background:#fff;
  border-bottom:5px solid #2d5c1e;
}
.visualiser-brand-logo{
  width:250px;
  height:auto;
  max-height:128px;
  object-fit:contain;
  justify-self:start;
  flex:0 0 auto;
}
.visualiser-title-wrap{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.visualiser-brand-title{
  margin:0;
  color:#000;
  font-size:40px;
  line-height:1.08;
  font-weight:500;
  letter-spacing:1.5px;
  text-transform:uppercase;
  text-align:center;
}
.visualiser-title-line{
  display:block;
  width:82px;
  height:4px;
  background:#2d5c1e;
  margin-top:20px;
}
.visualiser-header-spacer{
  display:block;
}
.sidebar-tab{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:92px;
  padding:18px 18px;
  color:#111;
  text-transform:uppercase;
}
.sidebar-tab.active{
  background:#f7fbf2;
  box-shadow:inset 5px 0 0 #2d5c1e;
}
.sidebar-icon{
  width:34px;
  height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 34px;
}
.sidebar-icon svg{
  width:34px;
  height:34px;
  display:block;
}
@media(max-width:1100px){
  .visualiser-brand-header{
    grid-template-columns:1fr;
    gap:12px;
    padding:18px 16px 20px;
    text-align:center;
  }
  .visualiser-brand-logo{
    width:210px;
    max-height:110px;
    justify-self:center;
  }
  .visualiser-brand-title{
    font-size:34px;
  }
  .visualiser-header-spacer{
    display:none;
  }
  .sidebar-tab{
    flex-direction:row;
    min-height:0;
    padding:15px 18px;
  }
}
@media(max-width:560px){
  .visualiser-brand-logo{
    width:180px;
    max-height:95px;
  }
  .visualiser-brand-title{
    font-size:28px;
  }
  .visualiser-title-line{
    width:66px;
    height:3px;
    margin-top:14px;
  }
}



/* Refined right-column colour selector layout */
.right-options-layout{
  border:1px solid #9fbd91;
  border-radius:14px;
  overflow:hidden;
  background:#fff;
}
.options-sidebar{
  border-right:1px solid #cfd8c8 !important;
  background:#fff;
}
.options-content{
  border-left:0;
  padding:34px 44px 38px;
  background:#fff;
}
.option-panel h3{
  font-size:28px;
  line-height:1.15;
  font-weight:700;
  margin:0 0 24px;
  text-transform:uppercase;
  color:#111;
}
.option-panel h4,
.option-panel .colour-options-title{
  font-size:20px;
  line-height:1.2;
  font-weight:700;
  margin:28px 0 18px;
  color:#111;
}
.wall-type-buttons{
  display:grid;
  grid-template-columns:repeat(2,minmax(160px,1fr));
  gap:16px;
  max-width:440px;
  margin:0 0 32px;
}
.wallTypeBtn{
  height:50px;
  width:100%;
  border:1px solid #8aa57c !important;
  border-radius:7px !important;
  background:#fff !important;
  font-size:14px;
  font-weight:700;
  text-transform:uppercase;
  color:#111;
}
.wallTypeBtn.active{
  outline:none !important;
  border-color:#2d5c1e !important;
  box-shadow:0 0 0 1px #2d5c1e inset;
  background:#fbfff6 !important;
}
.swatches{
  display:grid !important;
  grid-template-columns:repeat(4,minmax(90px,1fr));
  gap:26px 34px !important;
  align-items:start;
  max-width:760px;
}
.swatch-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}
.swatches .swatch-item button{
  width:100% !important;
  max-width:108px;
  height:82px !important;
  border:1px solid #bdbdbd !important;
  border-radius:6px !important;
  cursor:pointer;
  box-shadow:inset 0 1px 1px rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.12);
  position:relative;
}
.swatches .swatch-item button.active{
  border-color:#2d5c1e !important;
  box-shadow:0 0 0 2px #2d5c1e, inset 0 1px 1px rgba(255,255,255,.55);
}
.swatches .swatch-item button.active::after{
  content:"✓" !important;
  position:absolute;
  right:7px;
  top:6px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:#fff;
  color:#2d5c1e;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:800;
  border:1px solid #2d5c1e;
}
.swatch-label{
  margin-top:10px;
  font-size:12px;
  line-height:1.15;
  font-weight:700;
  text-transform:uppercase;
  color:#111;
  min-height:28px;
}
@media(max-width:1100px){
  .right-options-layout{border-radius:10px;}
  .options-content{display:none;}
  .mobile-accordion-panel{padding:24px 20px;}
  .mobile-accordion-panel h3{font-size:22px;}
  .swatches{grid-template-columns:repeat(3,minmax(80px,1fr)) !important;gap:22px 18px !important;}
  .swatches .swatch-item button{height:70px !important;}
  .wall-type-buttons{grid-template-columns:1fr;max-width:none;}
}
@media(max-width:560px){
  .swatches{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
  .swatches .swatch-item button{max-width:120px;height:64px !important;}
}



/* FINAL FIX: selectable sidebar + 3-column rectangular colour buttons */
@media (min-width: 901px){
  .right-options-layout{
    display:grid !important;
    grid-template-columns:220px minmax(0,1fr) !important;
    border:1px solid #2d5c1e !important;
    border-radius:12px !important;
    overflow:hidden !important;
    background:#fff !important;
  }
  .options-sidebar{
    display:block !important;
    border-right:1px solid #d9d9d9 !important;
    background:#fff !important;
  }
  .options-content{
    display:block !important;
    overflow:visible !important;
    max-height:none !important;
    min-width:0 !important;
    padding:28px 34px 34px !important;
    background:#fff !important;
  }
  .option-panel{display:none !important;}
  .option-panel.active{display:block !important;}
}

.sidebar-tab{
  border:0 !important;
  border-bottom:1px solid #e2e2e2 !important;
  background:#fff !important;
  cursor:pointer !important;
  width:100% !important;
  text-align:left !important;
  font-weight:800 !important;
  font-size:16px !important;
}
.sidebar-tab.active{
  background:#f8fcf4 !important;
  color:#000 !important;
  box-shadow:inset 5px 0 0 #2d5c1e !important;
}
.sidebar-tab.active .sidebar-icon{color:#2d5c1e !important;}

.option-panel h3{
  font-size:28px !important;
  line-height:1.15 !important;
  margin:0 0 22px !important;
  color:#000 !important;
  text-transform:uppercase !important;
}

.swatches{
  display:grid !important;
  grid-template-columns:repeat(3, minmax(120px, 1fr)) !important;
  gap:18px 22px !important;
  max-width:560px !important;
  width:100% !important;
  overflow:visible !important;
}
.swatch-item{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  text-align:center !important;
  min-width:0 !important;
}
.swatches .swatch-item button{
  width:100% !important;
  max-width:none !important;
  height:34px !important;
  min-height:34px !important;
  border-radius:4px !important;
  border:1px solid #b8a85a !important;
  box-shadow:none !important;
  cursor:pointer !important;
}
.swatches .swatch-item button.active{
  border-color:#2d5c1e !important;
  box-shadow:0 0 0 2px #2d5c1e inset !important;
}
.swatches .swatch-item button.active::after{
  content:"" !important;
  position:absolute !important;
  top:5px !important;
  right:6px !important;
  width:8px !important;
  height:8px !important;
  border-radius:50% !important;
  background:#d71920 !important;
  border:2px solid #fff !important;
}
.swatch-label{
  margin-top:8px !important;
  font-size:12px !important;
  line-height:1.2 !important;
  font-weight:500 !important;
  text-transform:none !important;
  color:#000 !important;
  min-height:0 !important;
  overflow-wrap:break-word !important;
}

.wall-type-buttons{
  display:grid !important;
  grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  max-width:430px !important;
  gap:14px !important;
}
.wallTypeBtn{height:42px !important;}

@media(max-width:900px){
  .right-options-layout{display:block !important;}
  .options-content{display:none !important;}
  .mobile-accordion-panel.active{display:block !important;}
  .swatches{grid-template-columns:repeat(3,minmax(0,1fr)) !important;max-width:none !important;gap:16px 12px !important;}
  .swatches .swatch-item button{height:32px !important;}
}
@media(max-width:520px){
  .swatches{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
}

/* Basic copy deterrents only. Real protection needs server-side licensing/domain checks. */
.svg-visualiser-wrap{
  -webkit-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
}
.svg-visualiser-wrap img,
.svg-visualiser-wrap svg{
  -webkit-user-drag:none;
  user-drag:none;
}



/* FINAL RESPONSIVE DESKTOP FIX: equal columns + no colour overflow */
@media (min-width:901px){
  .svg-visualiser-wrap{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  }
  .left-preview-column,
  .right-options-layout,
  .options-content{
    min-width:0 !important;
  }
  .right-options-layout{
    grid-template-columns:clamp(150px,16vw,220px) minmax(0,1fr) !important;
  }
  .options-content{
    overflow-y:auto !important;
    overflow-x:hidden !important;
    max-height:88vh !important;
    padding:clamp(16px,2vw,28px) clamp(14px,2vw,34px) !important;
  }
  .swatches{
    width:100% !important;
    max-width:none !important;
    grid-template-columns:repeat(auto-fit,minmax(72px,1fr)) !important;
    gap:12px 14px !important;
    overflow:visible !important;
  }
  .swatches .swatch-item button{
    height:clamp(26px,2.8vw,34px) !important;
  }
  .swatch-label{
    font-size:clamp(10px,1vw,12px) !important;
  }
  .wall-type-buttons{
    max-width:none !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}

@media (min-width:901px) and (max-width:1250px){
  .right-options-layout{
    grid-template-columns:160px minmax(0,1fr) !important;
  }
  .sidebar-tab{
    font-size:13px !important;
    gap:10px !important;
    padding:14px 12px !important;
  }
  .sidebar-icon,
  .sidebar-icon svg{
    width:26px !important;
    height:26px !important;
    flex-basis:26px !important;
  }
  .option-panel h3{
    font-size:22px !important;
  }
  .swatches{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:10px 12px !important;
  }
  .swatches .swatch-item button{
    height:28px !important;
  }
}

#headboxTint{
  opacity:1 !important;
  mix-blend-mode:normal !important;
  filter:none !important;
}
#headboxTint rect,
#headboxTint path,
#headboxTint polygon{
  filter:none !important;
}

/* Divi Code Module visibility fix */
.et_pb_code_inner .divi-visualiser-section,
.divi-visualiser-section{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
  overflow:visible !important;
}
.et_pb_code_inner .svg-visualiser-wrap{
  display:grid !important;
  visibility:visible !important;
  opacity:1 !important;
}

/* Extra front-end safety for Divi/theme/cache CSS */
#diviColourVisualiserRoot,
#diviColourVisualiserRoot *{box-sizing:border-box;}
#diviColourVisualiserRoot{display:block !important; visibility:visible !important; opacity:1 !important; min-height:400px !important; position:relative !important; z-index:1 !important;}
#diviColourVisualiserRoot .svg-visualiser-wrap{display:grid !important; visibility:visible !important; opacity:1 !important;}
#diviColourVisualiserRoot svg{display:block !important; visibility:visible !important; opacity:1 !important;}
/* Fast-load fix: avoid half-rendered visualiser flash while image/SVG assets initialise */
#diviColourVisualiserRoot .svg-visualiser-wrap{
  opacity:0;
  transition:opacity .12s ease;
}
#diviColourVisualiserRoot.visualiser-ready .svg-visualiser-wrap{
  opacity:1;
}
