/* Mobile CTA bar: Sign/Approve + More Actions + compact widget */
.mobile-cta-bar {
  display: none;
}

/* Compact top widget: hidden by default (wrapper controls visibility) */
#acorn-box-widget-top {
  display: none;
}

/* Sticky bottom container: hidden on desktop, fixed on mobile */
#acorn-sticky-container {
  display: none;
}

@media (max-width: 625px) {
  .mobile-cta-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    width: 100%;
  }

  #acorn-box-widget-top {
    display: block;
    width: 100%;
  }

  #acorn-sticky-container {
    display: block;
    position: fixed;
    bottom: 60px;
    left: 5px;
    right: 5px;
    z-index: 100;
    text-align: left;
  }

  #acorn-sticky-close {
    display: inline-block;
    margin-bottom: 4px;
    padding: 4px 14px;
    background-color: #147AC6;
    color: white;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: none;
    border-radius: 999px;
    cursor: pointer;
  }

  .btn-sign-approve {
    width: 100%;
    padding: 14px 20px;
    background-color: #4A7B52;
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    margin-bottom: 5px;
  }

  .btn-sign-approve:hover {
    background-color: #3D6644;
  }

  .more-actions-dropdown {
    width: 100%;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
  }

  .more-actions-dropdown summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }

  .more-actions-dropdown summary::after {
    content: "▼";
    font-size: 12px;
    color: #555;
  }

  .more-actions-dropdown summary::-webkit-details-marker {
    display: none;
  }
}

/* Base page styling */
.acorn-body {
  margin: 0;
  padding: 0;
  text-align: center;
  font-family: Roboto, sans-serif;
  background-color: rgb(240, 240, 240);
}

/* Header and nav */
#header {
  border-bottom: 3px solid #147AC6;
  padding: 10px 20px 20px 20px;
  margin-bottom: 20px;
  background-color: rgb(255, 255, 255);
  box-sizing: border-box;
  color: rgb(0, 145, 255);
  direction: ltr;
  display: flex;
  font-family: Roboto, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  height: 56px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  position: sticky;
  top: 0;
  margin-bottom: 10px !important;
}

/* Header inline centered layout overrides */
#header {
  display: flex;                /* ensure flex in case external CSS changes */
  justify-content: center;      /* center the whole row */
  align-items: center;          /* vertical center */
  gap: 5px;
  flex-wrap: nowrap;           /* Prevent header children from wrapping to multiple lines; ensures all elements remain on a single row for consistent layout */
  white-space: nowrap;         /* prevents child elements from wrapping onto multiple lines within the header */
  overflow-x: none;            /* don't allow horizontal scroll if too narrow */
  padding-bottom: 10px;
}
#header .nav-logo-left,
#header .nav-center,
#header .nav-logo-right {
  flex: 0 0 auto;               /* do not stretch */
  text-align: center;
  white-space: nowrap;         /* keep each block on one line */
}
#header h2 { margin: 0 }        /* tighten heading so centering is clean */
#header .nav-logo-right {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 5px;
}
#header .doc-type-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;                    /* inline with logo */
  white-space: nowrap;         /* keep select inline */
}
#header .doc-type-select {
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-width: 120px;
}

.nav-company-name-left { color: black; margin-top: 5px; margin-right: 5px; font-size: 22px; }
.nav-center { padding: 10px 1px 10px 5px; text-align: center; color: #227ec2; }

/* Layout blocks */
.container {
  max-width: 1140px;
  display: flex;
  flex-wrap: wrap-reverse;
  align-content: flex-end;
  align-items: flex-end;
  gap: 20px;
  margin: 10px 20px;
  padding: 0px 10px 10px 10px;
}
.estimate-item {
  flex: auto;
  max-width: 680px;
  margin: 5px auto;
  background-color: white;
  padding: 10px 25px;
  border: 1px solid lightgray;
  border-radius: 3px;
}
.payment-amount-widget-item {
  flex: 0 0 360px;
  margin: 5px auto;
  background-color: white;
  padding: 10px 5px;
  border: 1px solid lightgray;
  border-radius: 3px;
  text-align: center;
}
.acorn-widget-title {
  padding-top: 0px; 
  margin-top: 10px; 
  margin-bottom: 5px;
}
.drywall-defined {
  text-align: left;
  margin-bottom: 30px;
}

/* Utility rows/columns */
.row { display: flex; flex-direction: row; flex-wrap: wrap; width: 100%; }
.column { display: flex; flex-direction: column; flex-basis: 100%; flex: 1; }
.from-for-divider { display: none; }

/* Footer and misc */
.acorn-payment-amount-all { text-align: center; }
.acorn-logo-span img { margin-bottom: -4px; }
.acorn-payment-span, .acorn-popup-link a { color: #147AC6; }
footer { margin-top: 60px; margin-bottom: 20px; font-size: 14px; line-height: 22px; }
.acorn-popup-link-box a { background-color: #147AC6; }
.acorn-payment-span-box { color: #147AC6; }

/* <=1145px: stack behaviors and sticky footer widget */
@media (max-width: 1145px) {
  .container {
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
  }
  .payment-amount-widget-item {
    flex: auto;
    margin: auto !important;
    /* position: sticky; */
    bottom: 0;
    align-self: flex-end;
    max-width: 720px;
  }
  .acorn-footer { display: none; }
}

/* 626px–1145px: widget fills remaining right-side width, not wider than estimate cap */
@media (max-width: 1145px) and (min-width: 626px) {
  .payment-amount-widget-item {
    flex: 1 1 auto;                /* use remaining space */
    width: 100%;                    /* fill available width */
    max-width: 730px;               /* do not exceed estimate max width */
    margin: auto !important;
    position: static;               /* disable sticky here */
    align-self: flex-start;         /* top align */
    box-sizing: border-box;
  }
  .container { align-items: flex-start; }
}

/* <=625px: mobile stacking and polish */
@media (max-width: 625px) {
  .container {
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 !important;
    align-content: flex-start;
    align-items: flex-start;
    max-width: 1140px;
  }
  .payment-amount-widget-item {
    box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.2) !important;
  }
  .estimate-item {
    margin: 0 0 !important;
    font-size: 14px;
  }
  .powered-by { font-size: 12px; padding-right: 0;}
  .for-column { word-break: break-word; overflow-wrap: break-word; margin-left: 0 !important; }
  .from-for-row { flex-direction: column; }
  .from-for-divider { display: block; border: none; border-top: 1px solid darkgray; margin: 8px 0; width: 100%; }
}

/* <=425px and <=320px tweaks */
@media (max-width: 425px) {
  .nav-company-name-left { font-size: 18px; margin-top: 5px; }
  .nav-center { font-size: 14px; }
  .nav-logo-img-right { height: 24px; }
  .payment-amount-widget-item { flex: auto; margin: 5px 15px; padding: 0; }
  .estimate-item { flex: auto; margin: 5px 15px; }
  @media (max-width: 320px) {
    .estimate-item { font-size: 0.8rem; }
    .nav-company-name-left { font-size: 14px; }
    .payment-amount-widget-item h3 { font-size: 1em; }
  }
}

/* <=375px: small font */
@media (max-width: 375px) {
  .estimate-item { font-size: 12px; }
}

