/* Shared primitives. Layout and product-specific rules live separately. */
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1rem/1.6 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { width: 24px; height: 24px; flex-shrink: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.035em; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 3vw, 2.65rem); margin-bottom: 10px; font-weight: 800; }
h2 { font-size: 1.4rem; font-weight: 750; margin-bottom: 12px; }
h3 { font-size: 1.075rem; font-weight: 750; margin-bottom: 16px; }
p { margin-bottom: 16px; }
small, .muted { color: var(--muted); }
small { font-size: .875rem; }
.eyebrow, .nx-eyebrow, .nx-section-index, .nx-credit-eyebrow { display: block; margin-bottom: 10px; font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card, .product-detail-card, .faq-item { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
.btn, .nx-login-btn, .nx-nav-login, .nx-discord-login, .nx-purchase-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); font-size: .875rem; line-height: 1.4; font-weight: 700;
  text-align: center; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn:hover { background: var(--surface2); }
.btn:active, .nx-login-btn:active, .nx-nav-login:active, .nx-discord-login:active, .nx-purchase-button:active {
  transform: scale(0.98);
}
.btn-primary, .nx-nav-login, .nx-login-btn, .nx-purchase-button, .nx-discord-login {
  background: var(--accent); color: var(--ink); border-color: transparent;
  box-shadow: 0 4px 14px -2px rgba(163, 230, 53, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover, .nx-purchase-button:hover, .nx-discord-login:hover {
  background: var(--accent); opacity: 0.95; transform: translateY(-1.5px);
  box-shadow: 0 8px 20px -2px rgba(163, 230, 53, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-secondary {
  background: var(--accent2); color: #080d16; border-color: transparent;
  box-shadow: 0 4px 14px -2px rgba(56, 189, 248, 0.35);
}
.btn-secondary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px -2px rgba(56, 189, 248, 0.45);
}
.btn-ghost { border-color: var(--line); background: transparent; }
.btn-ghost:hover { background: var(--surface2); border-color: rgba(255, 255, 255, 0.2); }
.btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 7px 12px; border-radius: 9px; }
.btn:disabled { transform: none; box-shadow: none; opacity: 0.5; }
.actions, .pagination { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pagination { justify-content: flex-end; margin-top: 20px; }
.stack { display: grid; gap: 16px; }
.form-grid, .nx-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-grid > .btn { justify-self: start; }
.label, .nx-field label, .nx-credit-field > span, .balance-field > label { display: block; font-size: .875rem; font-weight: 650; margin-bottom: 7px; }
.input, .select, .textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px; background: var(--card); color: var(--text); font-size: .9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(163, 230, 53, 0.15);
}
.actions > :is(input, select) { flex: 1 1 160px; width: auto; }
.badge, .proxy-state, .proxy-health, .proxy-signal-tag, .nx-stock-state, .nx-product-status {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 4px 10px;
  font-size: .8125rem; font-weight: 700; background: var(--surface2); color: var(--muted); white-space: nowrap;
}
.badge.success, .proxy-state.active, .proxy-health.good, .proxy-health.is-good, .nx-stock-state.is-available { color: var(--success); background: var(--success-bg); }
.badge.warn, .proxy-signal-tag.gtred { color: var(--warn); background: var(--warn-bg); }
.badge.danger, .proxy-state.expired, .proxy-health.bad, .proxy-health.is-bad, .proxy-signal-tag.allred { color: var(--danger); background: var(--danger-bg); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .table-wrap { border: 0; border-radius: 0; box-shadow: none; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
.table th { color: var(--muted); font-weight: 700; background: var(--surface2); white-space: nowrap; }
.table th, .table td { padding: 15px 18px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface2); }
.table td { max-width: 340px; overflow-wrap: anywhere; }
.table td .actions { flex-wrap: nowrap; }
.table td .btn { white-space: nowrap; }
.table td[colspan] { padding: 35px 20px; text-align: center; color: var(--muted); }
.empty, .notice { padding: 26px; border: 1px dashed var(--rule); border-radius: var(--radius); background: var(--surface2); color: var(--muted); }
.empty { text-align: center; grid-column: 1 / -1; }
.empty strong { display: block; color: var(--text); }
.skeleton { min-height: 125px; background: var(--surface2); border-radius: var(--radius); animation: pulse 1.6s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }
.toast-wrap { position: fixed; bottom: 24px; right: 24px; z-index: 300; display: grid; gap: 10px; max-width: min(400px, calc(100vw - 32px)); }
.toast {
  background: var(--card); padding: 16px 20px; border: 1px solid var(--line);
  border-left: 4px solid var(--success); border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
}
.toast.error, .toast.danger { border-left-color: var(--danger); }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 500; background: var(--accent); color: #182022; padding: 12px; }
.skip-link:focus { top: 12px; }
.field-help { font-size: .875rem; color: var(--muted); margin-top: 6px; }
.section-link { font-size: .875rem; font-weight: 650; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 640px) {
  .form-grid, .nx-form-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .table th, .table td { padding: 13px; }
  .table { min-width: 550px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
