/* Readability tokens are independent of viewport size. Pair foreground and
   surface changes; never infer contrast from the theme name alone. */
html[data-theme="light"]{
  --wp-readable-text:#111315;--wp-readable-muted:#625a54;
  --wp-readable-surface:#ffffff;--wp-readable-raised:#fbf4ed;
  --wp-readable-link:#a33d00;--wp-readable-border:#83776e;
  --wp-readable-error:#9b2c20;--wp-readable-error-bg:#fff0ee;
  --wp-readable-disabled:#625a54;--wp-readable-disabled-bg:#f0ece7;
}
html[data-theme="dark"]{
  --wp-readable-text:#f7f7f4;--wp-readable-muted:#b5b0aa;
  --wp-readable-surface:#111315;--wp-readable-raised:#1d2027;
  --wp-readable-link:#ff9a42;--wp-readable-border:#8e8882;
  --wp-readable-error:#ffd3cc;--wp-readable-error-bg:#291512;
  --wp-readable-disabled:#b5b0aa;--wp-readable-disabled-bg:#1d2027;
}
:root{--wp-readable-on-orange:#19100a;--wp-readable-orange:#ff7b32}

/* Explicit page scope: do not recolour retailer artwork, barcodes or logos. */
html[data-theme] body:is(.personal-app.wenapay-home-v9,[data-wp-screen="BUSINESS-HOME-V7"],[data-wp-screen="BUSINESS-POS-V9"],[data-wp-screen="BUSINESS-CHILD-V7"]) :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  color:var(--wp-readable-text)!important;background-color:var(--wp-readable-surface)!important;
  border-color:var(--wp-readable-border)!important;caret-color:var(--wp-readable-text);
}
html[data-theme="light"] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) :is(input,select,textarea){color-scheme:light!important}
html[data-theme="dark"] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) :is(input,select,textarea){color-scheme:dark!important}
html[data-theme] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) :is(input,textarea)::placeholder{color:var(--wp-readable-muted)!important;opacity:1!important}
html[data-theme] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) select option{
  color:var(--wp-readable-text);background:var(--wp-readable-surface);
}
html[data-theme] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) :is(button,input,select,textarea):disabled{
  color:var(--wp-readable-disabled)!important;background:var(--wp-readable-disabled-bg)!important;
  opacity:1!important;cursor:not-allowed;
}
html[data-theme] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) button:disabled :is(span,strong,small,svg){color:inherit!important}
html[data-theme] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) :is(button,a,input,select,textarea,summary):focus-visible{
  outline:3px solid var(--wp-readable-link)!important;outline-offset:3px!important;
}
html[data-theme] body:is(.personal-app.wenapay-home-v9,[data-wp-screen]) :is(.error,.page-error,.incoming-request-error){
  color:var(--wp-readable-error)!important;background:var(--wp-readable-error-bg)!important;
}

/* Dark copy remains readable over every approved orange gradient stop. */
html[data-theme] body.personal-app.wenapay-home-v9 .wp-wallet-card--personal,
html[data-theme] body.personal-app.wenapay-home-v9 .wp-wallet-card--personal :is(.wp-wallet-kind,.wp-wallet-value,.wp-wallet-meta,.wp-wallet-chevron){color:var(--wp-readable-on-orange)!important;opacity:1!important}
html[data-theme] body.personal-app.wenapay-home-v9 .wp-wallet-card--personal .wp-wallet-kind svg{color:var(--wp-readable-on-orange)!important;stroke:currentColor!important}
html[data-theme] body.personal-app.wenapay-home-v9 .primary-button:not(:disabled),
html[data-theme] body[data-wp-screen="BUSINESS-HOME-V7"] .button.primary:not(:disabled),
html[data-theme] body[data-wp-screen="BUSINESS-HOME-V7"] .metric.metric-dark,
html[data-theme] body[data-wp-screen="BUSINESS-HOME-V7"] .metric.metric-dark :is(strong,span,small,a,.metric-kicker,.metric-foot),
html[data-theme] body[data-wp-screen="BUSINESS-POS-V9"] :is(.charge-button,.checkout-primary,.scan-mode):not(:disabled){color:var(--wp-readable-on-orange)!important}
html[data-theme] body.personal-app.wenapay-home-v9 .primary-button:not(:disabled) :is(span,strong,small,svg),
html[data-theme] body[data-wp-screen="BUSINESS-HOME-V7"] .button.primary:not(:disabled) :is(span,strong,small,svg),
html[data-theme] body[data-wp-screen="BUSINESS-POS-V9"] :is(.charge-button,.checkout-primary,.scan-mode):not(:disabled) :is(span,strong,small,svg){color:var(--wp-readable-on-orange)!important}
html[data-theme] body.personal-app.wenapay-home-v9 .wp-shared-bottom-nav .approved-nav-pay-icon,
html[data-theme] body.personal-app.wenapay-home-v9 .wp-shared-bottom-nav .approved-nav-pay-icon svg{color:var(--wp-readable-on-orange)!important}
html[data-theme] body.personal-app.wenapay-home-v9 .action-sheet :is(label,.sheet-help,.recipient-help,.amount-input>span),
html[data-theme] body[data-wp-screen="BUSINESS-POS-V9"] :is(.checkout-panel,.payment-dialog,.scanner-fallback) label{color:var(--wp-readable-text)!important}
html[data-theme="light"] body.personal-app.wenapay-home-v9 .wp-shared-bottom-nav .approved-nav-item.is-active{color:var(--wp-readable-link)!important}
html[data-theme="light"] body.personal-app.wenapay-home-v9 .pilot-note{color:var(--wp-readable-muted)!important}
html[data-theme="light"] body.personal-app.wenapay-home-v9 .security-banner>b{
  color:var(--wp-readable-text)!important;background:var(--wp-readable-surface)!important;
}
html[data-theme="light"] body.personal-app.wenapay-home-v9 .security-banner>b::after{color:var(--wp-readable-text)!important}
html[data-theme="light"] body.personal-app.wenapay-home-v9 .action-card .action-icon{color:var(--wp-readable-link)!important}
html[data-theme] body.personal-app.wenapay-home-v9 .wp-primary-pay-action .action-icon,
html[data-theme] body.personal-app.wenapay-home-v9 .wp-primary-pay-action .action-icon svg{color:var(--wp-readable-on-orange)!important}
html[data-theme="light"] body[data-wp-screen="BUSINESS-POS-V9"] .pos-context-banner{
  background:var(--wp-readable-raised)!important;color:var(--wp-readable-text)!important;
}
html[data-theme="light"] body[data-wp-screen="BUSINESS-POS-V9"] .pos-context-banner :is(strong,span,small){color:var(--wp-readable-text)!important}

/* Sales helper text and filters must share the selected surface. */
html[data-theme] body[data-wp-section="sales"] .filter{
  color:var(--wp-readable-text)!important;background:var(--wp-readable-raised)!important;
}
html[data-theme] body[data-wp-section="sales"] .filter label{color:var(--wp-readable-text)!important}
html[data-theme] body[data-wp-section="sales"] .filter #apply:not(:disabled){color:var(--wp-readable-on-orange)!important}
html[data-theme] body[data-wp-section="sales"] .note{
  color:var(--wp-readable-muted)!important;background:var(--wp-readable-raised)!important;
}
html[data-theme] body[data-wp-section="sales"] .note strong{color:var(--wp-readable-text)!important}
html[data-theme] body[data-wp-section="sales"] .ledger-status{color:var(--wp-readable-muted)!important}

/* Basket prices and QR breakdowns use a paired foreground and surface. */
html[data-theme] body[data-wp-screen="BUSINESS-POS-V9"] .pos-cart .cart-line-price{color:var(--wp-readable-text)!important}
html[data-theme] body[data-wp-screen="BUSINESS-POS-V9"] .payment-breakdown{background:var(--wp-readable-raised)!important;color:var(--wp-readable-text)!important;border-color:var(--wp-readable-border)!important}
html[data-theme] body[data-wp-screen="BUSINESS-POS-V9"] .payment-breakdown :is(span,strong,small){color:var(--wp-readable-text)!important}


/* Surface-specific labels, including Books' plain business-name div. */
html[data-theme] body[data-wp-section="books"] .business-name{color:var(--wp-readable-text)!important}
html[data-theme="light"] body:is([data-wp-screen="BUSINESS-CHILD-V7"],[data-wp-screen="BUSINESS-HOME-V7"],[data-wp-screen="BUSINESS-POS-V9"]) :is(.eyebrow,.ey,.checkout-kicker){color:var(--wp-readable-link)!important}
html[data-theme] body[data-wp-flow="CUSTOMERS-LOYALTY-V13"] .retention-action.primary,
html[data-theme] body[data-wp-flow="CUSTOMERS-LOYALTY-V13"] .retention-action.primary :is(strong,small,span,svg){color:var(--wp-readable-on-orange)!important;opacity:1!important}
html[data-theme="light"] body[data-wp-screen="BUSINESS-CHILD-V7"] .hero h1 :is(em,span){color:var(--wp-readable-link)!important}
html[data-theme="light"] body.personal-app.wenapay-home-v9 .section-heading .text-link{color:var(--wp-readable-link)!important}
html[data-theme] body[data-wp-screen="BUSINESS-CHILD-V7"] .merchant-side-nav b svg{display:block;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
/* The QR keeps its white quiet zone; small screens scroll the dialog itself. */
@media(max-width:700px){
 body[data-wp-screen="BUSINESS-POS-V9"] .payment-dialog h2{font-size:24px;line-height:1.12}
 body[data-wp-screen="BUSINESS-POS-V9"] .payment-overlay-copy{font-size:13px;margin-bottom:12px}
 body[data-wp-screen="BUSINESS-POS-V9"] .payment-dialog-grid{gap:14px}
 body[data-wp-screen="BUSINESS-POS-V9"] .large-qr-card{min-height:216px;padding:8px}
 body[data-wp-screen="BUSINESS-POS-V9"] .large-qr-card img{width:200px;height:200px}
}

/* Secondary affordances need the same contrast as the primary content. */
html[data-theme="light"] body[data-wp-screen="BUSINESS-HOME-V7"] .merchant-side-support a,
html[data-theme="light"] body[data-wp-screen="BUSINESS-HOME-V7"] .merchant-side-support a span,
html[data-theme="light"] body[data-wp-section="books"] .books-menu b{color:var(--wp-readable-link)!important}
html[data-theme="light"] body[data-wp-screen="BUSINESS-POS-V9"] .pos-context-meta b{color:var(--wp-readable-text)!important}
html[data-theme="light"] body[data-wp-screen="BUSINESS-POS-V9"] .payment-ready strong{color:var(--wp-readable-text)!important}
html[data-theme] body[data-wp-screen="BUSINESS-POS-V9"] .product-card:is(.no-product-image,.product-image-error) .product-thumb{
 background:#fff!important;color:#111315!important;
}
html[data-theme] body[data-wp-section="stock"] .inventory-photo{
 background:var(--wp-readable-raised)!important;color:var(--wp-readable-muted)!important;
}
html[data-theme] body[data-wp-section="stock"] .inventory-photo span{color:var(--wp-readable-muted)!important}
html[data-theme="light"] body[data-wp-section="books"] .payment-badge[data-tone="attention"]{
 background:#fff0e5!important;color:#8b3500!important;
}
html[data-theme] body[data-wp-section="books"] :is(.accountant-panel summary,.accounting-evidence){color:var(--wp-readable-muted)!important}
