:root {
  color-scheme: light;
  --bg: #f3faf5;
  --bg-soft: #eaf4ee;
  --surface: #fffefa;
  --surface-2: #eef7f1;
  --surface-3: #dcefe4;
  --text: #10211b;
  --muted: #607169;
  --line: #cfe1d6;
  --brand: #0f8f7a;
  --brand-strong: #0a6f62;
  --brand-soft: #d9f0e8;
  --accent: #e4a12f;
  --danger: #c94e4e;
  --ok: #178563;
  --shadow-sm: 0 0.5rem 1.5rem rgba(16, 33, 27, 0.06);
  --shadow-md: 0 1rem 3rem rgba(16, 33, 27, 0.1), 0 0.25rem 0.75rem rgba(16, 33, 27, 0.05);
  --shadow-lg: 0 1.5rem 4rem rgba(16, 33, 27, 0.14), 0 0.5rem 1.25rem rgba(16, 33, 27, 0.06);
  --radius: 0.5rem;
  --container: min(76rem, calc(100% - clamp(1rem, 4vw, 3rem)));
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1714;
  --bg-soft: #101f19;
  --surface: #152821;
  --surface-2: #1a3128;
  --surface-3: #213c31;
  --text: #f0faf4;
  --muted: #a3b9ae;
  --line: #2d4c3e;
  --brand: #48d0b7;
  --brand-strong: #83ead6;
  --brand-soft: #123d34;
  --accent: #f0bb61;
  --danger: #f07b7b;
  --ok: #70d9aa;
  --shadow-sm: 0 0.5rem 1.5rem rgba(5, 8, 7, 0.28);
  --shadow-md: 0 1rem 3rem rgba(5, 8, 7, 0.34), 0 0.25rem 0.75rem rgba(5, 8, 7, 0.22);
  --shadow-lg: 0 1.5rem 4rem rgba(5, 8, 7, 0.42), 0 0.5rem 1.25rem rgba(5, 8, 7, 0.26);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand) 12%, transparent), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  color: var(--text);
  font-family: "Noto Sans Thai", Inter, system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  user-select: text;
  -webkit-user-select: text;
}

::selection {
  background: color-mix(in srgb, var(--accent) 42%, var(--brand-soft));
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

input,
textarea,
select {
  user-select: text;
  -webkit-user-select: text;
}

button {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  caret-color: transparent;
}

button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--brand) 16%, transparent);
}

img {
  max-width: 100%;
}

svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@keyframes softIn {
  from {
    opacity: 0;
    transform: translateY(1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(0.875rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand) 12%, transparent), transparent 32rem),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

.boot-mark {
  display: grid;
  width: 3rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: var(--surface);
  font-weight: 900;
  line-height: 1;
  box-shadow: var(--shadow-md);
}

.app-shell > main {
  flex: 1 0 auto;
}

.app-shell > .app-footer {
  flex: 0 0 auto;
}

@supports (min-height: 100dvh) {
  .app-shell {
    min-height: 100dvh;
  }
}

.motion-on .topbar,
.motion-on .hero,
.motion-on .ticker,
.motion-on .section {
  animation: softIn 0.42s ease-out both;
}

.motion-on .topbar { animation-delay: 0.04s; }
.motion-on .hero { animation-delay: 0.1s; }
.motion-on .ticker { animation-delay: 0.16s; }
.motion-on .section { animation-delay: 0.22s; }

.container,
.topbar-inner {
  width: var(--container);
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 86%, transparent);
  background: var(--bg);
  box-shadow: 0 0.5rem 1.5rem color-mix(in srgb, var(--text) 4%, transparent);
  isolation: isolate;
}

.topbar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.875rem;
  align-items: center;
  padding-block: 0.875rem;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
}

.brand-button:hover .brand-mark,
.brand-button:hover .brand-logo {
  transform: translateY(-0.0625rem);
  box-shadow: var(--shadow-md);
}

.brand-mark,
.brand-logo {
  display: grid;
  width: 2.75rem;
  aspect-ratio: 1;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: var(--surface);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.brand-logo {
  background: var(--surface);
  object-fit: contain;
  object-position: center;
  box-shadow: var(--shadow-sm);
}

.app-footer {
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding-block: 2rem 2.5rem;
}

.footer-grid {
  display: grid;
  gap: 1rem;
}

.footer-brand {
  display: grid;
  width: 4rem;
  aspect-ratio: 1;
  place-items: center;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--brand);
  font-weight: 900;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.footer-brand:hover {
  transform: translateY(-0.0625rem);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  box-shadow: var(--shadow-md);
}

.footer-brand img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.footer-copy,
.footer-contact {
  min-width: 0;
}

.footer-copy strong,
.footer-contact h3 {
  display: block;
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.footer-copy p,
.footer-contact p {
  max-width: 34rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.main-nav {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  overflow-x: auto;
  padding-block: 0.25rem;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-width: 0;
}

.icon-button,
.pill-button,
.primary-button,
.secondary-button,
.link-button,
.nav-button,
.category-chip {
  align-items: center;
  justify-content: center;
  min-height: 2.625rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.icon-button:hover,
.pill-button:hover,
.primary-button:hover,
.secondary-button:hover,
.nav-button:hover,
.category-chip:hover,
.nav-button.active,
.category-chip.active {
  transform: translateY(-0.0625rem);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.icon-button:active,
.pill-button:active,
.primary-button:active,
.secondary-button:active,
.nav-button:active,
.category-chip:active {
  transform: translateY(0);
}

.icon-button {
  display: grid;
  width: 2.5rem;
  place-items: center;
}

.pill-button,
.primary-button,
.secondary-button,
.nav-button,
.category-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding-inline: 1rem;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

.primary-button {
  border-color: color-mix(in srgb, var(--brand) 82%, var(--line));
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  color: var(--surface);
  box-shadow: 0 0.75rem 1.75rem color-mix(in srgb, var(--brand) 24%, transparent);
}

.primary-button:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--brand) 88%, var(--line));
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
  color: var(--surface);
  box-shadow: 0 0.875rem 2rem color-mix(in srgb, var(--brand) 28%, transparent);
}

.primary-button:disabled {
  cursor: not-allowed;
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
  background: color-mix(in srgb, var(--brand) 62%, var(--surface-2));
  color: var(--surface);
  opacity: 0.82;
  transform: none;
}

.secondary-button {
  background: color-mix(in srgb, var(--surface-2) 80%, var(--surface));
}

.danger-button {
  border-color: color-mix(in srgb, var(--danger) 32%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
  color: var(--danger);
}

.link-button {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 800;
}

.nav-button {
  color: var(--muted);
  background: transparent;
}

.nav-button.active {
  color: var(--text);
}

.user-menu {
  position: relative;
}

.account-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.account-button:hover {
  transform: translateY(-0.0625rem);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.account-avatar {
  display: grid;
  width: 2rem;
  aspect-ratio: 1;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999rem;
  background: var(--brand-soft);
  color: var(--brand);
}

.account-avatar svg {
  width: 1.125rem;
  height: 1.125rem;
}

.account-meta {
  display: grid;
  gap: 0.0625rem;
  min-width: 0;
  text-align: left;
}

.account-meta strong,
.account-meta span,
.account-meta small {
  display: block;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-meta strong {
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.15;
}

.account-meta span {
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.account-meta small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 40;
  display: grid;
  width: min(14rem, calc(100vw - 2rem));
  gap: 0.25rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.dropdown-menu button {
  min-height: 2.375rem;
  padding-inline: 0.75rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  text-align: left;
  transition: background-color 160ms ease;
}

.dropdown-menu button:hover {
  background: var(--surface-2);
}

.hero {
  padding-block: clamp(2.25rem, 7vw, 5rem) clamp(2rem, 4vw, 3rem);
}

.hero-grid {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  max-width: 11.5ch;
  font-size: clamp(2.25rem, 8vw, 4.65rem);
  font-weight: 800;
  line-height: 1.08;
}

h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.18;
}

h3 {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.25;
}

.lead {
  max-width: 42rem;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.98rem, 2vw, 1.075rem);
  line-height: 1.6;
}

.notice {
  margin: 0;
  padding: 0.875rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
  overflow-wrap: anywhere;
}

.status-panel {
  display: grid;
  gap: 0.75rem;
  padding: clamp(0.875rem, 2vw, 1.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  box-shadow: var(--shadow-md);
}

.metric {
  display: grid;
  grid-template-columns: 3.375rem minmax(0, 1fr);
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--surface) 72%, var(--brand-soft)));
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 3.375rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent);
  border-radius: 0.875rem;
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, #ffffff 58%, transparent), transparent 52%),
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, var(--surface)), color-mix(in srgb, var(--brand-soft) 78%, var(--surface)));
  color: var(--brand-strong);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #ffffff 62%, transparent), 0 0.625rem 1.5rem color-mix(in srgb, var(--brand) 10%, transparent);
}

.metric-icon svg {
  width: 1.625rem;
  height: 1.625rem;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-glyph-bg {
  opacity: 0.16;
  stroke: none;
}

.metric-glyph-line {
  fill: none;
}

.metric.available .metric-icon {
  border-color: color-mix(in srgb, #16a765 26%, transparent);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, #ffffff 58%, transparent), transparent 52%),
    linear-gradient(135deg, color-mix(in srgb, #18a058 18%, var(--surface)), color-mix(in srgb, #dcf8ea 82%, var(--surface)));
  color: #0b7a46;
}

.metric.stock .metric-icon {
  border-color: color-mix(in srgb, #2563eb 24%, transparent);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, #ffffff 58%, transparent), transparent 52%),
    linear-gradient(135deg, color-mix(in srgb, #2563eb 16%, var(--surface)), color-mix(in srgb, #e2eaff 82%, var(--surface)));
  color: #1d4ed8;
}

.metric.sold .metric-icon {
  border-color: color-mix(in srgb, #d97706 26%, transparent);
  background:
    radial-gradient(circle at 30% 20%, color-mix(in srgb, #ffffff 58%, transparent), transparent 52%),
    linear-gradient(135deg, color-mix(in srgb, #d97706 18%, var(--surface)), color-mix(in srgb, #fff1d7 82%, var(--surface)));
  color: #b45309;
}

.metric-copy {
  min-width: 0;
}

.metric-value {
  display: block;
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
}

.metric-label {
  color: var(--muted);
  font-size: 0.8125rem;
}

.section {
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

.page-section {
  min-height: calc(100vh - 5rem);
  padding-top: clamp(2rem, 6vw, 3rem);
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.125rem;
}

.section-heading p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.purchase-panel {
  position: relative;
  overflow: hidden;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.purchase-panel::before,
.purchase-panel::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 3rem;
  content: "";
  pointer-events: none;
}

.purchase-panel::before {
  left: 0;
  background: linear-gradient(90deg, var(--surface), transparent);
}

.purchase-panel::after {
  right: 0;
  background: linear-gradient(270deg, var(--surface), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  gap: 0.75rem;
  animation: slide 46s linear infinite;
  animation-delay: var(--ticker-delay, 0ms);
  will-change: transform;
}

.ticker-item {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  min-width: min(22rem, 80vw);
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.purchase-image,
.history-row img,
.history-icon,
.topup-icon {
  display: grid;
  width: 3.5rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  object-fit: cover;
}

.purchase-info {
  min-width: 0;
}

.ticker-item strong {
  display: block;
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticker-item span,
.history-row div span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.empty,
.error,
.purchase-empty {
  display: grid;
  place-items: center;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.purchase-empty {
  text-align: center;
}

.error {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  color: var(--danger);
}

.product-grid,
.topup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.875rem, 2vw, 1.25rem);
}

.help-card .primary-button {
  margin-top: auto;
}

.help-link-icon.facebook {
  color: #1877f2;
}

.help-link-icon.discord {
  color: #5865f2;
}

.help-link-icon svg {
  display: block;
  width: 76%;
  height: 76%;
}

.product-card,
.topup-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 0.5rem 1.5rem color-mix(in srgb, var(--text) 5%, transparent);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.product-card:hover,
.topup-card:hover {
  transform: translateY(-0.125rem);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  box-shadow: var(--shadow-md);
}

.product-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 10%, transparent), transparent 38%);
  opacity: 0;
  transition: opacity 220ms ease;
}

.motion-on .product-card {
  animation: cardReveal 360ms ease both;
  animation-delay: calc(min(var(--card-index, 0), 8) * 45ms);
}

.product-card-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100% - 1.5rem);
  min-height: 1.875rem;
  padding: 0 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, var(--brand-soft));
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.product-card-type {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.875rem;
  padding: 0 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 90%, var(--brand-soft));
  color: var(--brand-strong);
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: clamp(0.875rem, 2vw, 1.15rem);
  border-bottom: 0;
  background: transparent;
  object-fit: contain;
  object-position: center;
  transition: transform 220ms ease, filter 220ms ease;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.875rem 1rem 1rem;
}

.product-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.38;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-description {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-line;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding-inline: 0.625rem;
  border: 1px solid var(--line);
  border-radius: 999rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.ok { color: var(--ok); }
.tag.danger { color: var(--danger); }

.price-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.price-label {
  width: 100%;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.discount-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.625rem;
  padding-inline: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--line));
  border-radius: 999rem;
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 800;
}

.role-discount-note {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand-strong);
}

.price {
  color: var(--text);
  font-size: 1.25rem;
  font-weight: 800;
}

.compare-price {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: line-through;
}

.card-actions {
  display: grid;
  gap: 0.5rem;
}

.card-actions .primary-button {
  width: 100%;
  min-height: 2.875rem;
  color: var(--surface);
  font-weight: 900;
  text-align: center;
  -webkit-text-fill-color: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.card-actions .primary-button:hover:not(:disabled) {
  color: var(--surface);
  -webkit-text-fill-color: var(--surface);
}

.card-actions .primary-button:disabled {
  color: var(--surface);
  -webkit-text-fill-color: var(--surface);
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-0.375rem);
  }

  .product-card:hover::after {
    opacity: 1;
  }

  .product-card:hover .product-image {
    transform: scale(1.035) translateY(-0.125rem);
    filter: saturate(1.04);
  }

  .product-card:hover .product-card-badge {
    transform: translateY(-0.0625rem);
    box-shadow: var(--shadow-md);
  }

  .product-card:hover .card-actions .primary-button:not(:disabled) {
    transform: translateY(-0.0625rem);
  }
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.category-chip img {
  width: 1.5rem;
  aspect-ratio: 1;
  flex: 0 0 auto;
  border-radius: calc(var(--radius) - 0.125rem);
  object-fit: cover;
}

.topup-card {
  gap: 1rem;
  padding: 1rem;
}

.topup-card.disabled {
  opacity: 0.68;
}

.topup-card.disabled:hover {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.topup-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.topup-card h3,
.topup-card p,
.topup-card small {
  margin: 0;
}

.topup-card p {
  color: var(--muted);
}

.topup-card small {
  display: block;
  margin-top: 0.5rem;
  color: var(--danger);
  line-height: 1.45;
}

.topup-icon {
  display: grid;
  place-items: center;
  width: 3rem;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.25rem);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  color: var(--brand);
  font-weight: 900;
}

.topup-brand-icon {
  overflow: hidden;
}

.topup-brand-icon svg {
  display: block;
  width: 72%;
  height: 72%;
}

.topup-brand-icon.truemoney_voucher {
  border-color: color-mix(in srgb, #ef3340 26%, var(--line));
  background: linear-gradient(135deg, #fff6f4, #ffe9e5);
  color: #e3212d;
}

.topup-brand-icon.promptpay_qr {
  border-color: color-mix(in srgb, #1f75cb 28%, var(--line));
  background: linear-gradient(135deg, #f3f8ff, #e7f0ff);
  color: #1f75cb;
}

.topup-brand-icon.bank_slip {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, var(--surface)), color-mix(in srgb, var(--brand) 14%, var(--surface)));
  color: var(--brand);
}

.help-link-icon {
  width: 3.25rem;
  border: 0;
  border-radius: 1rem;
  background: transparent;
  box-shadow: none;
  color: var(--brand);
}

.help-link-icon.facebook,
.help-link-icon.discord {
  border-color: transparent;
  background: transparent;
  color: inherit;
}

.help-link-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0.5rem 0.9rem color-mix(in srgb, var(--text) 10%, transparent));
}

.topup-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
}

.topup-status.ok {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--brand);
}

.topup-status.off {
  background: color-mix(in srgb, var(--muted) 8%, transparent);
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(0.75rem, 2.5vw, 1.5rem);
  background: rgba(17, 23, 19, 0.58);
  overscroll-behavior: contain;
}

body.modal-open .topbar,
body.modal-open main {
  pointer-events: none;
}

.modal {
  width: min(48rem, 100%);
  max-height: min(46rem, calc(100dvh - 2rem));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.auth-modal {
  width: min(28rem, 100%);
}

.history-modal {
  width: min(58rem, 100%);
}

.product-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(62rem, calc(100vw - clamp(1rem, 4vw, 3rem)));
  max-height: calc(100dvh - clamp(1rem, 4vw, 3rem));
  overflow: hidden;
}

.topup-payment-modal {
  width: min(34rem, calc(100vw - 2rem));
  overflow: hidden;
  border-radius: calc(var(--radius) + 0.25rem);
}

.topup-payment-form {
  display: grid;
}

.topup-payment-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, transparent), transparent 58%),
    var(--surface);
}

.topup-payment-title {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.topup-payment-title span {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  padding: 0 0.625rem;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 8%, transparent);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
}

.topup-payment-title h2 {
  margin: 0.375rem 0 0;
  font-size: clamp(1.55rem, 5vw, 2.25rem);
  line-height: 1.08;
}

.topup-payment-title p,
.topup-method-summary p,
.topup-help-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.topup-payment-mark {
  display: grid;
  place-items: center;
  width: 3.25rem;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: calc(var(--radius) - 0.125rem);
  font-weight: 950;
  box-shadow: var(--shadow-sm);
}

.topup-payment-mark svg {
  width: 74%;
  height: 74%;
}

.topup-payment-body {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
}

.topup-method-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.topup-method-summary strong,
.topup-voucher-field span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text);
  font-weight: 900;
}

.topup-method-summary > span {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0 0.75rem;
  border: 1px solid color-mix(in srgb, var(--brand) 26%, var(--line));
  border-radius: 999px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.topup-voucher-field {
  display: grid;
  gap: 0.45rem;
}

.topup-voucher-field input {
  width: 100%;
  min-height: 3.25rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.125rem);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.topup-voucher-field input:focus {
  outline: 0;
  border-color: color-mix(in srgb, var(--brand) 52%, var(--line));
  box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--brand) 12%, transparent);
}

.topup-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.topup-help-grid div {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.875rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.125rem);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.topup-help-grid span {
  display: grid;
  place-items: center;
  width: 2rem;
  aspect-ratio: 1;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 950;
}

.topup-payment-footer {
  display: grid;
  grid-template-columns: minmax(6rem, auto) 1fr;
  gap: 0.75rem;
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 54%, var(--surface));
}

.modal-header,
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.875rem;
  padding: clamp(0.875rem, 2vw, 1.125rem) clamp(1rem, 2.4vw, 1.5rem);
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.12;
}

.modal-footer {
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.product-modal .modal-footer {
  position: sticky;
  z-index: 3;
  bottom: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(10px);
}

.modal-footer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  min-width: 0;
}

.modal-footer-quantity {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.625rem;
  min-width: 0;
}

.modal-footer-quantity > span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.modal-footer-quantity .quantity-stepper {
  grid-template-columns: 2.25rem minmax(3.75rem, 4.5rem) 2.25rem;
}

.modal-footer-total {
  display: grid;
  justify-items: end;
  gap: 0.125rem;
}

.modal-footer-total span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.modal-footer-total strong {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 900;
}

.modal-body {
  padding: clamp(1rem, 2.4vw, 1.5rem);
}

.product-modal-body {
  display: block;
  min-height: 0;
  overflow: auto;
  padding: clamp(1rem, 2.4vw, 1.5rem);
}

.product-checkout-layout {
  display: grid;
  gap: clamp(1rem, 2vw, 1.25rem);
  min-width: 0;
}

.product-preview-panel,
.product-purchase-panel {
  display: grid;
  align-content: start;
  gap: 1rem;
  min-width: 0;
}

.product-modal-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 62%, var(--surface));
  object-fit: contain;
  padding: clamp(1rem, 3vw, 1.75rem);
}

.product-purchase-head {
  display: grid;
  gap: 0.625rem;
}

.product-purchase-head .tag {
  width: 100%;
}

.product-purchase-head h3 {
  margin: 0;
  font-size: clamp(1.12rem, 2vw, 1.35rem);
  line-height: 1.28;
}

.product-detail-box,
.modal-total,
.profile-summary div,
.webhook-field,
.category-admin {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.selected-package-summary {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--brand) 28%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand-soft) 44%, var(--surface));
}

.price-block:has(.variant-picker) {
  display: grid;
  gap: 1rem;
}

.selected-package-summary span,
.selected-package-summary small {
  color: var(--muted);
  font-size: 0.8125rem;
}

.selected-package-summary strong {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.package-price-summary {
  display: grid;
  gap: 0.425rem;
  margin-top: 0.35rem;
}

.package-price-summary div,
.package-price-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}

.package-price-summary div {
  justify-content: space-between;
  min-width: 0;
}

.package-price-summary span,
.package-price-summary small,
.package-price-inline small {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.package-price-summary strong {
  font-size: 1.12rem;
  font-weight: 950;
}

.package-price-summary del,
.package-price-inline del {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 800;
}

.package-price-summary em,
.package-price-inline em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  padding-inline: 0.5rem;
  border: 1px solid color-mix(in srgb, var(--danger) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 9%, var(--surface));
  color: var(--danger);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 900;
}

.package-price-inline {
  margin-top: 0.35rem;
  line-height: 1.25;
}

.package-price-inline strong {
  color: var(--text);
  font-weight: 950;
}

.package-price-inline.has-discount {
  gap: 0.4rem 0.5rem;
}

.checkout-summary-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
}

.modal-price-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.modal-price-row > span,
.quantity-row > span,
.modal-total > span {
  color: var(--muted);
  font-weight: 800;
}

.modal-price-row .price-block {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
  text-align: right;
}

.modal-price-row .price-block .price {
  font-size: 1.35rem;
}

.product-detail-box p,
.product-warning-text {
  margin: 0.5rem 0 0;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.product-warning-text {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

.quantity-row,
.modal-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.quantity-stepper {
  display: grid;
  grid-template-columns: 2.5rem minmax(4.5rem, 6rem) 2.5rem;
  gap: 0.5rem;
  align-items: center;
}

.qty-input,
.field input:not([type="checkbox"]),
.field textarea,
.field select,
.history-controls select,
.category-admin-row input {
  width: 100%;
  min-height: 2.625rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 76%, var(--bg));
  color: var(--text);
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.qty-input:focus,
.field input:not([type="checkbox"]):focus,
.field textarea:focus,
.field select:focus,
.history-controls select:focus,
.category-admin-row input:focus {
  border-color: color-mix(in srgb, var(--brand) 56%, var(--line));
  box-shadow: 0 0 0 0.25rem color-mix(in srgb, var(--brand) 14%, transparent);
}

.qty-input {
  text-align: center;
  font-weight: 800;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.field {
  display: grid;
  gap: 0.375rem;
}

.check-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.625rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 76%, var(--bg));
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.check-grid.full {
  grid-column: 1 / -1;
}

.check-field span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.check-field input[type="checkbox"] {
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.field.full {
  grid-column: 1 / -1;
}

.admin-note {
  padding: 0.75rem 0.875rem;
  border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--brand-soft) 72%, var(--surface));
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.field label,
.field span,
.history-controls label {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.field textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.turnstile-field {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.webhook-field small,
.category-admin p {
  color: var(--muted);
  line-height: 1.6;
}

.webhook-field .secondary-button {
  justify-self: start;
}

.admin-overview {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.admin-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-section-head h3,
.admin-section-head p {
  margin: 0;
}

.admin-section-head p {
  color: var(--muted);
  font-size: 0.875rem;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-metric,
.admin-panel-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.admin-metric {
  display: grid;
  gap: 0.25rem;
  padding: 0.875rem;
}

.admin-metric strong {
  font-size: 1.25rem;
  line-height: 1.15;
}

.admin-metric span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.admin-panel-block {
  overflow: hidden;
}

.admin-panel-block summary {
  padding: 0.875rem;
  cursor: pointer;
  font-weight: 900;
}

.admin-panel-block .form-grid {
  padding: 0 0.875rem 0.875rem;
}

.admin-table-wrap {
  overflow-x: auto;
  padding: 0 0.875rem 0.875rem;
}

.admin-table-wrap.compact {
  padding: 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table th,
.admin-table td {
  padding: 0.625rem;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.admin-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.admin-source-list {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.admin-source-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface-2) 72%, var(--surface));
  padding: 0.875rem;
}

.admin-source-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-source-head h4,
.admin-source-head p {
  margin: 0;
}

.admin-source-head p {
  color: var(--muted);
  font-size: 0.875rem;
}

.admin-source-head > span,
.admin-source-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-strong);
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.admin-source-head > span {
  min-height: 2rem;
  padding: 0 0.75rem;
}

.admin-source-pill {
  min-height: 1.375rem;
  padding: 0 0.5rem;
  margin-right: 0.35rem;
}

.saved-key-badge,
.missing-key-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.5rem;
  margin-left: 0.5rem;
  padding: 0 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.saved-key-badge {
  border: 1px solid color-mix(in srgb, var(--brand) 34%, transparent);
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
  color: var(--brand-strong);
}

.missing-key-badge {
  border: 1px solid color-mix(in srgb, #b91c1c 24%, transparent);
  background: color-mix(in srgb, #ef4444 10%, var(--surface));
  color: #b91c1c;
}

.group-admin,
.group-admin-list,
.group-product-picker,
.variant-picker,
.variant-grid {
  display: grid;
  gap: 0.75rem;
}

.group-admin {
  margin-top: 1rem;
}

.group-admin p {
  margin: 0;
  color: var(--muted);
}

.group-admin-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.group-admin-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.875rem;
  font-weight: 800;
}

.group-admin-card .form-grid {
  padding: 0 0.875rem 0.875rem;
}

.admin-add-button {
  width: fit-content;
  margin-top: 0.75rem;
}

.row-delete-button {
  align-self: center;
  justify-self: end;
}

.group-product-picker {
  max-height: 18rem;
  overflow: auto;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.check-field.compact {
  min-height: 2.75rem;
}

.variant-picker {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 68%, var(--surface));
}

.variant-picker > strong {
  display: none;
}

.variant-picker-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.25rem;
}

.variant-picker-head p,
.variant-picker-head span {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.variant-grid {
  grid-template-columns: 1fr;
}

.product-modal .variant-grid {
  max-height: min(18rem, 42vh);
  overflow: auto;
  padding: 0.125rem 0.35rem 0.125rem 0.125rem;
}

.variant-option {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.variant-option.active {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--line));
  background: color-mix(in srgb, var(--brand-soft) 42%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent), var(--shadow-sm);
}

.variant-option:not(:disabled):hover {
  transform: translateY(-0.0625rem);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--line));
}

.variant-option > span {
  display: inline-flex;
  width: fit-content;
  min-height: 1.5rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 7%, transparent);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 900;
}

.variant-option strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.variant-option small {
  color: var(--muted);
}

.variant-option:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

@media (min-width: 48rem) {
  .variant-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.admin-user-list {
  display: grid;
  gap: 0.75rem;
  padding: 0 0.875rem 0.875rem;
}

.admin-user-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-user-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem;
}

.admin-user-head h4,
.admin-user-head p,
.admin-user-history-head {
  margin: 0;
}

.admin-user-head p {
  color: var(--muted);
  font-size: 0.875rem;
}

.admin-user-body {
  display: grid;
  gap: 0.875rem;
  padding: 0.875rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 70%, var(--surface));
}

.admin-user-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.admin-user-actions,
.admin-user-history-stack,
.admin-user-history-head {
  grid-column: 1 / -1;
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.admin-user-delete-button {
  margin-left: auto;
}

.admin-user-history-stack {
  display: grid;
  gap: 0.75rem;
}

.admin-user-history-panel {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-user-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
}

.admin-product {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.admin-product summary {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  cursor: pointer;
}

.admin-product img {
  width: 4.5rem;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  object-fit: cover;
}

.admin-product .fieldset {
  padding: 0 0.75rem 0.75rem;
}

.admin-product .field:has(input[name="category"]) {
  display: none;
}

.category-admin {
  margin-block: 0.75rem 1rem;
}

.help-link-admin {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.help-link-admin-list {
  display: grid;
  gap: 0.75rem;
}

.help-link-admin-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 0.8fr) minmax(10rem, 1fr) minmax(13rem, 1.45fr) minmax(8.5rem, auto);
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.125rem);
  background: var(--surface);
}

.help-link-admin-row > * {
  min-width: 0;
}

.help-link-admin-row input[name^="helpLinkUrl"] {
  grid-column: 1 / 4;
}

.help-link-admin-row .row-delete-button {
  grid-column: 4;
  width: 100%;
  justify-self: stretch;
}

.help-link-visible {
  grid-column: 4;
  grid-row: 1;
  min-height: 3rem;
  justify-content: space-between;
  padding-inline: 0.875rem;
}

.category-admin h3,
.category-admin p {
  margin: 0;
}

.category-admin-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.category-admin-row {
  display: grid;
  grid-template-columns: minmax(7rem, 0.8fr) minmax(9rem, 1fr) minmax(10rem, 1.45fr) auto;
  align-items: center;
  gap: 0.5rem;
}

.role-admin-row {
  grid-template-columns: minmax(7rem, 0.85fr) minmax(9rem, 1fr) minmax(11rem, 1.35fr) minmax(5.5rem, 0.52fr) 2.75rem;
}

.role-admin-row .check-field.compact {
  justify-content: center;
  gap: 0.625rem;
  min-height: 2.625rem;
  padding: 0.5rem 0.625rem;
}

.role-admin-row .row-delete-button {
  width: 2.625rem;
  height: 2.625rem;
  justify-self: end;
}

.role-price-fields {
  display: grid;
  gap: 0.75rem;
  padding: 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.role-price-fields > strong {
  font-size: 0.9rem;
  font-weight: 900;
}

.profile-summary,
.history-list {
  display: grid;
  gap: 0.75rem;
}

.profile-modal-body {
  display: grid;
  gap: 1.125rem;
}

.profile-summary {
  gap: 0.625rem;
}

.profile-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
  padding: 0.875rem 1rem;
}

.profile-summary span {
  color: var(--muted);
}

.profile-summary + h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

.profile-modal .form-grid {
  gap: 0.875rem;
}

.history-modal-body {
  display: grid;
  gap: 1rem;
}

.history-controls,
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0;
}

.history-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.history-icon,
.history-method-icon {
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 900;
}

.history-method-icon {
  width: 3.5rem;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.25rem);
  background: var(--surface);
}

.history-method-icon svg {
  display: block;
  width: 72%;
  height: 72%;
}

.history-row small {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.history-row .tag {
  justify-self: end;
}

.compact-button {
  min-height: 2.25rem;
  padding-inline: 0.75rem;
  font-size: 0.875rem;
}

.order-info-body {
  display: grid;
  gap: 1rem;
}

.order-info-head {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 0.875rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.order-info-head img {
  width: 4rem;
  aspect-ratio: 1;
  border-radius: calc(var(--radius) - 0.25rem);
  object-fit: contain;
  background: var(--surface);
}

.order-info-head h3,
.order-info-head p {
  margin: 0;
}

.order-info-head p {
  color: var(--muted);
  font-size: 0.875rem;
}

.order-info-grid {
  display: grid;
  gap: 0.75rem;
}

.order-info-item {
  display: grid;
  gap: 0.4rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.order-info-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.order-info-item span {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.order-info-item code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
}

.auth-switch {
  margin: 1rem 0 0;
  color: var(--muted);
}

.toast {
  --toast-accent: var(--brand);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  width: min(26rem, calc(100% - 2rem));
  min-height: 3.5rem;
  padding: 0.875rem 1rem 1rem;
  border: 1px solid color-mix(in srgb, var(--toast-accent) 24%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--toast-accent) 7%, transparent), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 750;
  line-height: 1.45;
  overflow: hidden;
  transform-origin: 100% 100%;
  animation: toast-enter 260ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.toast::before {
  content: "";
  flex: 0 0 auto;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 999px;
  background: var(--toast-accent);
  box-shadow: 0 0 0 0.375rem color-mix(in srgb, var(--toast-accent) 14%, transparent);
}

.toast::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.1875rem;
  background: linear-gradient(90deg, var(--toast-accent), color-mix(in srgb, var(--toast-accent) 45%, var(--surface)));
  transform-origin: left;
  animation: toast-progress 3200ms linear both;
}

.toast-success {
  --toast-accent: #12805c;
}

.toast-error {
  --toast-accent: #d64545;
}

.toast-warning {
  --toast-accent: #c77700;
}

.toast-info {
  --toast-accent: #2f6fd6;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translate3d(0.75rem, 0.75rem, 0) scale(0.98);
    filter: blur(0.25rem);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0);
  }
}

@keyframes toast-progress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (min-width: 40rem) {
  .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(17rem, 0.88fr);
  }

  .status-panel {
    align-content: center;
    padding: 1.25rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topup-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .help-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: auto minmax(0, 1fr) minmax(14rem, 0.7fr);
    align-items: start;
    gap: 2rem;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-checkout-layout {
    grid-template-columns: minmax(15rem, 0.82fr) minmax(0, 1.18fr);
    align-items: start;
  }

  .product-modal-image {
    max-height: 18rem;
  }

  .product-preview-panel {
    position: sticky;
    top: 1rem;
  }

  .checkout-summary-panel {
    gap: 0.875rem;
  }

  .variant-grid {
    grid-template-columns: 1fr;
  }

  .category-admin-row {
    grid-template-columns: minmax(7rem, 0.75fr) minmax(9rem, 1fr) minmax(10rem, 1.4fr) auto;
  }

  .role-admin-row {
    grid-template-columns: minmax(7rem, 0.85fr) minmax(9rem, 1fr) minmax(11rem, 1.3fr) minmax(5.5rem, 0.5fr) 2.75rem;
  }

  .check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .history-row {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  }

  .history-row .tag {
    grid-column: auto;
  }
}

@media (max-width: 40rem) {
  .admin-user-form {
    grid-template-columns: 1fr;
  }

  .admin-user-delete-button {
    width: 100%;
    margin-left: 0;
  }

  .category-admin-row {
    grid-template-columns: 1fr;
  }

  .role-admin-row {
    grid-template-columns: 1fr 1fr;
  }

  .role-admin-row input[name^="roleMinTopup"] {
    grid-column: 1 / -1;
  }

  .role-admin-row .check-field.compact {
    justify-content: space-between;
  }

  .role-admin-row .row-delete-button {
    justify-self: end;
  }

  .help-link-admin-row {
    grid-template-columns: 1fr;
  }

  .help-link-admin-row input[name^="helpLinkUrl"] {
    grid-column: auto;
  }

  .help-link-admin-row .row-delete-button,
  .help-link-visible {
    grid-column: auto;
    grid-row: auto;
  }

  .history-row {
    grid-template-columns: 3.25rem minmax(0, 1fr);
  }

  .history-actions,
  .history-row .tag {
    grid-column: 1 / -1;
    justify-content: stretch;
    justify-self: stretch;
  }

  .history-actions .secondary-button {
    flex: 1 1 auto;
  }

  .row-delete-button {
    justify-self: start;
  }
}

@media (max-width: 34rem) {
  .topbar-inner {
    gap: 0.75rem;
  }

  .toolbar {
    justify-content: stretch;
  }

  .toolbar > .secondary-button,
  .toolbar > .account-button {
    flex: 1 1 auto;
  }

  h1 {
    max-width: 12ch;
  }

  .product-modal .modal-footer {
    grid-template-columns: 1fr;
  }

  .product-modal .modal-footer > .secondary-button {
    order: 2;
    width: 100%;
  }

  .modal-footer-actions {
    order: 1;
    justify-content: stretch;
  }

  .modal-footer-actions .primary-button {
    width: 100%;
  }

  .product-modal .modal-footer .primary-button {
    grid-column: auto;
  }

  .modal-footer-quantity {
    justify-content: space-between;
  }

  .modal-footer-quantity .quantity-stepper {
    flex: 1 1 auto;
  }

  .modal-footer-total {
    justify-items: start;
  }

  .quantity-row,
  .modal-price-row,
  .modal-total {
    align-items: stretch;
    flex-direction: column;
  }

  .quantity-stepper {
    grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
  }

  .topup-payment-header,
  .topup-payment-body,
  .topup-payment-footer {
    padding-inline: 1rem;
  }

  .topup-payment-title {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .topup-method-summary {
    display: grid;
  }

  .topup-payment-footer,
  .topup-help-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 64rem) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
