/* Integrated Quick Pencil Layout */
#quick-pencil form {
    padding: 1rem;
}
#quick-pencil .tabs {
    margin-bottom: 1rem;
}
#quick-pencil .qp-fields {
    margin-bottom: 1rem;
}
#quick-pencil .qp-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
#quick-pencil .qp-row label {
    justify-self: left;
    padding-right: 0.5rem;
    font-weight: 600;
    color: #333;
}
#quick-pencil .qp-row input,
#quick-pencil .qp-row select {
    width: 100%;
    max-width: 250px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

/* State dropdown specific styling */
#quick-pencil #state-select {
    background-color: white;
    cursor: text;
}

#quick-pencil #state-select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.1);
}
#quick-pencil .results {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
}
#quick-pencil .results h3,
#quick-pencil .results p {
    margin: 0.25rem 0;
    color: #333;
}
#quick-pencil .results h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

/* Divider and grid layout for summary rows in results */
#quick-pencil .results hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 0.5rem 0;
}
#quick-pencil .results .summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    margin-bottom: 0.75rem;
}
#quick-pencil .results .summary-row .label {
    font-weight: 600;
    color: #333;
    text-align: left;
}
#quick-pencil .results .summary-row .value {
    text-align: right;
}
#quick-pencil .results .summary-row.total-row .label {
    font-weight: 700;
}
#quick-pencil .results .summary-row:last-child .value {
    font-weight: bold;
}

/* Rebate disclosure styling */
#quick-pencil .results .summary-row.rebate-disclosure {
    grid-template-columns: 1fr;
    margin-bottom: 0.5rem;
    margin-top: -0.25rem;
}
#quick-pencil .results .summary-row.rebate-disclosure .disclosure-text {
    font-size: 0.9rem;
    font-style: italic;
    color: #666;
    text-align: left;
    padding-left: 1rem;
}

/* Print only the Quick Pencil summary content */
@media print {

  /* Hide form elements, only show results */
  #quick-pencil #qp-form, #quick-pencil .tabs {
      display: none !important;
  }

  /* Make only the results section and its children visible */
  #qp-results, #qp-results * {
    visibility: visible !important;
  }

  #qp-results {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px; /* Add some padding for print */
    margin: 0;
    background-color: #fff; /* Ensure white background for printing */
  }

  /* Mirror on-screen summary layout in print for #qp-results */
  #qp-results h2,
  #qp-results h3,
  #qp-results p,
  #qp-results div {
    margin: 0.25rem 0;
    color: #000 !important; /* Ensure text is black for printing */
    background-color: transparent !important;
  }
  #qp-results h2 {
    font-size: 1.2rem;
  }
  #qp-results h3 {
    margin-top: 0;
    font-size: 1.1rem;
  }
  #qp-results hr {
    border: none;
    border-top: 1px solid #ccc !important;
    margin: 0.5rem 0;
  }
  #qp-results .summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    margin-bottom: 0.75rem;
  }
  #qp-results .summary-row .label {
    font-weight: 600;
    text-align: left;
  }
  #qp-results .summary-row .value {
    text-align: right;
  }
  #qp-results .summary-row.total-row .label {
    font-weight: 700;
  }
  #qp-results .summary-row:last-child .value {
    font-weight: bold;
  }
  
  /* Print styling for rebate disclosure */
  #qp-results .summary-row.rebate-disclosure {
    grid-template-columns: 1fr;
    margin-bottom: 0.5rem;
    margin-top: -0.25rem;
  }
  #qp-results .summary-row.rebate-disclosure .disclosure-text {
    font-size: 0.9rem;
    font-style: italic;
    color: #666 !important;
    text-align: left;
    padding-left: 1rem;
  }

  /* Ensure action buttons do not appear on printouts */
  #qp-actions {
    display: none !important;
  }
}
