/* Buffer Page Builder Pro 2.1.0 — engine upgrade layer. Source library remains source-faithful. */
#bvb-canvas .red-section.bvbg-glass-section,.red-builder-output .red-section.bvbg-glass-section{background:var(--rs-bg)!important;border:0!important;border-radius:0!important;box-shadow:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
#bvb-canvas .red-section .bvbg-glass-dropzone,.red-builder-output .red-section .bvbg-glass-dropzone{background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important;backdrop-filter:none!important}

/* Desktop-only custom row ratios. Mobile/tablet keep the original responsive stacking rules. */
@media(min-width:761px){
  #bvb-canvas [data-bvb-row="1"][data-rvb2-layout="grid"],.red-builder-output [data-bvb-row="1"][data-rvb2-layout="grid"]{grid-template-columns:var(--rvb2-row-template)!important}
  #bvb-canvas [data-bvb-row="1"][data-rvb2-layout="flex"]>[data-bvb-column="1"],.red-builder-output [data-bvb-row="1"][data-rvb2-layout="flex"]>[data-bvb-column="1"]{flex:0 0 var(--rvb2-col-size,auto)!important;max-width:var(--rvb2-col-size,none)!important}
}
.rvb2-col-handle{position:fixed;z-index:100040;width:18px;transform:translateX(-9px);cursor:col-resize;pointer-events:auto;display:none}
.rvb2-col-handle::before{content:"";position:absolute;left:8px;top:0;bottom:0;width:2px;background:#d71920;border-radius:999px;box-shadow:0 0 0 3px rgba(215,25,32,.1)}
.rvb2-col-handle span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:#111;color:#fff;border-radius:999px;padding:4px 7px;font:700 10px/1 Inter,sans-serif;white-space:nowrap}
.rvb2-col-handle.is-active{display:block}

/* Element selection/context actions */
.rvb2-selected{outline:2px solid rgba(215,25,32,.7)!important;outline-offset:3px}
#rvb2-node-toolbar{position:fixed;z-index:100050;display:flex;align-items:center;gap:3px;padding:4px;background:#111;border-radius:8px;box-shadow:0 10px 32px rgba(0,0,0,.25)}
#rvb2-node-toolbar[hidden]{display:none!important}
#rvb2-node-toolbar button{width:30px;height:30px;border:0;border-radius:6px;background:transparent;color:#fff;cursor:pointer;font-size:13px}
#rvb2-node-toolbar button:hover{background:#2a2a2a}
#rvb2-node-toolbar .rvb2-node-label{padding:0 7px;color:#fff;font:700 10px/1 Inter,sans-serif;max-width:130px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#rvb2-context{position:fixed;z-index:100060;min-width:190px;padding:6px;background:#fff;border:1px solid #ddd;border-radius:10px;box-shadow:0 16px 50px rgba(0,0,0,.18)}
#rvb2-context[hidden]{display:none!important}
#rvb2-context button{width:100%;border:0;background:transparent;text-align:left;padding:9px 10px;border-radius:7px;cursor:pointer;font:600 12px/1.2 Inter,sans-serif;color:#222}
#rvb2-context button:hover{background:#f5f5f7}
#rvb2-context button.is-danger{color:#c20f17}

/* Image toolbar */
#rvb2-image-toolbar{position:fixed;z-index:100055;display:flex;gap:4px;padding:5px;background:#111;border-radius:9px;box-shadow:0 12px 36px rgba(0,0,0,.28)}
#rvb2-image-toolbar[hidden]{display:none!important}
#rvb2-image-toolbar button{border:0;border-radius:6px;background:transparent;color:#fff;padding:7px 9px;cursor:pointer;font:600 11px/1 Inter,sans-serif}
#rvb2-image-toolbar button:hover{background:#2a2a2a}

/* Q&A rich text */
#bvb-canvas [data-bvb-richtext="1"]{cursor:text;outline:1px dashed transparent}
#bvb-canvas [data-bvb-richtext="1"]:hover{outline-color:rgba(215,25,32,.45);outline-offset:4px}
.rvb-faq-answer{padding:14px 0 2px;color:var(--rs-muted);line-height:1.65}
.rs-accordion details.item{display:block!important;padding:0!important;border-top:1px solid var(--rs-line)}
.rs-accordion details.item:last-child{border-bottom:1px solid var(--rs-line)}
.rs-accordion details.item>summary{list-style:none;display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 0;cursor:pointer}
.rs-accordion details.item>summary::-webkit-details-marker{display:none}
.rs-accordion details.item[open] .rvb-faq-toggle{transform:rotate(45deg)}
.rvb-faq-toggle{transition:transform .2s ease}

/* Repeat groups rebalance only when explicitly marked by the semantic layer. */
@media(min-width:761px){
  #bvb-canvas [data-bvb-repeat-group="1"].rvb2-repeat-balanced,.red-builder-output [data-bvb-repeat-group="1"].rvb2-repeat-balanced{grid-template-columns:repeat(var(--rvb2-repeat-cols),minmax(0,1fr))!important}
}

/* Media Library must live inside the center canvas, never under fixed sidebars. */
body.rvb2-media-constrained .media-modal-backdrop{left:var(--rvb2-media-left,12px)!important;right:var(--rvb2-media-right,12px)!important;top:var(--rvb2-media-top,76px)!important;bottom:var(--rvb2-media-bottom,12px)!important;background:rgba(0,0,0,.18)!important}
body.rvb2-media-constrained .media-modal{left:var(--rvb2-media-left,12px)!important;right:var(--rvb2-media-right,12px)!important;top:var(--rvb2-media-top,76px)!important;bottom:var(--rvb2-media-bottom,12px)!important;width:auto!important;height:auto!important}
body.rvb2-media-constrained .media-frame{inset:0!important;width:100%!important;height:100%!important}

/* Page settings flyout — top-left, never covering responsive controls. */
#rvb2-page-settings{position:fixed;z-index:100070;left:12px;top:72px;width:min(330px,calc(100vw - 24px));max-height:calc(100vh - 86px);overflow:auto;background:#fff;border:1px solid #ddd;border-radius:12px;box-shadow:0 18px 54px rgba(0,0,0,.2);padding:14px}
#rvb2-page-settings[hidden]{display:none!important}
#rvb2-page-settings h3{margin:0 0 12px;font:800 14px/1.2 Inter,sans-serif;color:#111}
#rvb2-page-settings label{display:grid;gap:6px;margin:10px 0;font:700 11px/1.2 Inter,sans-serif;color:#333}
#rvb2-page-settings select,#rvb2-page-settings input{width:100%;box-sizing:border-box;min-height:38px;border:1px solid #ccd0d4;border-radius:7px;background:#fff;padding:6px 8px}
#rvb2-page-settings input[type=color]{padding:3px}
#rvb2-page-settings .rvb2-grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#rvb2-page-settings .rvb2-actions{display:flex;gap:8px;margin-top:12px}
#rvb2-page-settings button{border:0;border-radius:7px;padding:9px 11px;cursor:pointer;font-weight:700}
#rvb2-page-settings .primary{background:#d71920;color:#fff}

/* Source template mobile contract: one outside gutter only. */
@media(max-width:760px){
  #bvb-canvas .red-section .rs-wrap,.red-builder-output .red-section .rs-wrap{width:calc(100% - 10px)!important;max-width:none!important;margin-left:auto!important;margin-right:auto!important}
  #bvb-canvas .red-section[data-bvb-section],.red-builder-output .red-section[data-bvb-section]{padding-left:0!important;padding-right:0!important}
}

/* Functional tabs */
.rvb-tabs-component{display:grid;gap:18px}.rvb-tab-panels{min-width:0}.rvb-tab-panel[hidden]{display:none!important}.rvb-tab-panel{padding-top:6px}
#bvb-canvas [data-rvb-tab-control]{cursor:pointer;user-select:none}

/* Row Settings / background / overlay */
#rvb2-row-style{position:fixed;z-index:100075;left:12px;top:72px;width:min(350px,calc(100vw - 24px));max-height:calc(100vh - 86px);overflow:auto;background:#fff;border:1px solid #ddd;border-radius:12px;box-shadow:0 18px 54px rgba(0,0,0,.2);padding:14px;color:#222;font:500 12px/1.4 Inter,sans-serif}
#rvb2-row-style[hidden]{display:none!important}#rvb2-row-style .rvb2-panel-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}#rvb2-row-style .rvb2-panel-head button{border:0;background:#eee;width:28px;height:28px;border-radius:7px;cursor:pointer}#rvb2-row-style label{display:grid;gap:5px;margin:9px 0;font-weight:700}#rvb2-row-style select,#rvb2-row-style input{width:100%;box-sizing:border-box;min-height:36px;border:1px solid #ccd0d4;border-radius:7px;background:#fff;padding:5px 7px}#rvb2-row-style input[type=color]{padding:2px}#rvb2-row-style .rvb2-grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}#rvb2-row-style .rvb2-grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}#rvb2-row-style .rvb2-wide-btn{width:100%;border:1px solid #ddd;background:#f7f7f8;border-radius:7px;padding:9px;cursor:pointer;font-weight:700}#rvb2-row-style .rvb2-actions{display:flex;justify-content:flex-end;gap:7px;margin-top:12px}#rvb2-row-style .rvb2-actions button{border:0;border-radius:7px;padding:9px 10px;cursor:pointer;font-weight:700}#rvb2-row-style .rvb2-actions .primary{background:#d71920;color:#fff}
[data-rvb2-row-overlay="1"]{position:relative;isolation:isolate}[data-rvb2-row-overlay="1"]::after{content:"";position:absolute;inset:0;background:var(--rvb2-row-overlay-bg,rgba(0,0,0,.5));opacity:var(--rvb2-row-overlay-opacity,.5);pointer-events:none;z-index:0;border-radius:inherit}[data-rvb2-row-overlay="1"]>*{position:relative;z-index:1}

/* Buffer Page Builder Pro 2.1.1 — Section Library cards: thumbnail above, copy below. */
body.rvb-red-shell #bvb-template-library .bvb-template-card{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  grid-template-columns:none!important;
  gap:9px!important;
  min-height:0!important;
  padding:9px!important;
  text-align:left!important;
}
body.rvb-red-shell #bvb-template-library .bvb-template-card-preview{
  order:1;
  width:100%!important;
  max-width:none!important;
  height:auto!important;
  min-height:0;
  flex:0 0 auto;
}
body.rvb-red-shell #bvb-template-library .bvb-template-card-copy{
  order:2;
  width:100%!important;
  min-width:0;
  padding:0 2px 2px;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:4px!important;
}
body.rvb-red-shell #bvb-template-library .bvb-template-card-copy strong,
body.rvb-red-shell #bvb-template-library .bvb-template-card-copy>span,
body.rvb-red-shell #bvb-template-library .bvb-template-card-copy .bvb-template-meta{
  width:100%;
  max-width:100%;
  overflow-wrap:anywhere;
}
body.rvb-red-shell #bvb-template-library .bvb-template-drag{
  position:absolute!important;
  top:13px!important;
  right:13px!important;
  z-index:4;
  width:24px;
  height:24px;
  display:grid!important;
  place-items:center;
  border-radius:7px;
  background:rgba(255,255,255,.92);
  box-shadow:0 1px 5px rgba(17,17,19,.12);
}

/* Modal / large Section Library uses the same vertical card contract. */
body.rvb-red-shell .bvb-modal-template-card{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  grid-template-columns:none!important;
  gap:9px!important;
  min-height:0!important;
  text-align:left!important;
}
body.rvb-red-shell .bvb-modal-template-card .bvb-template-card-preview{
  order:1;
  width:100%!important;
  max-width:none!important;
  height:auto!important;
  min-height:0!important;
  aspect-ratio:16/9;
}
body.rvb-red-shell .bvb-modal-template-card>span{
  order:2;
  width:100%!important;
  min-width:0;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:4px!important;
}
body.rvb-red-shell .bvb-modal-template-card strong,
body.rvb-red-shell .bvb-modal-template-card small{
  width:100%;
  max-width:100%;
  overflow-wrap:anywhere;
}

/* Keep vertical card structure at every breakpoint. */
@media(max-width:1380px){
  body.rvb-red-shell #bvb-template-library .bvb-template-card,
  body.rvb-red-shell .bvb-modal-template-card{grid-template-columns:none!important}
}
@media(max-width:620px){
  body.rvb-red-shell .bvb-modal-template-card{grid-template-columns:none!important}
}

/* v2.1.3 category filtering: hidden cards must never be forced visible by vertical-card display rules. */
body.rvb-red-shell .bvb-modal-template-card[hidden],
body.rvb-red-shell #bvb-template-library .bvb-template-card[hidden]{display:none!important;}
