/* Important public messages only; ordinary help text and result counts stay quiet.
   New notices can use .rg-notice and data-notice-tone="info|warning|success|error".
   Keep explicit message text: colour is never the only indication of state. */
:root {
  --rg-warning-bg:#fff2cc; --rg-warning-border:#d58a00; --rg-warning-text:#654000;
  --rg-success-bg:#e8f5eb; --rg-success-border:#27803d; --rg-success-text:#205d31;
  --rg-error-bg:#ffebe9; --rg-error-border:#be352f; --rg-error-text:#85261f;
  --rg-info-bg:#e7f2fc; --rg-info-border:#2874a6; --rg-info-text:#174f73;
}
body.rgwc-page .woocommerce :is(.woocommerce-info,.woocommerce-message,.woocommerce-error,.rgow-fee-notice,.rgow-pi-notice,.rgow-shipping-unavailable,.rg-notice),
body .rg-notice,
body .rgwc-saved-cart .rgwc-saved-cart-status:not(:empty),
body :is(.rgo-spec-load-error,.rgo-filter-error),
body #rgwc-cart-progress:not(:empty),
body #rg-finder-results .rg-result-warning,
body.rg-material-page :is(.ms-notice,#rg-material-selector .ms-warning,#rg-material-selector .ms-errors),
body .wpcf7 form .wpcf7-response-output:not(:empty) {
  --notice-bg:var(--rg-warning-bg); --notice-border:var(--rg-warning-border); --notice-text:var(--rg-warning-text);
  box-sizing:border-box;
  padding:14px 16px;
  border:1px solid var(--notice-border);
  border-left-width:5px;
  border-radius:6px;
  background:var(--notice-bg);
  color:var(--notice-text);
  font-size:14px;
  font-weight:500;
  line-height:1.7;
  overflow-wrap:anywhere;
}
body.rgwc-page .woocommerce :is(.woocommerce-message,[data-notice-tone="success"]),
body [data-notice-tone="success"].rg-notice,
body #rgwc-cart-progress[data-notice-tone="success"] {
  --notice-bg:var(--rg-success-bg); --notice-border:var(--rg-success-border); --notice-text:var(--rg-success-text);
}
body.rgwc-page .woocommerce :is(.woocommerce-error,[data-notice-tone="error"]),
body [data-notice-tone="error"].rg-notice,
body .rgwc-saved-cart .rgwc-saved-cart-status:not(:empty),
body :is(.rgo-spec-load-error,.rgo-filter-error),
body #rgwc-cart-progress[data-notice-tone="error"],
body.rg-material-page #rg-material-selector .ms-errors,
body .wpcf7 form .wpcf7-response-output:not(:empty) {
  --notice-bg:var(--rg-error-bg); --notice-border:var(--rg-error-border); --notice-text:var(--rg-error-text);
}
/* CF7 5.x uses response classes; newer versions also expose form states. */
body .wpcf7 form.sent .wpcf7-response-output:not(:empty),
body .wpcf7 form .wpcf7-response-output.wpcf7-mail-sent-ok:not(:empty) {
  --notice-bg:var(--rg-success-bg); --notice-border:var(--rg-success-border); --notice-text:var(--rg-success-text);
}
body.rgwc-page .woocommerce [data-notice-tone="info"],
body [data-notice-tone="info"].rg-notice,
body #rgwc-cart-progress[data-notice-tone="info"] {
  --notice-bg:var(--rg-info-bg); --notice-border:var(--rg-info-border); --notice-text:var(--rg-info-text);
}
/* Keep WooCommerce's existing status icons and accessible links. */
body.rgwc-page .woocommerce :is(.woocommerce-info,.woocommerce-message,.woocommerce-error) {padding-left:48px}
body.rgwc-page .woocommerce :is(.woocommerce-info,.woocommerce-message,.woocommerce-error)::before {color:inherit}
body.rgwc-page .woocommerce .woocommerce-form-login-toggle .woocommerce-info {
  padding:14px 16px;
  border:1px solid var(--rg-info-border); border-left-width:5px;
  background:var(--rg-info-bg); color:var(--rg-info-text);
}
body :is(.rg-notice,.rgow-fee-notice,.rgow-shipping-unavailable,.rgow-pi-notice) :is(p,strong),
body.rgwc-page .woocommerce .rgow-fee-notice :is(p,strong) {color:inherit;font-size:inherit}
body :is(.rg-notice,.rgow-shipping-unavailable,.rgow-pi-notice,.rgow-fee-notice,.wpcf7-response-output) a {color:inherit;text-decoration:underline;text-underline-offset:3px}
body .rg-notice:empty {display:none}
body .rg-notice[hidden] {display:none!important}
body #rg-inquiry-dialog #contact .wpcf7-response-output:not(:empty) {
  background:var(--notice-bg);color:var(--notice-text);font-size:14px;
}
body #rgwc-cart-progress .rgwc-cart-retry {color:inherit;font-weight:700}
body .rgwc-cart-intro #rgwc-cart-progress:not(:empty) {font-size:14px}
body.rg-material-page #rg-material-selector .ms-errors {padding-left:34px}
/* Inline validation stays beside its field, with readable text and a clear edge. */
body.rgow-checkout-page .rgow-field-error:not(:empty),
body .wpcf7 .wpcf7-not-valid-tip,
body.rg-home #rg-finder .rg-finder-field-error:not([hidden]) {
  padding:7px 10px; margin-top:7px;
  border-left:3px solid var(--rg-error-border); border-radius:3px;
  background:var(--rg-error-bg); color:var(--rg-error-text);
  font-size:13px; font-weight:500; line-height:1.6;
}
/* The receipt already has a large state heading; highlight its explanation too. */
body .rgow-confirmation .rgow-receipt-message {
  padding:14px 16px; border:1px solid var(--rg-info-border); border-left-width:5px;
  border-radius:6px; background:var(--rg-info-bg); color:var(--rg-info-text); font-weight:500;
}
body .rgow-confirmation .rgow-receipt--pending .rgow-receipt-message {border-color:var(--rg-warning-border);background:var(--rg-warning-bg);color:var(--rg-warning-text)}
body .rgow-confirmation .rgow-receipt--paid .rgow-receipt-message {border-color:var(--rg-success-border);background:var(--rg-success-bg);color:var(--rg-success-text)}
body.rgwc-page .woocommerce .rgow-provisional-total,
body.rgow-checkout-page .woocommerce #order_review .rgow-provisional-total {
  padding:8px 10px; margin-top:10px; border-left:3px solid var(--rg-warning-border);
  background:var(--rg-warning-bg); color:var(--rg-warning-text); font-size:13px; font-weight:500; line-height:1.6;
}
/* A long fee warning must wrap without squeezing the Total label. */
body.rgow-checkout-page .woocommerce #order_review table.shop_table tfoot tr.order-total {grid-template-columns:max-content minmax(0,1fr)}
body.rgow-checkout-page .woocommerce #order_review .order-total td {min-width:0}
@media(max-width:600px) {
  body .rg-notice,body #rgwc-cart-progress:not(:empty) {padding:12px 14px}
}
