/* Phone estimate polish: compact the page without changing estimator math or saved data. */
#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu {
  width: 100%;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #a855f7;
  border-radius: 8px;
  background: #11101a;
  color: #f5eaff;
  cursor: pointer;
  list-style: none;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu > summary::-webkit-details-marker {
  display: none;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu > summary > span {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  gap: 2px 8px;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu > summary > span > svg {
  grid-row: 1 / 3;
  width: 19px;
  height: 19px;
  color: #d946ef;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu > summary strong {
  font-size: 15px;
  line-height: 1.1;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu > summary small {
  color: #bca7cc;
  font-size: 10px;
  line-height: 1.1;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu > summary > svg {
  width: 18px;
  height: 18px;
  transition: transform .18s ease;
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-menu[open] > summary > svg {
  transform: rotate(180deg);
}

#app .premium-app .core-ai-scope-tools .core-ai-cruz-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding-top: 8px;
}

@media (max-width: 680px) {
  /* The desktop grid's minimum viewport height was stretching this column and
     producing the large empty gap above Proposal summary on phones. */
  #app .customer-builder-painting-main .customer-builder-layout {
    min-height: 0 !important;
    align-content: start !important;
    grid-auto-rows: max-content !important;
  }

  #app .customer-builder-painting-main .customer-builder-main,
  #app .customer-builder-painting-main .customer-builder-services {
    min-height: 0 !important;
    height: auto !important;
    align-self: start !important;
    margin-bottom: 0 !important;
  }

  /* Give service and pricing their own full-width row so labels remain readable. */
  #app .painting-standalone-standard-header > .painting-service-header-actions,
  #app .painting-header-service-controls {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  #app .painting-header-add-service {
    grid-column: 1 / -1 !important;
    width: 100% !important;
  }

  #app .painting-header-service-select,
  #app .painting-header-method {
    min-width: 0 !important;
  }

  #app .painting-header-service-select span,
  #app .painting-header-method span,
  #app .painting-header-method strong,
  #app .painting-header-service-select select {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    line-height: 1.15 !important;
  }

  #app .painting-header-method {
    padding-inline: 9px !important;
  }

  #app .painting-header-method > span {
    gap: 6px !important;
  }

  #app .painting-header-method > span > svg {
    width: 16px !important;
    height: 16px !important;
  }

  #app .painting-header-method strong {
    font-size: 13px !important;
    letter-spacing: -.1px !important;
  }

  /* Template names are meaningful job information, so never shorten them to dots. */
  #app .painting-template-card-head > div:first-child h2 {
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    line-height: 1.28 !important;
  }

  /* Keep the currency prefix and value inside one clean phone-width field. */
  #app .painting-template-money {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  #app .painting-template-money b {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    padding: 0 !important;
  }

  #app .painting-template-money input {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  #app .premium-app:has(.painting-proposal-flow) .handyman-topbar .topbar-title-copy h1 {
    font-size: 18px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #app .premium-app:has(.painting-proposal-flow) .handyman-topbar .topbar-title-copy p {
    display: none !important;
  }

  /* One compact Cruz entry replaces three always-visible AI buttons. */
  #app .painting-module-shell.interior > .core-ai-scope-tools {
    display: block !important;
    margin: 7px 0 !important;
    padding: 7px !important;
  }

  #app .premium-app .core-ai-scope-tools .core-ai-cruz-options {
    grid-template-columns: minmax(0, 1fr);
  }

  #app .painting-module-shell.interior > .core-ai-scope-tools .core-ai-cruz-options .core-ai-button {
    justify-content: flex-start !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    font-size: 12px !important;
    text-align: left !important;
  }

  /* Keep long template wording editable inside a contained, invisible scroller. */
  #app .premium-app .painting-template-rich-editor {
    min-height: 250px !important;
    max-height: min(46vh, 390px) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  #app .premium-app .painting-template-rich-editor::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
}
