[data-book-orders] [hidden],
#invoiceForm [hidden] { display: none !important; }
[data-book-orders] input[type="url"],
#invoiceForm [data-book-order-link] { max-width: 32rem; width: 100%; }
[data-book-orders-table] { overflow-x: auto; }
[data-book-orders-table] td { min-width: 8rem; }
[data-book-orders-table] .section-toolbar { flex-wrap: wrap; margin: 0; }
[data-book-orders-table] .section-btn { text-decoration: none; }
[data-order-link-actions] { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
[data-payment-diagnostics] > summary { cursor: pointer; padding: .5rem 0; }
[data-payment-diagnostics] .section-card { margin-top: .5rem; }
.payment-period { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 !important; }
.payment-period .section-btn { min-height: 40px; padding: 8px 14px; border: 1px solid var(--line, #d9d9d9); border-radius: 99px; background: var(--panel, #fff); color: var(--ink, #6a3630); font: 15px LandingSerif, Georgia, serif; cursor: pointer; }
.pagehead.payments-page .pagehead-main { gap: 28px; flex-wrap: wrap; }
.payment-period input[type="month"] { width: 128px; min-height: 40px; padding: 7px 8px; text-align: center; border: 1px solid var(--line, #d9d9d9); background: var(--panel, #fff); color: var(--ink, #4d3428); font: 13px LandingSerif, Georgia, serif; }
.payment-period input[type="month"]::-webkit-datetime-edit { display: inline-flex; justify-content: center; padding: 0; text-align: center; }
.payment-period input[type="month"]::-webkit-date-and-time-value { text-align: center; }
.payment-period input[type="month"]::-webkit-calendar-picker-indicator { flex: none; width: 14px; margin: 0; padding: 0; }
.payment-period .is-active { border-color: #713735 !important; background: #7137350a !important; }
.payment-period button:disabled { opacity: .45; cursor: default; }
.payment-overview { margin-bottom: 16px; }
#sectionView:has([data-payment-overview]) { grid-template-columns: minmax(0, 1fr); }
#sectionView:has([data-payment-overview]) > * { min-width: 0; max-width: 100%; }
.payment-overview .section-card { margin-bottom: 0 !important; }
.payment-overview .section-stat { flex-wrap: wrap; gap: 8px 16px; }
.payment-overview .section-stat b { white-space: nowrap; }
.payment-table-scroll { overflow-x: auto; }
.payment-other-drafts > summary { cursor: pointer; font-size: 18px; padding: 4px 0; }
.payment-other-drafts[open] > summary { margin-bottom: 12px; }
[data-invoice-row], [data-payment-order] { cursor: context-menu; }
.payment-history-table, .payment-draft-table { width: 100%; table-layout: fixed; }
.payment-history-table { min-width: 540px; }
.payment-history-table th:nth-child(1) { width: 32%; }
.payment-history-table th:nth-child(2) { width: 18%; }
.payment-history-table th:nth-child(3) { width: 20%; }
.payment-history-table th:nth-child(4) { width: 30%; }
.payment-draft-table { min-width: 610px; }
.payment-draft-table th:nth-child(1) { width: 30%; }
.payment-draft-table th:nth-child(2) { width: 23%; }
.payment-draft-table th:nth-child(3) { width: 17%; }
.payment-draft-table th:nth-child(n+4) { width: 15%; }
.payment-history-table td, .payment-draft-table td { overflow-wrap: anywhere; }
.payment-menu-target td { background: #71373508 !important; }
.payment-context-menu { position: fixed; z-index: 1000; box-sizing: border-box; width: 244px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow: auto; padding: 5px; border: 1px solid var(--line, #ddd); border-radius: 9px; background: var(--panel, #fff); color: var(--ink, #4d3428); box-shadow: 0 10px 35px #28151030; font: 14px/1.3 LandingSerif, Georgia, serif; }
.payment-menu-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 7px 10px; font-size: 12px; opacity: .7; border-bottom: 1px solid var(--line, #ddd); margin-bottom: 4px; }
.payment-context-menu [role="menuitem"] { display: block; box-sizing: border-box; width: 100%; padding: 10px; border: 0; border-radius: 5px; background: transparent; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.payment-context-menu [role="menuitem"]:is(:hover,:focus-visible) { background: #71373512; outline: 0; }
.payment-context-menu .is-danger { color: #a13935; }
.payment-context-menu [aria-disabled="true"] { opacity: .5; cursor: default; }
@media (max-width: 600px) {
  .admin-workspace:has([data-payment-overview]) .pagehead-actions { flex-wrap: wrap !important; max-width: 100%; }
  .payment-period { display: grid !important; grid-template-columns: 40px minmax(0, 1fr) 40px; }
  .payment-period [data-payment-all] { grid-column: 1 / -1; }
  .payment-period [data-payment-all] { justify-self: start; }
  .payment-period input[type="month"] { width: 100%; min-width: 0; }
  .pagehead.payments-page .pagehead-main { gap: 14px; }
  .payment-period { flex-basis: 100%; width: 100%; }
  .payment-overview { grid-template-columns: 1fr !important; }
  .payment-overview .section-stat b { font-size: 32px; }
}

#invoiceModal .invoice-card { width: min(640px, 96vw) !important; padding: 24px; border-radius: 14px; }
#invoiceForm .invoice-body { display: grid; gap: 14px; }
#invoiceForm .book-modes { flex-wrap: wrap; gap: 10px 20px; margin: 0; }
#invoiceForm .form-label { display: grid; gap: 6px; margin: 0 !important; }
#invoiceForm .invoice-options { display: grid; gap: 12px; padding: 16px; }
#invoiceForm .invoice-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#invoiceForm :is(input,select) { min-width: 0; width: 100%; box-sizing: border-box; }
#invoiceForm .invoice-total { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0 0; border-top: 1px solid #e6e0dc; }
#invoiceForm .invoice-total b { white-space: nowrap; margin: 0; }
#invoiceForm .invoice-payment-type { min-width: 0; margin: 0; padding: 0; border: 0; }
#invoiceForm legend { margin-bottom: 8px; padding: 0; }
#invoiceForm .invoice-payment-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#invoiceForm .invoice-payment-choices label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border: 1px solid #ded7d2; border-radius: 8px; cursor: pointer; }
#invoiceForm .invoice-payment-choices label:has(:checked) { border-color: #713735; background: #71373508; }
#invoiceForm input[type="radio"] { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; accent-color: #713735; }
#invoiceForm .invoice-due { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#invoiceForm #invoiceDue { font-size: 26px; font-weight: 600; white-space: nowrap; }
#invoiceForm :is(.invoice-payment-note,.invoice-balance-label) { margin: 0; line-height: 1.45; color: #745e54; }
#invoiceForm .invoice-payment-note { font-size: 13px; white-space: pre-line; }
#invoiceForm .invoice-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
#invoiceForm .invoice-actions .btn { margin: 0; }
#invoiceForm [data-save-invoice] { background: #fff !important; color: #6a3630 !important; border-color: #d9d9d9 !important; }
#invoiceForm .btn:disabled { cursor: default; opacity: .5; }
#invoiceModal #invoiceForm [data-create-book-order]:disabled { background: var(--admin-hover, #e5e0dc) !important; border-color: var(--line, #d9d9d9) !important; color: var(--muted, #8b8079) !important; opacity: 1; cursor: not-allowed; }
#invoiceForm .local-message:empty { display: none; }
#invoiceForm [data-book-order-link] { max-width: none; }
#invoiceForm[data-linked="yes"] .invoice-actions { display: none; }
#invoiceForm .invoice-body > [data-order-link-actions] { margin: 0; }
@media (max-width: 520px) {
  #invoiceModal .invoice-card { padding: 18px; }
  #invoiceForm .invoice-prices { grid-template-columns: 1fr; gap: 10px; }
  #invoiceForm .invoice-payment-choices { grid-template-columns: 1fr; }
  #invoiceForm .invoice-actions .btn { width: 100%; }
}

.order-checkout {
  --order-ink: #433025;
  --order-muted: #695143;
  --order-border: #decfc4;
  --order-accent: #713837;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  box-sizing: border-box;
  place-items: center;
  margin: 0;
  padding: clamp(1rem, 4vw, 2.75rem);
  background: #f1e9de;
  color: var(--order-ink);
  font: 1rem/1.5 Georgia, serif;
}
.order-checkout [hidden] { display: none !important; }
.order-checkout-card {
  box-sizing: border-box;
  width: min(100%, 33rem);
  padding: clamp(1.2rem, 4vw, 2.4rem);
  background: #fffdfa;
  border: 1px solid var(--order-border);
  border-radius: 1.25rem;
  box-shadow: 0 1rem 2.8rem #58362512;
}
.order-checkout-header { text-align: center; margin-bottom: 1.25rem; }
.order-checkout-logo { display: block; width: 8.25rem; height: 3.3rem; margin: 0 auto .8rem; object-fit: contain; }
.order-checkout h1 { margin: .3rem 0 0; font-size: clamp(1.75rem, 6vw, 2.45rem); line-height: 1.12; font-weight: 600; }
.order-checkout #order-mode {
  display: inline-block;
  margin: 0;
  padding: .15rem .6rem;
  border-radius: 2rem;
  color: #6c4f30;
  background: #f3eadb;
  font: .79rem/1.5 system-ui, sans-serif;
}
.order-summary { padding: .9rem 1rem; border: 1px solid var(--order-border); border-radius: .8rem; background: #faf4ed; text-align: center; }
.order-summary p { margin: 0; }
.order-checkout #order-name { color: var(--order-muted); }
.order-checkout #order-amount { font-size: clamp(1.6rem, 7vw, 2.5rem); line-height: 1.2; font-weight: 600; margin-top: .15rem; }
.order-checkout a { color: var(--order-accent); text-underline-offset: .15em; }
.order-status { margin: 1rem 0; font-size: 1rem; color: var(--order-ink); }
.order-status[data-state="succeeded"] { color: #31553a; font-weight: 600; }
.order-checkout label { display: block; margin: .85rem 0 .25rem; }
.order-checkout input[type="email"], .order-checkout input[type="url"] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid #b39989;
  border-radius: .4rem;
  background: #fff;
  color: var(--order-ink);
  font: inherit;
}
.order-checkout input[aria-invalid="true"] { border-color: #a33835; }
.order-checkout :focus-visible { outline: 2px solid var(--order-accent); outline-offset: 2px; }
.order-help { margin: .4rem 0; font-size: .9rem; color: var(--order-muted); }
.order-error { margin: .45rem 0; font-size: .9rem; color: #8b2928; }
.order-checkout .order-accept { display: flex; align-items: flex-start; gap: .55rem; margin: .95rem 0 1rem; font-size: .91rem; }
.order-checkout .order-accept input { margin: .33rem 0 0; accent-color: var(--order-accent); }
.order-checkout button { cursor: pointer; font: inherit; }
.order-checkout .order-checkout-primary {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: .65rem .9rem;
  border: 1px solid var(--order-accent);
  border-radius: 2rem;
  background: var(--order-accent);
  color: #fffdfa;
  font: inherit;
  text-align: center;
  text-decoration: none;
}
.order-checkout .order-checkout-primary:hover { background: #552725; }
.order-checkout button:disabled { cursor: wait; opacity: .65; }
.order-checkout .order-checkout-primary:disabled,
.order-checkout .order-checkout-primary:disabled:hover { background: #dfd6cf; color: #807368; opacity: 1; cursor: not-allowed; }
.order-checkout .order-email-suggestion {
  padding: .3rem 0;
  border: 0;
  color: var(--order-accent);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: .18em;
}
.order-checkout input:disabled { color: var(--order-muted); background: #f8f3ed; opacity: 1; }
.order-checkout .order-status-actions { margin-top: .35rem; }
.order-checkout .order-status-actions:has(> :not([hidden])) { padding-top: .4rem; }
