:root {
  --bg: #050608;
  --surface: #080d12;
  --panel: #0d141b;
  --panel2: #111b24;
  --line: #26333d;
  --line-soft: rgba(255, 255, 255, .08);
  --text: #f5f7fa;
  --muted: #8d9aa7;
  --soft: #b8c3cc;
  --green: #30d158;
  --green2: #91f7b5;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --amber: #ffd60a;
  --red: #ff453a;
  --shadow: 0 18px 55px rgba(0, 0, 0, .34);
  --shadow-soft: 0 1px 0 rgba(255,255,255,.08) inset, 0 16px 45px rgba(0,0,0,.28);
  --r: 8px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% -18%, rgba(10, 132, 255, .10), transparent 34%),
    linear-gradient(180deg, #06080b 0%, #050608 46%, #030405 100%);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body.workbench-view {
  height: 100vh;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .012) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.72), rgba(0,0,0,.18));
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(76, 201, 216, .34);
  outline-offset: 2px;
}

.shell { min-height: 100vh; position: relative; z-index: 1; }

body.workbench-view .shell {
  height: 100vh;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  border-bottom: 1px solid rgba(80, 123, 136, .34);
  background: rgba(6, 12, 17, .86);
  backdrop-filter: blur(18px) saturate(130%);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .24);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
  font-weight: 850;
}

.logo,
.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: block;
  flex: 0 0 auto;
  object-fit: cover;
  color: #031411;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  box-shadow: 0 0 0 1px rgba(255,255,255,.10), 0 10px 24px rgba(50, 209, 127, .18);
}

.logo svg { width: 23px; height: 23px; }
.brand small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 700; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 18px; }

body.workbench-view .top {
  position: relative;
  top: auto;
}

body.workbench-view .wrap {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px 18px;
}

.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

body.invite-page {
  min-height: 100vh;
  overflow: auto;
}

.invite-top .btn {
  min-height: 38px;
}

.invite-wrap {
  width: min(980px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 46px 0 64px;
  display: grid;
  gap: 16px;
}

.invite-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
}

.invite-hero h1 {
  margin: 6px 0 10px;
  font-size: 38px;
  line-height: 1.06;
  letter-spacing: 0;
}

.invite-hero p {
  margin: 0;
  max-width: 640px;
  color: var(--soft);
  line-height: 1.75;
}

.invite-stock {
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 38px;
  display: grid;
  place-items: center;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(50, 209, 127, .42);
  background: rgba(50, 209, 127, .12);
  color: var(--green2);
  font-weight: 850;
}

.invite-stock.low {
  border-color: rgba(245, 187, 80, .45);
  background: rgba(245, 187, 80, .12);
  color: #ffd98a;
}

.invite-stock.empty,
.invite-stock.inactive {
  border-color: rgba(255, 108, 122, .4);
  background: rgba(255, 108, 122, .12);
  color: #ffb0b8;
}

.invite-card {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.invite-result {
  border: 1px solid rgba(98, 212, 232, .28);
  border-radius: var(--r);
  background: rgba(98, 212, 232, .08);
  padding: 18px;
  display: grid;
  gap: 8px;
}

.invite-code {
  width: 100%;
  overflow-wrap: anywhere;
  color: var(--green2);
  font-size: 28px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0;
}

.invite-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.invite-actions .btn {
  min-height: 44px;
}

.disabled-link {
  pointer-events: none;
  opacity: .55;
}

.invite-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.invite-rule {
  padding: 18px;
  display: grid;
  gap: 8px;
}

.invite-rule strong {
  font-size: 17px;
}

.invite-rule span {
  color: var(--muted);
  line-height: 1.65;
}

.card,
.intro-panel,
.auth-card,
.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012)),
    linear-gradient(180deg, rgba(18, 33, 41, .96), rgba(8, 18, 24, .96));
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.navbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
}

.lang-toggle {
  min-width: 72px;
  justify-content: center;
  letter-spacing: 0;
  white-space: nowrap;
}

.actions .lang-toggle {
  order: 90;
}

.navbtn svg,
.btn svg,
.support-widget svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 390px;
  gap: 18px;
  align-items: stretch;
}

.login-art {
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 30px;
  background:
    linear-gradient(135deg, rgba(98, 212, 232, .14), transparent 34%),
    linear-gradient(180deg, rgba(18, 33, 41, .98), rgba(8, 18, 24, .98));
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 8px 12px 8px 8px;
  background: rgba(255,255,255,.04);
  font-weight: 900;
}

.brand-badge img { width: 32px; height: 32px; border-radius: 8px; }
.login-art h1 { margin: 22px 0 0; font-size: 52px; line-height: 1.05; }
.login-art p { max-width: 720px; color: var(--muted); line-height: 1.7; font-size: 16px; }
.login-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
.login-steps span { border: 1px solid var(--line-soft); border-radius: 8px; padding: 13px; color: var(--soft); background: rgba(4,15,20,.62); font-weight: 850; }

.legal-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.legal-line label { display: inline-flex; align-items: center; gap: 8px; }
.legal-line input { width: 18px; height: 18px; accent-color: var(--green); }

.workbench {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

body.workbench-view .workbench {
  height: 100%;
  min-height: 0;
  grid-template-columns: minmax(310px, 360px) minmax(0, 1fr);
  align-items: stretch;
}

.selector-panel {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 16px;
}

body.workbench-view .selector-panel {
  position: static;
  top: auto;
  min-height: 0;
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
}

body.workbench-view .selector-panel .field.section {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.side-head strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.service-list,
.country-list {
  display: grid;
  gap: 8px;
}

.country-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

body.workbench-view .country-list {
  max-height: none;
  min-height: 0;
}

.pick-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px;
  color: var(--text);
  background: rgba(4, 15, 20, .62);
  text-align: left;
}

.pick-row.active {
  border-color: rgba(50,209,127,.72);
  background: rgba(50,209,127,.10);
}

.pick-row strong,
.pick-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }

.service-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #031411;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-weight: 950;
}

.market-panel { min-width: 0; }

body.workbench-view .market-panel {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  padding-bottom: 92px;
  scrollbar-gutter: stable;
}

body.workbench-view .trade-header h2 { font-size: 28px; }
body.workbench-view .trade-modes { margin-top: 8px; }
body.workbench-view .mode-card { gap: 8px; padding: 10px; }
body.workbench-view .active-order-table {
  overflow-x: visible;
}

body.workbench-view .active-order-table .orders-table,
.compact-orders {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.compact-orders th:nth-child(1),
.compact-orders td:nth-child(1) { width: 156px; }
.compact-orders th:nth-child(3),
.compact-orders td:nth-child(3) { width: 118px; }
.compact-orders th:nth-child(4),
.compact-orders td:nth-child(4) { width: 124px; }
.compact-orders th:nth-child(5),
.compact-orders td:nth-child(5) { width: 210px; }

.compact-orders td {
  min-width: 0;
}

.compact-orders td:not(:last-child) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-actions {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-content: stretch;
  width: 100%;
  pointer-events: auto;
}

.compact-actions .btn.sm {
  min-height: 34px;
  padding: 7px 8px;
  justify-content: center;
  white-space: nowrap;
}

.active-order-list {
  display: grid;
  gap: 8px;
}

.active-order-row {
  padding: 10px;
}

.active-order-main {
  display: grid;
  grid-template-columns: minmax(132px, .8fr) minmax(150px, 1fr) minmax(96px, .58fr) minmax(112px, .64fr) minmax(184px, .95fr);
  align-items: center;
  gap: 8px;
}

.active-status,
.active-phone,
.active-code,
.active-expire {
  min-width: 0;
}

.active-status strong,
.active-status small,
.active-phone strong,
.active-phone small,
.active-code small,
.active-expire small {
  display: block;
}

.active-status strong {
  margin-top: 5px;
}

.active-status small,
.active-phone small,
.active-code small,
.active-expire small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.active-phone strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  position: relative;
  z-index: 3;
}

.active-actions .btn.sm {
  min-height: 36px;
  padding: 7px 8px;
  justify-content: center;
  white-space: nowrap;
}

.active-detail {
  margin-top: 9px;
}

.trade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.trade-header h2 {
  margin: 0;
  font-size: 30px;
}

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

.order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.order-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.order-tabs button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--soft);
  background: rgba(4, 15, 20, .68);
  font-weight: 850;
}

.order-tabs button.active {
  color: #031411;
  border-color: transparent;
  background: var(--green);
}

.order-search-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 110px;
  gap: 10px;
  margin: 0 0 12px;
}

.order-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 13, 18, .62);
}

.orders-table {
  min-width: 980px;
}

.orders-table th {
  text-transform: none;
}

.orders-table td {
  padding: 9px 10px;
  vertical-align: middle;
}

.orders-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.orders-table .timer.small {
  font-size: 15px;
}

.inline-code {
  border: 1px solid rgba(50, 209, 127, .35);
  border-radius: 7px;
  padding: 6px 8px;
  color: var(--green2);
  background: rgba(50, 209, 127, .08);
  font-weight: 900;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: relative;
  z-index: 4;
}

.table-actions .btn.sm {
  min-height: 36px;
  min-width: 78px;
  pointer-events: auto;
}

.order-detail-row td {
  padding: 0 10px 10px;
  background: rgba(98, 212, 232, .025);
}

.order-detail-panel {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(280px, 1.1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(4, 15, 20, .72);
}

.detail-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.detail-text {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(3, 13, 18, .55);
}

.detail-text span,
.detail-text small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-text code,
.detail-text p {
  display: block;
  margin: 6px 0 0;
  color: var(--soft);
  white-space: normal;
  overflow-wrap: anywhere;
}

.receive-limit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.limit-card {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  background: rgba(4, 15, 20, .72);
  text-align: left;
}

.limit-card.active {
  border-color: rgba(50, 209, 127, .82);
  background: rgba(50, 209, 127, .13);
}

.limit-card strong,
.limit-card span {
  display: block;
}

.limit-card strong {
  font-size: 22px;
}

.limit-card span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.receive-limit-control {
  display: grid;
  grid-template-columns: minmax(190px, .72fr) minmax(260px, 1.28fr);
  gap: 10px;
  align-items: stretch;
}

.fee-note {
  border: 1px solid rgba(244, 183, 64, .36);
  border-radius: 8px;
  padding: 12px;
  background: rgba(244, 183, 64, .08);
  color: var(--soft);
  line-height: 1.55;
}

.fee-note strong,
.fee-note span {
  display: block;
}

.fee-note span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.active-orders {
  display: grid;
  gap: 14px;
}

.active-bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
}

.active-bulkbar strong,
.active-bulkbar span {
  display: block;
}

.active-bulkbar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.featured-order { border-color: rgba(98,212,232,.44); }

.order-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.order-meta div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: rgba(4, 15, 20, .52);
}

.order-meta span,
.number-box span,
.sms-box span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.order-meta strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.order-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.sms-box em { display: block; margin-top: 7px; color: var(--muted); font-style: normal; }

.api-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  margin: 16px auto 0;
}

.api-top h1 {
  margin: 2px 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.api-layout {
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 14px;
  max-width: 1240px;
  margin: 16px auto 0;
}

.api-shell {
  max-width: 1240px;
  margin: 16px auto 0;
  padding: 14px;
}

.api-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.api-tabs button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(5, 20, 26, .78);
  font-weight: 900;
  cursor: pointer;
}

.api-tabs button.active {
  color: #031411;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), #21c5a1);
  box-shadow: 0 12px 28px rgba(50, 209, 127, .16);
}

.api-tab-panel { display: none; }
.api-tab-panel.active { display: block; }

.api-layout.compact {
  max-width: none;
  margin: 0;
}

.api-docs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-card,
.api-status-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), transparent),
    rgba(10, 26, 32, .88);
  box-shadow: var(--shadow);
}

.api-card-wide { grid-column: 1 / -1; }

.mini-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mini-title span {
  color: var(--text);
  font-weight: 900;
  font-size: 16px;
}

.mini-title strong {
  color: var(--muted);
  font-size: 12px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--cyan));
}

.api-key-create {
  margin-top: 12px;
}

.api-key-cards {
  display: grid;
  gap: 10px;
}

.api-key-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(78, 116, 128, .34);
  border-radius: 8px;
  background: rgba(4, 15, 20, .7);
}

.api-key-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.api-key-name {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.compact-name {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 12px;
}

.api-key-preview {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  color: var(--text);
  background: rgba(2, 12, 16, .7);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.api-stat-pill {
  min-height: 58px;
  padding: 8px 9px;
  border: 1px solid rgba(78, 116, 128, .36);
  border-radius: 8px;
  background: rgba(7, 22, 28, .72);
}

.api-stat-pill span,
.api-status-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.api-stat-pill strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
}

.api-stat-pill small {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.api-status-cell {
  display: grid;
  gap: 5px;
  min-width: 92px;
}

.api-key-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.tab-strip button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 13px;
  color: var(--soft);
  background: rgba(23, 49, 58, .72);
  font-weight: 900;
  cursor: pointer;
}

.tab-strip button.active {
  color: #041612;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), #21c5a1);
}

.compact-filter {
  align-items: end;
  margin-bottom: 8px;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.mini-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.mini-inline {
  display: grid;
  gap: 4px;
  color: var(--soft);
  font-size: 12px;
  font-weight: 850;
}

.setting-inline {
  display: grid;
  gap: 6px;
  min-width: 110px;
}

.user-setting-cell {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 1fr);
  gap: 8px;
  min-width: 340px;
  align-items: center;
}

.user-setting-cell .tiny-select,
.user-setting-cell .btn {
  width: 100%;
}

.tiny-select {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.codeblock {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 14px;
  color: var(--soft);
  background: rgba(3, 13, 18, .82);
  overflow: auto;
  line-height: 1.6;
}

.compact-code { padding: 12px; }

.endpoint-list,
.rule-list,
.limit-list {
  display: grid;
  gap: 8px;
}

.endpoint-list div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1.2fr) minmax(120px, .8fr) 46px;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(3, 13, 18, .56);
}

.endpoint-list b {
  color: var(--green);
  font-size: 12px;
}

.endpoint-list code,
.url-format code,
.response-grid code {
  color: var(--soft);
  overflow-wrap: anywhere;
}

.endpoint-list span,
.endpoint-list em,
.rule-list span,
.limit-list span,
.unlock-line span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.endpoint-list em {
  font-style: normal;
  text-align: right;
}

.auth-examples {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-examples code {
  display: block;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--soft);
  background: rgba(3, 13, 18, .62);
  overflow-wrap: anywhere;
}

.url-format {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(3, 13, 18, .62);
}

.response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.response-grid div,
.limit-list div,
.rule-list span {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(3, 13, 18, .52);
}

.response-grid span,
.limit-list span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.response-grid small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.unlock-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 6px;
}

.unlock-line strong {
  color: var(--text);
  font-size: 13px;
}

.limit-list { margin-top: 14px; }

.limit-list strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.flat {
  box-shadow: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .028), transparent),
    rgba(12, 28, 35, .94);
}
.section { margin-top: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions.end { justify-content: flex-end; }
.top .actions { justify-content: flex-end; overflow-x: auto; max-width: calc(100vw - 250px); padding-bottom: 2px; }

.top .actions .btn.secondary {
  border-color: rgba(255, 255, 255, .08);
  background: rgba(9, 15, 20, .84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.top .actions .btn.secondary:hover {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(17, 25, 32, .95);
}

.top .actions .btn.secondary.navbtn,
.top .actions .btn.secondary.lang-toggle {
  min-height: 38px;
  border-radius: 999px;
}

.top .actions .btn.secondary.navbtn.active,
.top .actions .btn.secondary.lang-toggle.active {
  color: #f6fbff;
  border-color: rgba(10, 132, 255, .34);
  background: linear-gradient(180deg, rgba(24, 39, 54, .98), rgba(12, 17, 24, .98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 12px 26px rgba(10, 132, 255, .10);
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--soft);
  background: rgba(4, 15, 20, .62);
}

.iconbtn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.batch-field {
  display: grid;
  grid-template-columns: auto 94px;
  align-items: center;
  gap: 10px;
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.batch-field .input {
  height: 38px;
  text-align: center;
}

.buy-mode-card {
  min-height: 0;
}

.buy-mode-card .offer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.buy-mode-card .offer-top strong,
.buy-mode-card .offer-hint {
  display: block;
  min-width: 0;
}

.buy-mode-card .offer-hint {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.buy-mode-card .buy-controls {
  display: grid;
  grid-template-columns: minmax(118px, auto) 96px minmax(130px, 1fr);
  align-items: end;
  gap: 8px;
}

.buy-mode-card .price-line {
  font-size: 27px;
}

.buy-mode-card .batch-field {
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 0;
}

.buy-mode-card .batch-field .input {
  height: 36px;
}

.buy-mode-card .btn.wide {
  min-height: 38px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 10, .68);
  backdrop-filter: blur(10px);
}

.confirm-card {
  width: min(560px, 100%);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
}

.confirm-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.confirm-summary div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: rgba(3, 13, 18, .58);
}

.confirm-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.confirm-summary strong { overflow-wrap: anywhere; }

.auth-layout,
.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 380px;
  gap: 16px;
  align-items: stretch;
}

.admin-auth { grid-template-columns: minmax(0, 1.2fr) 420px; }

.intro-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 520px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(135deg, rgba(50, 209, 127, .12), transparent 34%),
    linear-gradient(180deg, rgba(18, 33, 41, .98), rgba(8, 18, 24, .98));
}

.intro-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, var(--green), var(--cyan), var(--amber));
  opacity: .78;
}

.intro-panel > * {
  position: relative;
  z-index: 1;
}

.intro-panel h1,
.search-card h2,
.legal-page h2 {
  margin: 0;
  font-size: 38px;
  line-height: 1.08;
  max-width: 860px;
}

.search-card h2 { font-size: 28px; }
.intro-panel p, .muted { color: var(--muted); line-height: 1.58; }
.metric { font-size: 30px; font-weight: 880; line-height: 1.08; }
.metric.small { font-size: 24px; }
.label { color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.subtle { color: var(--soft); margin-top: 7px; }

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h3,
.section-title p { margin: 0; }
.section-title p { color: var(--muted); line-height: 1.5; }

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 750;
}

.auth-card .field { cursor: text; }
.auth-card .field > span { pointer-events: none; }
.auth-card .input {
  display: block;
  min-height: 56px;
  line-height: normal;
  position: relative;
  z-index: 2;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
}

.field .seg { width: 100%; }
.field .seg button { flex: 1; min-height: 40px; }
.input.mini { min-width: 98px; min-height: 36px; padding: 7px 9px; font-size: 12px; }
.mini-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); font-size: 12px; }
.mini-check input { accent-color: var(--green); }

.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(4, 14, 19, .86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055);
}

.input::placeholder { color: #708985; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  color: #02120f;
  background: linear-gradient(135deg, var(--green), #21c5a1);
  font-weight: 900;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 12px 28px rgba(50, 209, 127, .18);
}

.btn.secondary {
  color: var(--text);
  background: rgba(23, 49, 58, .72);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}

.btn.secondary.active {
  color: #031411;
  background: var(--green);
  border-color: transparent;
}

.btn.warn { color: #1c1100; background: var(--amber); }
.btn.bad { color: #270606; background: var(--red); }
.btn.wide, .wide { width: 100%; }
.btn.sm { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.form-btn { align-self: end; min-width: 120px; }
.auth-card .btn.wide { min-height: 56px; }

.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 13, 18, .82);
}

.seg button {
  border: 0;
  border-radius: 6px;
  padding: 8px 11px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

.seg button.active {
  color: #031411;
  background: var(--green);
}

.auth-card { align-self: start; }
.auth-tabs { width: 100%; }
.auth-tabs button { flex: 1; min-height: 56px; }

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.checkline input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green); }
.fineprint { margin: 13px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.linkbtn { border: 0; padding: 0; color: var(--green2); background: transparent; font-weight: 850; text-decoration: underline; }

.refund-warning {
  margin-top: 12px;
  border: 1px solid rgba(244, 183, 64, .36);
  border-radius: 8px;
  padding: 11px 12px;
  color: #ffe0a6;
  background: rgba(244, 183, 64, .10);
  line-height: 1.5;
}

.refund-warning strong {
  display: block;
  margin-bottom: 4px;
  color: #fff1c7;
}

.refund-warning span {
  display: block;
  color: #f4d79b;
  font-size: 12px;
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.trust-grid div,
.guide-step,
.number-box,
.sms-box {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.028), transparent),
    rgba(5, 18, 24, .68);
  padding: 12px;
}

.trust-grid strong,
.trust-grid span,
.guide-step strong,
.guide-step span { display: block; }

.trust-grid span,
.guide-step span { margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.guide { width: 100%; }
.guide-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.guide-compact .guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guide-step b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  margin-bottom: 8px;
  color: #031411;
  background: var(--green);
}

.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.pill.ok { color: var(--green2); border-color: rgba(40, 209, 124, .42); background: rgba(40, 209, 124, .08); }
.pill.warn { color: var(--amber); border-color: rgba(244, 183, 64, .42); background: rgba(244, 183, 64, .08); }
.pill.bad { color: var(--red); border-color: rgba(255, 107, 107, .42); background: rgba(255, 107, 107, .08); }
.account-pill {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-input { margin-top: 2px; }

.country-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 8px;
  align-items: center;
}

.country-tools .compact-select {
  width: 100%;
  min-width: 0;
}

.list-note {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
  background: rgba(4, 15, 20, .46);
  font-size: 12px;
  line-height: 1.45;
}

.list-more {
  min-height: 42px;
  border: 1px solid rgba(50, 209, 127, .38);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--green2);
  background: rgba(50, 209, 127, .08);
  font-weight: 900;
  text-align: center;
}

.list-more:hover {
  border-color: rgba(50, 209, 127, .68);
  background: rgba(50, 209, 127, .13);
}

.tablewrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(4, 13, 18, .58);
}

table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 13px 10px; border-bottom: 1px solid rgba(78, 116, 128, .26); text-align: left; vertical-align: top; font-size: 13px; }
th { color: var(--muted); background: rgba(5, 18, 24, .92); font-size: 11px; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(98, 212, 232, .035); }

.timer { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 850; color: var(--cyan); }
.mono { font-family: "SF Mono", Consolas, "Liberation Mono", monospace; }
.code { display: inline-block; margin-top: 6px; font-size: 24px; color: var(--green2); }
.number-box, .sms-box { margin-top: 12px; }
.number-box strong { display: block; margin-top: 7px; font-size: 20px; overflow-wrap: anywhere; }
.phone-card strong { font-size: 24px; color: var(--text); }
.number-head,
.active-phone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.number-head span,
.active-phone-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.phone-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.number-box.compact strong { font-size: 12px; line-height: 1.45; color: var(--soft); word-break: break-all; }
.sms-box p { margin: 8px 0; color: var(--soft); line-height: 1.5; overflow-wrap: anywhere; }
.block { display: block; margin-top: 8px; }
.copy-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.copy-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
  background: rgba(4, 15, 20, .46);
}

.copy-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.copy-seg,
.bulk-copy-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.copy-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(23, 49, 58, .72);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.copy-mini svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  flex: 0 0 auto;
}

.copy-mini:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(50, 209, 127, .24);
  border-radius: 999px;
  color: var(--green2);
  background: rgba(50, 209, 127, .09);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  flex: 0 0 auto;
}

.copy-chip:hover {
  border-color: rgba(10, 132, 255, .34);
  color: #dff0ff;
  background: rgba(10, 132, 255, .10);
}

.copy-chip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  flex: 0 0 auto;
}

.bulk-copy-actions .btn {
  min-height: 44px;
  white-space: nowrap;
}
.buy-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }

.offer-stack {
  display: grid;
  gap: 12px;
}

.offer-compare {
  padding: 16px;
}

.country-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.flag {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
  font-size: 24px;
}

.country-head strong,
.country-head small {
  display: block;
}

.country-head small {
  margin-top: 3px;
  color: var(--muted);
}

.country-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.country-section-head span {
  display: block;
  color: var(--soft);
  font-size: 13px;
  font-weight: 850;
}

.country-section-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.country-refresh {
  align-self: center;
  min-width: 92px;
  border-radius: 999px;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mode-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  background: rgba(4, 15, 20, .62);
}

.mode-card.disabled {
  opacity: .68;
}

.price-line {
  color: var(--green2);
  font-size: 26px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.mode-card small {
  min-height: 0;
  color: var(--muted);
  line-height: 1.45;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 142px;
}

.metric-card.tone-warn { border-color: rgba(244, 183, 64, .38); }
.metric-card.tone-bad { border-color: rgba(255, 108, 122, .38); }

.admin-dashboard {
  display: grid;
  gap: 14px;
}

.admin-dashboard .dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(50,209,127,.14), transparent 34%),
    linear-gradient(180deg, rgba(19, 35, 43, .98), rgba(8, 18, 24, .98));
  box-shadow: var(--shadow-soft);
}

.admin-dashboard .dashboard-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.admin-dashboard .dashboard-head .muted {
  max-width: 760px;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-kpi {
  min-width: 0;
  min-height: 96px;
  border: 1px solid rgba(78, 116, 128, .32);
  border-radius: 8px;
  padding: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.034), transparent),
    rgba(5, 18, 24, .72);
}

.dashboard-kpi span,
.dashboard-kpi small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.dashboard-kpi strong {
  display: block;
  margin: 7px 0 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-kpi.tone-ok { border-color: rgba(50, 209, 127, .34); }
.dashboard-kpi.tone-info { border-color: rgba(98, 212, 232, .34); }
.dashboard-kpi.tone-warn { border-color: rgba(244, 183, 64, .46); background: rgba(42, 31, 12, .42); }
.dashboard-kpi.tone-bad { border-color: rgba(255, 108, 122, .42); }

.dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, .75fr);
  gap: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 12px;
}

.dashboard-card {
  min-width: 0;
  padding: 14px;
}

.dashboard-trend {
  min-height: 318px;
}

.trend-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.trend-summary-strip span {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(4, 15, 20, .56);
}

.trend-summary-strip small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.trend-summary-strip strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
}

.admin-trend-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(20px, 1fr));
  gap: 9px;
  align-items: end;
  height: 180px;
  padding: 16px 4px 20px;
}

.admin-trend-day {
  position: relative;
  display: flex;
  gap: 2px;
  align-items: end;
  min-width: 0;
  height: 100%;
}

.admin-trend-day small {
  position: absolute;
  right: -4px;
  bottom: -18px;
  left: -4px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.trend-bar {
  display: block;
  flex: 1 1 0;
  height: var(--h, 2%);
  min-height: 2px;
  border-radius: 999px 999px 2px 2px;
}

.trend-bar.topup { background: linear-gradient(180deg, #8ab4ff, #3b82f6); }
.trend-bar.net { background: linear-gradient(180deg, #85f2bf, #32d17f); }
.trend-bar.refund { background: linear-gradient(180deg, #ffd68a, #f4b740); }

.admin-trend-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.trend-day-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 10px;
  background: rgba(5, 8, 13, .72);
}

.trend-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.trend-day-head strong {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.trend-day-head span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.trend-amount-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 70px 42px;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.trend-amount-line span,
.trend-amount-line small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.trend-amount-line strong {
  color: var(--text);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.trend-amount-line small {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.trend-meter {
  height: 6px;
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.trend-meter i {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: inherit;
}

.trend-amount-line.topup .trend-meter i { background: #0a84ff; }
.trend-amount-line.net .trend-meter i { background: #30d158; }
.trend-amount-line.refund .trend-meter i { background: #ffd60a; }

.receive-stats-card {
  display: grid;
  gap: 12px;
}

.receive-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.receive-stat-strip span {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 9px 10px;
  background: rgba(5, 8, 13, .62);
}

.receive-stat-strip small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.receive-stat-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.receive-bucket-list {
  display: grid;
  gap: 9px;
}

.receive-bucket {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.receive-bucket > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.receive-bucket strong {
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.receive-bucket span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.receive-bucket i {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.receive-bucket i::before {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: inherit;
  content: "";
}

.receive-bucket i.warn::before { background: #ffd60a; }
.receive-bucket i.one::before { background: #0a84ff; }
.receive-bucket i.two::before { background: #64d2ff; }
.receive-bucket i.three::before { background: #30d158; }

.action-list,
.dashboard-row-list {
  display: grid;
  gap: 8px;
}

.agent-admin-page,
.agent-top-grid,
.agent-summary-grid,
.agent-list,
.agent-form,
.agent-mini-grid {
  min-width: 0;
}

.agent-admin-page {
  display: grid;
  gap: 14px;
}

.agent-top-grid {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 12px;
}

.agent-create-card,
.agent-summary-card,
.agent-board {
  padding: 16px;
}

.agent-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.agent-form .form-btn {
  grid-column: 1 / -1;
  justify-self: start;
  min-width: 180px;
}

.agent-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.agent-summary-item {
  border: 1px solid rgba(78, 116, 128, .36);
  border-radius: 8px;
  padding: 10px;
  background: rgba(4, 15, 20, .62);
}

.agent-summary-item span,
.agent-summary-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.agent-summary-item strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}

.agent-list {
  display: grid;
  gap: 8px;
}

.agent-name-cell,
.agent-stat-cell,
.agent-money-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.agent-num,
.agent-money-only {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-money-only {
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.agent-name-cell strong,
.agent-stat-cell strong,
.agent-money-cell strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-name-cell small,
.agent-name-cell span,
.agent-stat-cell span,
.agent-money-cell span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-name-cell span {
  width: fit-content;
  border: 1px solid rgba(50, 209, 127, .28);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--soft);
}

.agent-status-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.agent-status-cell .btn {
  min-width: 58px;
}

.agent-rate-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  height: 26px;
  border: 1px solid rgba(50, 209, 127, .28);
  border-radius: 999px;
  padding: 0 8px;
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-api-table-wrap table {
  min-width: 900px;
  table-layout: fixed;
}

.admin-api-table-wrap th:nth-child(1),
.admin-api-table-wrap td:nth-child(1) { width: 29%; }
.admin-api-table-wrap th:nth-child(2),
.admin-api-table-wrap td:nth-child(2) { width: 13%; }
.admin-api-table-wrap th:nth-child(3),
.admin-api-table-wrap td:nth-child(3) { width: 18%; }
.admin-api-table-wrap th:nth-child(4),
.admin-api-table-wrap td:nth-child(4) { width: 18%; }
.admin-api-table-wrap th:nth-child(5),
.admin-api-table-wrap td:nth-child(5) { width: 8%; }
.admin-api-table-wrap th:nth-child(6),
.admin-api-table-wrap td:nth-child(6) { width: 14%; }

.admin-api-key-cell,
.admin-api-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-api-key-cell strong,
.admin-api-stat strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-api-key-cell span,
.admin-api-stat span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-row-card {
  display: grid;
  grid-template-columns: minmax(130px, .85fr) minmax(210px, 1.15fr) minmax(210px, 1.15fr) minmax(150px, .78fr) minmax(82px, auto);
  gap: 10px;
  align-items: stretch;
  border: 1px solid rgba(78, 116, 128, .32);
  border-radius: 10px;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.028), transparent),
    rgba(4, 15, 20, .68);
}

.agent-identity,
.agent-metric-panel,
.agent-commission-panel,
.agent-row-actions {
  min-width: 0;
}

.agent-identity {
  display: grid;
  align-content: center;
  gap: 4px;
}

.agent-identity strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-identity small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-identity span {
  width: fit-content;
  border: 1px solid rgba(50, 209, 127, .34);
  border-radius: 999px;
  padding: 2px 7px;
  color: var(--soft);
  font-size: 11px;
}

.agent-metric-panel {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 8px;
  background: rgba(2, 12, 16, .48);
}

.agent-metric-panel > b {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.agent-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.agent-mini-grid span {
  min-width: 0;
}

.agent-mini-grid small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.agent-mini-grid strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-commission-panel {
  display: grid;
  align-content: center;
  border: 1px solid rgba(50, 209, 127, .22);
  border-radius: 8px;
  padding: 9px;
  background: rgba(2, 21, 16, .36);
}

.agent-commission-panel small,
.agent-commission-panel span,
.agent-commission-panel em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.agent-commission-panel strong {
  margin: 2px 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  white-space: nowrap;
}

.agent-row-actions {
  display: grid;
  align-content: center;
  justify-items: end;
  gap: 8px;
}

.action-row {
  display: grid;
  grid-template-columns: 10px minmax(92px, .72fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(4, 15, 20, .62);
  text-align: left;
}

.action-row small {
  color: var(--muted);
  line-height: 1.35;
}

.action-row b {
  justify-self: end;
  color: var(--soft);
  font-size: 12px;
}

.action-row.tone-warn { border-color: rgba(244, 183, 64, .36); }
.action-row.tone-bad { border-color: rgba(255, 108, 122, .36); }

.dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(4, 15, 20, .56);
}

.dashboard-row span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-row strong {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dashboard-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.dashboard-price-grid,
.dashboard-protection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.finance-board {
  padding: 14px;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.finance-metric {
  min-width: 0;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(4, 15, 20, .58);
}

.finance-metric span,
.finance-metric small {
  display: block;
  color: var(--muted);
}

.finance-metric strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--text);
  font-size: 21px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.finance-metric small {
  min-height: 0;
  line-height: 1.45;
}

.finance-metric.tone-ok { border-color: rgba(50, 209, 127, .34); }
.finance-metric.tone-warn { border-color: rgba(244, 183, 64, .42); }
.finance-metric.tone-bad { border-color: rgba(255, 108, 122, .44); }
.finance-metric.tone-info { border-color: rgba(76, 201, 216, .34); }

.finance-detail-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1.25fr) repeat(3, minmax(210px, .72fr));
  gap: 10px;
  margin-top: 12px;
  align-items: start;
}

.finance-panel {
  min-width: 0;
  max-height: 360px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(6, 20, 27, .54);
  overflow: hidden;
}

.finance-panel.chart-panel {
  max-height: 290px;
}

.finance-panel .section-title {
  gap: 8px;
}

.finance-panel .section-title h3 {
  font-size: 20px;
}

.finance-scroll {
  max-height: 250px;
  overflow: auto;
  padding-right: 4px;
  overscroll-behavior: contain;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(18px, 1fr));
  gap: 7px;
  align-items: end;
  height: 118px;
  padding: 8px 2px 0;
}

.bar-day {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: 1fr auto;
  gap: 2px;
  align-items: end;
  min-width: 0;
  height: 100%;
}

.bar-day small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}

.bar {
  display: block;
  min-height: 2px;
  border-radius: 999px 999px 2px 2px;
}

.bar.topup { background: linear-gradient(180deg, #8ab4ff, #3b82f6); }
.bar.net { background: linear-gradient(180deg, #85f2bf, #32d17f); }
.bar.refund { background: linear-gradient(180deg, #ffd68a, #f4b740); }

.chart-legend {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.chart-legend i.topup { background: #3b82f6; }
.chart-legend i.net { background: #32d17f; }
.chart-legend i.refund { background: #f4b740; }

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--text);
  background: rgba(4, 15, 20, .42);
  text-align: left;
}

.mini-row.clickable {
  cursor: pointer;
}

.mini-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-row strong {
  font-variant-numeric: tabular-nums;
}

.mini-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-rail {
  position: sticky;
  top: 96px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--r);
  background:
    linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.018)),
    rgba(9, 18, 24, .92);
  box-shadow: var(--shadow-soft);
  padding: 12px;
}

.rail-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.rail-title strong,
.rail-title small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.rail-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  color: #02120f;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(50,209,127,.18);
}

.rail-nav {
  display: grid;
  gap: 6px;
  padding-top: 12px;
}

.rail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  width: 100%;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 9px 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.rail-item span,
.rail-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rail-item span { font-weight: 900; }
.rail-item small { color: var(--muted); font-size: 12px; }

.rail-item:hover {
  border-color: rgba(98, 212, 232, .25);
  background: rgba(255,255,255,.045);
}

.rail-item.active {
  color: #02120f;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), #43d8c7);
  box-shadow: 0 12px 28px rgba(50,209,127,.20);
}

.rail-item.active small { color: rgba(2,18,15,.72); }

.admin-content {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.admin-content > .card,
.admin-content > .grid,
.admin-content > .admin-hero,
.admin-content > .section {
  min-width: 0;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.012)),
    radial-gradient(circle at top right, rgba(50,209,127,.16), transparent 36%),
    linear-gradient(180deg, rgba(18,33,41,.98), rgba(8,18,24,.98));
  box-shadow: var(--shadow-soft);
}

.admin-hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 14px;
}

.status-list,
.recent-list,
.kv-grid,
.price-snapshot {
  display: grid;
  gap: 10px;
}

.status-item,
.recent-row {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(4, 15, 20, .62);
  text-align: left;
}

.status-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.status-item strong,
.status-item small,
.recent-row strong,
.recent-row small {
  display: block;
}

.status-item small,
.recent-row small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.4;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
}

.status-dot.warn { background: var(--amber); }
.status-dot.bad { background: var(--red); }

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

.snapshot-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 15, 20, .62);
}

.snapshot-card small,
.snapshot-card span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.muted-box { opacity: .72; }

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

.kv-grid div {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 15, 20, .62);
}

.kv-grid span,
.kv-grid strong {
  display: block;
}

.kv-grid span {
  color: var(--muted);
  font-size: 12px;
}

.kv-grid strong {
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.recent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.compact-empty {
  padding: 12px;
}

.compact-filter {
  margin-bottom: 14px;
  align-items: end;
}

.wallet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(98, 212, 232, .13), transparent 36%),
    linear-gradient(180deg, rgba(18,33,41,.98), rgba(8,18,24,.98));
  box-shadow: var(--shadow);
}

.wallet-hero h1 {
  margin: 0;
  font-size: 46px;
  line-height: 1;
  font-weight: 930;
}

.wallet-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) 380px;
  gap: 14px;
}

.recharge-shell {
  padding: 16px;
  overflow: hidden;
  max-width: 1120px;
  margin: 0 auto;
}

.recharge-title {
  align-items: center;
  margin-bottom: 14px;
}

.recharge-title h1 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.08;
  font-weight: 950;
}

.recharge-grid {
  display: grid;
  grid-template-columns: minmax(240px, .72fr) minmax(320px, 1.28fr);
  gap: 12px;
  align-items: stretch;
}

.recharge-left {
  display: grid;
  gap: 12px;
}

.balance-card,
.method-card,
.topup-card,
.current-payment {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(4, 15, 20, .62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045);
}

.balance-card,
.method-card,
.topup-card {
  padding: 14px;
}

.balance-card span,
.balance-card small,
.pending-order span,
.pending-order small,
.min-pay-box span,
.min-pay-box small {
  display: block;
}

.balance-card span,
.pending-order span,
.min-pay-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.balance-card strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
  font-weight: 950;
}

.balance-card small,
.pending-order small,
.min-pay-box small {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.55;
}

.method-card h3,
.topup-card h3,
.current-payment h3 {
  margin: 0;
}

.method-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.method-pill {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--soft);
  background: rgba(8, 24, 31, .92);
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  text-align: center;
}

.method-pill span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  color: #06130f;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-size: 12px;
  font-weight: 950;
  flex: 0 0 auto;
}

.method-pill b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.method-pill.active {
  color: var(--text);
  border-color: rgba(50, 209, 127, .66);
  background: linear-gradient(180deg, rgba(50, 209, 127, .20), rgba(50, 209, 127, .08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 10px 24px rgba(50,209,127,.12);
}

.method-pill.disabled {
  color: var(--amber);
  border-color: rgba(244, 183, 64, .34);
  background: rgba(244, 183, 64, .08);
  cursor: default;
}

.method-card p,
.current-payment p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.topup-card {
  display: flex;
  flex-direction: column;
}

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

.topup-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.topup-submit {
  min-height: 46px;
  position: relative;
  z-index: 2;
}

.topup-card .form-error {
  margin-top: 10px;
}

.current-payment {
  display: grid;
  grid-template-columns: minmax(220px, .45fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px;
  margin-top: 10px;
}

.pending-payment {
  min-width: 0;
}

.pending-empty,
.pending-order {
  min-height: 84px;
  border: 1px dashed var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(8, 24, 31, .62);
}

.pending-empty {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--muted);
  line-height: 1.55;
}

.pending-empty strong {
  color: var(--text);
}

.pending-empty span {
  margin-top: 6px;
}

.pending-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-style: solid;
}

.pending-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pending-order strong {
  display: block;
  margin-top: 5px;
  font-size: 26px;
  line-height: 1;
}

.min-pay-box {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 15, 20, .62);
}

.min-pay-box strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.pay-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pay-steps span {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--soft);
  background: rgba(4, 15, 20, .58);
  font-weight: 850;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.payment-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: rgba(4, 15, 20, .62);
  text-align: left;
}

.payment-method strong,
.payment-method small {
  display: block;
}

.payment-method small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.payment-method.active {
  border-color: rgba(50,209,127,.76);
  background: rgba(50,209,127,.10);
}

.price-edit {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.price-edit small {
  font-size: 11px;
  line-height: 1;
}

.fixed-note {
  color: var(--green2);
}

.compact-select {
  width: auto;
  min-width: 130px;
  min-height: 38px;
  padding: 8px 10px;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.amount-btn {
  min-height: 58px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--text);
  background: rgba(4, 15, 20, .62);
  text-align: left;
  padding: 10px 12px;
}

.amount-btn strong,
.amount-btn span {
  display: block;
}

.amount-btn strong {
  font-size: 20px;
}

.amount-btn span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.amount-btn.active {
  border-color: rgba(50,209,127,.76);
  background: rgba(50,209,127,.10);
}

.wallet-rule {
  margin-top: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 15, 20, .62);
}

.wallet-rule strong,
.wallet-rule span {
  display: block;
}

.wallet-rule span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.faq-grid details {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(6, 22, 27, .72);
  padding: 12px;
}

.faq-grid summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 850;
}

.faq-grid p {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.legal-page { max-width: 920px; margin: 0 auto; }
.legal-copy { color: var(--soft); line-height: 1.68; }
.legal-copy h3 { margin: 22px 0 8px; color: var(--text); }
.legal-copy p { margin: 0 0 12px; }

.support-widget {
  position: fixed;
  inset: auto 18px 18px auto;
  z-index: 60;
  pointer-events: none;
}

.support-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.support-panel {
  width: min(312px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 24, 29, .97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .48);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.support-panel.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.support-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.support-title {
  display: flex;
  gap: 10px;
  min-width: 0;
}

.support-title strong,
.support-card strong { display: block; color: var(--text); font-size: 14px; }
.support-title p,
.support-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.support-icon,
.support-round {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(76, 201, 216, .28);
  border-radius: 8px;
  color: var(--green2);
  background: rgba(40, 209, 124, .08);
}

.support-icon svg,
.support-round svg,
.support-close svg,
.support-fab svg,
.support-actions svg,
.support-code button svg { width: 18px; height: 18px; }

.support-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #06161b;
}

.support-body { padding: 14px; }

.support-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #06161b;
}

.support-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 850;
}

.support-tabs button.active {
  color: #031411;
  background: var(--green);
  box-shadow: 0 12px 24px rgba(40, 209, 124, .18);
}

.support-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(76, 201, 216, .28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(40, 209, 124, .08), rgba(76, 201, 216, .06));
}

.support-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qr-frame {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background: #fff;
}

.qr-frame img {
  display: block;
  width: min(176px, 100%);
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
}

.support-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

.support-primary,
.support-secondary,
.support-code button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.support-primary {
  color: #031411;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.support-secondary,
.support-code button {
  border: 1px solid var(--line);
  color: var(--text);
  background: #06161b;
}

.support-code {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(6, 22, 27, .78);
}

.support-code span { display: block; color: var(--muted); font-size: 11px; }
.support-code strong { margin-top: 4px; }
.support-code button { width: 44px; padding: 0; }

.support-fab {
  display: grid;
  grid-template-columns: 42px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  color: var(--text);
  background: rgba(10, 24, 29, .97);
  box-shadow: 0 18px 45px rgba(0, 0, 0, .42);
  pointer-events: auto;
}

.support-fab > span {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #031411;
  background: linear-gradient(135deg, var(--green), var(--cyan));
}

.support-fab b { font-size: 14px; text-align: left; }
.support-fab small { color: var(--muted); font-size: 11px; text-align: left; }

body.workbench-view .support-widget {
  right: 12px;
  bottom: 12px;
}

body.workbench-view .support-fab {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  width: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 3px;
  border-radius: 999px;
}

body.workbench-view .support-fab > span {
  grid-row: auto;
  width: 40px;
  height: 40px;
}

body.workbench-view .support-fab b,
body.workbench-view .support-fab small {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(16, 35, 42, .96);
  box-shadow: var(--shadow);
  text-align: center;
}

.hidden { display: none !important; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 8px; padding: 16px; text-align: center; }

.form-error {
  border: 1px solid rgba(255, 108, 122, .42);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffd7dc;
  background: rgba(255, 108, 122, .10);
  font-size: 13px;
  line-height: 1.45;
}

.code-cell,
.row-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.code-cell .mono {
  max-width: 220px;
  overflow-wrap: anywhere;
}

.invite-copy-cell.copied .mono {
  color: var(--green2);
}

.btn.secondary.copied {
  color: #031411;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), #43d8c7);
}

.copy-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(50, 209, 127, .42);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--green2);
  background: rgba(50, 209, 127, .09);
  font-size: 11px;
  font-weight: 900;
}

.key-reveal {
  display: grid;
  grid-template-columns: minmax(160px, .72fr) minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(50, 209, 127, .34);
  border-radius: 8px;
  background: rgba(50, 209, 127, .08);
}

.key-reveal .btn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  min-width: 74px;
}

.key-reveal small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.key-reveal code {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--text);
  background: rgba(2, 13, 16, .78);
  user-select: all;
}

.notice {
  margin-top: 14px;
  border: 1px solid rgba(244, 183, 64, .34);
  border-radius: 8px;
  background: rgba(244, 183, 64, .08);
  color: var(--soft);
  padding: 11px 12px;
  line-height: 1.55;
  font-size: 13px;
}

.notice.compact {
  margin: 0 0 14px;
}

.workbench-rules {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.workbench-rules li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  list-style: none;
  color: var(--soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.workbench-rules li::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-top: .58em;
  border-radius: 999px;
  flex: 0 0 auto;
  background: rgba(100, 210, 255, .82);
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.pager span {
  min-width: 132px;
  text-align: center;
  white-space: nowrap;
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .seg button, .card, .auth-card, .intro-panel, .rail-item { transition: transform .16s, border-color .16s, background .16s; }
  .btn:hover:not(:disabled) { transform: translateY(-1px); }
  .support-panel, .support-fab, .support-close, .support-tabs button { transition: transform .18s, opacity .18s, border-color .18s, background .18s; }
  .support-fab:hover, .support-close:hover { transform: translateY(-1px); border-color: rgba(76, 201, 216, .45); }
}

@media (max-width: 1120px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-rail { position: static; }
  .rail-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .admin-dashboard .dashboard-head,
  .dashboard-main,
  .dashboard-bottom { grid-template-columns: 1fr; }
  .dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent-top-grid,
  .agent-row-card { grid-template-columns: 1fr; }
  .agent-form { grid-template-columns: 1fr 1fr; }
  .agent-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agent-row-actions { grid-template-columns: 1fr auto; justify-items: stretch; }
  .auth-layout, .dashboard-head, .admin-auth, .login-shell, .workbench, .api-layout, .api-tabs { grid-template-columns: 1fr; }
  .api-top { align-items: flex-start; flex-direction: column; }
  .ops-layout, .admin-hero, .wallet-layout, .wallet-hero, .recharge-grid, .current-payment, .finance-detail-grid { grid-template-columns: 1fr; }
  .hero-actions { justify-content: flex-start; }
  .intro-panel { min-height: auto; }
  .login-art { min-height: auto; }
  .selector-panel { position: static; }
  body.workbench-view .wrap { overflow: auto; }
  body.workbench-view .workbench { grid-template-columns: 1fr; height: auto; }
  body.workbench-view .selector-panel { overflow: visible; }
  body.workbench-view .selector-panel .field.section { display: block; }
  body.workbench-view .country-list { max-height: 420px; }
  body.workbench-view .market-panel { overflow: visible; padding-right: 0; }
  .active-order-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .active-actions { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top .actions { max-width: 100%; justify-content: flex-start; }
  .order-detail-panel { grid-template-columns: 1fr; }
  .api-key-card { grid-template-columns: 1fr; }
  .api-key-actions { grid-template-columns: 1fr auto; align-items: center; justify-items: stretch; }
  .api-key-name { min-width: 0; }
  .api-stat-grid { grid-template-columns: repeat(2, minmax(110px, 1fr)); min-width: 260px; }
  .invite-actions, .invite-rules { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .g2, .g3, .g4, .guide-grid, .guide-compact .guide-grid, .trust-grid, .faq-grid, .mode-grid, .metric-grid, .finance-grid, .price-snapshot, .kv-grid, .amount-grid, .login-steps, .pay-steps, .payment-methods, .method-pills, .trade-modes, .order-grid, .order-meta, .topup-row, .api-docs, .response-grid, .confirm-summary { grid-template-columns: 1fr; }
  .endpoint-list div { grid-template-columns: 48px minmax(0, 1fr); }
  .endpoint-list div span, .endpoint-list div em { grid-column: 1 / -1; text-align: left; }
  .rail-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail-item { min-height: 52px; }
  .dashboard-kpis,
  .dashboard-grid,
  .dashboard-price-grid,
  .agent-summary-grid,
  .dashboard-protection-grid { grid-template-columns: 1fr; }
  .admin-dashboard .dashboard-head h1 { font-size: 25px; }
  .admin-trend-chart { height: 160px; gap: 5px; overflow-x: auto; }
  .admin-trend-day { min-width: 28px; }
  .trend-summary-strip,
  .agent-form,
  .agent-mini-grid,
  .agent-row-actions { grid-template-columns: 1fr; }
  .action-row { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .action-row small { grid-column: 2 / -1; }
  .top { align-items: flex-start; flex-direction: column; padding: 12px 14px; }
  .wrap { padding: 16px; }
  .login-art h1 { font-size: 36px; }
  .intro-panel h1, .legal-page h2 { font-size: 30px; }
  .wallet-hero h1 { font-size: 38px; }
  .recharge-title h1 { font-size: 30px; }
  .admin-hero h1 { font-size: 26px; }
  .search-card h2 { font-size: 24px; }
  .section-title { flex-direction: column; }
  .row, .buy-row { align-items: flex-start; flex-direction: column; }
  .country-head { grid-template-columns: 42px minmax(0, 1fr); }
  .country-head .pill { grid-column: 1 / -1; }
  .country-section-head { flex-direction: column; }
  .country-refresh { width: 100%; min-width: 0; }
  .copy-row { grid-template-columns: 1fr; align-items: stretch; }
  .copy-row > span { margin-bottom: 2px; }
  .copy-seg, .bulk-copy-actions, .detail-copy-grid, .receive-limit-grid, .receive-limit-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .copy-mini, .bulk-copy-actions .btn { min-height: 44px; white-space: normal; }
  .copy-mini span, .bulk-copy-actions .btn span { overflow-wrap: anywhere; }
  .copy-chip { min-height: 44px; }
  .form-btn { width: 100%; align-self: stretch; }
  .timer { font-size: 24px; }
  .toast { left: 14px; right: 14px; bottom: 14px; max-width: none; transform: none; }
  .support-widget { left: 14px; right: 14px; bottom: 14px; }
  .support-stack { align-items: flex-end; }
  .support-panel { width: 100%; }
  .support-fab { max-width: calc(100vw - 28px); }
  .pager { justify-content: center; flex-wrap: wrap; }
  .api-key-name { grid-template-columns: 1fr; min-width: 0; }
  .api-stat-grid { grid-template-columns: 1fr; min-width: 0; }
  .api-key-actions { grid-template-columns: 1fr; }
  .key-reveal { grid-template-columns: 1fr; }
  .key-reveal .btn { width: 100%; min-height: 44px; }
  .orders-table { min-width: 920px; }
  .order-tabs button { flex: 1 1 calc(50% - 8px); }
  .order-search-row { grid-template-columns: 1fr; }
  .active-order-main { grid-template-columns: 1fr; }
  .active-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invite-wrap { width: min(100% - 24px, 980px); padding: 24px 0 42px; }
  .invite-hero { flex-direction: column; padding: 22px; }
  .invite-hero h1 { font-size: 30px; }
  .invite-actions, .invite-rules { grid-template-columns: 1fr; }
  .invite-code { font-size: 22px; }
}

@media (max-width: 560px) {
  .receive-limit-control { grid-template-columns: 1fr; }
}

/* Admin 20260529k: scoped graphite operations console */
body.admin-view {
  --bg: #050608;
  --surface: #080b10;
  --panel: #0b0f14;
  --panel2: #111820;
  --line: rgba(255,255,255,.08);
  --line-soft: rgba(255,255,255,.06);
  --text: #f5f7fa;
  --muted: #8b96a5;
  --soft: #c8d0da;
  --green: #30d158;
  --green2: #8ff0b1;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  --amber: #ffd60a;
  --red: #ff453a;
  --shadow: none;
  --shadow-soft: none;
  min-width: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top right, rgba(10,132,255,.08), transparent 34%),
    linear-gradient(180deg, #050608 0%, #07090d 100%);
}

body.admin-view::before {
  opacity: .2;
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 72px 72px;
}

body.admin-view .top {
  border-bottom-color: rgba(255,255,255,.08);
  background: rgba(5,6,8,.78);
  box-shadow: none;
}

body.admin-view .wrap {
  width: min(100% - 32px, 1480px);
  max-width: 1480px;
  overflow-x: hidden;
}

body.admin-view .admin-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.admin-view .admin-mobile-tabs {
  display: none;
}

body.admin-view .admin-content {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.admin-view .card,
body.admin-view .admin-rail,
body.admin-view .auth-card,
body.admin-view .intro-panel {
  border-color: rgba(255,255,255,.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012)),
    rgba(11,15,20,.92);
  box-shadow: none;
}

body.admin-view .admin-rail {
  top: 86px;
  padding: 10px;
}

body.admin-view .rail-title {
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 8px 7px 12px;
}

body.admin-view .rail-mark,
body.admin-view .logo,
body.admin-view .brand-icon {
  background: linear-gradient(135deg, #0a84ff, #64d2ff);
  box-shadow: none;
}

body.admin-view .rail-item {
  min-height: 48px;
  border-radius: 8px;
  padding: 8px 10px;
}

body.admin-view .rail-item span {
  font-weight: 840;
}

body.admin-view .rail-item small {
  display: none;
}

body.admin-view .rail-item:hover {
  border-color: rgba(10,132,255,.34);
  background: rgba(10,132,255,.09);
}

body.admin-view .rail-item.active {
  color: #fff;
  border-color: rgba(10,132,255,.52);
  background: linear-gradient(180deg, rgba(10,132,255,.88), rgba(10,96,210,.88));
  box-shadow: none;
}

body.admin-view .btn {
  border-color: rgba(10,132,255,.42);
  background: linear-gradient(180deg, #168cff, #0a74df);
  color: #fff;
  box-shadow: none;
}

body.admin-view .btn.secondary {
  border-color: rgba(255,255,255,.10);
  background: rgba(17,24,32,.95);
  color: var(--text);
}

body.admin-view .btn.bad {
  border-color: rgba(255,69,58,.35);
  background: rgba(255,69,58,.16);
  color: #ffb7b3;
}

body.admin-view .pill.ok {
  color: #8ff0b1;
  border-color: rgba(48,209,88,.34);
  background: rgba(48,209,88,.09);
}

body.admin-view .pill.warn {
  color: #ffe486;
  border-color: rgba(255,214,10,.35);
  background: rgba(255,214,10,.09);
}

body.admin-view .pill.bad {
  color: #ffaaa4;
  border-color: rgba(255,69,58,.36);
  background: rgba(255,69,58,.10);
}

body.admin-view .pill.neutral {
  color: var(--soft);
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.045);
}

body.admin-view .tab-strip button {
  border-color: rgba(255,255,255,.10);
  background: rgba(17,24,32,.95);
  color: var(--soft);
}

body.admin-view .tab-strip button.active {
  color: #fff;
  border-color: rgba(10,132,255,.45);
  background: linear-gradient(180deg, rgba(10,132,255,.90), rgba(10,96,210,.88));
}

body.admin-view .input {
  border-color: rgba(255,255,255,.10);
  background: rgba(5,8,12,.95);
}

body.admin-view .tablewrap {
  max-width: 100%;
  overflow-x: hidden;
  border-color: rgba(255,255,255,.08);
  background: rgba(5,8,12,.58);
}

body.admin-view table {
  min-width: 0;
}

body.admin-view th,
body.admin-view td {
  border-bottom-color: rgba(255,255,255,.07);
}

body.admin-view th {
  color: var(--muted);
  background: rgba(8,11,16,.94);
  text-transform: none;
}

.admin-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  width: 100%;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(10,132,255,.13), transparent 42%),
    linear-gradient(180deg, rgba(17,24,32,.88), rgba(9,13,18,.88));
}

.admin-page-head h1 {
  margin: 3px 0 6px;
  font-size: 28px;
  line-height: 1.12;
}

.admin-page-head p:not(.label) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-page-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.admin-filter-bar,
.admin-command-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.admin-command-form {
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(150px, auto);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.settings-grid .form-btn {
  min-height: 42px;
}

.admin-row-list {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.admin-object-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.15fr) minmax(210px, 1.25fr) minmax(210px, 1.25fr) minmax(150px, .9fr) minmax(130px, auto);
  gap: 10px;
  align-items: center;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 10px;
  background: rgba(7,11,16,.86);
}

.order-object-row {
  grid-template-columns: minmax(105px,.7fr) minmax(210px,1.15fr) minmax(160px,.9fr) minmax(82px,.45fr) minmax(150px,.85fr) minmax(92px,.45fr) minmax(88px,auto);
}

.api-object-row {
  grid-template-columns: minmax(220px,1.35fr) repeat(3, minmax(185px,1fr)) minmax(145px,.72fr);
}

.user-object-row {
  grid-template-columns: minmax(230px,1.3fr) minmax(230px,1.1fr) minmax(190px,.9fr) minmax(82px,.45fr) minmax(94px,auto);
}

.object-line {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.object-line strong,
.numeric-cell strong,
.money-cell {
  overflow: hidden;
  color: var(--text);
  font-weight: 850;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.object-line small,
.numeric-cell small,
.status-actions small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-pack {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.stat-pack span {
  min-width: 0;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 8px;
  padding: 7px 8px;
  background: rgba(255,255,255,.025);
}

.stat-pack small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-pack strong {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.status-actions {
  display: grid;
  justify-items: end;
  gap: 7px;
  min-width: 0;
}

.row-detail {
  grid-column: 1 / -1;
  min-width: 0;
}

.row-detail summary,
.json-detail summary {
  width: fit-content;
  min-height: 30px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--soft);
  background: rgba(255,255,255,.035);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.row-detail summary::-webkit-details-marker,
.json-detail summary::-webkit-details-marker {
  display: none;
}

.row-detail[open] summary {
  margin-bottom: 10px;
  border-color: rgba(10,132,255,.34);
  color: #b8d8ff;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 10px;
  background: rgba(0,0,0,.16);
}

.detail-grid div {
  min-width: 0;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.detail-grid strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.admin-data-table {
  width: 100%;
  table-layout: fixed;
}

.admin-data-table td {
  vertical-align: middle;
}

.numeric-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}

body.admin-view .dashboard-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.admin-view .dashboard-kpi {
  min-height: 88px;
  border-color: rgba(255,255,255,.08);
  background: rgba(11,15,20,.88);
}

body.admin-view .dashboard-kpi.tone-ok,
body.admin-view .dashboard-kpi.tone-info,
body.admin-view .dashboard-kpi.tone-warn,
body.admin-view .dashboard-kpi.tone-bad {
  border-color: rgba(255,255,255,.10);
}

body.admin-view .dashboard-main {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px,.72fr);
}

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

body.admin-view .dashboard-trend {
  min-height: 380px;
}

body.admin-view .admin-trend-chart {
  height: 230px;
  gap: 12px;
}

body.admin-view .agent-top-grid {
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
}

body.admin-view .agent-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.admin-view .agent-table-wrap table,
body.admin-view .admin-api-table-wrap table {
  min-width: 0;
}

body.admin-view .agent-table-wrap th,
body.admin-view .agent-table-wrap td {
  position: static;
  width: auto;
  text-align: left;
}

body.admin-view .admin-login-only {
  grid-template-columns: minmax(320px, 440px);
  justify-content: center;
  align-items: start;
  padding-top: clamp(18px, 8vh, 72px);
}

body.admin-view .admin-login-card {
  width: 100%;
}

body.agent-view {
  --bg: #050608;
  --surface: #090d12;
  --panel: #0f151c;
  --panel2: #141c25;
  --line: rgba(255,255,255,.10);
  --line-soft: rgba(255,255,255,.08);
  --text: #f5f7fa;
  --muted: #8e99a8;
  --soft: #cbd5e1;
  --green: #30d158;
  --cyan: #64d2ff;
  --blue: #0a84ff;
  background:
    radial-gradient(circle at 78% -10%, rgba(10,132,255,.14), transparent 31%),
    linear-gradient(180deg, #050608 0%, #070a0f 48%, #030406 100%);
}

body.agent-view::before {
  opacity: .28;
  background:
    linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 64px 64px;
}

body.agent-view .top {
  border-bottom-color: rgba(255,255,255,.08);
  background: rgba(5, 6, 8, .88);
  box-shadow: none;
}

body.agent-view .card,
body.agent-view .auth-card,
body.agent-view .admin-rail,
body.agent-view .intro-panel {
  border-color: rgba(255,255,255,.09);
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.016)), rgba(10,15,20,.92);
  box-shadow: none;
}

body.agent-view .admin-hero {
  border-color: rgba(255,255,255,.09);
  background:
    radial-gradient(circle at top right, rgba(10,132,255,.17), transparent 35%),
    linear-gradient(180deg, rgba(17,24,32,.96), rgba(9,13,18,.96));
  box-shadow: none;
}

body.agent-view .btn {
  color: #fff;
  background: linear-gradient(135deg, #0a84ff, #3b8cff);
  box-shadow: 0 12px 28px rgba(10,132,255,.18);
}

body.agent-view .btn.secondary {
  color: var(--text);
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  box-shadow: none;
}

body.agent-view .pill.ok,
body.agent-view .pill.warn,
body.agent-view .pill.bad,
body.agent-view .pill {
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
}

body.agent-view .pill.ok {
  color: #30d158;
  border-color: rgba(48,209,88,.34);
  background: rgba(48,209,88,.10);
}

body.agent-view .rail-mark,
body.agent-view .logo,
body.agent-view .brand-icon {
  color: #fff;
  background: linear-gradient(135deg, #0a84ff, #64d2ff);
  box-shadow: 0 12px 26px rgba(10,132,255,.18);
}

body.agent-view .rail-item.active {
  color: #fff;
  border-color: rgba(10,132,255,.45);
  background: rgba(10,132,255,.18);
  box-shadow: none;
}

body.agent-view .rail-item.active small {
  color: rgba(255,255,255,.72);
}

body.agent-view .input {
  border-color: rgba(255,255,255,.12);
  background: rgba(3,6,10,.76);
}

body.agent-view table th {
  background: rgba(255,255,255,.035);
}

body.agent-view tbody tr:hover td {
  background: rgba(10,132,255,.055);
}

.json-detail pre {
  max-height: 260px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.24);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 1280px) {
  body.admin-view .wrap {
    width: min(100% - 24px, 1280px);
  }

  body.admin-view .admin-shell {
    grid-template-columns: 210px minmax(0,1fr);
  }

  .admin-object-row,
  .order-object-row,
  .api-object-row,
  .user-object-row {
    grid-template-columns: minmax(220px,1fr) minmax(240px,1fr) minmax(180px,.8fr);
  }

  .status-actions {
    justify-items: start;
  }
}

@media (max-width: 980px) {
  body.admin-view .admin-shell,
  body.admin-view .dashboard-main,
  body.admin-view .agent-top-grid {
    grid-template-columns: 1fr;
  }

  body.admin-view .admin-rail {
    position: static;
  }

  body.admin-view .rail-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-page-head,
  .admin-filter-bar,
  .admin-command-form,
  .settings-grid,
  .admin-object-row,
  .order-object-row,
  .api-object-row,
  .user-object-row {
    grid-template-columns: 1fr;
  }

  body.admin-view .dashboard-kpis,
  body.admin-view .dashboard-grid,
  body.admin-view .agent-summary-grid,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body.admin-view .wrap {
    width: 100%;
    padding: 12px;
  }

  body.admin-view .rail-nav,
  body.admin-view .dashboard-kpis,
  body.admin-view .dashboard-grid,
  body.admin-view .agent-summary-grid,
  .stat-pack,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body.admin-view {
    overflow-x: hidden;
  }

  body.admin-view .top {
    position: static;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 12px;
  }

  body.admin-view .brand {
    min-width: 0;
  }

  body.admin-view .brand small {
    display: none;
  }

  body.admin-view .top .actions {
    max-width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  body.admin-view .top .actions .btn,
  body.admin-view .top .actions .pill,
  body.admin-view .top .actions .input {
    flex: 0 0 auto;
  }

  body.admin-view .wrap {
    width: 100%;
    max-width: none;
    padding: 10px;
  }

  body.admin-view .admin-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  body.admin-view .admin-rail {
    display: none;
  }

  body.admin-view .admin-mobile-tabs {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    gap: 8px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 12px;
    padding: 8px;
    background: rgba(5,6,8,.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
  }

  body.admin-view .mobile-tab-current {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    padding: 0 4px;
    color: var(--soft);
    font-size: 12px;
    font-weight: 900;
  }

  body.admin-view .mobile-tab-current::after {
    content: '左右滑动切换';
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
  }

  body.admin-view .mobile-tab-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 3px;
    scrollbar-width: thin;
  }

  body.admin-view .mobile-tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 74px;
    min-height: 42px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    padding: 0 14px;
    background: rgba(17,24,32,.96);
    color: var(--soft);
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
  }

  body.admin-view .mobile-tab.active {
    color: #fff;
    border-color: rgba(10,132,255,.55);
    background: linear-gradient(180deg, rgba(10,132,255,.96), rgba(10,96,210,.92));
  }

  body.admin-view .admin-page-head {
    grid-template-columns: 1fr;
    padding: 14px;
    gap: 12px;
  }

  body.admin-view .admin-page-head h1 {
    font-size: 22px;
  }

  body.admin-view .admin-page-head p:not(.label) {
    font-size: 13px;
  }

  body.admin-view .admin-page-actions {
    justify-content: flex-start;
  }

  body.admin-view .admin-page-actions .btn,
  body.admin-view .form-btn,
  body.admin-view .row-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  body.admin-view .card,
  body.admin-view .auth-card,
  body.admin-view .intro-panel {
    border-radius: 10px;
    padding: 14px;
  }

  body.admin-view .section-title {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  body.admin-view .section-title h3 {
    font-size: 18px;
  }

  body.admin-view .section-title p,
  body.admin-view .field-hint {
    font-size: 12px;
  }

  body.admin-view .admin-filter-bar,
  body.admin-view .admin-command-form,
  body.admin-view .settings-grid,
  body.admin-view .agent-form {
    grid-template-columns: 1fr;
  }

  body.admin-view .input,
  body.admin-view .btn {
    min-height: 44px;
  }

  body.admin-view .admin-object-row,
  body.admin-view .order-object-row,
  body.admin-view .api-object-row,
  body.admin-view .user-object-row,
  body.admin-view .agent-object-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
  }

  body.admin-view .stat-pack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.admin-view .status-actions {
    width: 100%;
    justify-items: stretch;
  }

  body.admin-view .status-actions .btn {
    width: 100%;
  }

  body.admin-view .tablewrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  body.admin-view .admin-data-table,
  body.admin-view .admin-data-table thead,
  body.admin-view .admin-data-table tbody,
  body.admin-view .admin-data-table tr,
  body.admin-view .admin-data-table th,
  body.admin-view .admin-data-table td {
    display: block;
    width: 100%;
  }

  body.admin-view .admin-data-table thead {
    display: none;
  }

  body.admin-view .admin-data-table tr {
    margin-bottom: 10px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 8px;
    background: rgba(7,11,16,.86);
  }

  body.admin-view .admin-data-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 9px 4px;
    font-size: 13px;
  }

  body.admin-view .admin-data-table td:last-child {
    border-bottom: 0;
  }

  body.admin-view .admin-data-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
  }

  body.admin-view .code-cell,
  body.admin-view .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
  }

  body.admin-view .price-edit {
    display: grid;
    gap: 6px;
  }

  body.admin-view .price-edit .input,
  body.admin-view .input.mini {
    width: 100%;
  }

  body.admin-view .pager {
    justify-content: stretch;
  }

  body.admin-view .pager .btn {
    flex: 1 1 120px;
  }

  body.admin-view .admin-login-only {
    grid-template-columns: 1fr;
    padding-top: 10px;
  }
}

@media (max-width: 420px) {
  body.admin-view .stat-pack,
  body.admin-view .dashboard-kpis,
  body.admin-view .dashboard-grid,
  body.admin-view .agent-summary-grid,
  body.admin-view .detail-grid {
    grid-template-columns: 1fr;
  }

  body.admin-view .admin-data-table td {
    grid-template-columns: 1fr;
    gap: 5px;
  }
}
