/* CIDB V16 — premium wide canvas, immersive inner heroes, clear onboarding,
   unified footer and genuinely centred desktop navigation. */

/* The Visual Builder deliberately emits @layer builder-admin-priority with
   !important declarations. Later unlayered !important rules cannot override
   those settings. The shared layer is used here only for the requested design
   corrections, so the same rules work on pages and admin-regenerated menus. */
@layer builder-admin-priority {

  /* Wide, consistent content gutters across pages, forms, footer and articles. */
  html[data-theme="light"] body main .wrap,
  html[data-theme="light"] body footer.cidb-footer-v10 .wrap {
    box-sizing:border-box!important;
    width:min(calc(100% - 64px),1800px)!important;
    max-width:1800px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
  html[data-theme="light"] body main .cidb-v7-extra .wrap,
  html[data-theme="light"] body main .cidb-article-section .cidb-article {
    max-width:1200px!important;
  }

  /* Header: left brand, centre including its Contact CTA, right RO/EN. The
     available empty space on both sides of the navigation is symmetrical. */
  html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap,
  html[data-theme="light"] body .cidb-topbar-elite > .wrap {
    box-sizing:border-box!important;
    width:calc(100% - 32px)!important;
    max-width:none!important;
    margin:0 16px!important;
    padding:0!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap {
    display:grid!important;
    grid-template-columns:max-content minmax(0,1fr) max-content!important;
    column-gap:0!important;
    align-items:center!important;
    justify-content:stretch!important;
    height:100%!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-brand-elite {
    grid-column:1!important;justify-self:start!important;margin:0!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-nav-elite {
    grid-column:2!important;justify-self:center!important;
    display:flex!important;width:max-content!important;max-width:100%!important;
    flex:0 0 auto!important;margin:0!important;
    justify-content:center!important;align-items:center!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-header-actions {
    grid-column:3!important;justify-self:end!important;margin:0!important;
    display:flex!important;align-items:center!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-header-actions .header-contact {
    display:none!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-nav-elite > a.cidb-nav-contact {
    display:inline-flex!important;justify-content:center!important;align-items:center!important;
    min-width:106px!important;padding:0 14px!important;gap:8px!important;
    background:#bb965a!important;border:1px solid #a98348!important;
    color:#142c22!important;font-weight:850!important;
    border-radius:25px!important;box-shadow:0 5px 16px rgba(34,40,29,.12)!important;
  }
  html[data-theme="light"] body .site-header.cidb-header-elite .cidb-nav-elite > a.cidb-nav-contact:hover {
    background:#e0ba7f!important;color:#162b22!important;
  }
  html[data-theme="light"] body .cidb-topbar-elite > .wrap {
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    min-height:36px!important;gap:16px!important;
  }
  html[data-theme="light"] body .cidb-topbar-elite .topbar-links {
    display:flex!important;align-items:center!important;justify-content:flex-end!important;
    margin-left:auto!important;gap:clamp(14px,1.45vw,27px)!important;
  }

  /* Interior service heroes fill the right side of the browser, without the
     old blank 400px margin shown in the screenshot. Homepage is untouched. */
  html[data-theme="light"] body main .cidb-v7-mast .wrap.cidb-v7-mast-layout {
    width:calc(100% - clamp(26px,4vw,82px))!important;
    max-width:none!important;
    margin:0 0 0 clamp(26px,4vw,82px)!important;
    padding:clamp(28px,2.8vw,54px) 0!important;
    grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr)!important;
    gap:clamp(28px,3vw,64px)!important;
    align-items:center!important;
  }
  html[data-theme="light"] body main .cidb-v7-mast .cidb-v7-mast-photo {
    width:100%!important;height:clamp(680px,81vh,900px)!important;
    min-height:660px!important;max-height:none!important;
    margin:0!important;border-right:0!important;border-radius:18px 0 0 18px!important;
  }
  html[data-theme="light"] body main .cidb-v7-mast .cidb-v7-mast-photo img {
    display:block!important;width:100%!important;height:100%!important;
    object-fit:cover!important;object-position:center!important;
  }
  html[data-theme="light"] body main .cidb-v7-mast .cidb-v7-mast-copy {
    width:100%!important;max-width:690px!important;margin:0!important;
  }
  /* About Us and the four company/Self Employed form heroes use their own
     markup and need the same large photographic treatment. */
  html[data-theme="light"] body main .cidb-story-mast-inner.wrap {
    width:calc(100% - clamp(26px,4vw,82px))!important;
    max-width:none!important;margin-left:clamp(26px,4vw,82px)!important;
    margin-right:0!important;grid-template-columns:minmax(0,.80fr) minmax(0,1.20fr)!important;
    gap:clamp(27px,3.2vw,68px)!important;
    padding:clamp(30px,3.5vw,65px) 0!important;
  }
  html[data-theme="light"] body main .cidb-story-mast-image {
    height:clamp(620px,77vh,850px)!important;min-height:600px!important;
    margin:0!important;border-radius:17px 0 0 17px!important;overflow:hidden!important;
  }
  html[data-theme="light"] body main .cidb-story-mast-image img {
    width:100%!important;height:100%!important;object-fit:cover!important;
  }
  html[data-theme="light"] body main .cidb-reg-hero-grid.wrap {
    width:calc(100% - clamp(26px,4vw,82px))!important;
    max-width:none!important;margin-left:clamp(26px,4vw,82px)!important;
    margin-right:0!important;grid-template-columns:minmax(0,.88fr) minmax(0,1.12fr)!important;
    gap:clamp(25px,3.3vw,68px)!important;
    padding:clamp(38px,4vw,75px) 0!important;
  }
  html[data-theme="light"] body main .cidb-reg-hero-art {
    height:clamp(480px,42vw,680px)!important;min-height:470px!important;
    border:0!important;border-radius:18px 0 0 18px!important;
  }
  html[data-theme="light"] body main .cidb-reg-hero-art img {
    width:100%!important;height:100%!important;object-fit:cover!important;
    object-position:center!important;background:transparent!important;
  }
  /* Legacy article/legal mastheads also have an image but use .cidb-innerhero
     instead of the editorial V7 component. */
  html[data-theme="light"] body main .cidb-innerhero .wrap.hero-grid {
    width:calc(100% - clamp(26px,4vw,82px))!important;
    max-width:none!important;margin-left:clamp(26px,4vw,82px)!important;
    margin-right:0!important;grid-template-columns:minmax(0,.82fr) minmax(0,1.18fr)!important;
    gap:clamp(27px,3vw,64px)!important;
  }
  html[data-theme="light"] body main .cidb-innerhero .hero-art {
    min-width:0!important;max-width:none!important;width:100%!important;
  }
  html[data-theme="light"] body main .cidb-innerhero .hero-art img {
    display:block!important;width:100%!important;height:clamp(560px,64vh,790px)!important;
    max-height:none!important;object-fit:cover!important;
  }

  /* The two Self Employed forms: 4 balanced steps, large inputs and a full-
     width reassurance panel, rather than a crowded narrow sidebar. */
  html[data-theme="light"] body main .cidb-self-workspace {
    background:linear-gradient(150deg,#f4f1e9 0%,#ebe6db 100%)!important;
    padding:clamp(65px,6vw,115px) 0!important;
  }
  html[data-theme="light"] body main .cidb-self-workspace .wrap.cidb-self-layout {
    display:flex!important;flex-direction:column!important;
    align-items:stretch!important;gap:35px!important;
    width:min(calc(100% - 64px),1640px)!important;
    max-width:1640px!important;margin-inline:auto!important;
  }
  html[data-theme="light"] body main .cidb-self-form-panel {
    display:block!important;width:100%!important;margin:0!important;
    padding:0!important;background:transparent!important;border:0!important;
    border-radius:0!important;box-shadow:none!important;
  }
  html[data-theme="light"] body main .cidb-self-heading {
    border:0!important;margin:0 0 25px!important;padding:0!important;
    max-width:850px!important;
  }
  html[data-theme="light"] body main .cidb-self-heading h2 {
    font:500 clamp(42px,4vw,65px)/1.08 Georgia,serif!important;
    margin:12px 0!important;letter-spacing:-.045em!important;color:#1f372a!important;
  }
  html[data-theme="light"] body main .cidb-self-heading p {
    font:500 16px/1.65 Arial,sans-serif!important;color:#596f60!important;
  }
  html[data-theme="light"] body main .cidb-self-progress {
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:10px!important;margin:0 0 28px!important;
  }
  html[data-theme="light"] body main .cidb-self-progress span {
    display:flex!important;align-items:center!important;gap:10px!important;
    padding:14px 16px!important;border-radius:10px!important;
    border:1px solid #dfd4c0!important;background:rgba(255,255,255,.55)!important;
    color:#3b5947!important;font:750 13px/1.4 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-self-progress b {
    display:grid!important;place-items:center!important;flex:none!important;
    width:30px!important;height:30px!important;border-radius:50%!important;
    background:#1e3c30!important;color:#e4c38b!important;
    font:850 11px/1 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-self-intake-form {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:24px!important;margin:0!important;padding:0!important;
    border:0!important;background:transparent!important;box-shadow:none!important;
    align-items:stretch!important;
  }
  html[data-theme="light"] body main .cidb-self-stage {
    display:block!important;min-width:0!important;margin:0!important;
    padding:clamp(24px,2.6vw,44px)!important;
    border:1px solid #dbceb9!important;border-top:4px solid #bb985f!important;
    border-radius:18px!important;background:#fffefa!important;
    box-shadow:0 18px 45px rgba(32,47,32,.08)!important;
  }
  html[data-theme="light"] body main .cidb-self-stage:nth-child(2) {border-top-color:#718977!important}
  html[data-theme="light"] body main .cidb-self-stage:nth-child(3) {border-top-color:#9eae91!important}
  html[data-theme="light"] body main .cidb-self-stage:last-of-type {border-top-color:#b79452!important}
  html[data-theme="light"] body main .cidb-self-stage-head {
    display:flex!important;align-items:center!important;gap:16px!important;
    margin:0 0 27px!important;padding-bottom:20px!important;
    border-bottom:1px solid #eae2d4!important;
  }
  html[data-theme="light"] body main .cidb-self-stage-head>b {
    display:grid!important;place-items:center!important;width:49px!important;height:49px!important;
    background:#1f4135!important;color:#eacb97!important;border:0!important;
    border-radius:12px!important;font:850 13px/1 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-self-stage-head h2 {
    font:500 clamp(25px,2.05vw,34px)/1.18 Georgia,serif!important;
    color:#263e30!important;margin:0 0 6px!important;
  }
  html[data-theme="light"] body main .cidb-self-stage-head p {
    font:500 13.5px/1.6 Arial,sans-serif!important;
    color:#718074!important;margin:0!important;
  }
  html[data-theme="light"] body main .cidb-self-field-grid {
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:start!important;gap:20px!important;
  }
  html[data-theme="light"] body main .cidb-self-field {
    display:block!important;min-width:0!important;
    font:750 13px/1.45 Arial,sans-serif!important;color:#334b3b!important;
  }
  html[data-theme="light"] body main .cidb-self-field>span {margin:0 0 9px!important}
  html[data-theme="light"] body main .cidb-self-intake-form :is(input:not([type=checkbox]),select,textarea) {
    display:block!important;box-sizing:border-box!important;width:100%!important;
    min-width:0!important;min-height:56px!important;
    border:1px solid #d2cab9!important;border-radius:9px!important;
    background:#fbfaf6!important;color:#233a2d!important;
    padding:14px 15px!important;font:500 15px/1.45 Arial,sans-serif!important;
    box-shadow:none!important;
  }
  html[data-theme="light"] body main .cidb-self-intake-form :is(input,select,textarea):focus-visible {
    border-color:#bd9259!important;outline:3px solid rgba(189,146,89,.2)!important;outline-offset:1px!important;
  }
  html[data-theme="light"] body main .cidb-self-intake-form textarea {min-height:135px!important}
  html[data-theme="light"] body main .cidb-self-safety {
    grid-column:1/-1!important;background:#f4efe4!important;
    border-left:3px solid #c5a36d!important;padding:17px!important;
    color:#556b57!important;border-radius:9px!important;font:500 13px/1.65 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-self-field-full {width:100%!important;margin:0 0 18px!important}
  html[data-theme="light"] body main .cidb-self-privacy {
    display:flex!important;align-items:flex-start!important;gap:12px!important;
    color:#405b47!important;font:600 13px/1.6 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-self-privacy input[type=checkbox] {
    width:19px!important;height:19px!important;flex:0 0 19px!important;
    min-height:19px!important;margin:2px 0 0!important;accent-color:#254b39!important;
  }
  html[data-theme="light"] body main .cidb-self-submit {
    display:flex!important;align-items:center!important;gap:16px!important;
    flex-wrap:wrap!important;margin:28px 0 0!important;
  }
  html[data-theme="light"] body main .cidb-self-submit button {
    display:inline-flex!important;align-items:center!important;justify-content:center!important;
    min-height:55px!important;padding:0 27px!important;
    background:#b99252!important;color:#182e24!important;border-radius:9px!important;
    border:1px solid #aa8348!important;font-weight:850!important;
  }
  html[data-theme="light"] body main .cidb-self-submit>span {
    max-width:220px!important;font:500 12px/1.6 Arial,sans-serif!important;color:#607466!important;
  }
  html[data-theme="light"] body main .cidb-self-aside {
    display:grid!important;grid-template-columns:minmax(225px,.7fr) minmax(0,1.6fr) auto!important;
    grid-template-rows:auto auto!important;
    grid-template-areas:"eyebrow perks link" "heading perks link"!important;
    gap:8px 35px!important;align-items:center!important;
    position:static!important;top:auto!important;width:100%!important;max-width:none!important;
    margin:0!important;padding:clamp(25px,3.2vw,45px)!important;
    border:1px solid #486353!important;border-radius:17px!important;
    background:linear-gradient(110deg,#1b392e,#244738)!important;
    box-shadow:0 22px 55px rgba(18,41,29,.12)!important;
  }
  html[data-theme="light"] body main .cidb-self-aside>span {grid-area:eyebrow!important;font:850 11px/1.4 Arial,sans-serif!important}
  html[data-theme="light"] body main .cidb-self-aside h3 {
    grid-area:heading!important;font:500 clamp(23px,2vw,32px)/1.25 Georgia,serif!important;
    margin:2px 0 0!important;color:#fff9e9!important;
  }
  html[data-theme="light"] body main .cidb-self-aside ul {
    grid-area:perks!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:12px!important;padding:0!important;margin:0!important;
  }
  html[data-theme="light"] body main .cidb-self-aside li {
    border:0!important;padding:6px 2px 6px 24px!important;
    color:#e4eadf!important;font:550 12.5px/1.65 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-self-aside>a {
    grid-area:link!important;white-space:nowrap!important;
    color:#ecc88b!important;font:800 12.5px/1.6 Arial,sans-serif!important;
  }

  /* Footer: four equal columns, one uniform typographic system and centred
     presentation. The official CIDB logo stays inside its white tile. */
  html[data-theme="light"] body .cidb-footer-v10,
  html[data-theme="light"] body .cidb-footer-v10 :is(h2,h3,p,a,span,li) {
    font-family:Arial,Helvetica,sans-serif!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-cta h2 {
    font:600 clamp(35px,3.4vw,53px)/1.13 Arial,Helvetica,sans-serif!important;
    letter-spacing:-.035em!important;color:#fff7e9!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main {
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:clamp(24px,2.8vw,55px)!important;align-items:start!important;
    padding:clamp(60px,5vw,90px) 0!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main>div {
    display:flex!important;flex-direction:column!important;align-items:center!important;
    justify-content:flex-start!important;text-align:center!important;min-width:0!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .footer-grid h3 {
    width:100%!important;min-height:35px!important;
    font:800 15px/1.35 Arial,Helvetica,sans-serif!important;
    letter-spacing:.075em!important;text-transform:uppercase!important;
    color:#d9b982!important;margin:11px 0 21px!important;text-align:center!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .footer-grid a:not(.btn) {
    font:600 14px/1.6 Arial,Helvetica,sans-serif!important;
    color:#d6e1d8!important;margin:0 0 14px!important;text-align:center!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-brand-block>p,
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-reach p {
    max-width:350px!important;margin:22px auto 17px!important;
    font:500 14px/1.8 Arial,Helvetica,sans-serif!important;
    color:#b5c5b9!important;text-align:center!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-reach p {margin:14px auto 18px!important}
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-logo-link {
    display:flex!important;align-items:center!important;justify-content:center!important;
    width:220px!important;height:125px!important;padding:12px!important;
    margin:0 auto!important;border-radius:13px!important;background:#fff!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-logo-link .footer-logo {
    display:block!important;max-width:100%!important;width:184px!important;
    height:auto!important;max-height:98px!important;object-fit:contain!important;
    margin:auto!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-credentials {
    display:flex!important;justify-content:center!important;align-items:center!important;
    gap:8px!important;margin-top:0!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-credentials span {
    font:800 10px/1.3 Arial,Helvetica,sans-serif!important;
    letter-spacing:.045em!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal>.wrap {
    display:flex!important;justify-content:space-between!important;align-items:center!important;
    gap:15px 28px!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal :is(span,a) {
    font:600 11.5px/1.6 Arial,Helvetica,sans-serif!important;
  }

  @media(max-width:1319px) {
    html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap {
      grid-template-columns:minmax(0,1fr) max-content!important;
    }
    html[data-theme="light"] body .site-header.cidb-header-elite .cidb-nav-elite {display:none!important}
    html[data-theme="light"] body .site-header.cidb-header-elite .cidb-brand-elite {grid-column:1!important}
    html[data-theme="light"] body .site-header.cidb-header-elite .cidb-header-actions {grid-column:2!important}
    html[data-theme="light"] body .site-header.cidb-header-elite .cidb-header-actions .header-contact {
      display:inline-flex!important;
    }
    html[data-theme="light"] body .site-header.cidb-header-elite .menu-toggle {display:grid!important;place-items:center!important}
  }
  @media(max-width:1150px) {
    html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main {grid-template-columns:repeat(2,minmax(0,1fr))!important;row-gap:50px!important}
    html[data-theme="light"] body main .cidb-self-intake-form {grid-template-columns:1fr!important}
    html[data-theme="light"] body main .cidb-self-aside {grid-template-columns:1fr!important;grid-template-areas:"eyebrow" "heading" "perks" "link"!important;gap:14px!important}
  }
  @media(max-width:950px) {
    html[data-theme="light"] body main .cidb-v7-mast .wrap.cidb-v7-mast-layout,
    html[data-theme="light"] body main .cidb-story-mast-inner.wrap,
    html[data-theme="light"] body main .cidb-reg-hero-grid.wrap,
    html[data-theme="light"] body main .cidb-innerhero .wrap.hero-grid {
      width:calc(100% - 42px)!important;max-width:none!important;
      margin:0 21px!important;grid-template-columns:1fr!important;
      gap:30px!important;padding:55px 0 42px!important;
    }
    html[data-theme="light"] body main .cidb-v7-mast .cidb-v7-mast-photo,
    html[data-theme="light"] body main .cidb-story-mast-image,
    html[data-theme="light"] body main .cidb-reg-hero-art,
    html[data-theme="light"] body main .cidb-innerhero .hero-art img {
      height:clamp(380px,62vw,530px)!important;min-height:0!important;
      border-radius:15px!important;
    }
    html[data-theme="light"] body main .cidb-self-aside ul {grid-template-columns:1fr!important}
  }
  @media(max-width:760px) {
    html[data-theme="light"] body main .wrap,
    html[data-theme="light"] body footer.cidb-footer-v10 .wrap {
      width:calc(100% - 36px)!important;max-width:none!important;
    }
    html[data-theme="light"] body .cidb-topbar-elite .topbar-links {display:none!important}
    html[data-theme="light"] body main .cidb-self-workspace .wrap.cidb-self-layout {
      width:calc(100% - 32px)!important;
    }
    html[data-theme="light"] body main .cidb-self-progress {grid-template-columns:repeat(2,minmax(0,1fr))!important}
    html[data-theme="light"] body main .cidb-self-field-grid {grid-template-columns:1fr!important;gap:17px!important}
    html[data-theme="light"] body main .cidb-self-stage {padding:24px 20px!important}
    html[data-theme="light"] body main .cidb-self-stage-head h2 {font-size:26px!important}
    html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main {grid-template-columns:1fr!important;gap:32px!important}
    html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main>div {padding-bottom:27px!important;border-bottom:1px solid rgba(222,202,164,.14)!important}
    html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal>.wrap {flex-direction:column!important;text-align:center!important}
    html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal nav {justify-content:center!important}
  }
  @media(max-width:650px) {
    html[data-theme="light"] body .site-header.cidb-header-elite > .wrap.cidb-nav-elite-wrap,
    html[data-theme="light"] body .cidb-topbar-elite > .wrap {
      width:calc(100% - 22px)!important;margin:0 11px!important;
    }
    html[data-theme="light"] body .site-header.cidb-header-elite .cidb-header-actions .header-contact {
      display:none!important;
    }
  }
}
