/* The shared depth of buttons (owner, 2026-11-30), shaped after Meta's Astryx design system. Astryx: MIT License, Copyright (c) 2026
   Meta Platforms, Inc. The sibling of ui.css for apps with their own palettes: it never sets a colour or a background, only shadow,
   press, focus and the "saving" spinner, so every palette, theme and client store keeps its own colours.
   Canonical file: infra/web-kit/ui-depth.css; each app keeps an identical copy at shared/web-kit/ui-depth.css (change both in one
   commit), loaded AFTER the app's own stylesheet, with ui.js. Works on the class names .btn, .btn-*. */

.btn { position: relative; -webkit-tap-highlight-color: transparent; transition: transform .1s, box-shadow .1s, filter .12s; }

/* raised: a lit top edge and a soft shadow; pressing pushes it in */
.btn:not(.btn-ghost):not(.btn-link):not([disabled]) {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 1px 2px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.12);
}
@media (hover: hover) { .btn:not([disabled]):hover { filter: brightness(1.05); } }
.btn:not(.btn-ghost):not(.btn-link):not([disabled]):active { transform: translateY(1px) scale(.99); box-shadow: inset 0 2px 5px rgba(0,0,0,.28); }
.btn-ghost:active, .btn-link:active { transform: scale(.98); }
.btn[disabled] { box-shadow: none; }
.btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* deep: the big actions sink into a base */
.btn-lg:not(.btn-ghost):not(.btn-link):not([disabled]), .btn-deep:not([disabled]) {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 4px 0 rgba(0,0,0,.32), 0 8px 14px rgba(0,0,0,.2);
  margin-bottom: 4px;
}
.btn-lg:not(.btn-ghost):not(.btn-link):not([disabled]):active, .btn-deep:not([disabled]):active {
  transform: translateY(3px); box-shadow: inset 0 1px 3px rgba(0,0,0,.25), 0 1px 0 rgba(0,0,0,.32);
}

/* working: ui.js marks the pressed button until the server answers; the words stay, a ring turns beside them */
.btn.busy { pointer-events: none; }
.btn.busy::after { content: ""; display: inline-block; width: .95em; height: .95em; margin-left: .5em; vertical-align: -.12em; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: ui-spin .7s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn.busy::after { animation-duration: 2s; } }
