.signoff-workflow {
  display: grid;
  gap: 16px;
}
.signoff-step {
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  display: grid;
  gap: 12px;
}
.signoff-step input:not([type="checkbox"]):not([type="file"]),
.signoff-step select,
.signoff-step textarea {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid #bbb;
  border-radius: 8px;
}
.customer-signature {
  width: 100%;
  height: 150px;
  touch-action: none;
  border: 2px solid #777;
  border-radius: 8px;
  background: #fff;
}
.signoff-signature-image {
  max-width: 100%;
  max-height: 100px;
}
.signoff-status {
  font-size: 1.15rem;
  font-weight: 700;
  padding: 14px;
  background: #fff3d1;
  border-radius: 8px;
}
.signoff-status[data-state="approved"] {
  background: #d8f6e0;
  color: #17612e;
}
.signoff-status[data-state="needs_fix"] {
  background: #ffe0df;
  color: #8b2521;
}
/* Balance payment (Stripe scan to pay). One calm card under the approval line.
 * Paid is the strongest line. A refund, a dispute or a failed cancel is a
 * warning. "Checking payment" is quiet on purpose. */
.stripe-balance {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface, #fff);
  border: 1px solid var(--line-strong, #cbd5e1);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: var(--ink, #111827);
}
.stripe-balance p { margin: 0; }
.stripe-balance button { width: 100%; margin: 0; }
.stripe-balance-paid {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: #d8f6e0;
  border: 2px solid #17612e;
  border-radius: 10px;
  color: #17612e;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}
.stripe-balance-paid::before {
  content: "\2713";
  flex: none;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: #17612e;
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
}
.stripe-balance-left {
  font-size: 1.2rem;
  font-weight: 700;
}
.stripe-balance-warning {
  padding: 12px 14px;
  background: var(--warning-soft, #fffbeb);
  border: 1px solid #f3d9a4;
  border-left: 5px solid var(--warning, #a16207);
  border-radius: 8px;
  color: #713f12;
  font-weight: 700;
}
.stripe-balance-info {
  padding: 12px 14px;
  background: var(--blue-050, #eff6ff);
  border: 1px solid var(--blue-border, #bfdbfe);
  border-radius: 8px;
  color: #1e3a8a;
  font-weight: 600;
}
.stripe-balance-note {
  padding: 12px 14px;
  background: var(--surface-muted, #f1f5f9);
  border-radius: 8px;
  color: var(--ink, #111827);
  font-weight: 600;
}
.stripe-balance-checking {
  color: var(--muted, #475569);
  font-size: 0.95rem;
  text-align: center;
}
.stripe-balance-qr {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 4px 0;
  text-align: center;
}
.stripe-balance-due-label {
  color: var(--muted, #475569);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stripe-balance-amount {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}
.stripe-balance canvas {
  width: min(340px, 100%);
  height: auto;
  margin: 8px 0 4px;
  background: #fff;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
}
.stripe-balance-scan {
  font-size: 1.1rem;
  font-weight: 600;
}
/* The panel sits at the bottom of the job screen, above Send for approval. */
#stripeBalancePanel { margin-top: 16px; }
.stripe-balance-parts {
  color: var(--muted, #475569);
  font-size: 1.05rem;
  font-weight: 600;
}
.stripe-balance-test {
  justify-self: start;
  padding: 6px 12px;
  background: var(--warning-soft, #fffbeb);
  border: 1px solid #f3d9a4;
  border-radius: 999px;
  color: #713f12;
  font-weight: 700;
}
.stripe-balance-qr .stripe-balance-test { justify-self: center; }
.stripe-balance-tip-note {
  color: var(--muted, #475569);
  font-size: 0.95rem;
  text-align: center;
}
.stripe-balance button.stripe-balance-alt {
  justify-self: center;
  width: auto;
  min-height: 44px;
  padding: 0 18px;
  background: transparent;
  border: 0;
  color: var(--muted, #475569);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
#signoffTermsDialog {
  max-width: 92vw;
  max-height: 85vh;
}
#signoffTermsText {
  white-space: pre-wrap;
  font: inherit;
  overflow: auto;
}

.signoff-workflow { gap: 22px; }
.signoff-step { padding: 0; overflow: hidden; border: 2px solid #b9d6ca; gap: 0; font-size: 18px; }
.signoff-step-header { display: flex; flex-wrap: wrap; width: 100%; align-items: center; gap: 8px 12px; padding: 18px; border: 0; background: #dcefe8; color: #173e31; text-align: left; font-size: 20px; cursor: pointer; box-sizing: border-box; max-width: 100%; }
.signoff-step-header strong { flex: 1 1 auto; min-width: 0; overflow-wrap: break-word; }
.signoff-step[data-signoff-step="before"] .signoff-step-header,
.signoff-step[data-signoff-step="after"] .signoff-step-header { background: #e0eef9; color: #183a57; }
.signoff-step[data-signoff-step="charges"] .signoff-step-header,
.signoff-step[data-signoff-step="final"] .signoff-step-header { background: #e8e2f6; color: #40315e; }
.signoff-step-chip { border-radius: 30px; padding: 7px 12px; background: #fff; white-space: nowrap; font-size: 16px; font-weight: 800; }
.signoff-step-summary { margin: 0; padding: 16px 20px; }
.signoff-step-content { display: grid; gap: 16px; padding: 20px; }
.signoff-step-content[hidden],.signoff-step-summary[hidden] { display: none !important; }
.signoff-progress { font-size: 23px; font-weight: 800; margin: 4px 0; }
.signoff-step input:not([type="checkbox"]):not([type="file"]),.signoff-step textarea,.signoff-step select { font-size: 19px; min-height: 48px; }
#signoffChecklist, #jobDocumentationChecklist { display: none; }

/* Owner 2026-10-30: the final sign-off box stays closed until every other step is done. */
.signoff-final-waiting {
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff7df;
  color: #5c3b00;
}
.signoff-final-waiting p { margin: 0 0 6px; font-weight: 600; }
.signoff-final-waiting ul { margin: 0; padding-left: 18px; }
.signoff-final-waiting li { margin: 4px 0; }

/* Owner 2026-11-18: Save signature and Send for approval are the obvious next step. */
.signoff-save-signature { width: 100%; min-height: 56px; margin-top: 4px; font-size: 20px; }
button.signoff-clear-signature {
  width: auto;
  min-height: 40px;
  margin: 0;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 15px;
  font-weight: 650;
  justify-self: start;
}
.signoff-resign-note { margin: 0; color: #5c3b00; font-weight: 700; }
.documentation-actions { flex-direction: column; align-items: stretch; }
.documentation-actions button.primary-button { flex: 1 1 auto; width: 100%; min-height: 56px; font-size: 20px; }
.documentation-actions button.signoff-save-draft {
  flex: 0 0 auto;
  width: auto;
  align-self: flex-start;
  min-height: 40px;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  color: #111;
  font-size: 15px;
  font-weight: 650;
}
.signoff-send-hint { margin: 0; min-height: 1.2em; font-weight: 700; }
.signoff-send-error { color: #8b2521; }
.signoff-send-ok { color: #17612e; }

/* Owner 2026-11-12: the billable Organizer time stands out; shifts not billed sit small under it. */
#signoffSquareTime { margin: 8px 0 2px; font-size: 1.1rem; font-weight: 700; }
#signoffSquareExcluded p { margin: 1px 0; font-size: 0.9rem; color: #637178; }
#signoffSquareExcluded .square-not-billed-label { margin-top: 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }

/* The step rule above sets every input to width 100% and 10px of padding.
   A product quantity is two digits and centered. Minus, the quantity, and plus
   stay on one line. Remove drops under them when the card is too narrow. */
.signoff-step .documentation-product-row .product-line-actions { flex-wrap: wrap; }
.signoff-step .documentation-product-row .product-line-actions .quantity-stepper { flex: 0 0 auto; }
.signoff-step .documentation-product-row .product-line-actions .quantity-step-button {
  width: 40px;
  min-width: 40px;
  max-width: 40px;
  flex: 0 0 auto;
}
.signoff-step .documentation-product-row .product-line-actions .quantity-stepper input[type="number"] {
  width: 2.75rem;
  min-width: 2.75rem;
  max-width: 2.75rem;
  padding: 0;
  text-align: center;
  box-sizing: border-box;
  flex: 0 0 auto;
}

/* Owner 2026-11-19 (iPad): on a tablet the controls sat under the name on the left with empty
   space to the right. From 600px wide, the name stays on the left and the -, quantity, + and
   Remove sit on the right of the same line, with bigger finger targets. Phones keep the stacked row. */
@media (min-width: 600px) {
  .signoff-step .documentation-product-row,
  .documentation-product-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }
  .documentation-product-row .product-line-copy { flex: 1 1 auto; }
  .signoff-step .documentation-product-row .product-line-actions,
  .documentation-product-row .product-line-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 14px;
  }
  .signoff-step .documentation-product-row .product-line-actions .quantity-step-button {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
  }
  .signoff-step .documentation-product-row .product-line-actions .quantity-stepper input[type="number"] {
    width: 3.5rem;
    min-width: 3.5rem;
    max-width: 3.5rem;
    min-height: 48px;
    padding: 0;
    font-size: 1.1rem;
  }
  .documentation-product-row .product-remove { min-height: 48px; padding: 0 8px; }
}

/* Owner 2026-11-19: the box's small up and down arrows were too small for a thumb, so they are
   gone. Tap the number to select it and type the new count; the big - and + stay. */
.documentation-products input[type="number"]::-webkit-inner-spin-button,
.documentation-products input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.documentation-products input[type="number"] { -moz-appearance: textfield; appearance: textfield; text-align: center; }
.documentation-products .products-added-label { margin: 14px 0 6px; font-weight: 700; }
.documentation-products .products-empty-note { margin: 14px 0 6px; color: var(--muted); }

/* Owner 2026-11-19: "Let's bring the 'Add a product' field higher up and clearly separated
   from everything else below it." The picker is the first thing in the Products step, the
   empty space above it is gone, and a line separates it from the products already added.
   The word "Quantity" is read aloud to screen readers but not shown, so the picker, the
   - 1 + count and Add line up on one row. */
.signoff-step .documentation-products { margin-top: 0; }
.documentation-products .ordered-context:empty { display: none; }
.documentation-products .documentation-product-editor {
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 6px;
  border-bottom: 2px solid #93c5fd;
}
.documentation-product-editor .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* The total changed: the sentence and the two totals, at the top of the
   signature box so nobody has to scroll to see why the pad was cleared. */
.signoff-receipt-compare {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  padding: 14px 16px;
  border-left: 4px solid #b45309;
  border-radius: 8px;
  background: #fff7df;
  color: #5c3b00;
  scroll-margin-top: 96px;
}
.signoff-receipt-compare p { flex: 1 1 180px; margin: 0; font-size: 18px; }
.signoff-receipt-compare p.signoff-receipt-compare-message { flex: 1 1 100%; font-size: 19px; font-weight: 800; line-height: 1.3; }
.signoff-receipt-compare p.signoff-receipt-compare-total { font-weight: 650; }
.signoff-receipt-compare .signoff-app-refresh { flex: 1 1 100%; min-height: 52px; margin: 4px 0 0; font-size: 19px; }

/* Tip for the crew at the final signature (owner 2026-11-22). One calm row of
 * large buttons, each with its dollar amount. Selecting one changes only its
 * colors, so nothing on the step moves. */
.signoff-tip {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: var(--surface-muted, #f8fafc);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px;
}
.signoff-tip p { margin: 0; }
.signoff-tip-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink, #111827);
}
.signoff-tip-choices {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.signoff-tip-choice {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 72px;
  padding: 8px 4px;
  margin: 0;
  background: #fff;
  border: 2px solid var(--line-strong, #cbd5e1);
  border-radius: 10px;
  color: var(--ink, #111827);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.signoff-tip-choice.is-selected {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.signoff-tip-choice:disabled { opacity: 0.55; }
.signoff-tip-label {
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}
.signoff-tip-amount {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.15;
  white-space: nowrap;
  opacity: 0.85;
}
.signoff-tip-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.signoff-tip-custom-label {
  display: grid;
  gap: 4px;
  font-weight: 700;
}
.signoff-tip-custom .signoff-tip-use { min-height: 48px; margin: 0; }
.signoff-tip-share {
  color: var(--muted, #475569);
  font-size: 0.95rem;
}
.signoff-tip-message {
  color: #8b2521;
  font-weight: 700;
}
.signoff-tip-saved { font-weight: 700; }
.signoff-tip-words { display: block; font-weight: 700; }
.receipt-total.receipt-tip span { color: var(--muted, #475569); }
/* The amount keeps one width ("No tip" or "$239.39"), so picking a tip never
 * re-wraps the label and nothing below it moves. */
.receipt-total.receipt-tip strong { flex: none; min-width: 9ch; text-align: right; }
@media (max-width: 520px) {
  .signoff-tip-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .signoff-tip-custom { grid-template-columns: minmax(0, 1fr); }
}
/* The owner's Fold cover screen: two wide columns so every amount fits. */
@media (max-width: 400px) {
  .signoff-tip-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The owner's customer pay link (owner preview "for real" only). */
#ownerPayLinkPanel { margin-top: 16px; }
.owner-pay-link { display: grid; gap: 12px; padding: 18px; background: var(--surface, #fff); border: 2px dashed #94a3b8; border-radius: 12px; color: var(--ink, #111827); }
.owner-pay-link h3 { margin: 0; }
.owner-pay-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.owner-pay-badge { padding: 3px 10px; border-radius: 999px; background: #fffbeb; border: 1px solid #f3d9a4; color: #713f12; font-size: 0.8rem; font-weight: 800; }
.owner-pay-note { margin: 0; color: var(--muted, #475569); overflow-wrap: anywhere; }
.owner-pay-make { width: 100%; min-height: 56px; font-size: 1.1rem; }
.owner-pay-error { margin: 0; padding: 12px 14px; border-radius: 8px; background: #fffbeb; border: 1px solid #f3d9a4; border-left: 5px solid #a16207; color: #713f12; font-weight: 700; }
.owner-pay-card { display: grid; gap: 12px; }
.owner-pay-amount { margin: 0; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.owner-pay-amount small { display: block; font-size: 0.9rem; font-weight: 600; color: var(--muted, #475569); }
.owner-pay-url { margin: 0; padding: 10px 12px; border-radius: 8px; background: #f1f5f9; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9rem; word-break: break-all; }
.owner-pay-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.owner-pay-buttons > * { min-height: 52px; margin: 0; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.owner-pay-copied { margin: 0; min-height: 1.2em; color: #15803d; font-weight: 700; }
.owner-pay-qr { display: grid; justify-items: center; gap: 6px; text-align: center; }
.owner-pay-qr canvas { width: min(340px, 100%); height: auto; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; }
.owner-pay-qr p { margin: 0; color: var(--muted, #475569); }
.owner-pay-message { display: grid; gap: 6px; }
.owner-pay-label { margin: 0; font-weight: 700; }
.owner-pay-message textarea { width: 100%; box-sizing: border-box; padding: 10px; font: inherit; border: 1px solid #cbd5e1; border-radius: 8px; resize: vertical; }
.owner-pay-offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
