:root{font-family:Inter,system-ui,-apple-system,Segoe UI,sans-serif;color:#111827;background:#f3f4f6}*{box-sizing:border-box}body{margin:0}header{background:#111827;color:white;padding:12px max(16px,calc((100% - 1180px)/2));display:flex;align-items:center;justify-content:space-between;position:sticky;top:0;z-index:5}header span{margin-left:12px;color:#9ca3af;font-size:.88rem}main{max-width:1180px;margin:auto;padding:16px}.hidden{display:none!important}button{border:0;border-radius:9px;background:#2563eb;color:white;padding:11px 15px;font-weight:700;cursor:pointer;min-height:44px}.secondary{background:#e5e7eb;color:#111827}.ghost{background:transparent;color:inherit;border:1px solid #d1d5db}.panel{background:white;border:1px solid #e5e7eb;border-radius:14px;padding:18px;margin:14px 0}.narrow{max-width:460px;margin:60px auto}.stack{display:grid;gap:14px}label{font-size:.86rem;font-weight:700;color:#374151;display:grid;gap:6px}input,select,textarea{width:100%;font:inherit;font-size:16px;border:1px solid #cbd5e1;border-radius:9px;padding:10px 11px;background:white;color:#111827}.check{display:flex;gap:9px;align-items:center;min-height:44px}.check input{width:auto}#tabs{display:flex;gap:7px;overflow:auto;padding:4px 0 10px}#tabs button{background:#e5e7eb;color:#374151;white-space:nowrap}#tabs button.active{background:#111827;color:white}.tab{display:none}.tab.active{display:block}.hero,.sectionHead{display:flex;justify-content:space-between;align-items:center;gap:14px}.hero h1,.sectionHead h1{margin-bottom:4px}.hero p,.sectionHead p{margin-top:0;color:#6b7280}.stats{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.stats article{background:white;border:1px solid #e5e7eb;border-radius:13px;padding:16px}.stats span{display:block;color:#6b7280;font-size:.82rem}.stats strong{display:block;font-size:1.5rem;margin-top:5px}.stats .danger strong{color:#b91c1c}.stats .warning strong{color:#92400e}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.gridForm{display:grid;grid-template-columns:repeat(6,1fr);align-items:end;gap:10px}.lineBox{border:1px dashed #94a3b8;padding:12px;border-radius:12px;background:#f8fafc}.actions{display:flex;gap:10px;flex-wrap:wrap}.list{display:grid;gap:9px}.row{background:white;border:1px solid #e5e7eb;border-radius:12px;padding:13px 15px;display:flex;align-items:center;justify-content:space-between;gap:14px}.row .meta{color:#6b7280;font-size:.86rem}.money{font-variant-numeric:tabular-nums;font-weight:800}.pill{display:inline-block;padding:3px 8px;border-radius:999px;background:#e5e7eb;font-size:.76rem;font-weight:800;text-transform:uppercase}.linePreview{display:flex;justify-content:space-between;gap:10px;padding:9px 2px;border-bottom:1px solid #e5e7eb}.testRow{display:flex;gap:10px}.actionStatus{min-height:1.35em;color:#475569;font-size:.9rem;font-weight:650}button:disabled{opacity:.65;cursor:wait}#flash{min-height:0;margin:8px 0}.flash{padding:10px 12px;border-radius:9px;background:#dcfce7;color:#166534}.flash.error{background:#fee2e2;color:#991b1b}h1{font-size:1.7rem}h2{font-size:1.05rem;margin:10px 0 0}@media(max-width:850px){.stats{grid-template-columns:1fr 1fr}.gridForm{grid-template-columns:1fr 1fr 1fr}.grid3{grid-template-columns:1fr 1fr}.hero,.sectionHead{align-items:flex-start}.hero{flex-direction:column}}@media(max-width:560px){main{padding:12px}.stats,.grid2,.grid3,.gridForm{grid-template-columns:1fr}.row{align-items:flex-start;flex-direction:column}.actions button{flex:1 1 100%}.hero button,.sectionHead button{width:100%}.sectionHead{flex-direction:column}.testRow{flex-direction:column}h1{font-size:1.45rem}}
.brandingEditor{display:grid;grid-template-columns:minmax(240px,.8fr) minmax(300px,1.2fr);gap:18px;align-items:start}.logoPane{display:grid;gap:10px}.logoPreview{min-height:140px;border:1px dashed #94a3b8;border-radius:12px;background:#f8fafc;display:flex;align-items:center;justify-content:center;padding:16px;color:#64748b;text-align:center}.logoPreview img{display:block;max-width:100%;max-height:120px;object-fit:contain}.securityNote{padding:12px 14px;border:1px solid #bfdbfe;background:#eff6ff;border-radius:10px;color:#1e3a5f;font-size:.88rem;line-height:1.5}input[type=color]{min-height:44px;padding:5px}@media(max-width:700px){.brandingEditor{grid-template-columns:1fr}}

/* v0.1.7 mobile/PWA shell */
.appHeader{gap:14px}.headerBrand{display:flex;align-items:center;min-width:0}.headerBrand strong{white-space:nowrap}.headerTools{display:flex;align-items:center;gap:8px}.headerTools .compact,.compact{min-height:38px;padding:7px 10px}.networkBadge{margin-left:0!important;padding:5px 9px;border-radius:999px;font-size:.75rem!important;font-weight:800;color:#d1fae5!important;background:#064e3b;white-space:nowrap}.networkBadge.offline{color:#fef3c7!important;background:#78350f}.offlineBanner{margin:8px 0 12px;padding:10px 12px;border:1px solid #f59e0b;border-radius:10px;background:#fffbeb;color:#78350f;font-size:.88rem;font-weight:650;line-height:1.4}.mobileNav{display:none}.mobileMore{position:fixed;z-index:30;left:12px;right:12px;bottom:82px;background:white;border:1px solid #d1d5db;border-radius:16px;padding:12px;box-shadow:0 18px 45px rgba(15,23,42,.24);gap:8px}.mobileMore:not(.hidden){display:grid}.mobileMore>button{width:100%;text-align:left}.mobileMoreHead{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:2px 2px 8px}.mobileMoreHead strong{font-size:1.05rem}.mobileMore .ghost{color:#374151}

@media(max-width:700px){
  body{padding-bottom:74px}
  .appHeader{padding:9px 14px;min-height:58px}
  .headerBrand strong{font-size:1.03rem}
  .headerBrand #who{display:none}
  .headerTools #logoutBtn{display:none!important}
  .headerTools #installAppBtn{display:none!important}
  .networkBadge{font-size:.7rem!important;padding:4px 8px}
  main{padding:10px 12px 18px}
  #tabs{display:none}
  .mobileNav{display:grid;position:fixed;z-index:25;left:0;right:0;bottom:0;grid-template-columns:repeat(5,1fr);gap:0;background:#111827;border-top:1px solid #334155;padding:5px 4px calc(5px + env(safe-area-inset-bottom))}
  .mobileNav button{min-width:0;min-height:57px;padding:5px 2px;border-radius:8px;background:transparent;color:#cbd5e1;display:grid;place-items:center;align-content:center;gap:1px}
  .mobileNav button span{font-size:1.18rem;line-height:1}
  .mobileNav button small{font-size:.67rem;font-weight:800;white-space:nowrap}
  .mobileNav button.active{background:#1e293b;color:white}
  .mobileNav #mobileMoreBtn.active{background:#1e293b;color:white}
  .hero{gap:10px;margin-bottom:10px}.hero h1,.sectionHead h1{font-size:1.35rem;margin-top:8px}.hero p,.sectionHead p{font-size:.92rem;margin-bottom:3px}
  .hero button{min-height:52px;font-size:1rem}
  #tab-dashboard .stats,#invoiceReportPanel .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  #tab-dashboard .stats article,#invoiceReportPanel .stats article{padding:12px;min-height:88px}
  #tab-dashboard .stats span,#invoiceReportPanel .stats span{font-size:.76rem;line-height:1.2}
  #tab-dashboard .stats strong,#invoiceReportPanel .stats strong{font-size:1.35rem;margin-top:7px}
  #tab-dashboard .stats article:last-child,#invoiceReportPanel .stats article:last-child{grid-column:1/-1;min-height:78px}
  .panel{padding:14px;margin:10px 0;border-radius:12px}
  .row{padding:12px;gap:8px}
  .row .money{font-size:1.02rem}
  .linePreview{align-items:center}
  #tab-visit .panel{margin-top:8px}
  #tab-visit .actions{display:grid;grid-template-columns:1fr 1fr}
  #tab-visit .actions button{width:100%;min-height:49px}
  #tab-visit .actions button[data-mode="send"]{grid-column:1/-1;min-height:54px}
  .sectionHead{gap:8px}
}

@media(max-width:380px){
  .mobileNav button small{font-size:.61rem}
  #tab-dashboard .stats strong,#invoiceReportPanel .stats strong{font-size:1.22rem}
  .appHeader{padding-left:10px;padding-right:10px}
}

/* v0.1.8 offline sync */
.syncStrip{margin:8px 0 12px;padding:9px 11px;border:1px solid #cbd5e1;border-radius:10px;background:#fff;display:flex;align-items:center;justify-content:space-between;gap:10px;color:#475569;font-size:.84rem;font-weight:650}.syncStrip.pending{border-color:#f59e0b;background:#fffbeb;color:#78350f}.syncStrip.error{border-color:#fecaca;background:#fef2f2;color:#991b1b}.syncStrip .compact{min-height:36px;padding:6px 10px;white-space:nowrap}.offlineQueued{display:inline-flex;align-items:center;gap:5px;margin-left:6px;padding:2px 7px;border-radius:999px;background:#fef3c7;color:#92400e;font-size:.72rem;font-weight:800}
@media(max-width:700px){.syncStrip{margin:6px 0 10px;font-size:.77rem}.syncStrip .compact{min-height:34px;font-size:.76rem}.offlineBanner{font-size:.8rem}}


/* v0.1.9 centered feedback, payments, catalog editing */
.flashHost{position:fixed;inset:0;z-index:100;display:grid;place-items:center;pointer-events:none;padding:20px}.flashHost:empty{display:none}.flash{pointer-events:auto;max-width:min(520px,92vw);padding:15px 18px;border-radius:12px;background:#dcfce7;color:#166534;border:1px solid #86efac;box-shadow:0 20px 55px rgba(15,23,42,.28);font-weight:750;line-height:1.4;text-align:center}.flash.error{background:#fee2e2;color:#991b1b;border-color:#fca5a5}.paymentBalance{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.paymentBalance>div{border:1px solid #e5e7eb;border-radius:11px;padding:11px 13px;background:#f8fafc}.paymentBalance span{display:block;color:#64748b;font-size:.8rem}.paymentBalance strong{display:block;margin-top:4px;font-size:1.15rem}.paymentHistory{display:grid;gap:7px}.paymentHistory .paymentRow{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #e5e7eb;padding-top:8px;color:#475569;font-size:.86rem}.invoiceActions{display:flex;align-items:center;justify-content:flex-end;gap:7px;flex-wrap:wrap}.catalogActions{display:flex;align-items:center;gap:8px}.catalogActions .money{min-width:80px;text-align:right}@media(max-width:700px){.paymentBalance{grid-template-columns:1fr 1fr}.paymentBalance>div:last-child{grid-column:1/-1}.invoiceActions{justify-content:flex-start;width:100%}.catalogActions{width:100%;justify-content:space-between}}


/* v0.1.10 invoice history/detail viewer */
body.modalOpen{overflow:hidden}.invoiceDetailOverlay{position:fixed;inset:0;z-index:90;background:rgba(15,23,42,.58);display:flex;align-items:center;justify-content:center;padding:20px}.invoiceDetailCard{width:min(980px,96vw);max-height:90vh;overflow:auto;background:white;border-radius:16px;border:1px solid #dbe3ee;box-shadow:0 24px 70px rgba(15,23,42,.36);padding:20px}.invoiceDetailHead{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding-bottom:12px;border-bottom:1px solid #e5e7eb}.invoiceDetailHead h2{font-size:1.35rem;margin:0 0 4px}.invoiceDetailSummary{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin:16px 0}.invoiceDetailSummary>div{border:1px solid #e5e7eb;background:#f8fafc;border-radius:11px;padding:10px 12px}.invoiceDetailSummary span:first-child{display:block;color:#64748b;font-size:.78rem}.invoiceDetailSummary strong{display:block;margin-top:4px}.invoiceDetailGrid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:14px 0}.invoiceDetailGrid section,.invoiceNotes,.invoicePayments{border-top:1px solid #e5e7eb;padding-top:12px}.invoiceDetailGrid h3,.invoiceNotes h3,.invoicePayments h3{margin:0 0 7px;font-size:.95rem}.detailText{color:#334155;font-size:.9rem;line-height:1.55;white-space:pre-wrap}.invoiceItemsWrap{overflow:auto;border:1px solid #e5e7eb;border-radius:11px;margin:15px 0}.invoiceItems{width:100%;border-collapse:collapse;min-width:680px;font-size:.88rem}.invoiceItems th,.invoiceItems td{padding:10px;border-bottom:1px solid #e5e7eb;text-align:left}.invoiceItems th{background:#f8fafc;color:#475569;font-size:.78rem;text-transform:uppercase;letter-spacing:.02em}.invoiceItems .num{text-align:right;white-space:nowrap}.invoiceTotals{margin-left:auto;max-width:360px;display:grid;gap:4px}.invoiceTotals>div{display:flex;justify-content:space-between;gap:20px;padding:6px 9px}.invoiceTotals .balance{border-top:1px solid #cbd5e1;background:#eef2ff;border-radius:8px;font-size:1.05rem}.invoicePayments{margin-top:18px}.invoicePayment{display:flex;justify-content:space-between;gap:14px;padding:10px 0;border-top:1px solid #e5e7eb}.invoicePayment:first-of-type{border-top:0}.invoiceDetailActions{justify-content:flex-end;border-top:1px solid #e5e7eb;margin-top:18px;padding-top:14px}
@media(max-width:700px){.invoiceDetailOverlay{padding:8px;align-items:flex-end}.invoiceDetailCard{width:100%;max-height:94vh;border-radius:16px 16px 0 0;padding:15px}.invoiceDetailSummary{grid-template-columns:1fr 1fr}.invoiceDetailGrid{grid-template-columns:1fr}.invoiceDetailActions{justify-content:stretch}.invoiceDetailActions button{flex:1 1 100%}.invoicePayment{align-items:flex-start}.invoiceItemsWrap{margin-left:-2px;margin-right:-2px}}

/* v0.1.11 invoice write-offs */
.writeoffNotice{padding:12px 14px;border:1px solid #fed7aa;background:#fff7ed;border-radius:10px;color:#9a3412;font-size:.88rem;line-height:1.5}.dangerButton{background:#991b1b;border-color:#991b1b;color:white}.dangerButton:hover{background:#7f1d1d}.invoiceWriteoffs{margin-top:18px;border-top:1px solid #e5e7eb;padding-top:12px}.invoiceWriteoffs h3{margin:0 0 7px;font-size:.95rem}.writeoffEntry strong:last-child,.invoiceTotals .writtenOff strong{color:#991b1b}.invoiceTotals .writtenOff{color:#7f1d1d}.writeoffEntry{background:#fff7ed;padding-left:9px;padding-right:9px;border-radius:8px}
@media(max-width:700px){#writeOffForm .paymentBalance>div:last-child{grid-column:auto}.dangerButton{width:100%}}

/* v0.1.12 payment refunds */
.refundNotice{padding:12px 14px;border:1px solid #fde68a;background:#fffbeb;border-radius:10px;color:#92400e;font-size:.88rem;line-height:1.5}.invoiceRefunds{margin-top:18px;border-top:1px solid #e5e7eb;padding-top:12px}.invoiceRefunds h3{margin:0 0 7px;font-size:.95rem}.refundEntry{background:#fffbeb;padding-left:9px;padding-right:9px;border-radius:8px}.refundEntry strong:last-child,.invoiceTotals .refunded strong{color:#b45309}.invoiceTotals .refunded{color:#92400e}.paymentAmounts{display:grid;justify-items:end;gap:2px}.paymentAmounts .meta{font-size:.72rem}@media(max-width:700px){#refundForm .paymentBalance>div:last-child{grid-column:auto}.paymentAmounts{justify-items:start}}


/* v0.1.13 compact mobile invoice cards + action sheet */
.mobileInvoiceBar,.mobileInvoiceMeta,.mobileInvoiceStatus{display:none}.invoiceCardInfo{min-width:0}.invoiceTitleLine{min-width:0}.invoiceActionOverlay{position:fixed;inset:0;z-index:95;background:rgba(15,23,42,.58);display:flex;align-items:flex-end;justify-content:center;padding:16px}.invoiceActionSheet{width:min(520px,100%);background:white;border:1px solid #dbe3ee;border-radius:18px;padding:16px;box-shadow:0 24px 70px rgba(15,23,42,.36)}.invoiceActionSheetHead{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding-bottom:12px;border-bottom:1px solid #e5e7eb}.invoiceActionSheetHead strong{display:block;font-size:1.05rem;line-height:1.3}.invoiceActionEyebrow{font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:#64748b;margin-bottom:3px}.invoiceActionButtons{display:grid;gap:9px;padding-top:12px}.invoiceActionButtons button{width:100%;text-align:left;min-height:50px;padding:12px 14px}.invoiceActionEmpty{padding:8px 2px}
@media(max-width:700px){.invoiceRow{display:block}.invoiceTitleLine{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}.invoiceTitleLine strong{font-size:1rem;line-height:1.25;min-width:0;overflow-wrap:anywhere}.mobileInvoiceStatus{display:inline-block;flex:0 0 auto;margin-top:1px}.desktopInvoiceMeta,.desktopInvoiceActions{display:none}.mobileInvoiceMeta{display:block;margin-top:5px;font-size:.78rem;line-height:1.35}.mobileInvoiceBar{display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:10px;border-top:1px solid #e5e7eb}.invoiceBalanceBlock{display:grid;gap:1px;margin-right:auto;min-width:0}.invoiceBalanceBlock span{font-size:.7rem;color:#64748b;font-weight:700;text-transform:uppercase;letter-spacing:.03em}.invoiceBalanceBlock strong{font-size:1.05rem}.mobileInvoiceBar button{min-height:42px;padding:8px 13px}.mobileInvoiceBar .mobileInvoiceMenu{width:46px;padding:8px 0;font-size:1.05rem;letter-spacing:1px}.invoiceActionOverlay{padding:8px 8px calc(82px + env(safe-area-inset-bottom));}.invoiceActionSheet{border-radius:16px;padding:14px}}

/* v0.1.14 mobile action alignment */
@media(max-width:700px){
  /* Detail/modal action groups follow the mobile convention: actions live on the right. */
  .invoiceDetailActions{
    width:100%;
    justify-content:flex-end;
    align-items:center;
  }
  .invoiceDetailActions button{
    flex:0 0 auto;
    width:auto;
  }

  /* Financial forms use the same right-edge action placement. */
  #paymentForm>#recordPaymentBtn{
    justify-self:end;
    width:auto;
  }
  #writeOffForm>.actions,
  #refundForm>.actions{
    width:100%;
    justify-content:flex-end;
  }
  #writeOffForm>.actions button,
  #refundForm>.actions button{
    flex:0 0 auto;
    width:auto;
  }

  /* Header-level Cancel buttons on financial detail forms stay compact and right aligned. */
  #paymentForm>.sectionHead,
  #writeOffForm>.sectionHead,
  #refundForm>.sectionHead{
    width:100%;
  }
  #paymentForm>.sectionHead button,
  #writeOffForm>.sectionHead button,
  #refundForm>.sectionHead button{
    width:auto;
    margin-left:auto;
    flex:0 0 auto;
  }
}


/* v0.1.15 mobile report/detail-list action alignment */
@media(max-width:700px){
  /* Report invoice rows keep the amount on the left and the action on the right. */
  #reportInvoiceList .invoiceActions{
    width:100%;
    justify-content:space-between;
    align-items:center;
  }
  #reportInvoiceList .invoiceActions .reportViewInvoice{
    margin-left:auto;
    flex:0 0 auto;
    width:auto;
  }
}


/* v0.1.16 walk-in / one-time customer */
.walkInPanel{border:1px solid #bfdbfe;background:#f8fbff;border-radius:12px;padding:14px}.walkInPanel>div:first-child strong{font-size:.95rem}.walkInPanel>div:first-child p{margin:3px 0 0;color:#64748b}.walkInPanel .check{margin-top:1px}
@media(max-width:700px){.walkInPanel{padding:12px}.walkInPanel .grid2,.walkInPanel .grid3{grid-template-columns:1fr}}

/* Company context stays readable alongside the authenticated user. */
.unbilledHead{margin:24px 0 10px}.unbilledHead h2{font-size:1.2rem}.unbilledHead p{margin:5px 0;font-size:.9rem}.visitCardInfo{min-width:0;flex:1}.visitCardInfo>strong{overflow-wrap:anywhere}.visitSummary{margin-top:6px;color:#475569;font-size:.88rem;white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.visitRowActions{display:flex;align-items:center;gap:16px;flex-shrink:0}.visitSubtotal{display:grid;gap:3px;text-align:right}.visitSubtotal>span{font-size:.74rem;color:#64748b}.unbilledPagination{display:flex;justify-content:flex-end;align-items:center;gap:12px;margin-top:14px;font-size:.85rem;color:#475569}#visitDetailStatus{margin-top:12px;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:700px){.visitRow{align-items:stretch;flex-direction:column}.visitRowActions{justify-content:space-between;width:100%;border-top:1px solid #e5e7eb;padding-top:10px}.visitSubtotal{text-align:left}.unbilledPagination{justify-content:space-between;gap:8px;font-size:.78rem}.unbilledHead button{width:auto}.unbilledHead{flex-direction:row}.unbilledPagination button{padding:7px 10px}#visitDetailActions button{flex:1 1 auto}}
.headerBrand{gap:12px;flex-wrap:wrap}.headerBrand strong,.headerBrand #who{white-space:nowrap}.headerBrand #who{margin-left:0}.headerBrand #organizationPicker{width:auto;max-width:300px;min-width:180px}.headerTools{flex-wrap:wrap}
@media(max-width:700px){.appHeader{align-items:flex-start;gap:10px;flex-wrap:wrap}.headerBrand{width:100%;gap:8px}.headerBrand #organizationPicker{max-width:100%;flex:1;min-width:150px}.headerTools{margin-left:auto}#newOrganizationBtn{font-size:.78rem;padding:7px 9px}}
/* Guided company email setup and invoice resend. */
.mailSetup{border:1px solid #cbd5e1;border-radius:12px;padding:18px;background:#f8fafc;margin:14px 0}.mailSetup h2,.mailSetup h3{margin:0}.mailSetup p{margin:5px 0;line-height:1.5}.mailSetup ol{padding-left:24px;line-height:1.6}.mailSetup li{margin:9px 0}.mailSetup a{overflow-wrap:anywhere}.mailSetup [data-mail-step]{scroll-margin:30px}.resendCard{max-width:560px}.resendCard p{line-height:1.5}.mailSetup .actions button{flex:0 1 auto}
@media(max-width:700px){.mailSetup{padding:14px}.mailSetup .sectionHead{align-items:flex-start;flex-wrap:wrap}.mailSetup .grid3,.mailSetup .grid2{grid-template-columns:1fr}.mailSetup .actions{justify-content:space-between}.resendCard{width:100%}}
/* Recurring charge editor. */
.recurringCharge{min-width:0;border:1px solid #cbd5e1;border-radius:12px;padding:14px;display:grid;gap:12px;background:#f8fafc}.recurringCharge legend{font-weight:700;padding:0 5px}.recChargeFields{display:grid;grid-template-columns:1fr 1fr 1fr 1fr;gap:12px;align-items:end}.recChargeFooter,.recurringRowActions{display:flex;align-items:center;justify-content:space-between;gap:12px}.recurringRowActions{flex-shrink:0;flex-wrap:wrap}.recurringRow>div:first-child{min-width:0;overflow-wrap:anywhere}#recurringForm{scroll-margin-top:100px}
@media(max-width:700px){.recChargeFields{grid-template-columns:1fr 1fr}.recurringRow{flex-direction:column;align-items:stretch}.recurringRowActions{width:100%}.recChargeFooter{flex-wrap:wrap}#recurringForm{scroll-margin-top:120px}}

.invoiceCardPayment{border-top:1px solid #e2e8f0;margin-top:20px;padding-top:12px}.invoiceCardPayment button{margin:8px 8px 8px 0}.invoicePaymentQr svg{display:block;width:192px;height:192px;max-width:100%;margin:12px 0}#stripeWebhookUrl{display:block;overflow-wrap:anywhere}

#settingsForm,#stripeSetup{grid-template-columns:minmax(0,1fr)}#settingsForm>*,#stripeSetup>*{min-width:0}#stripeSetup p,#stripeSetup li{overflow-wrap:anywhere}#settingsForm select{min-width:0}

#phoneCardForm p{line-height:1.6}#phoneCardReview,#phoneCardStripeLink{overflow-wrap:anywhere}#phoneCardForm .paymentBalance{grid-template-columns:repeat(2,minmax(0,1fr))}#phoneCardForm .paymentBalance>div:last-child{grid-column:auto}@media(max-width:700px){#phoneCardForm .paymentBalance{grid-template-columns:1fr}}

/* Prominent phone card action in the invoice footer. */
button.phoneCardAction{background:#15803d;color:#fff}button.phoneCardAction:hover{background:#166534}button.phoneCardAction:focus-visible{outline:3px solid #86efac;outline-offset:3px}

/* Shared invoice editor: stable controls above the customer-facing invoice. */
.invoiceBuilder{min-width:0;display:grid;gap:20px}.chargeEditor h3,.invoicePreview h3{margin:0}.chargeEditor{scroll-margin-top:100px}.invoicePaper{display:block;min-width:0;width:100%;overflow-x:auto;border-radius:12px}.chargeStatus{margin:0}.chargeStatus.error{color:#b91c1c}.invoicePreview .meta{line-height:1.5}.invoicePreview{min-width:0}

.scheduleSettings{border:1px solid #e2e8f0;border-radius:10px;padding:12px;background:#f8fafc}.scheduleSettings summary{cursor:pointer;color:#475569;font-size:.88rem;line-height:1.6}.scheduleFields{padding-top:16px}
