/* Shared reset + primitives. Each app (store.css / admin.css) defines the color tokens. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--tx); font-family: var(--font, 'DM Sans', system-ui, sans-serif); -webkit-font-smoothing: antialiased; line-height: 1.45; }
a { color: var(--link, inherit); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
img { max-width: 100%; }
::selection { background: var(--sel, oklch(0.72 0.17 280)); color: #fff; }
:focus-visible { outline: 2px solid var(--focus, oklch(0.8 0.13 200)); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mono { font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace); }
.num { font-variant-numeric: tabular-nums; }
.ic { flex: none; display: inline-block; vertical-align: middle; }

/* Scroll reveal: fade-up when entering the viewport (see lib.js reveal()) */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.7,.2,1) var(--rv-delay, 0ms), transform .7s cubic-bezier(.2,.7,.2,1) var(--rv-delay, 0ms), border-color .25s, background .25s, box-shadow .25s; }
[data-reveal].rv-in, [data-reveal][data-rv="in"] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="on"]) *, :root:not([data-motion="on"]) *::before, :root:not([data-motion="on"]) *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  :root:not([data-motion="on"]) [data-reveal] { opacity: 1; transform: none; }
}

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }

.spinner { width: 18px; height: 18px; border-radius: 99px; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--skel1, oklch(0.18 0.018 285)) 0, var(--skel2, oklch(0.22 0.02 285)) 40%, var(--skel1, oklch(0.18 0.018 285)) 80%) 0 0 / 800px 100%; animation: shimmer 1.4s linear infinite; }

/* Toasts */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; padding: 11px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; background: var(--toast-bg, oklch(0.22 0.02 285)); color: var(--tx); border: 1px solid var(--line2); box-shadow: 0 16px 40px oklch(0 0 0 / .45); animation: pop .25s ease-out; max-width: 100%; }
.toast-err { border-color: oklch(0.7 0.18 25 / .6); color: oklch(0.88 0.08 25); }
.toast { display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; }
.toast-ic { width: 18px; height: 18px; flex: none; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; background: var(--ac, currentColor); color: var(--bg); }
.toast-err .toast-ic { background: oklch(0.7 0.18 25); }
.toast-msg { flex: 1; min-width: 0; }
.toast-x { border: 0; background: none; color: inherit; opacity: .55; font-size: 16px; line-height: 1; padding: 0 2px; cursor: pointer; }
.toast-x:hover { opacity: 1; }
.toast-bar { display: none; }

/* Markdown content */
.md { line-height: 1.65; color: var(--mu); }
.md h2, .md h3, .md h4 { color: var(--tx); letter-spacing: -0.02em; margin: 1.4em 0 .4em; line-height: 1.2; }
.md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p { margin: .6em 0; }
.md b { color: var(--tx); }
.md a { color: var(--accent2, oklch(0.8 0.13 200)); text-decoration: underline; text-underline-offset: 3px; }
.md code { font-family: var(--mono); font-size: .9em; padding: 1px 6px; border-radius: 6px; background: oklch(1 0 0 / .07); }
.md ul { padding-left: 1.2em; }

.coin-fallback { display: inline-flex; align-items: center; justify-content: center; border-radius: 99px; background: oklch(0.3 0.03 285); font-size: 11px; font-weight: 700; }
.btn-copy { flex: none; border: 1px solid var(--line2); background: oklch(0.2 0.02 285); color: var(--tx); border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 600; transition: border-color .2s; }
.btn-copy:hover { border-color: var(--accent2, oklch(0.8 0.13 200)); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: oklch(1 0 0 / .1); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }
