/* Panel Portal — obsidian & champagne gold. No external fonts or CDNs. */

:root,
[data-skin="obsidian"] {
  --bg: #07080a;
  --bg-2: #0c0d10;
  --surface: rgba(255, 255, 255, 0.028);
  --surface-solid: #111216;
  --surface-2: rgba(255, 255, 255, 0.045);
  --surface-3: rgba(255, 255, 255, 0.07);
  --field: rgba(0, 0, 0, 0.38);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --hairline: rgba(255, 255, 255, 0.05);
  --text: #f3efe7;
  --text-2: #bdb7ab;
  --muted: #7d786f;

  --accent: #d8b26e;
  --accent-strong: #ecd096;
  --accent-ink: #1b1407;
  --accent-soft: rgba(216, 178, 110, 0.1);
  --accent-text: #e2c084;
  --accent-glow: rgba(216, 178, 110, 0.3);
  --accent-grad: linear-gradient(135deg, #f7e6bd 0%, #e2c084 38%, #b98b45 100%);
  --accent-line: linear-gradient(90deg, transparent, rgba(226, 192, 132, 0.65), transparent);

  --ok: #5cd6a8;
  --ok-soft: rgba(92, 214, 168, 0.1);
  --err: #ff7a7a;
  --err-soft: rgba(255, 122, 122, 0.09);
  --warn: #f2c063;
  --warn-soft: rgba(242, 192, 99, 0.1);

  --orb-a: rgba(216, 178, 110, 0.16);
  --orb-b: rgba(96, 118, 170, 0.12);

  --radius: 18px;
  --radius-md: 14px;
  --radius-sm: 11px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-pop: 0 30px 60px -15px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.06);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --display-w: 500;
  --bw: 1px;
  --text-grad: var(--accent-grad);
  --grid-op: 0.6;
  --btn-border: 0;
  --btn-shadow: 0 1px 0 rgba(255, 255, 255, 0.45) inset, 0 -1px 0 rgba(0, 0, 0, 0.15) inset, 0 12px 28px -12px var(--accent-glow);
  --btn-tt: none;
  --btn-ls: 0.01em;
  --feature-bg: linear-gradient(160deg, #17140e, #0b0a08 60%) padding-box, var(--accent-grad) border-box;
  --feature-fg: #f6efe2;
  --feature-muted: rgba(243, 236, 222, 0.55);
  --feature-value: linear-gradient(135deg, #fbefd2 0%, #e2c084 45%, #c39552 100%);
  --feature-ring: rgba(226, 192, 132, 0.18);
  --feature-shadow: 0 24px 50px -24px var(--accent-glow), 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  --feature-border: transparent;
  --vc-bg: radial-gradient(120% 90% at 0% 0%, rgba(226, 192, 132, 0.28), transparent 55%), radial-gradient(90% 80% at 100% 100%, rgba(120, 140, 190, 0.2), transparent 60%), linear-gradient(145deg, #1c1912, #0c0b09 70%);
  --vc-fg: #fbf3e2;
  --vc-muted: rgba(243, 236, 220, 0.55);
  --vc-border: rgba(226, 192, 132, 0.28);
  --vc-shadow: 0 40px 70px -30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04) inset, 0 1px 0 rgba(255, 255, 255, 0.12) inset;
  --topbar-h: 64px;
  --tabbar-h: 68px;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* ---------- ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}
.orb-a {
  width: 620px;
  height: 620px;
  top: -260px;
  left: -160px;
  background: radial-gradient(circle, var(--orb-a), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
.orb-b {
  width: 560px;
  height: 560px;
  bottom: -240px;
  right: -180px;
  background: radial-gradient(circle, var(--orb-b), transparent 70%);
  animation: drift 32s ease-in-out infinite alternate-reverse;
}
.gridlines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--hairline) 1px, transparent 1px), linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: var(--grid-op);
}
@keyframes drift {
  to {
    transform: translate(80px, 60px) scale(1.08);
  }
}

a {
  color: var(--accent-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  font-weight: 600;
}
h1 {
  font-family: var(--display);
  font-size: 30px;
  font-weight: var(--display-w);
  letter-spacing: -0.015em;
}
h2 {
  font-size: 15px;
  letter-spacing: -0.005em;
}
h3 {
  font-size: 14px;
}
p {
  margin: 0;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.nowrap {
  white-space: nowrap;
}
.right {
  text-align: right;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- brand ---------- */

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: -0.04em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 8px 22px -6px var(--accent-glow);
  flex: none;
}
.brand-tag {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: 999px;
  padding: 2px 8px;
}

/* ---------- top bar (floating glass) ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 12px 0;
}
.topbar-inner {
  position: relative;
  max-width: 1200px;
  height: var(--topbar-h);
  margin: 0 auto;
  padding: 0 12px 0 16px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: var(--bw) solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.topbar-inner::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: -1px;
  height: 1px;
  background: var(--accent-line);
}

.mainnav {
  display: none;
  gap: 2px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface-2);
  border: var(--bw) solid var(--hairline);
}
.mainnav a {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 10px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.mainnav a .icon {
  width: 16px;
  height: 16px;
}
.mainnav a:hover {
  color: var(--text);
  text-decoration: none;
}
.mainnav a.on {
  color: var(--text);
  background: var(--surface-3);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 6px 14px -8px rgba(0, 0, 0, 0.6);
}
.mainnav a.on .icon {
  color: var(--accent-text);
}

.top-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (min-width: 980px) {
  .mainnav + .top-right {
    margin-left: 0;
  }
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.balance-chip:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.balance-chip .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-grad);
  box-shadow: 0 0 14px -2px var(--accent-glow);
  position: relative;
}
.balance-chip .dot::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1.6px solid var(--accent-ink);
  opacity: 0.7;
}
.balance-chip .balance-label {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: var(--bw) solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn:hover {
  color: var(--accent-text);
  border-color: var(--border-strong);
}

.user-menu {
  position: relative;
}
.user-menu summary {
  list-style: none;
  cursor: pointer;
}
.user-menu summary::-webkit-details-marker {
  display: none;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--accent-text);
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  text-transform: uppercase;
  border: var(--bw) solid var(--border-strong);
}
.user-menu[open] .avatar {
  border-color: var(--accent);
}
.menu-pop {
  position: absolute;
  right: 0;
  top: 50px;
  min-width: 236px;
  background: var(--surface-solid);
  border-radius: 16px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 30;
  animation: pop 0.14s ease-out;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}
.menu-pop .who {
  padding: 10px 12px 12px;
  border-bottom: var(--bw) solid var(--border);
  margin-bottom: 6px;
}
.menu-pop a,
.menu-pop button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.menu-pop a:hover,
.menu-pop button:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.menu-pop .danger {
  color: var(--err);
}

/* admin: chip nav strip on small screens */
.subnav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 1200px;
  margin: 10px auto 0;
  padding: 0 12px;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar {
  display: none;
}
.subnav a {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  border: var(--bw) solid var(--border);
  background: var(--surface);
}
.subnav a.on {
  color: var(--accent-ink);
  border-color: transparent;
  background: var(--accent-grad);
}
.subnav a:hover {
  text-decoration: none;
}
.subnav .icon {
  width: 15px;
  height: 15px;
}

/* ---------- bottom tab bar (floating, mobile) ---------- */

.tabbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: var(--bw) solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  height: 100%;
}
.tabbar a:hover {
  text-decoration: none;
}
.tabbar a.on {
  color: var(--text);
}
.tabbar a.on .icon {
  color: var(--accent-text);
}
.tabbar .icon {
  width: 21px;
  height: 21px;
}
.tabbar .tab-cta {
  color: var(--text-2);
}
.tabbar .tab-cta .tab-cta-inner {
  width: 50px;
  height: 50px;
  margin-top: -30px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: 0 0 0 5px var(--bg), 0 12px 26px -6px var(--accent-glow);
}
.tabbar .tab-cta .icon,
.tabbar .tab-cta.on .icon {
  color: var(--accent-ink);
  width: 22px;
  height: 22px;
}

/* ---------- page ---------- */

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 26px 16px 56px;
}
.admin .page {
  padding-bottom: 56px;
}
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head .sub {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}
.page-head h1.row {
  gap: 12px;
}
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumb:hover {
  color: var(--accent-text);
  text-decoration: none;
}

.grid {
  display: grid;
  gap: 14px;
}
.grid-2,
.grid-3,
.grid-4 {
  grid-template-columns: 1fr;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.gap-top {
  margin-top: 18px;
}

/* ---------- cards ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 40%);
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card-pad {
  padding: 20px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: var(--bw) solid var(--border);
}
.card-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.card-head h2 > .icon {
  width: 30px;
  height: 30px;
  padding: 7px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.card-head a.small {
  font-weight: 500;
}
.card-body {
  padding: 20px;
}

.stat {
  padding: 18px 20px 20px;
  overflow: hidden;
}
.stat .label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.stat .label .icon {
  width: 15px;
  height: 15px;
  color: var(--accent-text);
}
.stat .value {
  margin-top: 12px;
  font-family: var(--display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums lining-nums;
}
.stat .hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
/* Feature card: black metal with a gold edge and moving sheen */
.stat.feature {
  border: var(--bw) solid var(--feature-border);
  background: var(--feature-bg);
  box-shadow: var(--feature-shadow);
  color: var(--feature-fg);
}
.stat.feature .value {
  background: var(--feature-value);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat.feature .label .icon {
  color: var(--feature-fg);
  opacity: 0.85;
}
.stat.feature .label,
.stat.feature .hint {
  color: var(--feature-muted);
}
.stat.feature::before {
  content: "";
  position: absolute;
  top: -60%;
  left: -60%;
  width: 60%;
  height: 220%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.07), transparent);
  transform: rotate(18deg);
  animation: sheen 7s ease-in-out infinite;
  pointer-events: none;
}
.stat.feature::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid var(--feature-ring);
  box-shadow: 0 0 0 18px color-mix(in srgb, var(--feature-ring) 25%, transparent), 0 0 0 38px color-mix(in srgb, var(--feature-ring) 14%, transparent);
  pointer-events: none;
}
@keyframes sheen {
  0%,
  60% {
    left: -60%;
  }
  100% {
    left: 130%;
  }
}

/* ---------- forms ---------- */

label.field {
  display: block;
}
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--field);
  border: var(--bw) solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select {
  height: 48px;
}
textarea {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  min-height: 200px;
}
input:hover,
select:hover,
textarea:hover {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border-strong));
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 24px -8px var(--accent-glow);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent-text) 50%), linear-gradient(135deg, var(--accent-text) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
select option {
  background: var(--surface-solid);
  color: var(--text);
}

.input-icon {
  position: relative;
  display: block;
}
.input-icon > .icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  width: 17px;
  height: 17px;
  transition: color 0.15s;
}
.input-icon > input {
  padding-left: 44px;
}
.input-icon:focus-within > .icon {
  color: var(--accent-text);
}
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input {
  padding-right: 48px;
}
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.pw-toggle:hover {
  color: var(--accent-text);
  background: var(--surface-2);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.check input,
.cb {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}
.form-grid {
  display: grid;
  gap: 16px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
  border: var(--bw) solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.06s, box-shadow 0.2s, filter 0.15s;
}
.btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong));
  text-decoration: none;
}
.btn:active {
  transform: translateY(1px);
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.btn-primary {
  border: var(--btn-border);
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: var(--btn-shadow);
  letter-spacing: var(--btn-ls);
  text-transform: var(--btn-tt);
}
.btn-primary:hover:not([disabled]) {
  filter: brightness(1.07);
}
.btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--err) 40%, transparent);
  color: var(--err);
}
.btn-danger:hover {
  background: var(--err-soft);
  border-color: var(--err);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--text);
}
.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  border-radius: 10px;
}
.btn-lg {
  height: 52px;
  font-size: 15px;
  border-radius: 14px;
}
.btn-block {
  width: 100%;
}
.btn .icon {
  width: 16px;
  height: 16px;
}

/* ---------- alerts ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
  border: 1px solid;
  backdrop-filter: blur(10px);
}
.alert .icon {
  margin-top: 1px;
}
.alert-ok {
  background: var(--ok-soft);
  border-color: color-mix(in srgb, var(--ok) 30%, transparent);
  color: var(--ok);
}
.alert-err {
  background: var(--err-soft);
  border-color: color-mix(in srgb, var(--err) 30%, transparent);
  color: var(--err);
}
.alert-warn {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  color: var(--warn);
}

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
  border: var(--bw) solid var(--hairline);
}
a.badge:hover {
  text-decoration: none;
  filter: brightness(1.15);
}
.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 22%, transparent);
}
.badge-err {
  background: var(--err-soft);
  color: var(--err);
  border-color: color-mix(in srgb, var(--err) 22%, transparent);
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 22%, transparent);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ---------- tables / lists ---------- */

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 12px 20px;
  border-bottom: var(--bw) solid var(--border);
  white-space: nowrap;
}
td {
  padding: 14px 20px;
  border-bottom: var(--bw) solid var(--hairline);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 0.12s;
}
tbody tr:hover td {
  background: var(--surface-2);
}
td.amount {
  font-family: var(--mono);
  font-weight: 600;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.pos {
  color: var(--ok);
}
.neg {
  color: var(--text-2);
}

.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: var(--bw) solid var(--hairline);
  color: var(--text);
  transition: background 0.12s;
}
.list-item:last-child {
  border-bottom: 0;
}
a.list-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}
a.list-item > .icon:last-child {
  color: var(--muted);
}
.list-item .grow {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.list-item .title {
  font-weight: 600;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-item .meta {
  font-size: 12px;
  color: var(--muted);
}
.list-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent-text);
  flex: none;
}
.list-btn {
  width: 100%;
  background: none;
  border: 0;
  border-bottom: var(--bw) solid var(--hairline);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.list-btn:hover {
  background: var(--surface-2);
}
form:last-child > .list-btn {
  border-bottom: 0;
}
.danger-text,
.danger-text .list-icon {
  color: var(--err);
}
.danger-text .list-icon {
  background: var(--err-soft);
  border-color: color-mix(in srgb, var(--err) 20%, transparent);
}

.empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty > .icon {
  width: 46px;
  height: 46px;
  padding: 12px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent-text);
  margin-bottom: 12px;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: var(--bw) solid var(--border);
  font-size: 13px;
  color: var(--muted);
}

/* ---------- buy page ---------- */

.chips {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 14px;
  background: var(--surface);
  border: var(--bw) solid var(--border);
}
.chip {
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover {
  color: var(--text);
}
.chip.on {
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px -10px var(--accent-glow);
}
.product-group + .product-group {
  margin-top: 26px;
}
.product-group > h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 14px;
}
.product-group > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.js .product-group[hidden] {
  display: none;
}
fieldset.bare {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
html:not(.js) .hide-nojs {
  display: none;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}
.plan {
  position: relative;
  display: block;
  cursor: pointer;
}
.plan input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.plan-box {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 16px 16px;
  height: 100%;
  border: var(--bw) solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.2s;
  overflow: hidden;
}
.plan-box::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  transition: all 0.15s;
}
.plan:hover .plan-box {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  transform: translateY(-2px);
}
.plan input:checked + .plan-box {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, var(--bg-2)), var(--bg-2)) padding-box,
    var(--accent-grad) border-box;
  box-shadow: 0 18px 40px -20px var(--accent-glow);
}
.plan input:checked + .plan-box::after {
  border-color: transparent;
  background: var(--accent-grad);
  box-shadow: inset 0 0 0 5px color-mix(in srgb, var(--accent-ink) 85%, transparent);
}
.plan input:focus-visible + .plan-box {
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.plan input:disabled + .plan-box {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
.plan-name {
  font-weight: 600;
  font-size: 15px;
  padding-right: 26px;
}
.plan-price {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 500;
  margin-top: 10px;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}
.plan input:checked + .plan-box .plan-price {
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.plan-stock {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.plan-stock .pip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.plan-stock.low .pip {
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}
.plan-stock.out .pip {
  background: var(--err);
  box-shadow: none;
}

.stepper {
  display: flex;
  align-items: stretch;
  height: 52px;
  border: var(--bw) solid var(--border-strong);
  border-radius: 14px;
  overflow: hidden;
  background: var(--field);
  width: 100%;
}
.stepper button {
  width: 52px;
  border: 0;
  background: var(--surface-2);
  color: var(--accent-text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.stepper button:hover {
  background: var(--surface-3);
}
.stepper input {
  height: 100%;
  border: 0;
  border-radius: 0;
  text-align: center;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  background: transparent;
  box-shadow: none !important;
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  padding: 7px 0;
  color: var(--text-2);
}
.summary-row strong {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
  text-align: right;
}
.summary-row.total {
  border-top: 1px dashed var(--border-strong);
  margin-top: 8px;
  padding-top: 14px;
  align-items: baseline;
  color: var(--text);
}
.summary-row.total strong {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 500;
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.summary-row .short {
  color: var(--err);
}
#sum-plan {
  font-family: var(--font);
}

/* ---------- key output ---------- */

.keys {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 6px;
}
.key-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 14px;
  border-radius: 12px;
  background: var(--field);
  border: var(--bw) solid var(--hairline);
}
.key-row .n {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-text);
  width: 22px;
  flex: none;
  opacity: 0.8;
}
.key-row code {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  word-break: break-all;
  user-select: all;
}
.copy-btn.done {
  color: var(--ok);
  border-color: var(--ok);
}

/* ---------- news ---------- */

.news-item {
  position: relative;
  padding: 18px 20px 18px 36px;
  border-bottom: var(--bw) solid var(--hairline);
}
.news-item::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 25px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}
.news-item:last-child {
  border-bottom: 0;
}
.news-item .when {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
}
.news-item h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 500;
  margin: 4px 0 6px;
}
.news-item .body {
  font-size: 14px;
  color: var(--text-2);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- auth ---------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
.auth-hero {
  display: none;
}
.auth-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 28px 16px;
  gap: 18px;
}
@property --ring-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 30px 26px 24px;
  border-radius: 26px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, var(--surface-solid), var(--bg-2)) padding-box,
    conic-gradient(from var(--ring-angle), rgba(255, 255, 255, 0.06) 0deg, var(--accent) 50deg, rgba(255, 255, 255, 0.06) 120deg, rgba(255, 255, 255, 0.06) 220deg, color-mix(in srgb, var(--accent) 55%, transparent) 280deg, rgba(255, 255, 255, 0.06) 340deg) border-box;
  box-shadow: var(--shadow-pop), 0 0 90px -30px var(--accent-glow);
  animation: ring 9s linear infinite;
}
@keyframes ring {
  to {
    --ring-angle: 360deg;
  }
}
.brand-mobile {
  justify-content: center;
  margin-bottom: 26px;
}
.auth-card-head {
  text-align: center;
  margin-bottom: 24px;
}
.seal {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent-text);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 5%, transparent), 0 14px 30px -14px var(--accent-glow);
}
.seal .icon {
  width: 24px;
  height: 24px;
}
.auth-card h1 {
  font-size: 30px;
}
.auth-card .lead {
  color: var(--muted);
  margin-top: 6px;
  font-size: 14px;
}
.auth-foot {
  margin-top: 22px;
  padding-top: 18px;
  border-top: var(--bw) solid var(--hairline);
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.auth-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.auth-foot .icon {
  width: 13px;
  height: 13px;
  color: var(--accent-text);
}
.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}
.auth-copy {
  font-size: 12px;
  color: var(--muted);
}

.brand-lg {
  font-size: 22px;
}
.brand-lg .brand-mark {
  width: 42px;
  height: 42px;
  font-size: 17px;
  border-radius: 13px;
}
.hero-copy {
  max-width: 540px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 var(--ok);
  animation: live 2.2s infinite;
}
@keyframes live {
  70% {
    box-shadow: 0 0 0 8px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
.hero-title {
  margin-top: 22px;
  font-family: var(--display);
  font-size: clamp(40px, 4.4vw, 62px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.03em;
}
.hero-title em {
  font-style: italic;
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.02em;
}
.hero-sub {
  margin-top: 18px;
  font-size: 16px;
  color: var(--text-2);
  max-width: 440px;
}
.hero-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  color: var(--text-2);
  font-size: 13.5px;
}
.hero-points li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-points .icon {
  color: var(--accent-text);
  width: 16px;
  height: 16px;
}

/* the metal "license pass" card */
.vault-card {
  position: relative;
  width: 380px;
  max-width: 100%;
  aspect-ratio: 1.62;
  padding: 24px 26px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--vc-fg);
  background: var(--vc-bg);
  border: var(--bw) solid var(--vc-border);
  box-shadow: var(--vc-shadow);
  transform: perspective(1100px) rotateY(-14deg) rotateX(7deg);
  overflow: hidden;
}
.vault-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.09) 45%, transparent 60%);
  animation: sheen-card 6s ease-in-out infinite;
}
@keyframes sheen-card {
  0%,
  50% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}
.vc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.vc-chip {
  width: 44px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 32%, rgba(0, 0, 0, 0.25) 33%, transparent 34%, transparent 65%, rgba(0, 0, 0, 0.25) 66%, transparent 67%),
    linear-gradient(0deg, transparent 47%, rgba(0, 0, 0, 0.25) 48%, transparent 52%),
    linear-gradient(135deg, #f7e6bd, #c69b55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3) inset;
}
.vc-label {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--vc-muted);
}
.vc-number {
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: 0.08em;
  color: var(--vc-fg);
}
.vc-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.vc-cap {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vc-muted);
}
.vc-val {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  margin-top: 2px;
}
.vc-ok {
  color: #7fe0bb;
}

/* ---------- error page ---------- */

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
}
.error-page .code {
  font-family: var(--display);
  font-size: 96px;
  font-weight: 400;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.04em;
  background: var(--text-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

/* ---------- misc ---------- */

details.inline-edit {
  position: relative;
}
details.inline-edit > summary {
  cursor: pointer;
  list-style: none;
}
details.inline-edit > summary::-webkit-details-marker {
  display: none;
}
.edit-panel {
  margin-top: 10px;
  padding: 16px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-2);
}
.edit-panel.pop-right {
  position: absolute;
  right: 0;
  top: 38px;
  z-index: 15;
  width: 280px;
  max-width: calc(100vw - 48px);
  background: var(--surface-solid);
  border-color: transparent;
  box-shadow: var(--shadow-pop);
  text-align: left;
  animation: pop 0.14s ease-out;
}
.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}
.kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 16px;
  font-size: 14px;
  margin: 0;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  text-align: right;
  font-weight: 500;
}
.danger-zone {
  border-color: color-mix(in srgb, var(--err) 28%, var(--border));
}
.danger-zone .card-head h2 > .icon {
  background: var(--err-soft);
  color: var(--err);
}
.search-form {
  flex-wrap: nowrap;
}
.search-form input {
  min-width: 0;
  width: 240px;
}
.info-card h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.info-card h2 .icon {
  color: var(--accent-text);
}
.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: var(--bw) solid var(--border);
  border-radius: 13px;
  background: var(--field);
}
.seg label {
  position: relative;
  cursor: pointer;
}
.seg input {
  position: absolute;
  opacity: 0;
}
.seg span {
  display: block;
  text-align: center;
  padding: 9px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.15s;
}
.seg input:checked + span {
  background: var(--accent-grad);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px -10px var(--accent-glow);
}
.seg input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.file-btn {
  position: relative;
  cursor: pointer;
}
.break {
  word-break: break-all;
}
.narrow {
  max-width: 540px;
}
textarea.plain-text {
  font-family: var(--font);
  font-size: 15px;
  min-height: 150px;
}

/* ---------- responsive ---------- */

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 980px) {
  .mainnav {
    display: flex;
  }
  .tabbar {
    display: none;
  }
  .page {
    padding: 34px 16px 64px;
  }
  .subnav {
    display: none;
  }
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
  }
  .split > .sticky {
    position: sticky;
    top: calc(var(--topbar-h) + 32px);
  }
  .split-wide {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  h1 {
    font-size: 36px;
  }

  .auth-card {
    padding: 38px 36px 28px;
  }
}

@media (max-width: 979px) {
  .split > * + *,
  .split-wide > * + * {
    margin-top: 16px;
  }
  .hide-sm {
    display: none !important;
  }
  .top-right .balance-label {
    display: none;
  }
  .search-form,
  .search-form input {
    width: 100%;
  }
}
@media (min-width: 980px) {
  .hide-lg {
    display: none !important;
  }
}
@media (max-width: 420px) {
  .topbar-inner > .brand {
    font-size: 16px;
    gap: 9px;
  }
  .balance-chip {
    padding-right: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 639px) {
  .grid-4 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .grid-4 > .feature {
    grid-column: 1 / -1;
  }
  .grid-4 > .stat:not(.feature) {
    padding: 14px 14px 16px;
  }
  .grid-4 > .stat:not(.feature) .value {
    font-size: 24px;
  }
  .grid-4 > .stat:not(.feature) .label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .grid-3 > .feature {
    grid-column: 1 / -1;
  }
}

/* ---------- admin side drawer (mobile / tablet) ---------- */

.menu-toggle {
  margin-left: -4px;
}
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 4, 6, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.drawer-backdrop[hidden] {
  display: none;
}
.drawer-open .drawer-backdrop {
  opacity: 1;
}
.drawer {
  position: fixed;
  top: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 41;
  width: min(310px, calc(100vw - 52px));
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: var(--bw) solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow-pop);
  transform: translateX(calc(-100% - 24px));
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  visibility: hidden;
}
.drawer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: var(--accent-line);
}
.drawer-open .drawer {
  transform: none;
  visibility: visible;
}
.drawer-open {
  overflow: hidden;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px 14px 18px;
}
.drawer-who {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 14px 6px;
  padding: 12px;
  border-radius: 16px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.drawer-who > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.drawer-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 10px 6px;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 13px;
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 500;
}
.drawer-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.drawer-ic {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: var(--bw) solid var(--hairline);
  color: var(--text-2);
  flex: none;
}
.drawer-nav .chev {
  margin-left: auto;
  width: 15px;
  height: 15px;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.15s;
}
.drawer-nav a:hover .chev,
.drawer-nav a.on .chev {
  opacity: 1;
}
.drawer-nav a.on {
  color: var(--text);
  background: var(--surface-3);
}
.drawer-nav a.on .drawer-ic {
  background: var(--accent-grad);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 8px 18px -10px var(--accent-glow);
}
.drawer-foot {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-top: var(--bw) solid var(--border);
}
@media (min-width: 980px) {
  .drawer,
  .drawer-backdrop {
    display: none;
  }
}
@media (max-width: 380px) {
  .hide-xs {
    display: none;
  }
}
.drawer-backdrop {
  pointer-events: none;
}
.drawer-open .drawer-backdrop {
  pointer-events: auto;
}

/* ---------- admin: design picker ---------- */

.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.skin-opt {
  position: relative;
  display: block;
  cursor: pointer;
}
.skin-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.skin-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.skin-opt:hover .skin-card {
  transform: translateY(-2px);
}
.skin-opt input:checked + .skin-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow);
}
.skin-opt input:focus-visible + .skin-card {
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.skin-demo {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  border-bottom: var(--bw) solid var(--border);
}
[data-skin="ocean"].skin-demo {
  background: linear-gradient(160deg, #0b4a63, #051923);
}
.sd-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sd-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 800;
  border: var(--btn-border);
}
.sd-name {
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 14px;
}
.sd-feature {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: var(--bw) solid var(--feature-border);
  background: var(--feature-bg);
  color: var(--feature-fg);
  box-shadow: var(--feature-shadow);
}
.sd-label {
  display: block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--feature-muted);
}
.sd-value {
  display: inline-block;
  margin-top: 4px;
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 22px;
  background: var(--feature-value);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sd-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-grad);
  color: var(--accent-ink);
  border: var(--btn-border);
  box-shadow: var(--btn-shadow);
  font-size: 12px;
  font-weight: 700;
  text-transform: var(--btn-tt);
  letter-spacing: var(--btn-ls);
}
.sd-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--ok);
  background: var(--ok-soft);
  border: var(--bw) solid var(--hairline);
}
.sd-card {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: var(--surface-3);
  border: var(--bw) solid var(--border);
}
.skin-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px 16px;
}
.skin-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}
.skin-actions {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Admin has more menu items: keep the ☰ drawer up to 1399px wide */
.mainnav a {
  white-space: nowrap;
}
@media (min-width: 980px) and (max-width: 1399px) {
  .admin .mainnav {
    display: none;
  }
  .admin .mainnav + .top-right {
    margin-left: auto;
  }
  .admin .menu-toggle.hide-lg {
    display: grid !important;
  }
  .admin .drawer {
    display: flex;
  }
  .admin .drawer-backdrop:not([hidden]) {
    display: block;
  }
}

/* Reseller: on small screens the ☰ drawer holds account + sign out, so drop the avatar */
@media (max-width: 979px) {
  .user .top-right .user-menu {
    display: none;
  }
}

/* ---------- key generator (Get keys) ---------- */

.gen-card {
  max-width: 640px;
  margin: 0 auto;
  overflow: hidden;
}
.gen-head {
  position: relative;
  text-align: center;
  padding: 26px 20px 20px;
  border-bottom: var(--bw) solid var(--border);
  background: linear-gradient(180deg, var(--accent-soft), transparent);
}
.gen-head::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent-grad);
}
.gen-head h1 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.gen-ic {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  border: var(--btn-border);
}
.gen-ic .icon {
  width: 18px;
  height: 18px;
}
.gen-head .sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.gen-body {
  padding: 22px 20px 24px;
}
.field-label.with-ic {
  display: flex;
  align-items: center;
  gap: 8px;
}
.field-label.with-ic .icon {
  width: 15px;
  height: 15px;
  color: var(--accent-text);
}
.stock-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  color: var(--ok);
  background: var(--ok-soft);
  border: var(--bw) solid color-mix(in srgb, var(--ok) 30%, transparent);
}
.stock-line.low {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}
.stock-line.out {
  color: var(--err);
  background: var(--err-soft);
  border-color: color-mix(in srgb, var(--err) 30%, transparent);
}
.stock-line .icon {
  width: 17px;
  height: 17px;
}
.gen-total {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: var(--bw) dashed var(--border-strong);
}
.gen-total > div {
  display: flex;
  flex-direction: column;
}
.gen-total strong {
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.gen-total .short {
  color: var(--err);
}
.gen-warn {
  color: var(--err);
  margin: -4px 0 0;
}
.stepper button {
  width: 64px;
  background: var(--accent-grad);
  color: var(--accent-ink);
}
.stepper button:hover {
  background: var(--accent-grad);
  filter: brightness(1.06);
}

/* ---------- dashboard ---------- */

.welcome {
  padding: 20px;
  border: var(--bw) solid var(--feature-border);
  background: var(--feature-bg);
  color: var(--feature-fg);
  box-shadow: var(--feature-shadow);
  overflow: hidden;
}
.welcome-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.welcome-ic {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--feature-fg) 14%, transparent);
  border: var(--bw) solid color-mix(in srgb, var(--feature-fg) 30%, transparent);
}
.welcome-ic .icon {
  width: 24px;
  height: 24px;
}
.welcome-who {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.welcome-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--feature-muted);
}
.welcome-name {
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 24px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
}
.welcome-cta {
  margin-left: auto;
}
.welcome-balance {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: inherit;
  background: color-mix(in srgb, var(--feature-fg) 10%, transparent);
  border: var(--bw) solid color-mix(in srgb, var(--feature-fg) 18%, transparent);
}
.welcome-balance:hover {
  text-decoration: none;
  background: color-mix(in srgb, var(--feature-fg) 14%, transparent);
}
.wb-ic {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--feature-fg) 14%, transparent);
}
.wb-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--feature-muted);
}
.wb-value {
  margin-left: auto;
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 30px;
  font-variant-numeric: tabular-nums;
  background: var(--feature-value);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 20px 14px;
}
.tile-wide {
  margin-top: 12px;
  padding: 24px 16px;
}
.tile-link {
  color: inherit;
}
.tile-link:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.tile-ic {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border: var(--bw) solid var(--hairline);
}
.tile-ic .icon {
  width: 21px;
  height: 21px;
}
.t-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.t-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.t-err {
  background: var(--err-soft);
  color: var(--err);
}
.t-accent {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.tile-num {
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.tile-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.tile-big {
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 34px;
  line-height: 1.1;
  color: var(--ok);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 980px) {
  .tiles {
    grid-template-columns: repeat(4, 1fr);
  }
  .tile-wide-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* ---------- admin: products & variants ---------- */

.new-product {
  padding: 12px;
}
.np-form {
  display: flex;
  align-items: center;
  gap: 10px;
}
.np-ic {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: var(--bw) solid var(--hairline);
}
.np-form input {
  flex: 1;
  min-width: 0;
}
.np-form .btn {
  height: 48px;
}
.product-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.product-card.is-off .pc-title h2 {
  opacity: 0.6;
}
.pc-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: var(--bw) solid var(--border);
  flex-wrap: wrap;
}
.pc-ic {
  width: 44px;
  height: 44px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-grad);
  color: var(--accent-ink);
  border: var(--btn-border);
}
.pc-title {
  flex: 1;
  min-width: 160px;
}
.pc-title h2 {
  font-family: var(--display);
  font-weight: var(--display-w);
  font-size: 19px;
}
.pc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.pc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.variant-list {
  display: flex;
  flex-direction: column;
}
.variant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: var(--bw) solid var(--hairline);
}
.variant.is-off .v-main {
  opacity: 0.55;
}
.v-main {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(110px, 1.4fr) auto auto auto auto;
  align-items: center;
  gap: 14px;
}
.v-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.v-name strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v-price {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.v-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.danger-ic {
  color: var(--err);
}
.variant-empty {
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
  border-bottom: var(--bw) solid var(--hairline);
}
.add-variant > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 18px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-text);
}
.add-variant > summary::-webkit-details-marker {
  display: none;
}
.add-variant > summary:hover {
  background: var(--surface-2);
}
.add-variant[open] > summary {
  border-bottom: var(--bw) dashed var(--border);
}
.av-form {
  display: grid;
  grid-template-columns: 1.6fr 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 14px 18px 18px;
}
.av-form .btn {
  height: 48px;
}
.stock-group + .stock-group {
  border-top: var(--bw) solid var(--border);
}
.stock-group-head {
  padding: 12px 20px 4px;
  font-size: 13px;
  color: var(--text-2);
}
@media (max-width: 720px) {
  .v-main {
    grid-template-columns: 1fr auto;
    row-gap: 6px;
  }
  .v-sold {
    display: none;
  }
  .av-form {
    grid-template-columns: 1.4fr 1fr auto;
  }
  .np-ic {
    display: none;
  }
  .np-form {
    flex-wrap: wrap;
  }
  .np-form input {
    flex-basis: 100%;
  }
  .np-form .btn {
    width: 100%;
  }
}
.move-btns {
  display: flex;
  gap: 2px;
  padding-right: 6px;
  margin-right: 2px;
  border-right: var(--bw) solid var(--hairline);
}
.move-btns .btn {
  width: 34px;
  padding: 0;
}

/* ---------- products: collapsible variants + compact phone layout ---------- */

.pc-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  border-bottom: var(--bw) solid var(--hairline);
}
.pc-toggle::-webkit-details-marker {
  display: none;
}
.pc-toggle:hover {
  background: var(--surface-2);
}
.pc-toggle-sum {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-chev {
  margin-left: auto;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transition: transform 0.15s;
}
.pc-body[open] > .pc-toggle .pc-chev {
  transform: rotate(180deg);
}
.pc-body[open] > .pc-toggle .pc-toggle-sum {
  visibility: hidden;
}
.pc-body:not([open]) > .pc-toggle {
  border-bottom: 0;
}

@media (max-width: 720px) {
  .product-list {
    gap: 10px;
    margin-top: 12px;
  }
  .product-card {
    border-radius: 14px;
  }
  .pc-head {
    gap: 10px;
    padding: 10px 10px 10px 12px;
    flex-wrap: nowrap;
  }
  .pc-ic {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .pc-ic .icon {
    width: 16px;
    height: 16px;
  }
  .pc-title {
    min-width: 0;
  }
  .pc-title h2 {
    font-size: 15px;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pc-meta {
    gap: 4px;
    margin-top: 2px;
    font-size: 11px;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: hidden;
  }
  .pc-meta .badge {
    height: 18px;
    padding: 0 6px;
    font-size: 10px;
  }
  .pc-actions {
    gap: 2px;
    flex: none;
  }
  .pc-actions .btn-sm {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 8px;
  }
  .pc-actions .btn-sm .icon {
    width: 14px;
    height: 14px;
  }
  .pc-actions .hide-xs {
    display: none;
  }
  .move-btns {
    flex-direction: column;
    gap: 0;
    padding-right: 4px;
    margin-right: 2px;
  }
  .move-btns .btn {
    width: 26px;
    height: 17px !important;
    border-radius: 5px;
  }
  .move-btns .btn .icon {
    width: 13px;
    height: 13px;
  }
  .move-btns form {
    line-height: 0;
  }
  .pc-toggle {
    padding: 8px 12px;
    font-size: 12px;
    gap: 8px;
  }
  .variant {
    gap: 6px;
    padding: 7px 8px 7px 12px;
  }
  .v-main {
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    row-gap: 0;
  }
  .v-name {
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
  }
  .v-name strong {
    font-size: 13px;
  }
  .v-name .small {
    font-size: 11px;
    white-space: nowrap;
  }
  .v-price {
    font-size: 13px;
  }
  .v-stock.badge {
    height: 20px;
    padding: 0 7px;
    font-size: 10.5px;
  }
  .v-main > .badge-err:last-child {
    display: none;
  }
  .v-actions .btn-sm {
    width: 28px;
    height: 28px;
    padding: 0;
  }
  .v-actions .btn-sm .icon {
    width: 14px;
    height: 14px;
  }
  .variant-empty {
    padding: 10px 12px;
    font-size: 13px;
  }
  .add-variant > summary {
    padding: 9px 12px;
    font-size: 13px;
  }
  .av-form {
    padding: 10px 12px 12px;
    gap: 8px;
  }
  .av-form input {
    height: 40px;
  }
  .av-form .btn {
    height: 40px;
  }
  .new-product {
    padding: 10px;
  }
  .np-form {
    gap: 8px;
  }
  .np-form input,
  .np-form .btn {
    height: 42px;
  }
}
@media (max-width: 420px) {
  .v-stock.badge {
    font-size: 0;
    min-width: 30px;
    justify-content: center;
  }
  .v-stock.badge::before {
    content: attr(data-n);
    font-size: 10.5px;
  }
}

/* Compact key-upload box (still resizable by dragging the corner) */
#keys-input {
  min-height: 110px;
  height: 130px;
}

/* ---------- admin: settings & API pages ---------- */

.settings-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.settings-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border: var(--bw) solid var(--border);
  background: var(--surface);
}
.settings-tabs a:hover {
  text-decoration: none;
  color: var(--text);
  border-color: var(--accent);
}
.settings-tabs .icon {
  width: 15px;
  height: 15px;
}
.settings-section + .settings-section {
  margin-top: 18px;
}
.settings-section {
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.settings-note {
  margin-bottom: 14px;
}
.tg-grid {
  display: grid;
  gap: 20px;
}
.tg-switch {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: var(--bw) solid var(--border);
  background: var(--surface-2);
}
.tg-help {
  padding: 16px;
  border-radius: var(--radius-md);
  border: var(--bw) dashed var(--border-strong);
  background: var(--surface-2);
}
.tg-help h3 {
  margin-bottom: 10px;
}
.cmd-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cmd-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmd-list code,
.tg-help code {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--accent-text);
}
.cmd-list span {
  font-size: 12px;
  color: var(--muted);
}
.tg-help form {
  margin-top: 12px;
}
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.api-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 20px;
}
.api-card h2 {
  font-size: 16px;
}
.api-card .badge {
  margin-top: auto;
}
.api-ic {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: var(--bw) solid var(--hairline);
  margin-bottom: 4px;
}
@media (min-width: 980px) {
  .tg-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    align-items: start;
  }
}
.stock-line[hidden] {
  display: none;
}
