/* money area styles: quotes, invoices, price list, customer pages. Owned by the money agent. Every class starts with m-. Phone first. */
.m-small { font-size: .9rem; } .m-label-small { display: block; font-size: var(--fs-13); font-weight: 600; color: var(--muted); }
.m-label { display: block; font-weight: 600; margin-bottom: 4px; }
.m-prose { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 12px; }
.m-wrap { overflow-wrap: anywhere; }
.m-intro { margin: -4px 0 16px; max-width: 60ch; }
.m-none { padding: 20px 4px; }
.m-linkish { background: none; border: 0; padding: 0 2px; min-height: 36px; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; }
.m-linkish:hover { text-decoration: underline; }
.m-btn-quiet-danger { color: var(--danger); }
.m-btn-quiet-danger:hover { border-color: var(--danger); }
.m-callout { padding: 10px 12px; border-radius: 8px; background: var(--brand-soft); color: var(--text); font-weight: 600; }

/* Page heads */
.m-head { align-items: flex-start; }
.m-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.m-head h1 .badge { font-size: .85rem; }
.m-subtitle { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.m-head-total { text-align: right; } .m-head-total .money { font-size: 1.35rem; font-weight: 800; }
/* On a phone the total wraps under the title, so it lines up on the left with it. */
@media (max-width: 639px) { .m-head-total { text-align: left; } }

/* Lists */
.m-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.m-toolbar > * { min-width: 0; }
.m-chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.m-chips .chip { flex: none; min-height: 44px; padding: 0 14px; }
.m-chip-count { font-size: .8rem; font-weight: 700; padding: 0 7px; border-radius: 999px; background: rgba(0,0,0,.07); }
.chip[aria-pressed=true] .m-chip-count { background: rgba(255,255,255,.2); }
.m-rows { gap: 6px; }
.m-row { min-height: 60px; }
.m-row:hover { border-color: #b9c2be; }
.m-row-main { display: grid; gap: 2px; min-width: 0; }
.m-row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-num-tag { color: var(--muted); font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.m-row-sub { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-row-side { display: grid; justify-items: end; gap: 4px; flex: none; }
.m-row-amount { font-weight: 700; }
.m-row-overdue { border-left: 4px solid var(--danger); }

.m-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.m-tile { display: grid; gap: 2px; text-align: left; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.m-tile[aria-pressed=true] { outline: 2px solid var(--brand); outline-offset: -2px; }
.m-tile-label { font-size: var(--fs-13); font-weight: 600; color: var(--muted); }
.m-tile-amount { font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.m-tile-sub { font-size: .8rem; color: var(--muted); }
.m-tile-warn .m-tile-amount { color: var(--warn); } .m-tile-danger .m-tile-amount { color: var(--danger); }

/* Status and actions */
.m-status { border-left: 4px solid var(--line); }
.m-status > p { margin: 0 0 8px; } .m-status > p:last-child { margin-bottom: 0; }
.m-status-brand { border-left-color: var(--brand); } .m-status-ok { border-left-color: var(--ok); background: var(--ok-soft); }
.m-status-danger { border-left-color: var(--danger); } .m-status-warn { border-left-color: var(--warn); }
.m-status .btn { margin-top: 4px; }
/* An approved quote's next step (schedule the job, check the invoice), right under the approval banner. */
.m-next-step { margin: 10px 0; padding-top: 10px; border-top: 1px solid var(--line-strong); }
.m-next-step > p { margin: 0 0 8px; }
.m-next-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.m-next-actions .btn { margin-top: 0; white-space: normal; text-align: center; }
@media (max-width: 520px) { .m-next-actions .btn { flex: 1 1 100%; } }
.m-balance-panel { display: grid; gap: 2px; }
.m-balance-big { font-size: 1.9rem; font-weight: 800; line-height: 1.15; }
.m-status-danger .m-balance-big { color: var(--danger); }
.m-draft-note { margin: -4px 0 10px; }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.m-actions > .btn { flex: 1 1 auto; }
.m-inline-share { flex: 1 1 100%; }
.m-inline-share > summary { list-style: none; display: inline-flex; }
.m-inline-share > summary::-webkit-details-marker { display: none; }
.m-inline-share[open] > summary { margin-bottom: 8px; }
.m-inline-share .m-share { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* Two columns on wide screens */
.m-columns { display: grid; gap: 12px; }
.m-col-main, .m-col-side { min-width: 0; }

/* A quote or invoice, read-only */
.m-doc-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 4px; }
.m-doc-head h2 { margin: 0; }
.m-doc-title { font-size: 1.15rem; margin: 8px 0 6px; }
.m-lines { width: 100%; border-collapse: collapse; margin: 8px 0 4px; }
.m-lines th { text-align: left; font-size: var(--fs-13); font-weight: 600; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); }
.m-lines td { padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.m-lines .m-num { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; }
.m-lines .m-wide { display: none; }
.m-item { display: grid; gap: 2px; }
.m-item-name { font-weight: 600; overflow-wrap: anywhere; }
.m-item-desc { color: var(--muted); font-size: .9rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.m-item-math { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.m-item-tag { justify-self: start; font-size: .75rem; font-weight: 700; color: var(--muted); background: #eef0ef; border-radius: 999px; padding: 1px 8px; }
.m-amount { font-weight: 600; }
.m-empty-lines { padding: 12px 0; }
.m-totals { margin: 8px 0 0; display: grid; gap: 4px; justify-items: stretch; }
.m-total-row { display: flex; justify-content: space-between; gap: 12px; }
.m-total-row dt { color: var(--muted); } .m-total-row dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.m-grand { padding-top: 8px; margin-top: 4px; border-top: 2px solid var(--text); font-weight: 800; font-size: 1.15rem; }
.m-grand dt { color: var(--text); }
.m-balance { font-weight: 800; font-size: 1.1rem; } .m-balance dt { color: var(--text); }
.m-totals-msg { margin: 4px 0 0; }
.m-terms { margin-top: 16px; padding-top: 4px; border-top: 1px solid var(--line); }
.m-terms h3 { font-size: 1rem; }

.m-facts { margin: 0; display: grid; gap: 10px; }
.m-evidence { border-left: 4px solid var(--ok); }
.m-next h2, .m-notes h2, .m-history h2, .m-evidence h2, .m-payments h2, .m-share-card h2, .m-doc h2 { margin-top: 0; }
.m-next .list { margin-bottom: 10px; }
.m-next .btn { width: 100%; }

.m-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.m-version { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.m-version > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 44px; padding: 8px 12px; cursor: pointer; }
.m-version-name { font-weight: 700; }
.m-version > summary .money { margin-left: auto; font-weight: 600; }
.m-version > summary .m-small { flex-basis: 100%; }
.m-version-body { padding: 0 12px 12px; }

/* Share box */
.m-share { display: grid; gap: 10px; margin-top: 10px; }
.m-share .hint { margin: 0; }

/* Dialogs */
.m-dialog .m-callout { margin-bottom: 12px; }
.m-danger-form .btn-primary { background: var(--danger); border-color: var(--danger); }

/* Customer picker */
.m-picker { display: grid; gap: 10px; }
.m-picker-results { gap: 6px; }
.m-picker-row { min-height: 56px; }
.m-picker-text { display: grid; gap: 2px; min-width: 0; }
.m-picker-note { padding: 12px 4px; }
.m-new-customer { border: 1px dashed #b9c2be; border-radius: var(--radius); padding: 0 14px; background: var(--surface); }
.m-new-customer > summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--brand); }
.m-new-customer[open] { padding-bottom: 14px; }
.m-row3 { display: grid; grid-template-columns: 1fr; gap: 14px; }
.m-picked { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 0; }
.m-picked-main { display: grid; gap: 2px; min-width: 0; }
.m-for { display: grid; gap: 14px; }

/* Editor */
.m-editor { gap: 18px; grid-template-columns: minmax(0, 1fr); }
.m-editor > *, .m-edit-section > * { min-width: 0; }
.m-edit-section h2 { margin-top: 0; }
.m-edit-lines { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.m-line { margin: 0; min-width: 0; display: grid; gap: 10px 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "head head" "name name" "qty price" "tax total" "more more" "desc desc"; }
.m-line .field input:not([type=checkbox]) { min-width: 0; }
.m-line-head { grid-area: head; display: flex; align-items: center; gap: 8px; }
.m-line-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: .85rem; }
.m-line-remove { margin-left: auto; }
.m-line-move { min-width: 44px; }
.m-line-name { grid-area: name; } .m-line-qty { grid-area: qty; } .m-line-price { grid-area: price; }
.m-line-tax { grid-area: tax; align-self: center; } .m-line-tax label { min-height: 44px; align-items: center; }
.m-line-total { grid-area: total; text-align: right; align-self: center; }
.m-line-amount { font-weight: 800; font-size: 1.1rem; }
.m-line-more { grid-area: more; margin-top: -6px; } .m-line-desc { grid-area: desc; }
.m-line .field-msg { overflow-wrap: anywhere; }
.m-adders { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }


.m-adders > .btn { justify-self: start; }
.m-edit-totals { margin: 0; }
.m-edit-adjust { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.m-edit-adjust .hint { font-size: .82rem; }
.m-totals-live { padding-top: 8px; border-top: 1px solid var(--line); }
.m-bar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0,0,0,.07); }
.m-bar-sum { display: grid; } .m-bar-total { font-size: 1.25rem; font-weight: 800; }
.m-bar-actions { display: flex; gap: 8px; min-width: 0; }
@media (max-width: 559px) { .m-bar { gap: 8px; padding-left: 12px; padding-right: 12px; } .m-bar-actions .btn { padding: 0 12px; } }

.has-tabbar .m-bar { bottom: calc(var(--tabbar-h) + var(--safe-bottom)); padding-bottom: 10px; }

/* Payments */
.m-pay-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 0; }
.m-pay { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.m-pay-main { display: grid; gap: 1px; min-width: 0; }
.m-pay-amount { font-weight: 800; }
.m-due-edit > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--brand); }

/* Price list */
.m-svc-section h2 { margin-top: 0; }
.m-add-svc > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--brand); }
.m-add-svc[open] > summary { margin-bottom: 8px; }
.m-add-svc:not([open]) { padding-top: 4px; padding-bottom: 4px; }
.m-svc-list { gap: 8px; }
.m-svc { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.m-svc-main { flex: 1 1 220px; min-width: 0; display: grid; gap: 4px; }
.m-svc-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.m-svc-top strong { overflow-wrap: anywhere; }
.m-svc-price { font-weight: 800; white-space: nowrap; }
.m-svc .m-prose { margin: 0; }
.m-svc-tags { display: flex; gap: 6px; }
.m-svc-actions { display: flex; gap: 6px; }
.m-svc > .m-svc-form { flex: 1 1 100%; }
.m-archived-toggle { margin-top: 12px; }
.m-settings h2 { margin-top: 0; }
/* /services#settings: the heading lands below the phone's top bar, not under it. */
.m-settings { scroll-margin-top: 76px; }

/* Customer pages (/q/:token, /i/:token) */
.m-pub-root { min-height: 100vh; background: var(--bg); }
.m-pub-head { background: var(--brand); color: var(--brand-ink); padding: 12px 16px; }
.m-pub-head-inner { max-width: 720px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; }
.m-pub-company { margin: 0; padding: 8px 0; font-size: 1.25rem; font-weight: 800; overflow-wrap: anywhere; }
.m-pub-contacts { display: flex; flex-wrap: wrap; gap: 0 14px; }
.m-pub-contact { display: inline-flex; align-items: center; min-height: 44px; color: inherit; font-weight: 600; overflow-wrap: anywhere; }
.m-pub-head :focus-visible { outline-color: #fff; }
.m-pub-body { max-width: 720px; margin: 0 auto; padding: 16px; }
.m-pub-doc { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 16px; box-shadow: var(--shadow); }
.m-pub-doc h3 { font-size: var(--fs-15); color: var(--ink-2); margin: 22px 0 4px; }
.m-pub-titlebar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.m-pub-titlebar h1 { margin: 0; }
.m-pub-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin: 14px 0 4px; }
.m-pub-for { display: grid; gap: 1px; margin: 0; }
.m-pub-dates { margin: 0; color: var(--muted); font-size: .9rem; align-self: end; }
.m-pub-title { font-size: 1.3rem; margin: 18px 0 0; overflow-wrap: anywhere; }
.m-pub-doc .m-totals { margin-left: auto; max-width: 360px; }
.m-pub-panel { margin-top: 22px; padding: 16px; border-radius: var(--radius); background: #f3f5f4; border: 1px solid var(--line); }
.m-pub-panel h2 { margin: 0 0 6px; }
.m-pub-panel p { margin: 0 0 6px; } .m-pub-panel p:last-child { margin-bottom: 0; }
.m-pub-ok { background: var(--ok-soft); border-color: #bfe3cc; }
.m-pub-ok h2 { color: var(--ok); }
.m-pub-notice { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--brand-soft); font-weight: 600; }
.m-pub-notice-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0d9a8; }
.m-pub-notice-ok { background: var(--ok-soft); color: var(--ok); }
.m-pub-notice:focus { outline: none; }
.m-pub-decide { margin-top: 24px; padding-top: 18px; border-top: 2px solid var(--line); }
.m-pub-approve h2 { margin: 0; }
.m-pub-approve > p { margin: 0; }
.m-pub-agree label { font-weight: 700; font-size: 1.05rem; }
.m-pub-agree input { width: 26px; height: 26px; }
.m-pub-go { width: 100%; min-height: 52px; font-size: 1.05rem; }
.m-pub-decline { margin-top: 18px; }
.m-pub-decline > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-weight: 600; }
.m-pub-decline[open] > summary { margin-bottom: 6px; }
.m-pub-decline textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #b9c2be; border-radius: 8px; font: inherit; }
.m-pub-decline p { margin: 0; }
.m-pub-due { display: grid; gap: 2px; margin: 14px 0 0; padding: 14px 16px; border-radius: var(--radius); background: var(--warn-soft); }
.m-pub-due-amount { font-size: 2rem; font-weight: 800; line-height: 1.15; }
.m-pub-due-late { background: var(--danger-soft); color: var(--danger); } .m-pub-due-late .m-label-small { color: var(--danger); }
.m-pub-due-paid { background: var(--ok-soft); color: var(--ok); } .m-pub-due-paid .m-label-small { color: var(--ok); }
.m-pub-payments .m-pay:last-child { border-bottom: 0; }
.m-pub-howto { background: var(--brand-soft); border-color: #c6e2da; }
.m-pub-foot { max-width: 720px; margin: 0 auto; padding: 0 16px 32px; display: flex; justify-content: center; }

@media (min-width: 560px) {
  .m-row3 { grid-template-columns: 2fr 1fr 1fr; }
  .m-actions > .btn { flex: 0 0 auto; }
  .m-pub-doc { padding: 24px 28px; }
  .m-pub-go { width: auto; padding: 0 28px; }
}
@media (min-width: 760px) {
  .m-toolbar { grid-template-columns: minmax(220px, 320px) 1fr; align-items: center; }
  .m-lines .m-wide { display: table-cell; } .m-lines .m-narrow { display: none; }
  .m-tile-amount { font-size: 1.35rem; }
  .m-line { grid-template-columns: 2rem minmax(0, 1fr) 5.5rem 8rem 7rem 6.75rem 44px 5.75rem; align-items: end;
    grid-template-areas: "n name qty price total tax move remove" ". more more more more more more more" ". desc desc desc desc desc desc desc"; }
  .m-line-head { display: contents; }
  .m-line-n { grid-area: n; align-self: end; margin-bottom: 8px; }
  .m-line-move { grid-area: move; min-width: 0; width: 44px; padding: 0; } .m-line-remove { grid-area: remove; margin-left: 0; width: 100%; }
  .m-line-total { align-self: end; min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
  .m-line-tax { align-self: end; }
  .m-line-more { margin-top: -4px; }
  /* Repeat the column labels only on the first line; later lines keep them for screen readers. */
  .m-line + .m-line .m-line-name label, .m-line + .m-line .m-line-qty label, .m-line + .m-line .m-line-price label,
  .m-line + .m-line .m-line-total .m-label-small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .m-edit-adjust { max-width: 420px; }
  .m-edit-totals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 8px 24px; align-items: start; }
  .m-edit-totals > .hint { grid-column: 1 / -1; }
  .m-bar { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); }
}
@media (min-width: 960px) {
  .has-tabbar .m-bar { bottom: 0; }
  .m-columns { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .m-col-side { position: sticky; top: 12px; }
}
@media print {
  .topbar, .nav, .back-link, .m-actions, .m-bar, .m-share-card, .m-col-side, .m-history, .m-pub-foot, .m-pub-decide, .m-pub-contacts a::after, #toasts { display: none !important; }
  body, .m-pub-root { background: #fff; }
  .m-pub-head { background: none; color: #000; border-bottom: 2px solid #000; padding: 0 0 8px; }
  .m-pub-body { padding: 12px 0; max-width: none; }
  .m-pub-doc, .card { border: 0; box-shadow: none; padding: 0; }
  .m-lines .m-wide { display: table-cell; } .m-lines .m-narrow { display: none; }
  .m-columns { display: block; }
}

/* ---------- Round 1 fixes: removed payments, how-to-pay buttons, setup warning ---------- */
/* A payment taken off stays listed: struck through, never counted, with when and why under it. */
.m-pay-removed .m-pay-amount { text-decoration: line-through; color: var(--muted); }
.m-pay-removed-note { display: block; color: var(--warn); }
/* Tap-to-call and tap-to-email on the customer's invoice page: full width on a phone, side by side when there is room. */
.m-pub-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.m-pub-actions .btn { flex: 1 1 220px; min-height: 48px; justify-content: center; overflow-wrap: anywhere; text-align: center; }
/* A long email ("Email dana.owner@example.test") wraps inside its button instead of running off a 360px phone. */
.m-pub-actions .btn { white-space: normal; min-width: 0; max-width: 100%; padding-top: 8px; padding-bottom: 8px; }
.m-setup-notice { margin: 0 0 12px; }
.m-setup-notice p { margin: 0 0 8px; }
.m-setup-notice p:last-child { margin-bottom: 0; }
.m-howto-add { margin: 4px 0 10px; }
.m-howto-add > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--brand); }
.m-howto-add .form { margin-top: 4px; }
.m-doc-for { margin: 0 0 8px; overflow-wrap: anywhere; }

/* ---------- Round 3: share only when shared, payment setup, payment apps, receipts, print, proof details ---------- */
/* "I sent it another way": the box that marks a link as shared without Copy, Text or Email. */
.m-sent-other { margin: 0; }
.m-sent-other label { font-weight: 600; }
.m-sent-other input { width: 22px; height: 22px; }
/* "Use 8.25% for every new quote" under the tax rate. */
.m-edit-left { min-width: 0; }
.m-tax-offer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 8px; max-width: 420px; }
.m-tax-offer .hint { margin: 0; }
.m-tax-offer-btn { min-height: 44px; }
/* Before an unpaid invoice can be shared: one small form for what the customer needs. */
.m-setup-card { border-left: 4px solid var(--warn); }
.m-setup-card h2 { margin-top: 0; }
.m-setup-card > p { margin: 0 0 10px; }
.m-setup-card .callout { margin-bottom: 10px; }
.m-setup-group { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; display: grid; gap: 4px; }
.m-setup-group > legend { font-weight: 700; padding: 0; margin-bottom: 4px; }
.m-setup-group > .hint { margin: 0 0 6px; }
.m-setup-group .form-row { min-width: 0; }
/* A paid invoice: "Send receipt" opens the same share box. */
.m-receipt > p { margin: 0 0 8px; }
.m-receipt details > summary { list-style: none; display: inline-flex; }
.m-receipt details > summary::-webkit-details-marker { display: none; }
.m-receipt details[open] > summary { margin-bottom: 4px; }
.m-share-ready > p { margin: 0 0 4px; }
/* The approval's technical evidence, closed until someone needs it. */
.m-proof { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.m-proof > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--brand); }
.m-proof > p { margin: 0 0 8px; }
.m-proof code { font-size: .8rem; }
.m-version-current { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 44px; padding: 8px 12px; }
.m-version-current .money { margin-left: auto; font-weight: 600; }
/* The customer's invoice: payment apps as big rows to tap. */
.m-pub-paywith { list-style: none; margin: 8px 0 12px; padding: 0; display: grid; gap: 8px; }
.m-pub-payrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px; min-height: 52px; padding: 8px 14px;
  border: 1px solid #b8d8ce; border-radius: var(--radius); background: var(--surface); color: var(--text); text-decoration: none; }
a.m-pub-payrow:hover { border-color: var(--brand); }
.m-pub-payname { grid-column: 1; font-weight: 700; }
.m-pub-payhandle { grid-column: 1; color: var(--muted); overflow-wrap: anywhere; min-width: 0; }
.m-pub-payrow .chev, .m-pub-payrow .btn { grid-column: 2; grid-row: 1 / span 2; }
@media print {
  .m-share, .m-setup-card, .m-print, .m-status .btn, .m-proof > summary, .m-tax-offer { display: none !important; }
  .m-proof:not([open]) { display: none; }
  .m-pub-payrow { border: 0; padding: 0; min-height: 0; }
  .m-pub-payrow .chev, .m-pub-payrow .btn { display: none; }
}

/* ---------- Money upgrades: choices, labor, pictures, costs and margins, extras, progress, batch ---------- */
.m-line-opts { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.m-line-opts .field { margin: 0; }
.m-line-opts .field-check label { min-height: 44px; align-items: center; }
.m-line-choice { border-color: var(--brand-line, var(--line)); background: var(--brand-soft); }
.m-line-labor .m-line-labor-note, .m-line-why { grid-column: 1 / -1; margin: 0; }
.m-line-picwrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.m-line-pic { display: flex; align-items: center; gap: 10px; }
.m-line-pic img, .m-item-pic { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-control, 6px); border: 1px solid var(--line); background: var(--surface); }
.m-item-pic { width: 64px; height: 64px; grid-row: 1 / span 6; align-self: start; }
.m-item:has(.m-item-pic) { grid-template-columns: 64px minmax(0, 1fr); column-gap: 12px; }
.m-item:has(.m-item-pic) > :not(.m-item-pic) { grid-column: 2; }
.m-line-cost { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; }
.m-line-cost .hint { grid-column: 1 / -1; margin: 0; }
.m-inline { display: flex; gap: 8px; align-items: center; } .m-inline input { min-width: 0; flex: 1 1 60px; }
.m-file-pick { display: inline-grid; gap: 4px; } .m-file-pick .field-msg { margin: 0; }
.m-groups-card, .m-edit-extra { margin: 0; }
.m-groups-card h3 { margin: 0 0 4px; font-size: var(--fs-18, 18px); }
.m-edit-extra h2 { margin-top: 0; font-size: var(--fs-18, 18px); }
.m-attach-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.m-attach { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; overflow-wrap: anywhere; }
.m-work-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.m-work-tile { position: relative; display: block; border-radius: var(--radius-control, 6px); overflow: hidden; border: 2px solid transparent; cursor: pointer; }
.m-work-tile:has(input:checked) { border-color: var(--brand); }
.m-work-tile input { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; }
.m-work-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.m-min p { margin: 0 0 8px; }
.m-min-row dt { font-weight: 500; color: var(--ink-2, var(--muted)); }
.m-totals-note { margin: 0 0 8px; }
.m-tag-choice { color: var(--brand); background: var(--brand-soft); }
.m-line-min td { background: var(--ground, #eef0ec); }
.m-margin h2, .m-margin h3 { margin-top: 0; font-size: var(--fs-18, 18px); }
.m-intro { margin-bottom: 8px; }
.m-presented { display: grid; gap: 4px; margin-top: 10px; }
.m-chosen h2 { margin-top: 0; }
.m-progress h2 { margin-top: 0; }
.m-progress-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 4px 0 12px; }
.m-progress-bar span { display: block; height: 100%; background: var(--done, #2F7A4F); }
.m-stage { margin-top: 12px; } .m-stage summary { display: inline-flex; list-style: none; } .m-stage summary::-webkit-details-marker { display: none; }
.m-stage[open] summary { margin-bottom: 8px; }
.m-tools { display: grid; gap: 12px; margin: 0 0 16px; }
.m-tool { margin: 0; }
.m-ai summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.m-ai .callout { margin-top: 10px; }

/* The choices a customer ticks (also in the office's "Record approval"). */
.m-choices { display: grid; gap: 14px; margin: 12px 0; }
.m-choice-set { margin: 0; padding: 0; border: 0; min-width: 0; display: grid; gap: 8px; }
.m-choice-set legend { font-weight: 700; font-size: var(--fs-18, 18px); margin-bottom: 6px; padding: 0; }
.m-choice { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 10px 12px;
  border: 1px solid var(--line-firm, var(--line)); border-radius: var(--radius-lg, 10px); background: var(--surface); cursor: pointer; }
.m-choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--brand-soft); }
.m-choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--brand); }
.m-choice-pic { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-control, 6px); }
.m-choice:not(:has(img)) { grid-template-columns: auto minmax(0, 1fr) auto; }
.m-choice-text { display: grid; gap: 2px; min-width: 0; }
.m-choice-name { font-weight: 600; overflow-wrap: anywhere; }
.m-choice-desc { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.m-choice-amount { font-weight: 700; white-space: nowrap; }
.m-pub-choose-hint { margin: 14px 0 0; color: var(--ink-2, var(--muted)); }

/* Customer pages: logo, intro, attachments, photos, reviews. */
.m-pub-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.m-pub-logo { height: 40px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.m-pub-intro { font-size: var(--fs-18, 18px); }
.m-pub-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-pub-file { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-lg, 10px); overflow-wrap: anywhere; }
.m-pub-file span:nth-of-type(1) { flex: 1 1 auto; font-weight: 600; }
.m-pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.m-pub-shot img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-control, 6px); }
.m-pub-reviews { display: grid; gap: 10px; }
.m-pub-review { margin: 0; padding: 12px 14px; border-left: 4px solid var(--brand); background: var(--ground, #eef0ec); border-radius: 0 var(--radius-lg, 10px) var(--radius-lg, 10px) 0; }
.m-pub-review blockquote { margin: 0; font-size: var(--fs-16, 16px); }
.m-pub-review figcaption { margin-top: 6px; color: var(--ink-2, var(--muted)); font-weight: 600; }

/* Batch invoicing */
.m-batch-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-batch-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-lg, 10px); background: var(--surface); }
.m-batch-row input[type=checkbox] { width: 22px; height: 22px; }
.m-batch-main { display: grid; gap: 2px; min-width: 0; } .m-batch-main span { overflow-wrap: anywhere; }
.m-batch-share { display: grid; gap: 12px; }
.m-batch-share .m-share { border: 1px solid var(--line); border-radius: var(--radius-lg, 10px); padding: 12px; }

@media (min-width: 560px) {
  .m-line-opts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .m-line-opts .m-line-cost, .m-line-opts .m-line-picwrap { grid-column: 1 / -1; }
  .m-line-cost { grid-template-columns: minmax(0, 200px) minmax(0, 260px); }
}
@media print { .m-new-tools, .m-margin, .m-progress, .m-stage { display: none !important; } }
@media (min-width: 760px) {
  /* A labor line reads People / Hours on site, not the Qty / Price headings of the line above it. */
  .m-line.m-line-labor .m-line-qty label, .m-line.m-line-labor .m-line-price label { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; }
  .m-line-labor .m-line-head .badge { display: none; }
  .m-line-head .badge-warn { grid-column: 2 / -1; justify-self: start; }
}
.m-svc-top .m-item-pic { width: 48px; height: 48px; grid-row: auto; flex: 0 0 auto; }
.m-svc-top:has(.m-item-pic) { gap: 10px; } .m-svc-top:has(.m-item-pic) strong { flex: 1 1 auto; }
.m-work-pick > p, .m-work-pick > .error { grid-column: 1 / -1; }
.m-svc-extras { display: grid; gap: 8px; }
.m-logo-now { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.m-review-edit { display: grid; gap: 4px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.m-review-edit > .btn { justify-self: start; }
.m-batch { max-width: 760px; display: grid; gap: 14px; } .m-batch > * { margin: 0; }
.m-batch .field { margin: 0; }

/* Commercial workspace: a calm document ledger, not a wall of cards. */
.m-commercial-list { max-width: 1280px; }
.m-commercial-list .page-head { align-items: center; gap: 18px; margin-bottom: 26px; }
.m-commercial-list .page-head h1 { margin: 4px 0 6px; letter-spacing: -.035em; }
.m-eyebrow { margin: 0; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: 0; }
.m-list-intro { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.m-pipeline { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); margin-bottom: 24px; }
.m-pipeline-step { display: grid; gap: 6px; padding: 20px 22px; min-width: 0; background: transparent; border: 0; border-right: 1px solid var(--line); text-align: left; cursor: pointer; color: var(--text); font: inherit; position: relative; }
.m-pipeline-step:last-child { border-right: 0; }
.m-pipeline-step:hover { background: var(--brand-soft); }
.m-pipeline-step[aria-pressed=true] { box-shadow: inset 0 -3px var(--brand); background: var(--brand-soft); }
.m-pipeline-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.m-pipeline-count { font-size: 32px; letter-spacing: -.05em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.m-pipeline-detail { font-size: 11px; color: var(--muted); }
.m-commercial-list .m-toolbar { gap: 16px; margin-bottom: 18px; }
.m-commercial-list .m-chips { gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.m-commercial-list .m-chips .chip { border-radius: 7px; }
.m-commercial-list .m-rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.m-commercial-list .m-rows > li + li { border-top: 1px solid var(--line); }
.m-commercial-list .m-ledger-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px 18px; min-height: 94px; padding: 19px 22px; border: 0; border-radius: 0; box-shadow: none; }
.m-commercial-list .m-ledger-row:hover { background: var(--brand-soft); }
.m-commercial-list .m-row-title { font-size: 14px; letter-spacing: -.01em; }
.m-commercial-list .m-row-sub { font-size: 12px; margin-top: 4px; }
.m-commercial-list .m-row-amount { font-size: 17px; letter-spacing: -.02em; }
.m-commercial-list .m-num-tag { font-size: 11px; padding-right: 6px; font-weight: 500; }
.m-row-next { grid-column: 1 / -1; color: var(--brand); font-size: 11px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.m-commercial-list .m-tiles { gap: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 24px; }
.m-commercial-list .m-tile { padding: 22px; border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; gap: 9px; }
.m-commercial-list .m-tile:last-child { border-right: 0; }
.m-commercial-list .m-tile-amount { font-size: clamp(20px,2.5vw,30px); letter-spacing: -.04em; }
@media (min-width: 1000px) {
  .m-commercial-list .m-ledger-row { grid-template-columns: minmax(0,1fr) 140px 170px; align-items: center; }
  .m-commercial-list .m-row-next { grid-column: auto; justify-content: flex-end; }
}
@media (max-width: 560px) {
  .m-commercial-list .page-head { align-items: flex-start; }
  .m-commercial-list .page-actions { width: 100%; }
  .m-commercial-list .page-actions .btn { flex: 1; }
  .m-pipeline-step, .m-commercial-list .m-tile { padding: 16px 10px; }
  .m-pipeline-label, .m-commercial-list .m-tile-label { font-size: 11px; }
  .m-pipeline-detail { font-size: 10px; }
  .m-pipeline-count { font-size: 27px; }
  .m-commercial-list .m-tile-amount { font-size: 19px; }
  .m-commercial-list .m-ledger-row { padding: 16px 12px; gap: 8px 10px; }
  .m-commercial-list .m-row-amount { font-size: 15px; }
  .m-commercial-list .m-row-title, .m-commercial-list .m-row-sub { white-space: normal; overflow-wrap: anywhere; }
  .m-commercial-list .m-row-side { max-width: 130px; }
}
.m-commercial-list .m-ledger-row.m-row-overdue { box-shadow: inset 3px 0 var(--danger); }
.m-commercial-list .m-pipeline-step:focus-visible { outline: 3px solid var(--brand); outline-offset: -4px; }
