@font-face {
  font-family: "Noto Sans SC";
  src: url('/assets/fonts/NotoSansCJKsc-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url('/assets/fonts/NotoSansCJKsc-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans SC";
  src: url('/assets/fonts/NotoSansCJKsc-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url('/assets/fonts/JetBrainsMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url('/assets/fonts/JetBrainsMono-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url('/assets/fonts/JetBrainsMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-page: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-hover: #F1F3F5;
  --border: #E4E7EC;
  --border-strong: #8A94A3;
  --text-muted: #5B6472;
  --text: #1F2937;
  --accent: #2B5FD9;
  --accent-hover: #234DB5;
  --accent-text: #2B5FD9;
  --accent-subtle: #EAF1FB;
  --success: #1F7A4A;
  --success-subtle: #E7F4EC;
  --warning: #8A5300;
  --warning-subtle: #FFF3DC;
  --danger: #B42318;
  --danger-solid: #B42318;
  --danger-subtle: #FDECEA;
  --info: #2B5FD9;
  --info-subtle: #EAF1FB;
  --on-accent: #FFFFFF;
  --sidebar-surface: #1F2937;
  --sidebar-text: #E6E8EC;
  --sidebar-muted: #A1A9B6;
  --sidebar-hover: #374151;
  --sidebar-border: #4B5563;
  --overlay: color-mix(in srgb, var(--text) 42%, transparent);
  --shadow-overlay: 0 4px 16px rgba(31, 41, 55, .10);
  --radius: 8px;
}

:root[data-theme="dark"] {
  --bg-page: #0F1115;
  --bg-surface: #171A21;
  --bg-hover: #1F232B;
  --border: #2A2F3A;
  --border-strong: #5E6878;
  --text-muted: #A1A9B6;
  --text: #E6E8EC;
  --accent: #3D6FE0;
  --accent-hover: #3360CC;
  --accent-text: #7BA3F2;
  --accent-subtle: #1B2A45;
  --success: #4CC38A;
  --success-subtle: #15291F;
  --warning: #E8A33D;
  --warning-subtle: #2E2412;
  --danger: #F0705F;
  --danger-solid: #C2392B;
  --danger-subtle: #33191A;
  --info: #7BA3F2;
  --info-subtle: #1B2A45;
  --on-accent: #FFFFFF;
  --sidebar-surface: #0F1115;
  --sidebar-text: #E6E8EC;
  --sidebar-muted: #A1A9B6;
  --sidebar-hover: #1F232B;
  --sidebar-border: #2A2F3A;
  --overlay: color-mix(in srgb, var(--text) 42%, transparent);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg-page); color: var(--text); }
body {
  font-family: "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
::placeholder { color: var(--text-muted); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 36px; font-weight: 500; letter-spacing: 0; }
h2 { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: 0; }
h3 { font-size: 16px; line-height: 24px; font-weight: 500; }
.svg-icon { width: 16px; height: 16px; display: block; }
.mono, code, .order-id, [class*="price"], [class*="amount"], [class*="balance"], [class*="countdown"] { font-family: "JetBrains Mono", monospace; font-variant-numeric: tabular-nums; }

.customer-email { text-decoration: none; }


* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-page);
  color: var(--text);
  font-family: "Noto Sans SC", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::placeholder { color: var(--text-muted); opacity: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; line-height: 1.25; letter-spacing: -.03em; }
h2 { font-size: 20px; line-height: 1.35; letter-spacing: -.02em; }
h3 { font-size: 17px; line-height: 1.4; }
.svg-icon { width: 16px; height: 16px; display: block; }

/* -------------------------------------------------------------------------
   Admin shell
   ------------------------------------------------------------------------- */
.app-shell { min-height: 100vh; display: flex; background: var(--bg-page); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 5; width: 240px;
  padding: 16px; display: flex; flex-direction: column;
  background: var(--sidebar-surface); color: var(--sidebar-text);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 24px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--accent);
  color: var(--on-accent); display: grid; place-items: center; font-size: 18px; font-weight: 800;
}
.brand-text { font-size: 17px; font-weight: 700; letter-spacing: -.02em; color: var(--sidebar-text); }
.brand-text small {
  display: block; color: var(--sidebar-muted); font-size: 14px; font-weight: 600;
  letter-spacing: .12em; margin-top: 3px; text-transform: uppercase;
}
.sidebar-label {
  padding: 0 11px; color: var(--sidebar-muted); font-size: 14px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px;
}
.nav { display: grid; gap: 2px; }
.nav-btn {
  border: 0; border-radius: 7px; background: transparent; color: var(--sidebar-text);
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  text-align: left; font-size: 15px; font-weight: 600; transition: .15s ease;
}
.nav-btn:hover { color: var(--sidebar-text); background: var(--bg-hover); }
.nav-btn.active { color: var(--accent-text); background: var(--accent-subtle); box-shadow: inset 2px 0 0 var(--accent); }
.nav-icon { width: 17px; height: 17px; display: grid; place-items: center; }
.nav-badge {
  margin-left: auto; color: var(--sidebar-muted); background: var(--sidebar-border);
  border-radius: 99px; padding: 2px 6px; font-size: 14px; font-weight: 700;
}
.nav-btn.active .nav-badge { color: var(--accent-text); background: var(--accent-subtle); }
.sidebar-bottom { margin-top: auto; }
.balance-mini {
  border: 1px solid var(--sidebar-border); border-radius: 8px;
  padding: 12px; margin: 14px 0 12px; background: var(--bg-hover);
}
.balance-mini-top { color: var(--sidebar-muted); font-size: 14px; display: flex; align-items: center; justify-content: space-between; }
.balance-mini strong { display: block; margin: 7px 0 10px; font-family: "JetBrains Mono", monospace; font-size: 22px; letter-spacing: -.03em; }
.balance-mini button {
  width: 100%; border: 0; background: var(--accent); color: var(--on-accent);
  padding: 7px; border-radius: 6px; font-size: 14px; font-weight: 700;
}
.user-mini { display: flex; align-items: center; gap: 9px; padding: 10px 8px 0; border-top: 1px solid var(--sidebar-border); margin-top: 12px; }
.avatar {
  width: 29px; height: 29px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sidebar-hover); color: var(--border); font-size: 15px; font-weight: 700;
}
.user-mini strong { display: block; font-size: 15px; color: var(--border); }
.user-mini span { color: var(--sidebar-muted); font-size: 14px; }

.main { width: calc(100% - 264px); margin-left: 264px; min-width: 0; }
.topbar {
  height: 56px; border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-surface) 94%, transparent); backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 3;
}
.breadcrumbs { display: flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 15px; }
.breadcrumbs strong { color: var(--text); font-size: 15px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button {
  width: 34px; height: 34px; border: 1px solid var(--border); background: var(--bg-surface);
  color: var(--text-muted); border-radius: 7px; display: grid; place-items: center; position: relative;
}
.icon-button:hover { border-color: var(--border-strong); color: var(--text); }
.notification-dot { width: 5px; height: 5px; background: var(--accent); border: 1px solid var(--bg-surface); border-radius: 50%; position: absolute; top: 7px; right: 8px; }
.user-pill { border: 1px solid var(--border); background: var(--bg-surface); border-radius: 8px; display: flex; align-items: center; gap: 7px; padding: 3px 8px 3px 4px; font-size: 15px; font-weight: 600; }
.user-pill .avatar { width: 25px; height: 25px; background: var(--accent-subtle); color: var(--accent-hover); }
.content { max-width: 1440px; margin: 0 auto; padding: 32px 36px 56px; }
.admin-token-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--border-strong); background: var(--accent-subtle); border-radius: var(--radius); padding: 12px 15px; margin-bottom: 16px; }
.admin-token-banner strong { display: block; color: var(--accent-hover); font-size: 15px; }
.admin-token-banner p { color: var(--text-muted); font-size: 14px; margin-top: 3px; }
.admin-token-banner > div:last-child { display: flex; gap: 6px; align-items: center; }
.admin-token-banner input { width: 240px; border: 1px solid var(--border-strong); background: var(--on-accent); border-radius: 6px; padding: 9px 11px; font-size: 16px; outline: none; }
.admin-token-banner input:focus { border-color: var(--accent); }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.eyebrow { color: var(--text-muted); font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1 { margin-top: 6px; }
.subtitle { color: var(--text-muted); font-size: 15px; margin-top: 6px; }
.actions { display: flex; gap: 8px; align-items: center; }

.btn {
  border: 1px solid var(--border); border-radius: 7px; background: var(--bg-surface);
  color: var(--text); padding: 10px 14px; font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px; transition: .15s ease;
}
.btn:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn:disabled:hover { background: var(--bg-surface); border-color: var(--border); }
.btn-primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); }
.btn-dark { border-color: var(--sidebar-surface); background: var(--sidebar-surface); color: var(--on-accent); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 7px 10px; font-size: 15px; }

/* Admin overview */
.hero {
  min-height: auto; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; background: var(--bg-surface); color: var(--text);
  display: flex; justify-content: space-between; gap: 24px; box-shadow: none;
}
.hero:after { display: none; }
.hero-content { max-width: 600px; }
.hero .eyebrow { color: var(--text-muted); }
.hero h2 { color: var(--text); font-size: 22px; margin: 7px 0 6px; letter-spacing: -.02em; }
.hero p { color: var(--text-muted); font-size: 15px; line-height: 1.65; }
.hero-tags { margin-top: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.hero-tag {
  display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 7px; background: var(--bg-hover);
  color: var(--text-muted); font-size: 14px; font-weight: 600;
}
.hero-tag i { width: 5px; height: 5px; border-radius: 50%; background: var(--success); }
.hero-metric { align-self: center; min-width: 180px; border-left: 1px solid var(--border); padding-left: 22px; }
.hero-metric-label { color: var(--text-muted); font-size: 14px; }
.hero-metric-value { display: block; font-family: "JetBrains Mono", monospace; font-size: 34px; letter-spacing: -.04em; margin: 4px 0 6px; color: var(--text); }
.hero-metric-change { color: var(--text-muted); font-size: 14px; }
.hero-metric-change em { font-style: normal; color: var(--text-muted); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 12px 0; }
.kpi { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: none; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--text-muted); font-size: 14px; font-weight: 600; }
.kpi-icon { width: 27px; height: 27px; border-radius: 6px; display: grid; place-items: center; color: var(--text-muted); font-size: 15px; background: var(--bg-hover); }
.kpi:nth-child(1) .kpi-icon { color: var(--accent); background: var(--accent-subtle); }
.kpi:nth-child(2) .kpi-icon { color: var(--accent); background: var(--accent-subtle); }
.kpi:nth-child(3) .kpi-icon { color: var(--warning); background: var(--warning-subtle); }
.kpi:nth-child(4) .kpi-icon { color: var(--info); background: var(--info-subtle); }
.kpi-value { font-family: "JetBrains Mono", monospace; font-size: 27px; letter-spacing: -.04em; margin: 12px 0 5px; white-space: nowrap; color: var(--text); }
.kpi-foot { display: flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 14px; }
.positive { color: var(--success); font-weight: 700; }
.negative { color: var(--danger); font-weight: 700; }
.grid-2-1 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); gap: 12px; }
.grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-surface); padding: 22px; min-width: 0; box-shadow: none; }
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.panel-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.select {
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-muted);
  border-radius: 6px; padding: 8px 10px; font-size: 16px; outline: none;
}
.select:focus { border-color: var(--accent); }

.chart { height: 196px; position: relative; }
.chart-grid { position: absolute; inset: 10px 0 24px; display: flex; flex-direction: column; justify-content: space-between; }
.chart-grid span { height: 1px; background: var(--border); width: 100%; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-labels { position: absolute; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-between; color: var(--text-muted); font-size: 14px; }
.chart-value {
  position: absolute; right: 5%; top: 18px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--accent-subtle); padding: 6px 8px;
  color: var(--accent-hover); font-family: "JetBrains Mono", monospace; font-size: 14px;
}
.chart-empty { height: 196px; display: grid; place-items: center; color: var(--text-muted); font-size: 15px; border: 1px dashed var(--border); border-radius: 8px; }
.chart-meta { color: var(--text-muted); font-size: 14px; margin-bottom: 6px; }
.bar-chart { height: 180px; display: flex; align-items: flex-end; gap: 10px; padding-top: 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 7px; height: 100%; }
.bar-track { width: 100%; max-width: 44px; flex: 1; display: flex; align-items: flex-end; background: var(--bg-hover); border-radius: 4px; overflow: hidden; }
.bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; }
.bar-col span { color: var(--text-muted); font-size: 14px; white-space: nowrap; }
.chart-total { position: absolute; right: 0; top: 0; color: var(--text-muted); font-size: 14px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; min-height: 196px; }
.donut {
  width: 136px; height: 136px; border-radius: 50%;
  background: conic-gradient(var(--accent) 0 42%, var(--accent) 42% 67%, var(--warning) 67% 84%, var(--info) 84% 100%);
  display: grid; place-items: center; flex: 0 0 auto;
}
.donut:after { content: ''; width: 88px; height: 88px; background: var(--bg-surface); border-radius: 50%; }
.donut-center { position: absolute; text-align: center; font-family: "JetBrains Mono", monospace; font-size: 25px; letter-spacing: -.04em; }
.donut-center small { display: block; color: var(--text-muted); font-family: "Noto Sans SC", sans-serif; font-size: 14px; letter-spacing: 0; margin-top: 4px; }
.legend { display: grid; gap: 10px; width: 100%; }
.legend-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-muted); font-size: 14px; }
.legend-name { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-item strong { color: var(--text); font-family: "JetBrains Mono", monospace; font-size: 14px; }
.donut-empty { display: grid; place-items: center; min-height: 196px; color: var(--text-muted); font-size: 15px; border: 1px dashed var(--border); border-radius: 8px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th {
  color: var(--text-muted); font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 700; padding: 0 12px 10px; white-space: nowrap;
}
td { border-top: 1px solid var(--border); padding: 14px 12px; color: var(--text-muted); font-size: 16px; white-space: nowrap; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; text-align: right; }
.service-cell { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.service-logo {
  width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; background: var(--bg-hover); color: var(--text);
}
.service-meta { display: block; color: var(--text-muted); font-size: 14px; font-weight: 500; margin-top: 2px; }
.status { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 9px; font-size: 14px; font-weight: 700; }
.status:before { content: ''; width: 4px; height: 4px; background: currentColor; border-radius: 50%; }
.status-live { color: var(--success); background: var(--success-subtle); }
.status-pending { color: var(--warning); background: var(--warning-subtle); }
.status-done { color: var(--accent-hover); background: var(--accent-subtle); }
.status-failed { color: var(--danger); background: var(--danger-subtle); }
.mono { font-family: "JetBrains Mono", monospace; }
.payment-review { max-width: 260px; font-size: 14px; line-height: 1.5; word-break: break-all; }

/* Pricing */
.price-hero {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; display: flex; align-items: center; justify-content: space-between;
  gap: 24px; margin-bottom: 12px; box-shadow: none;
}
.price-hero h2 { font-size: 22px; margin: 6px 0; }
.price-hero p { max-width: 560px; color: var(--text-muted); font-size: 15px; line-height: 1.65; }
.multiplier-box { display: flex; align-items: center; gap: 10px; background: var(--bg-hover); padding: 6px; border: 1px solid var(--border); border-radius: 8px; }
.multiplier-input {
  width: 72px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-surface);
  color: var(--text); padding: 10px 8px; font-family: "JetBrains Mono", monospace;
  font-size: 22px; font-weight: 500; text-align: center; outline: none;
}
.multiplier-input:focus { border-color: var(--accent); }
.multiplier-box span { color: var(--text-muted); font-size: 14px; font-weight: 600; padding-right: 6px; }
.price-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.preview-card { border: 1px solid var(--border); background: var(--bg-surface); border-radius: var(--radius); padding: 16px; box-shadow: none; }
.preview-card label { color: var(--text-muted); font-size: 14px; }
.preview-card strong { display: block; margin-top: 9px; font-family: "JetBrains Mono", monospace; font-size: 25px; letter-spacing: -.04em; }
.preview-card small { display: block; color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.pricing-table .price { color: var(--text); font-family: "JetBrains Mono", monospace; font-weight: 500; }
.pricing-table .retail { color: var(--accent-hover); font-family: "JetBrains Mono", monospace; font-weight: 600; }
.range { width: 160px; accent-color: var(--accent); }
.inline-form { display: flex; align-items: center; gap: 8px; }
.saved-note { color: var(--success); font-size: 14px; font-weight: 700; opacity: 0; transition: .2s; }
.saved-note.show { opacity: 1; }

/* Marketplace */
.market-banner {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; color: var(--text); display: flex; align-items: center;
  justify-content: space-between; gap: 20px; margin-bottom: 12px; box-shadow: none;
}
.market-banner:after { display: none; }
.market-banner h2 { font-size: 20px; margin: 6px 0 4px; }
.market-banner p { color: var(--text-muted); font-size: 15px; }
.market-badges { display: flex; gap: 6px; }
.market-badge {
  display: flex; align-items: center; gap: 5px; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; background: var(--bg-hover);
  color: var(--text-muted); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.market-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.search {
  min-width: 220px; max-width: 300px; flex: 1; border: 1px solid var(--border);
  border-radius: 7px; background: var(--bg-surface); padding: 9px 12px 9px 32px;
  color: var(--text); outline: none; font-size: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 11px center;
}
.search:focus { border-color: var(--accent); }
.country-tabs { display: flex; gap: 5px; overflow-x: auto; }
.country-tab {
  border: 1px solid var(--border); background: var(--bg-surface); border-radius: 6px;
  padding: 6px 9px; color: var(--text-muted); font-size: 14px; white-space: nowrap;
}
.country-tab.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.service-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.service-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 15px;
  background: var(--bg-surface); transition: .15s ease; box-shadow: none;
}
.service-card:hover { border-color: var(--border-strong); }
.service-card-top { display: flex; align-items: center; justify-content: space-between; }
.service-card-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.service-card .service-logo { width: 32px; height: 32px; font-size: 17px; }
.stock { color: var(--success); font-size: 14px; font-weight: 700; }
.service-card-info { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 18px; }
.service-card-price { font-family: "JetBrains Mono", monospace; font-size: 23px; letter-spacing: -.04em; }
.service-card-price small { display: block; color: var(--text-muted); font-family: "Noto Sans SC", sans-serif; font-size: 14px; letter-spacing: 0; margin-bottom: 3px; }
.service-card .btn { padding: 7px 9px; font-size: 14px; }
.service-cost-note { display: block; color: var(--text-muted); font-size: 14px; margin-top: 5px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); gap: 12px; }
.setting-section { border-bottom: 1px solid var(--border); padding: 0 0 20px; margin-bottom: 20px; }
.setting-section:last-child { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.setting-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.setting-number {
  width: 24px; height: 24px; background: var(--accent-subtle); color: var(--accent-hover);
  border-radius: 6px; display: grid; place-items: center;
  font-family: "JetBrains Mono", monospace; font-size: 14px;
}
.setting-title p { color: var(--text-muted); font-size: 14px; margin-top: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label { display: block; color: var(--text-muted); font-size: 15px; margin-bottom: 6px; }
.field input, .field select {
  width: 100%; border: 1px solid var(--border); background: var(--bg-surface);
  border-radius: 7px; padding: 10px 11px; color: var(--text); font-size: 16px; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.field input[readonly] { color: var(--text-muted); background: var(--bg-hover); }
.input-with-icon { position: relative; }
.input-with-icon input { padding-right: 34px; }
.input-with-icon button { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border: 0; background: transparent; color: var(--text-muted); }
.secure-note {
  display: flex; gap: 7px; color: var(--info); background: var(--accent-subtle);
  border: 1px solid var(--border-strong); border-radius: 7px; padding: 9px 10px;
  margin-top: 12px; font-size: 14px; line-height: 1.6;
}
.field textarea {
  width: 100%; border: 1px solid var(--border); background: var(--bg-surface);
  border-radius: 7px; padding: 10px 11px; color: var(--text); font-size: 16px;
  outline: none; resize: vertical; min-height: 76px; line-height: 1.6;
}
.field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }
.seo-check { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 14px; }
.seo-preview-panel { align-self: start; position: sticky; top: 12px; }
.settings-preview-label { color: var(--text-muted); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 8px; }
.seo-search-preview { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--bg-hover); }
.seo-preview-url { color: var(--success); font-size: 14px; margin-bottom: 4px; word-break: break-all; }
.seo-preview-title { color: var(--accent-text); font-size: 18px; line-height: 1.35; margin-bottom: 4px; word-break: break-word; }
.seo-preview-desc { color: var(--text-muted); font-size: 14px; line-height: 1.6; word-break: break-word; }
.seo-social-preview { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-surface); }
.seo-social-image { height: 130px; background: var(--bg-hover); display: grid; place-items: center; color: var(--text-muted); font-size: 14px; overflow: hidden; }
.seo-social-image img { width: 100%; height: 100%; object-fit: cover; }
.seo-social-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.seo-social-body small { color: var(--text-muted); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.seo-social-body strong { font-size: 15px; line-height: 1.4; }
.seo-social-body p { color: var(--text-muted); font-size: 14px; line-height: 1.5; margin: 0; }
.connection-card { background: var(--bg-hover); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.connection-state { display: flex; align-items: center; gap: 7px; color: var(--success); font-weight: 700; font-size: 15px; }
.connection-state i { width: 7px; height: 7px; background: var(--success); border-radius: 50%; box-shadow: 0 0 0 3px var(--success-subtle); }
.connection-card p { color: var(--text-muted); line-height: 1.6; font-size: 14px; margin-top: 8px; }
.docs-list { display: grid; gap: 8px; margin-top: 14px; }
.doc-step { display: flex; gap: 8px; color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.doc-step b { color: var(--text); }
.key, .value { font-family: "JetBrains Mono", monospace; font-size: 14px; color: var(--text); }
.webhook-list { display: grid; gap: 6px; }
.webhook-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--border); background: var(--bg-surface); border-radius: 7px; padding: 8px 9px; }
.webhook-item > div { min-width: 0; display: grid; gap: 2px; }
.webhook-item b { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webhook-item small { color: var(--text-muted); font-family: "JetBrains Mono", monospace; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.webhook-empty { color: var(--text-muted); font-size: 14px; border: 1px dashed var(--border); border-radius: 7px; padding: 12px; text-align: center; }

/* Orders */
.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 20px; margin-bottom: 16px; }
.tab { border: 0; background: transparent; padding: 0 0 11px; color: var(--text-muted); font-size: 16px; font-weight: 600; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent-hover); border-color: var(--accent); }
.table-toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.order-search { width: 270px; }
.order-id { color: var(--text); font-family: "JetBrains Mono", monospace; font-size: 14px; }
.customer { color: var(--text); font-weight: 600; }
.customer small { color: var(--text-muted); display: block; font-weight: 500; margin-top: 2px; font-size: 14px; }

.empty { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--bg-hover); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 10px; font-size: 22px; color: var(--text-muted); }
.empty p { font-size: 15px; }

/* Overlays */
.toast {
  position: fixed; right: 22px; bottom: 20px; z-index: 20; background: var(--sidebar-surface);
  color: var(--sidebar-text); border-radius: 8px; padding: 11px 14px; font-size: 15px;
  box-shadow: 0 10px 30px var(--shadow-overlay); transform: translateY(12px);
  opacity: 0; transition: .2s; pointer-events: none;
}
.toast.show { transform: none; opacity: 1; }
.toast strong { color: var(--accent-text); }
.modal-backdrop {
  position: fixed; inset: 0; background: var(--overlay); z-index: 10;
  display: grid; place-items: center; padding: 20px; opacity: 0;
  pointer-events: none; transition: .18s;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  width: min(460px, 100%); border-radius: var(--radius); background: var(--bg-surface);
  padding: 20px; transform: translateY(8px); transition: .18s;
  border: 1px solid var(--border); box-shadow: 0 24px 60px var(--shadow-overlay);
}
.modal-backdrop.open .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 19px; }
.modal-head p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.modal-close { border: 1px solid var(--border); background: var(--bg-hover); width: 26px; height: 26px; border-radius: 6px; color: var(--text-muted); }
.confirm-line { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 15px; }
.confirm-line span:first-child { color: var(--text-muted); }
.confirm-line strong { font-family: "JetBrains Mono", monospace; text-align: right; }
.modal-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 16px; }

/* Top-up */
.topup-modal { width: min(480px, 100%); }
.topup-balance { display: flex; justify-content: space-between; align-items: center; background: var(--bg-hover); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.topup-balance span { color: var(--text-muted); font-size: 14px; }
.topup-balance strong { font-family: "JetBrains Mono", monospace; font-size: 22px; }
.topup-label { color: var(--text-muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin: 13px 0 7px; }
.topup-amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.topup-amount { border: 1px solid var(--border); background: var(--bg-surface); border-radius: 7px; padding: 9px 0; font-size: 15px; font-weight: 600; }
.topup-amount:hover { border-color: var(--border-strong); }
.topup-amount.selected { background: var(--accent-subtle); border-color: var(--accent); color: var(--accent-hover); box-shadow: inset 0 0 0 1px var(--accent); }
.topup-custom { width: 100%; border: 1px solid var(--border); border-radius: 7px; padding: 10px 11px; font-size: 16px; margin-top: 7px; outline: none; background: var(--bg-surface); }
.topup-custom:focus { border-color: var(--accent); }
.topup-hint { color: var(--text-muted); font-size: 14px; margin-top: 7px; line-height: 1.6; }
.topup-methods { display: grid; gap: 6px; }
.topup-method { display: flex; justify-content: space-between; align-items: center; text-align: left; border: 1px solid var(--border); background: var(--bg-surface); border-radius: 7px; padding: 10px 12px; }
.topup-method:hover { border-color: var(--border-strong); }
.topup-method.selected { border-color: var(--accent); background: var(--accent-subtle); }
.topup-method span { display: grid; gap: 2px; }
.topup-method b { font-size: 15px; color: var(--text); }
.topup-method small { color: var(--text-muted); font-size: 14px; }
.topup-method i { font-style: normal; color: var(--accent-hover); font-weight: 800; }
.topup-waiting { text-align: center; padding: 10px 6px 0; display: grid; gap: 7px; justify-items: center; }
.topup-waiting strong { font-size: 34px; letter-spacing: -.03em; }
.topup-waiting p { color: var(--text-muted); font-size: 14px; }
.topup-spinner { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-subtle); color: var(--accent); font-size: 25px; animation: spin 1.5s linear infinite; }
.crypto-modal { width: min(520px, 100%); }
.crypto-waiting { display: grid; gap: 10px; padding-top: 4px; }
.crypto-head { display: grid; justify-items: center; gap: 5px; text-align: center; }
.crypto-head strong { font-family: "JetBrains Mono", monospace; font-size: 32px; letter-spacing: -.03em; }
.crypto-head strong small { font-family: "Noto Sans SC", sans-serif; font-size: 15px; color: var(--text-muted); letter-spacing: 0; }
.crypto-badge { display: inline-flex; align-items: center; border-radius: 999px; background: var(--accent-subtle); color: var(--accent-hover); font-size: 14px; font-weight: 800; letter-spacing: .08em; padding: 4px 8px; }
.crypto-countdown { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.crypto-countdown.expired { color: var(--danger); }
.crypto-card { border: 1px solid var(--border); background: var(--bg-hover); border-radius: 8px; padding: 10px 12px; display: grid; gap: 6px; }
.crypto-card label { color: var(--text-muted); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.crypto-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.crypto-value { font-family: "JetBrains Mono", monospace; font-size: 15px; color: var(--text); word-break: break-all; }
.crypto-copy { border: 1px solid var(--border); background: var(--bg-surface); border-radius: 6px; padding: 5px 8px; font-size: 14px; font-weight: 700; color: var(--accent-hover); flex: none; }
.crypto-copy:hover { border-color: var(--accent); }
.crypto-warning { border: 1px solid var(--border-strong); background: var(--warning-subtle); color: var(--warning); border-radius: 8px; padding: 9px 11px; font-size: 14px; line-height: 1.6; }
.crypto-meta { color: var(--text-muted); font-size: 14px; line-height: 1.6; text-align: center; }
.crypto-txid { display: flex; gap: 6px; }
.crypto-txid input { flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 7px; padding: 10px 11px; font-size: 16px; outline: none; background: var(--bg-surface); }
.crypto-txid input:focus { border-color: var(--accent); }
.crypto-txid .btn { flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.history-modal { width: min(560px, 100%); }
.history-list { max-height: 45vh; overflow: auto; display: grid; gap: 7px; }
.history-item { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.history-item > div { display: grid; gap: 3px; }
.history-item strong { font-size: 15px; }
.history-item small { color: var(--text-muted); font-size: 14px; }
.history-item > span { display: grid; justify-items: end; gap: 4px; text-align: right; }
.history-item > span b { font-family: "JetBrains Mono", monospace; font-size: 15px; }

/* -------------------------------------------------------------------------
   Customer storefront
   ------------------------------------------------------------------------- */
.customer-app { min-height: 100vh; background: var(--bg-page); }
.customer-topbar {
  height: 56px; padding: 0 30px; display: flex; align-items: center; gap: 24px;
  border-bottom: 1px solid var(--border); background: color-mix(in srgb, var(--bg-surface) 96%, transparent);
  backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 8;
}
.customer-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; min-width: 170px; }
.customer-brand-mark {
  width: 30px; height: 30px; border-radius: 7px; background: var(--accent);
  color: var(--on-accent); display: grid; place-items: center; font-size: 17px; font-weight: 700;
}
.customer-brand strong { font-size: 18px; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.customer-brand strong span { color: var(--accent); }
.customer-support { display: flex; align-items: center; gap: 8px; }
.customer-support-pill, .customer-email {
  border: 1px solid var(--border); background: var(--bg-surface); border-radius: 7px;
  padding: 7px 10px; font-size: 14px; color: var(--text-muted);
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.customer-support-pill b, .customer-email b { color: var(--text); font-weight: 600; }
.customer-email span { color: var(--text-muted); font-family: "JetBrains Mono", monospace; }
.customer-top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.customer-balance { min-width: 112px; padding: 0 8px; }
.customer-balance small { display: block; color: var(--text-muted); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.customer-balance strong { display: block; font-family: "JetBrains Mono", monospace; font-size: 22px; letter-spacing: -.03em; margin-top: 2px; }
.customer-topup {
  border: 1px solid var(--accent); color: var(--on-accent); background: var(--accent);
  border-radius: 7px; padding: 9px 12px; font-size: 15px; font-weight: 600;
}
.customer-topup:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.customer-language { border: 1px solid var(--border); background: var(--bg-surface); border-radius: 7px; color: var(--text-muted); padding: 8px 10px; font-size: 14px; }
.customer-avatar {
  width: 31px; height: 31px; border: 1px solid var(--border); display: grid;
  place-items: center; border-radius: 50%; color: var(--accent-hover);
  background: var(--accent-subtle); font-size: 15px; font-weight: 700;
}
.admin-link { border-left: 1px solid var(--border); padding-left: 12px; color: var(--text-muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.admin-link:hover { color: var(--text); }

.customer-layout { display: flex; min-height: calc(100vh - 56px); }
.customer-sidebar {
  width: 240px; flex: 0 0 240px; background: var(--bg-surface); border-right: 1px solid var(--border);
  padding: 17px 13px; position: sticky; top: 56px; height: calc(100vh - 56px);
  display: flex; flex-direction: column;
}
.customer-sidebar nav { display: grid; gap: 2px; }
.customer-nav {
  border: 0; background: transparent; border-radius: 7px; display: flex;
  align-items: center; gap: 12px; padding: 11px 10px; color: var(--text-muted);
  font-size: 15px; font-weight: 600; text-align: left;
}
.customer-nav:hover { background: var(--bg-hover); color: var(--text); }
.customer-nav.active { background: var(--accent-subtle); color: var(--accent-hover); }
.customer-nav > span { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; }
.customer-nav-svg { width: 22px; height: 22px; display: block; }
.customer-nav em {
  margin-left: auto; font-style: normal; font-size: 14px; font-weight: 700;
  color: var(--accent-hover); background: var(--accent-subtle); border-radius: 4px; padding: 2px 4px;
}
.customer-collapse { margin-top: auto; border: 1px solid var(--border); background: var(--bg-surface); border-radius: 6px; padding: 7px 8px; color: var(--text-muted); font-size: 14px; text-align: left; }
.customer-main { flex: 1; min-width: 0; }
.customer-content { max-width: 1260px; margin: 0 auto; padding: 30px 30px 50px; }

.customer-banner {
  background: var(--accent-subtle); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: 18px 22px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 16px;
}
.customer-banner h2 { font-size: 19px; color: var(--accent-hover); letter-spacing: -.01em; }
.customer-banner p { color: var(--text); font-size: 14px; margin-top: 5px; line-height: 1.65; }
.customer-banner-badge { font-size: 14px; font-weight: 700; color: var(--accent-hover); background: var(--on-accent); border: 1px solid var(--border-strong); border-radius: 99px; padding: 5px 10px; white-space: nowrap; }
.customer-progress, .banner-lock { display: none; }

.customer-step {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px; box-shadow: none;
}
.country-step { margin-bottom: 16px; }
.customer-section-title { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.step-number {
  width: 26px; height: 26px; border-radius: 6px; background: var(--accent-subtle);
  color: var(--accent-hover); font-size: 14px; font-weight: 700;
  display: grid; place-items: center; flex: 0 0 auto; margin-top: 1px;
}
.customer-section-title h2 { font-size: 20px; line-height: 28px; font-weight: 500; letter-spacing: 0; margin: 0; }
.customer-section-title p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.customer-list-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.customer-search {
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-surface); padding: 0 12px; color: var(--text-muted);
  font-size: 15px; height: 44px;
}
.customer-search input { border: 0; outline: 0; background: transparent; font-size: 16px; width: 190px; color: var(--text); }
.customer-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-subtle); }

.customer-service-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
  max-height: 480px; overflow-y: auto; padding-right: 4px;
}
.customer-service-card {
  min-height: 84px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-surface); display: flex; align-items: center; gap: 11px;
  padding: 12px 13px; text-align: left; position: relative; transition: .15s ease;
}
.customer-service-card:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.customer-service-card.selected { border-color: var(--accent); background: var(--accent-subtle); box-shadow: inset 0 0 0 1px var(--accent); }
.customer-check {
  width: 19px; height: 19px; flex: 0 0 auto; border-radius: 5px; background: var(--on-accent);
  border: 1px solid var(--border-strong); color: var(--on-accent); display: grid;
  place-items: center; font-size: 14px; font-weight: 700;
}
.selected .customer-check { background: var(--accent); border-color: var(--accent); }
.customer-service-icon {
  width: 42px; height: 42px; flex: 0 0 auto; border-radius: 8px; background: var(--bg-hover);
  display: grid; place-items: center; font-size: 17px; font-weight: 800; color: var(--text);
}
.selected .customer-service-icon { background: var(--on-accent); color: var(--accent-hover); }
.customer-service-copy { min-width: 0; flex: 1; }
.customer-service-copy b { display: block; overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 700; }
.customer-service-copy small { display: block; overflow: hidden; color: var(--text-muted); font-size: 14px; margin-top: 4px; text-overflow: ellipsis; white-space: nowrap; }
.customer-service-card > strong { color: var(--text); font-family: "JetBrains Mono", monospace; font-size: 17px; font-weight: 500; font-synthesis: none; letter-spacing: 0; align-self: flex-start; margin-top: 1px; }
.customer-service-loader,
.customer-service-empty {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: center;
  min-height: 44px; border: 1px dashed var(--border); border-radius: 8px;
  background: var(--bg-hover); color: var(--text-muted); font-size: 14px;
}
.customer-service-empty { min-height: 140px; }
.price-cny { color: var(--text-muted); font-size: 14px; font-weight: 500; white-space: nowrap; }

.customer-country-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.customer-country {
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg-surface);
  padding: 13px 15px; display: flex; align-items: center; gap: 12px; text-align: left;
  min-height: 90px;
}
.customer-country:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.customer-country.selected { border-color: var(--accent); background: var(--accent-subtle); box-shadow: inset 0 0 0 1px var(--accent); }
.customer-country-flag { font-size: 25px; line-height: 1; flex: 0 0 auto; }
.customer-country-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.customer-country-name { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.customer-country-name b { color: var(--text); font-size: 16px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.customer-country-name small { color: var(--text-muted); font-family: "JetBrains Mono", monospace; font-size: 14px; font-weight: 500; letter-spacing: .03em; }
.customer-country em { display: flex; align-items: baseline; gap: 4px; color: var(--text-muted); font-size: 14px; font-style: normal; font-weight: 500; line-height: 1.15; white-space: nowrap; }
.customer-country em b { color: var(--accent-hover); font-family: "JetBrains Mono", monospace; font-size: 18px; font-weight: 500; font-synthesis: none; letter-spacing: -.01em; }
.customer-country-empty { color: var(--text-muted); font-size: 14px; }
.customer-country-mark { margin-left: auto; color: var(--text-muted); font-size: 15px; font-weight: 500; }
.customer-country.selected .customer-country-mark { color: var(--accent-hover); }

[hidden] { display: none !important; }
.customer-pick-hint {
  display: flex; align-items: center; gap: 12px; margin-top: 12px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--bg-hover); padding: 18px 20px;
}
.customer-pick-mark {
  width: 34px; height: 34px; flex: none; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-subtle); color: var(--accent-hover); font-size: 17px; font-weight: 800;
}
.customer-pick-hint b { display: block; color: var(--text); font-size: 15px; }
.customer-pick-hint p { color: var(--text-muted); font-size: 14px; margin-top: 3px; line-height: 1.6; }

.customer-subpage { min-height: 360px; }
.customer-page-loading { display: grid; place-items: center; min-height: 180px; color: var(--text-muted); font-size: 15px; }
.customer-placeholder {
  border: 1px dashed var(--border); border-radius: 10px; background: var(--bg-hover);
  padding: 44px 20px; display: grid; justify-items: center; gap: 11px; text-align: center;
}
.customer-placeholder-mark {
  width: 48px; height: 48px; border-radius: 12px; background: var(--accent-subtle);
  color: var(--accent-hover); display: grid; place-items: center; font-size: 27px; font-weight: 700;
}
.customer-placeholder p { max-width: 540px; color: var(--text-muted); font-size: 15px; line-height: 1.75; }
.customer-history-list { max-height: none; }
.customer-wallet-panel { max-width: 680px; }
.customer-topup-card {
  width: 100%; max-width: none; background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px; box-shadow: none;
}
.customer-topup-card .modal-close { display: none; }

.customer-checkout {
  margin-top: 0; border-radius: var(--radius); background: var(--bg-surface); color: var(--text);
  border: 1px solid var(--border); padding: 18px 20px; display: flex;
  align-items: center; justify-content: space-between; gap: 18px; box-shadow: none;
}
.customer-checkout > div:first-child { display: grid; gap: 5px; }
.customer-checkout small { color: var(--text-muted); font-size: 14px; }
.customer-checkout strong { font-size: 15px; color: var(--text); }
.customer-checkout p { color: var(--text-muted); font-size: 14px; }
.customer-checkout-price { display: flex; align-items: center; gap: 14px; }
.customer-checkout-price > strong { font-family: "JetBrains Mono", monospace; font-size: 23px; letter-spacing: -.03em; color: var(--text); }
.customer-checkout button {
  border: 1px solid var(--accent); border-radius: 7px; background: var(--accent);
  color: var(--on-accent); padding: 11px 16px; font-size: 15px; font-weight: 700;
}
.customer-checkout button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.customer-checkout button:disabled { opacity: .6; }

.customer-order-card {
  margin-top: 0; border: 1px solid var(--border-strong); background: var(--accent-subtle);
  border-radius: var(--radius); padding: 20px;
}
.customer-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.customer-order-head .eyebrow { color: var(--accent-hover); }
.customer-order-head h2 { margin-top: 4px; font-size: 18px; }
.customer-order-head p { color: var(--text-muted); margin-top: 4px; font-size: 14px; }
.customer-order-head-side { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
.customer-order-timer {
  display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid var(--border-strong);
  border-radius: 6px; background: var(--accent-subtle); color: var(--accent-hover); padding: 4px 7px;
}
.customer-order-timer small { color: var(--text-muted); font-size: 14px; font-weight: 600; }
.customer-order-timer strong { font-family: "JetBrains Mono", monospace; font-size: 15px; letter-spacing: .02em; }
.customer-order-timer.urgent { border-color: var(--border-strong); background: var(--warning-subtle); color: var(--warning); }
.customer-order-timer.ended { border-color: var(--border); background: var(--sidebar-text); color: var(--text-muted); }
.customer-order-body { display: flex; align-items: center; gap: 9px; margin-top: 14px; }
.customer-phone-box { min-width: 200px; border: 1px solid var(--border); background: var(--bg-surface); border-radius: 8px; padding: 11px 13px; }
.customer-phone-box small { display: block; color: var(--text-muted); font-size: 14px; }
.customer-phone-box strong { display: block; margin-top: 5px; font-family: "JetBrains Mono", monospace; font-size: 15px; }
.waiting-code { color: var(--text-muted); }
.code-arrived { color: var(--success) !important; letter-spacing: .08em; }
.customer-order-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; margin-left: auto; }
.customer-order-actions .btn { margin-left: 0; }
.customer-order-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--accent-subtle); color: var(--text-muted); font-size: 14px; }
.customer-order-hint { color: var(--text-muted); }

/* Legacy inline helpers */
.key { color: var(--text); }
.value { color: var(--text-muted); }

@media (max-width: 560px) {
  .topbar { height: 56px; }
  .customer-topbar { height: 56px; padding: 0 14px; }
  .customer-layout { min-height: calc(100vh - 56px); }
  .customer-sidebar { top: 56px; height: calc(100vh - 56px); width: 62px; flex: 0 0 62px; padding: 12px 8px; }
  .customer-content { padding: 18px 14px 36px; }
  .customer-banner { align-items: flex-start; flex-direction: column; gap: 10px; }
  .customer-section-title { flex-wrap: wrap; }
  .customer-list-tools { width: 100%; margin: 6px 0 0 38px; }
  .customer-search { flex: 1; }
  .customer-search input { width: auto; flex: 1; }
  .customer-service-grid { grid-template-columns: 1fr; max-height: none; }
  .customer-country-grid { grid-template-columns: 1fr; }
  .customer-checkout { align-items: stretch; flex-direction: column; }
  .customer-checkout-price { justify-content: space-between; }
  .customer-order-body { align-items: stretch; flex-direction: column; }
  .customer-phone-box { min-width: 0; }
  .customer-order-head { flex-direction: column; }
  .customer-order-head-side { justify-content: flex-start; }
  .customer-order-actions { margin-left: 0; justify-content: stretch; }
  .customer-order-actions .btn { flex: 1; justify-content: center; }
  .topup-amounts { grid-template-columns: repeat(3, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .price-preview { grid-template-columns: 1fr; }
  .hero { flex-direction: column; }
  .hero-metric { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; padding-top: 12px; width: 100%; }
}


/* Shared shell, modal and mobile behavior */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(440px, 100%); padding: 32px; }
.auth-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; margin-bottom: 24px; }
.auth-brand strong { font-size: 20px; font-weight: 500; }
.auth-brand strong span { color: var(--accent-text); }
.auth-card h1 { margin-bottom: 8px; }
.auth-card form { display: grid; gap: 16px; margin-top: 24px; }
.auth-submit { width: 100%; justify-content: center; }
.captcha-row { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.captcha-row span { min-height: 36px; display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.field-error, .form-error { color: var(--danger); font-size: 14px; line-height: 20px; min-height: 20px; margin-top: 4px; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger) !important; }
.btn-secondary { border-color: var(--border-strong); background: var(--bg-surface); color: var(--text); }
.btn-danger { border-color: var(--danger); color: var(--danger); background: var(--bg-surface); }
.btn-danger-solid { border-color: var(--danger-solid); color: var(--on-accent); background: var(--danger-solid); }
.mobile-menu-toggle { display: none; min-height: 44px; border: 1px solid var(--border); background: var(--bg-surface); color: var(--text); border-radius: 4px; padding: 0 12px; font-weight: 500; }
.alert-log { max-height: 45vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--border); background: var(--bg-hover); border-radius: 4px; padding: 12px; font: 14px/22px "JetBrains Mono", monospace; }
.breakable { overflow-wrap: anywhere; word-break: break-word; }
.modal-backdrop { overflow: auto; }
.modal { max-height: calc(100dvh - 32px); overflow: auto; box-shadow: var(--shadow-overlay); }
.modal-actions { position: sticky; bottom: -20px; background: var(--bg-surface); padding-top: 16px; }
.toast, .customer-toast { box-shadow: var(--shadow-overlay); }

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

@media (min-width: 1280px) {
  .content, .customer-content { max-width: 1200px; }
}
@media (min-width: 768px) and (max-width: 1279px) {
  .sidebar { width: 64px; padding: 16px 8px; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .brand-text, .sidebar-label, .nav-btn > span:not(.nav-icon), .nav-badge, .balance-mini, .user-mini > div { display: none; }
  .nav-btn { justify-content: center; padding-left: 0; padding-right: 0; }
  .main { width: calc(100% - 64px); margin-left: 64px; }
  .customer-sidebar { width: 64px; flex-basis: 64px; padding-left: 8px; padding-right: 8px; }
  .customer-nav { justify-content: center; padding-left: 0; padding-right: 0; font-size: 0; }
  .customer-nav em, .customer-collapse { display: none; }
}
@media (max-width: 767px) {
  html, body { overflow-x: hidden; }
  .mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .sidebar, .customer-sidebar { position: fixed; top: 56px; bottom: 0; left: 0; width: min(280px, 86vw); height: calc(100dvh - 56px); transform: translateX(-105%); transition: transform .18s ease; z-index: 12; box-shadow: var(--shadow-overlay); }
  .sidebar.menu-open, .customer-sidebar.menu-open { transform: translateX(0); }
  .sidebar .brand-text, .sidebar .sidebar-label, .sidebar .nav-btn > span:not(.nav-icon), .sidebar .nav-badge, .sidebar .balance-mini, .sidebar .user-mini > div, .customer-nav em, .customer-collapse { display: initial; }
  .sidebar .nav-btn, .customer-nav { justify-content: flex-start; padding: 10px; font-size: 14px; }
  .main { width: 100%; margin-left: 0; }
  .topbar, .customer-topbar { height: 56px; padding: 0 16px; }
  .topbar { gap: 12px; }
  .breadcrumbs span, .breadcrumbs b { display: none; }
  .user-pill span:not(.avatar), .customer-support, .customer-language, .customer-balance { display: none; }
  .content, .customer-content { padding: 24px 16px 40px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .actions, .inline-form, .table-toolbar, .market-controls { width: 100%; flex-wrap: wrap; }
  .actions .btn, .actions a { flex: 1 1 auto; justify-content: center; }
  .service-grid, .customer-service-grid, .customer-country-grid { grid-template-columns: 1fr; }
  .grid-2-1, .grid-1-1, .settings-layout, .price-preview { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .field, .settings-layout .panel { min-width: 0; }
  .search, .order-search { width: 100%; max-width: none; min-width: 0; }
  .customer-sidebar { top: 56px; height: calc(100dvh - 56px); }
  .customer-layout { min-height: calc(100dvh - 56px); }
  .customer-menu-toggle { margin-right: 4px; }
  .customer-top-actions { margin-left: auto; }
  .customer-checkout, .customer-order-body, .customer-order-head { align-items: stretch; flex-direction: column; }
  .customer-order-actions { margin-left: 0; justify-content: stretch; }
  .customer-order-actions .btn { flex: 1; justify-content: center; }
  .recharge-options, .topup-amounts { grid-template-columns: 1fr; }
  .redeem-form { flex-direction: column; }
  .redeem-form .btn { width: 100%; justify-content: center; }
  .crypto-row, .crypto-txid { align-items: stretch; flex-direction: column; }
  .crypto-copy, .crypto-txid .btn { width: 100%; }
  .modal-backdrop { place-items: start center; padding: 16px; }
  .modal { width: min(560px, 100%); }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { min-height: 44px; flex: 1 1 auto; justify-content: center; }
  .table-wrap { max-width: 100%; overflow-x: auto; }
}

@media (max-height: 640px) and (max-width: 767px) {
  .modal { max-height: calc(100dvh - 16px); }
}


.service-icon-image { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: 6px; }
.customer-service-icon .service-icon-image { border-radius: 6px; }
.confirm-line .service-icon-image,
.customer-checkout strong .service-icon-image,
.customer-order-head .service-icon-image,
.customer-service-copy .service-icon-image { width: 17px; height: 17px; display: inline-block; vertical-align: -3px; border-radius: 4px; }

/* -------------------------------------------------------------------------
   Redemption codes
   ------------------------------------------------------------------------- */
.redeem-guide-panel { align-self: start; }
.redeem-guide { display: grid; gap: 12px; }
.redeem-guide > div { display: grid; gap: 4px; border-bottom: 1px solid var(--border); padding-bottom: 11px; }
.redeem-guide > div:last-child { border-bottom: 0; padding-bottom: 0; }
.redeem-guide b { color: var(--text); font-size: 15px; }
.redeem-guide span { color: var(--text-muted); font-size: 14px; line-height: 1.65; }
.redeem-row-actions { display: inline-flex; gap: 5px; justify-content: flex-end; }
.redeem-status-cell { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.redeem-progress { display: grid; gap: 4px; min-width: 132px; }
.redeem-progress-track { height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.redeem-progress-track span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s ease; }
.redeem-progress small { color: var(--text-muted); font-family: "JetBrains Mono", monospace; font-size: 14px; }
.redeem-modal { width: min(620px, 100%); }
.redeem-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 14px; }
.redeem-summary > div { border: 1px solid var(--border); background: var(--bg-hover); border-radius: 8px; padding: 9px 10px; display: grid; gap: 3px; }
.redeem-summary span { color: var(--text-muted); font-size: 14px; }
.redeem-summary strong { font-family: "JetBrains Mono", monospace; font-size: 19px; font-weight: 500; }
.redeem-code-list {
  width: 100%; min-height: 190px; max-height: 40vh; resize: vertical; border: 1px solid var(--border);
  border-radius: 8px; padding: 11px; background: var(--bg-hover); color: var(--text);
  font-family: "JetBrains Mono", monospace; font-size: 16px; line-height: 1.75; outline: none;
}
.redeem-code-list:focus { border-color: var(--accent); }
.link-button { border: 0; background: none; color: var(--accent-hover); font-size: 14px; font-weight: 700; padding: 0; text-decoration: underline; }

.wallet-dashboard { display: grid; gap: 14px; }
.wallet-balance-card {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  border: 1px solid var(--border); background: var(--bg-surface); border-radius: 10px;
  padding: 18px 20px; box-shadow: none;
}
.wallet-balance-card > div:first-child { display: grid; gap: 5px; }
.wallet-balance-card span { color: var(--text-muted); font-size: 14px; }
.wallet-balance-card strong { font-family: "JetBrains Mono", monospace; font-size: 31px; font-weight: 500; letter-spacing: -.03em; }
.wallet-balance-actions { display: flex; gap: 7px; }
.redeem-box {
  border: 1px solid var(--border-strong); background: var(--accent-subtle); border-radius: 10px; padding: 17px 18px;
}
.redeem-box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.redeem-box-head h3 { font-size: 17px; }
.redeem-box-head p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }
.redeem-badge {
  flex: none; border-radius: 999px; background: var(--accent-subtle); color: var(--accent-hover);
  font-size: 14px; font-weight: 800; letter-spacing: .1em; padding: 5px 8px;
}
.recharge-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.recharge-option {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--border);
  background: var(--bg-surface); border-radius: 10px; padding: 14px 16px; text-align: left;
  box-shadow: none; transition: .15s ease;
}
.recharge-option:hover { border-color: var(--accent); background: var(--accent-subtle); }
.recharge-option-icon {
  width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent-subtle); color: var(--accent-hover); font-size: 22px; font-weight: 800;
}
.recharge-option-usdt .recharge-option-icon { background: var(--success-subtle); color: var(--success); }
.recharge-option-copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
.recharge-option-copy b { color: var(--text); font-size: 16px; }
.recharge-option-copy small { color: var(--text-muted); font-size: 14px; }
.recharge-option-arrow { color: var(--text-muted); font-size: 19px; }
.recharge-option:hover .recharge-option-arrow { color: var(--accent-hover); }
.redeem-form { display: flex; align-items: stretch; gap: 7px; margin-top: 13px; }
.redeem-form textarea {
  flex: 1; min-width: 0; min-height: 92px; resize: vertical; border: 1px solid var(--border);
  border-radius: 7px; padding: 10px 12px; background: var(--bg-surface); color: var(--text);
  font-family: "JetBrains Mono", monospace; font-size: 16px; line-height: 1.65;
  letter-spacing: .02em; outline: none; text-transform: uppercase;
}
.redeem-form textarea:focus { border-color: var(--accent); }
.redeem-form .btn { flex: none; align-self: flex-end; }
.redeem-result {
  margin-top: 13px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface); overflow: hidden;
}
.redeem-result-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 10px 12px; background: var(--bg-hover); border-bottom: 1px solid var(--border);
}
.redeem-result-head b { display: block; color: var(--text); font-size: 15px; }
.redeem-result-head small { display: block; color: var(--text-muted); font-size: 14px; margin-top: 3px; }
.redeem-result-close { border: 0; background: none; color: var(--text-muted); font-size: 19px; line-height: 1; padding: 0 2px; }
.redeem-result-list { max-height: 190px; overflow: auto; }
.redeem-result-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.redeem-result-row:last-child { border-bottom: 0; }
.redeem-result-row .mono { color: var(--text); word-break: break-all; }
.redeem-result-row span:last-child { flex: none; text-align: right; }
.wallet-history { border: 1px solid var(--border); background: var(--bg-surface); border-radius: 10px; padding: 17px 18px; }
.wallet-history .panel-header { margin-bottom: 11px; }

@media (max-width: 560px) {
  .wallet-balance-card { align-items: flex-start; flex-direction: column; }
  .recharge-options { grid-template-columns: 1fr; }
  .redeem-form { flex-direction: column; }
  .redeem-form .btn { width: 100%; }
  .redeem-summary { grid-template-columns: repeat(2, 1fr); }
  .redeem-row-actions { flex-wrap: wrap; }
}

/* Monetary values use proportional tabular figures instead of monospace. */
.balance-mini strong,
.hero-metric-value,
.kpi-value,
.legend-item strong,
.preview-card strong,
.pricing-table .price,
.pricing-table .retail,
.service-card-price,
.customer-balance strong,
.customer-service-card > strong,
.customer-country em b,
.customer-checkout-price > strong,
.topup-balance strong,
.topup-amount,
.wallet-balance-card strong,
.history-item > span b,
.redeem-summary strong,
.crypto-head strong {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-weight: 700;
  letter-spacing: 0;
}

/* Final responsive contract: desktop, tablet icon rail, mobile menu. */
@media (min-width: 1280px) { .sidebar { width: 240px; } .main { width: calc(100% - 240px); margin-left: 240px; } .customer-sidebar { width: 240px; flex-basis: 240px; } }
@media (min-width: 768px) and (max-width: 1279px) { .sidebar { width: 64px; } .main { width: calc(100% - 64px); margin-left: 64px; } .customer-sidebar { width: 64px; flex-basis: 64px; } }
@media (max-width: 767px) { .sidebar, .customer-sidebar { width: min(280px, 86vw); transform: translateX(-105%); } .sidebar.menu-open, .customer-sidebar.menu-open { transform: translateX(0); } .main { width: 100%; margin-left: 0; } }
.mobile-nav-scrim { display: none; position: fixed; inset: 56px 0 0; z-index: 11; border: 0; background: color-mix(in srgb, var(--text) 40%, transparent); }
.mobile-nav-scrim.show { display: block; }
@media (min-width: 768px) { .mobile-nav-scrim { display: none !important; } }
