/* CIDB V17: full-width contract, legible calculator totals, balanced footer,
   and raised quick-contact launcher. Loaded after V16. */
@layer builder-admin-priority {
  /* The standalone agreement had two independent max-width constraints:
     .cidb-contract (1100px) and .cidb-ca (960px). Override both. */
  html[data-theme="light"] body main .wrap.cidb-contract {
    box-sizing:border-box!important;
    width:min(calc(100% - 64px),1800px)!important;
    max-width:1800px!important;
    margin-inline:auto!important;
    padding:0!important;
  }
  html[data-theme="light"] body main .cidb-contract-shell.cidb-ca {
    box-sizing:border-box!important;
    width:100%!important;
    max-width:none!important;
    margin:20px auto 70px!important;
    color:#263e32!important;
    font-family:Arial,Helvetica,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-contract-intro {
    max-width:980px!important;
    margin:0 auto 32px!important;
    text-align:center!important;
  }
  html[data-theme="light"] body main .cidb-contract-stage-notice {
    display:flex!important;
    gap:20px!important;
    align-items:flex-start!important;
    width:min(100%,1250px)!important;
    padding:19px 24px!important;
    margin:0 auto 22px!important;
    border:1px solid #d2ad68!important;
    border-left:5px solid #ba8749!important;
    border-radius:12px!important;
    background:#fff5e2!important;
    color:#5a4529!important;
    font:500 14px/1.65 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-contract-stage-notice strong {
    flex:none!important;
    color:#69431f!important;
    letter-spacing:.06em!important;
  }
  html[data-theme="light"] body main .cidb-ca-form {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:24px!important;
    align-items:start!important;
  }
  html[data-theme="light"] body main .cidb-ca-form>.cidb-ca-card {
    box-sizing:border-box!important;
    min-width:0!important;
    margin:0!important;
    padding:clamp(25px,2.6vw,45px)!important;
    border-radius:17px!important;
    border:1px solid #dbd1bc!important;
    background:#fffefa!important;
    box-shadow:0 15px 42px rgba(37,53,41,.075)!important;
  }
  html[data-theme="light"] body main .cidb-ca-form>.cidb-ca-provider,
  html[data-theme="light"] body main .cidb-ca-form>.cidb-ca-card:has(.cidb-ca-term),
  html[data-theme="light"] body main .cidb-ca-form>.cidb-ca-card:has(.cidb-ca-canvas) {
    grid-column:1/-1!important;
  }
  html[data-theme="light"] body main .cidb-ca-form>.cidb-ca-provider {
    border-left:5px solid #bc995d!important;
    background:linear-gradient(120deg,#f5efe2,#fffefa)!important;
  }
  html[data-theme="light"] body main .cidb-ca-card h3 {
    font:600 clamp(23px,2vw,32px)/1.25 Georgia,serif!important;
    color:#223b2c!important;
    margin:0 0 22px!important;
  }
  html[data-theme="light"] body main .cidb-ca-card :is(input:not([type=checkbox]):not([type=radio]),textarea,select) {
    min-height:52px!important;
    border-radius:9px!important;
    border-color:#d2c8b5!important;
    background:#fff!important;
    font:500 15px/1.5 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-ca-services {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:13px!important;
  }
  html[data-theme="light"] body main .cidb-ca-term p,
  html[data-theme="light"] body main .cidb-ca-check,
  html[data-theme="light"] body main .cidb-ca-choice {
    font:500 14px/1.72 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-ca-form .cidb-ca-send {
    min-height:55px!important;
    padding:15px 28px!important;
    border-radius:10px!important;
    background:#bb975c!important;
    color:#1c3124!important;
    font:800 14px/1.4 Arial,sans-serif!important;
  }

  /* Pricing LTD: large GBP figure and explanatory rate on separate lines.
     This avoids the overlapping anonymous text / small-inline layout. */
  html[data-theme="light"] body main .cidb-pricing-summary .cidb-summary-total {
    display:flex!important;
    flex-direction:column!important;
    align-items:flex-start!important;
    justify-content:flex-start!important;
    gap:8px!important;
    max-width:100%!important;
    min-width:0!important;
    margin:17px 0 24px!important;
    font:600 clamp(43px,4.2vw,67px)/1.08 Georgia,serif!important;
    letter-spacing:-.05em!important;
    color:#f1c987!important;
    overflow-wrap:anywhere!important;
  }
  html[data-theme="light"] body main .cidb-pricing-summary .cidb-summary-total>small {
    display:block!important;
    width:100%!important;
    min-width:0!important;
    padding:8px 0 0!important;
    margin:0!important;
    border-top:1px solid rgba(231,206,154,.2)!important;
    color:#dfeddf!important;
    font:600 13px/1.6 Arial,sans-serif!important;
    letter-spacing:0!important;
    white-space:normal!important;
  }
  html[data-theme="light"] body main .cidb-pricing-summary .cidb-summary-header {
    color:#e8cb97!important;
    font:800 11px/1.5 Arial,sans-serif!important;
    letter-spacing:.13em!important;
  }
  html[data-theme="light"] body main .cidb-pricing-summary .cidb-price-lines>div {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:12px!important;
    align-items:start!important;
  }
  html[data-theme="light"] body main .cidb-pricing-summary .cidb-price-lines>div :is(span,strong) {
    font:600 13px/1.55 Arial,sans-serif!important;
  }
  html[data-theme="light"] body main .cidb-pricing-summary .cidb-price-lines strong {
    color:#fff9e7!important;
    text-align:right!important;
  }

  /* All four footer columns use the same title, link and body type scales.
     The brand identity is the only graphic element, not another font family. */
  html[data-theme="light"] body .cidb-footer-v10 .wrap.cidb-footer-main {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    align-items:start!important;
    gap:clamp(28px,3.2vw,58px)!important;
    padding:68px 0 74px!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main>div {
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    text-align:center!important;
    gap:0!important;
    min-width:0!important;
    max-width:none!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main h3 {
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    min-height:48px!important;
    margin:3px 0 16px!important;
    padding:0!important;
    color:#e8c58d!important;
    font:800 15px/1.32 Arial,Helvetica,sans-serif!important;
    letter-spacing:.04em!important;
    text-transform:uppercase!important;
    text-align:center!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main a:not(.cidb-footer-logo-link) {
    display:block!important;
    padding:0!important;
    margin:0 0 14px!important;
    color:#dce6dc!important;
    font:600 14px/1.65 Arial,Helvetica,sans-serif!important;
    text-align:center!important;
    text-decoration:none!important;
    overflow-wrap:anywhere!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main :is(p,p span) {
    color:#b8c9bc!important;
    font:500 14px/1.8 Arial,Helvetica,sans-serif!important;
    text-align:center!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-brand-block>p {
    max-width:320px!important;
    margin:22px auto 18px!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-main .cidb-footer-reach p {
    margin:13px auto 17px!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-credentials {
    flex-wrap:wrap!important;
    gap:9px!important;
    justify-content:center!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-credentials span {
    font:800 10px/1.4 Arial,sans-serif!important;
    color:#d7b47a!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal>.wrap {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)!important;
    align-items:center!important;
    gap:24px!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal>.wrap>span:last-child {
    text-align:right!important;
  }
  html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal :is(span,a) {
    font:500 12px/1.6 Arial,Helvetica,sans-serif!important;
    letter-spacing:0!important;
  }

  /* Twenty-five pixels above the existing mobile and desktop positions. */
  html[data-theme="light"] body .cidb-contact-rail {
    bottom:calc(clamp(13px,2vw,28px) + 25px)!important;
  }
  @media(max-width:1150px) {
    html[data-theme="light"] body .cidb-footer-v10 .wrap.cidb-footer-main {
      grid-template-columns:repeat(2,minmax(0,1fr))!important;
      row-gap:42px!important;
    }
  }
  @media(max-width:950px) {
    html[data-theme="light"] body main .cidb-ca-form {grid-template-columns:1fr!important}
    html[data-theme="light"] body main .cidb-ca-form>.cidb-ca-card {grid-column:1/-1!important}
    html[data-theme="light"] body main .cidb-ca-services {grid-template-columns:1fr!important}
  }
  @media(max-width:760px) {
    html[data-theme="light"] body main .wrap.cidb-contract {
      width:calc(100% - 36px)!important;
    }
    html[data-theme="light"] body .cidb-footer-v10 .wrap.cidb-footer-main {
      grid-template-columns:1fr!important;
      padding:46px 0!important;
    }
    html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal>.wrap {
      grid-template-columns:1fr!important;
      gap:15px!important;
      text-align:center!important;
    }
    html[data-theme="light"] body .cidb-footer-v10 .cidb-footer-legal>.wrap>span:last-child {
      text-align:center!important;
    }
    html[data-theme="light"] body .cidb-contact-rail {bottom:39px!important}
  }
}
