/* RC22 — global contrast contract. Brand colors may vary, readable controls may not. */
:root{
  --ui-text-strong:#fffdf7;
  --ui-text:#eee8dc;
  --ui-text-muted:#bdb5a7;
  --ui-accent:#e7c665;
  --ui-accent-hi:#ffe49a;
  --ui-accent-deep:#9c6d18;
  --ui-on-accent:#1c1204;
  --ui-surface:#17181d;
  --ui-surface-2:#202127;
  --ui-line:rgba(255,255,255,.15);
  --ui-line-accent:rgba(231,198,101,.42);
  --ui-focus:0 0 0 3px rgba(255,228,154,.28),0 0 0 1px #fff inset;
}

/* Shared content colors */
:is(.minimal-shell,.admin-v3,.storefront-v3,.board-v4){color:var(--ui-text)}
:is(.minimal-shell,.admin-v3,.storefront-v3) :where(h1,h2,h3,h4,strong,b){color:var(--ui-text-strong)}
:is(.minimal-shell,.admin-v3,.storefront-v3) :where(p,small,.muted,.field-help){color:var(--ui-text-muted)}

/* Generic and admin controls */
:is(.minimal-shell,.admin-v3) .btn,
.admin-v3 :where(button,.button)[class*="btn"]{
  border-color:var(--ui-line)!important;
  background:linear-gradient(180deg,#292a31,#202127)!important;
  color:var(--ui-text-strong)!important;
  text-shadow:none!important;
  box-shadow:0 8px 22px rgba(0,0,0,.2)!important;
}
:is(.minimal-shell,.admin-v3) .btn.primary,
.admin-v3 .btn.primary{
  border-color:rgba(255,229,151,.48)!important;
  background:linear-gradient(135deg,var(--ui-accent-hi),var(--ui-accent) 52%,#b98728)!important;
  color:var(--ui-on-accent)!important;
  font-weight:900!important;
  box-shadow:0 12px 30px rgba(190,139,40,.28)!important;
}
:is(.minimal-shell,.admin-v3) .btn.ghost,
.admin-v3 .btn.ghost{
  border-color:rgba(255,255,255,.2)!important;
  background:rgba(255,255,255,.075)!important;
  color:#fff!important;
}
:is(.minimal-shell,.admin-v3) .btn.danger,
.admin-v3 .btn.danger{
  border-color:rgba(255,151,157,.42)!important;
  background:linear-gradient(135deg,#a43f49,#6e252d)!important;
  color:#fff!important;
}
:is(.minimal-shell,.admin-v3) .btn:hover{filter:brightness(1.1);border-color:var(--ui-line-accent)!important}
:is(.minimal-shell,.admin-v3) :where(.btn,button,a,input,select,textarea):focus-visible{
  outline:0!important;box-shadow:var(--ui-focus)!important
}
:is(.minimal-shell,.admin-v3) :where(input,select,textarea){
  border-color:rgba(255,255,255,.18)!important;
  background:#11141a!important;
  color:#fff!important;
}
:is(.minimal-shell,.admin-v3) :where(input,textarea)::placeholder{color:#948e84!important;opacity:1}

/* Admin navigation and actionable links */
.admin-v3 :where(.panel-head a,.workspace-head a,.table-wrap a,.order-number,.av4-store-link){
  color:#f4d77e!important;text-decoration-color:rgba(244,215,126,.45)!important
}
.admin-v3 :where(.panel-head a,.workspace-head a,.table-wrap a):hover{color:#fff1bd!important;text-decoration:underline}
.admin-v3 .av4-nav a{color:#ded8cd!important}
.admin-v3 .av4-nav a small{color:#938d84!important}
.admin-v3 .av4-nav a.is-active{color:#fff!important;background:linear-gradient(135deg,rgba(231,198,101,.2),rgba(255,255,255,.055))!important;border-color:rgba(231,198,101,.28)!important}
.admin-v3 .av4-nav a.is-active .av4-link-icon{color:#ffe08b!important}

/* Storefront buttons and links */
.storefront-v3 :where(.sf-button,.sf-action-button,.sf-checkout-button,.sf-cart-checkout,.sf-form-actions button){
  border:1px solid var(--ui-line)!important;
  color:#fff!important;
  text-shadow:none!important;
}
.storefront-v3 :where(.sf-button-primary,.sf-action-primary,.sf-checkout-button,.sf-cart-checkout){
  background:linear-gradient(135deg,var(--ui-accent-hi),var(--ui-accent) 55%,#b47d21)!important;
  border-color:rgba(255,231,158,.48)!important;
  color:var(--ui-on-accent)!important;
  font-weight:900!important;
  box-shadow:0 13px 34px rgba(190,139,40,.3)!important;
}
.storefront-v3 :where(.sf-button-ghost,.sf-action-secondary){
  background:rgba(8,8,7,.66)!important;
  border-color:rgba(255,255,255,.28)!important;
  color:#fff!important;
}
.storefront-v3 :where(.sf-button,.sf-action-button,.sf-checkout-button,a,button,input,select,textarea):focus-visible{
  outline:0!important;box-shadow:var(--ui-focus)!important
}
.storefront-v3 :where(.sf-nav a,.sf-footer-column a,.sf-footer-contact a,.sf-section>header>a,.sf-product-copy a,.sf-page-link){color:#eee6d8!important}
.storefront-v3 :where(.sf-nav a,.sf-footer-column a,.sf-footer-contact a,.sf-section>header>a,.sf-product-copy a,.sf-page-link):hover{color:#ffe39a!important}
.storefront-v3 .sf-nav a.is-active{color:#fff4c5!important;background:rgba(231,198,101,.16)!important;border-color:rgba(231,198,101,.28)!important}

/* Minimal/error states must remain readable even when custom theme colors are dark. */
.minimal-shell .error-card{
  border-color:rgba(255,255,255,.18)!important;
  background:linear-gradient(180deg,#171c24,#11161d)!important;
  box-shadow:0 30px 90px rgba(0,0,0,.42)!important;
}
.minimal-shell .error-card .error-code{color:#f2d477!important;text-shadow:0 8px 30px rgba(231,198,101,.2)}
.minimal-shell .error-card h1{color:#fff!important}
.minimal-shell .error-card p{color:#c9c2b7!important}
.minimal-shell .error-card code{color:#ffe49a!important;background:#0a0d11;padding:3px 7px;border-radius:7px}
.minimal-shell .error-card .btn.primary{min-width:150px;margin-top:8px}

/* Board text contrast */
.board-v4{--board-text:#fffdf6;--board-muted:#bdb5a5;--board-gold:#e4c36d}
.board-v4 .spb-rate-item{color:#fff!important}
.board-v4 .spb-rate-copy small,.board-v4 .spb-rate-price small,.board-v4 .spb-chart-head,.board-v4 .spb-footer{color:#bdb5a5!important}
