:root {
  --bg: #f0f4f8;
  --primary: #2f6bff;
  --primary-dark: #1a5ae8;
  --primary-soft: #e8f0fe;
  --primary-muted: #a8c4ff;
  --card: #ffffff;
  --text: #1c2434;
  --text-muted: #8b95a8;
  --border: rgba(28, 36, 52, 0.08);
  --green: #16a34a;
  --green-bg: #dcfce7;
  --input-bg: #f3f5f8;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(28, 36, 52, 0.06);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.splash-active {
  overflow: hidden;
}

body.splash-active .app {
  opacity: 0;
  pointer-events: none;
}

body.modal-open {
  overflow: hidden;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input,
textarea {
  font: inherit;
  border: none;
  outline: none;
}

.app {
  min-height: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transition: opacity 0.45s ease 0.1s;
}

/* ── Splash Preloader ── */
.splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash[hidden] {
  display: none !important;
}

.splash--exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  animation: splashFadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.splash__mark {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}

.splash__ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  animation: splashBreath 2.8s ease-in-out infinite;
}

.splash__brand {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.splash__logo {
  font-size: 42px;
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--text);
  line-height: 1;
}

.splash__loader {
  width: 72px;
}

.splash__loader-track {
  height: 1.5px;
  border-radius: 1px;
  background: var(--border);
  overflow: hidden;
}

.splash__loader-bar {
  height: 100%;
  width: 0%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 0.28s ease-out;
}

@keyframes splashFadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes splashBreath {
  0%, 100% {
    opacity: 0.35;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash__inner,
  .splash__ring {
    animation: none !important;
  }

  .splash__inner {
    opacity: 1;
    transform: none;
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
}

.user-avatar-wrap .user-avatar,
.user-avatar-wrap .user-avatar--fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.user-avatar {
  border-radius: 50%;
  object-fit: cover;
}

.user-avatar--fallback {
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.user-avatar--fallback[hidden],
.user-avatar[hidden] {
  display: none !important;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo svg {
  width: 20px;
  height: 20px;
}

.header-title {
  font-size: 15px;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-btn:hover {
  background: var(--input-bg);
  color: var(--text);
}

.header-btn svg {
  width: 18px;
  height: 18px;
}

.header-btn__icon[hidden] {
  display: none;
}

.lang-picker {
  position: relative;
}

.lang-picker__trigger {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.lang-picker__trigger:hover {
  background: #e8ecf2;
}

.lang-picker--open .lang-picker__trigger {
  background: var(--card);
  box-shadow: var(--shadow);
}

.lang-picker__badge {
  min-width: 22px;
  text-align: center;
  line-height: 1;
}

.lang-picker__chevron {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.lang-picker--open .lang-picker__chevron {
  transform: rotate(180deg);
}

.lang-picker__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  padding: 4px;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(28, 36, 52, 0.12);
  border: 1px solid var(--border);
  z-index: 50;
  opacity: 0;
  transform: translateY(-4px) scale(0.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.lang-picker--open .lang-picker__menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-picker__menu[hidden] {
  display: block;
}

.lang-picker__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  text-align: left;
  transition: background 0.12s ease;
}

.lang-picker__option:hover {
  background: var(--input-bg);
}

.lang-picker__option--active {
  background: var(--primary-soft);
  color: var(--primary);
}

.lang-picker__option-code {
  width: 26px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}

.lang-picker__option-name {
  flex: 1;
  font-weight: 500;
}

/* Pages */
.page {
  display: none;
  flex: 1;
  padding: 8px 16px calc(88px + var(--safe-bottom));
  overflow-y: auto;
}

.page--active {
  display: block;
}

.page-intro {
  margin-bottom: 22px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.page-subtitle {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

/* Sections */
.data-section + .data-section {
  margin-top: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
}

.section-bar {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}

/* Metric cards (home) */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px 14px;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.metric-card--primary {
  background: var(--primary);
  color: #fff;
}

.metric-card--primary .metric-label {
  color: rgba(255, 255, 255, 0.85);
}

.metric-card--soft {
  background: var(--primary-soft);
}

.metric-label {
  font-size: 12px;
  color: var(--text-muted);
}

.metric-value {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.metric-card--primary .metric-value {
  font-size: 28px;
}

.metric-unit {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Performance K-line (home) */
.performance-section {
  margin-bottom: 8px;
}

.performance-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.performance-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title--inline {
  margin: 0;
}

.performance-card__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.chart-period-tabs {
  display: flex;
  gap: 4px;
  background: var(--input-bg);
  padding: 3px;
  border-radius: 999px;
  flex-shrink: 0;
}

.chart-period-tab {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.chart-period-tab--active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(28, 36, 52, 0.08);
}

.performance-card__stats {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border);
}

.performance-card__label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.performance-card__value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.performance-card__change {
  font-size: 18px;
  font-weight: 700;
  text-align: right;
}

.performance-card__change--up {
  color: #16a34a;
}

.performance-card__change--down {
  color: #ef4444;
}

.kline-chart {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kline-chart__svg {
  width: 100%;
  height: 100%;
  display: block;
  max-width: 100%;
}

.kline-grid {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.kline-axis,
.kline-date {
  font-size: 9px;
  fill: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.kline-chart__empty {
  text-align: center;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.pill--addr {
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

/* Search & filters (numbers) */
.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 14px 12px 42px;
  background: var(--card);
  border-radius: 999px;
  font-size: 14px;
  color: var(--text);
  box-shadow: var(--shadow);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  background: var(--card);
  color: var(--text-muted);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.filter-tab--active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.list-summary {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-bulk-list {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
}

.btn-bulk-list:active {
  opacity: 0.88;
}

.btn-bulk-list[hidden] {
  display: none !important;
}

.bulk-list-table-wrap {
  overflow-x: auto;
  margin: 12px 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.bulk-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bulk-list-table th,
.bulk-list-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.bulk-list-table th {
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
}

.bulk-list-table tr:last-child td {
  border-bottom: none;
}

.bulk-list-table__phone {
  font-weight: 600;
  white-space: nowrap;
}

.number-card__checkbox[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Number card */
.number-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.number-card:active {
  transform: scale(0.99);
}

.number-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.number-card__phone {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
}

.chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}

.tag--blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.tag--listed {
  background: #dcfce7;
  color: #15803d;
}

.tag--muted {
  background: #f1f5f9;
  color: var(--text-muted);
}

.number-card__lease {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
}

.number-card__lease-label {
  font-size: 13px;
  color: var(--text-muted);
}

.number-card__lease-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.number-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--input-bg);
  font-size: 11px;
  color: var(--text-muted);
}

.list-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Wallet - balance card */
.balance-card {
  background: var(--primary);
  border-radius: 20px;
  padding: 20px 18px 16px;
  color: #fff;
  margin-bottom: 22px;
}

.balance-card__label {
  font-size: 13px;
  opacity: 0.85;
}

.balance-card__amount {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 500;
}

.balance-card__value {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.balance-card__frozen {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.85;
}

.balance-card__frozen-value {
  font-weight: 600;
}

.balance-card__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.balance-btn {
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease;
}

.balance-btn--warn {
  background: #fef3c7;
  color: #b45309;
}

.onboarding-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 16px;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  opacity: 0.45;
}

.onboarding-step--active {
  opacity: 1;
}

.onboarding-step--done {
  opacity: 0.85;
}

.onboarding-step__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.onboarding-step__label {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  color: var(--text);
}

.onboarding-step__line {
  width: 24px;
  height: 2px;
  background: var(--border);
  flex-shrink: 0;
}

.onboarding-status-icon {
  font-size: 40px;
  text-align: center;
  margin: 12px 0;
}

.onboarding-meta {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin: 8px 0 16px;
  word-break: break-all;
}

#modal-onboarding .hint-text {
  margin-bottom: 14px;
}

.onboarding-security-warn {
  margin: 0 0 14px;
}

.onboarding-security-warn p {
  font-size: 12px;
  line-height: 1.5;
  color: #b45309;
  font-weight: 600;
}

.onboarding-profit-hint {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
}

.onboarding-ton-verified {
  font-size: 13px;
  color: #15803d;
  background: #dcfce7;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  word-break: break-all;
}

.member-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: 24px;
}
.member-gate[hidden] { display: none !important; }
.member-gate__card {
  text-align: center;
  max-width: 300px;
}
.member-gate__icon { font-size: 48px; margin-bottom: 16px; }
.member-gate__text { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.member-gate__sub { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.twofa-gate {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 40px;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
}
.twofa-gate[hidden] { display: none !important; }
.twofa-gate__card {
  width: 100%;
  max-width: 360px;
}
.twofa-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 20px;
  padding: 0;
}
.twofa-steps .onboarding-step {
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  text-align: center;
  opacity: 0.5;
}
.twofa-steps .onboarding-step--active {
  opacity: 1;
}
.twofa-steps .onboarding-step__num {
  width: 28px;
  height: 28px;
  font-size: 13px;
}
.twofa-steps .onboarding-step__label {
  font-size: 10px;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
  color: var(--text);
  width: 100%;
}
.twofa-steps .onboarding-step__line {
  display: none;
}
.twofa-gate__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.twofa-gate__desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.twofa-gate__apps-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.twofa-gate__apps {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px 18px;
  line-height: 1.6;
}
.twofa-gate__qr {
  display: block;
  margin: 12px auto;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}
.twofa-gate__secret {
  font-size: 12px;
  text-align: center;
  word-break: break-all;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.twofa-gate__secret code {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--text);
}
.twofa-gate .form-label {
  color: var(--text);
  line-height: 1.4;
}
.twofa-gate .hint-text {
  color: var(--text-muted);
}

.warn-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.warn-banner p {
  font-size: 13px;
  color: #92400e;
  line-height: 1.55;
  margin: 0;
}

.balance-btn:active {
  background: rgba(255, 255, 255, 0.3);
}

/* Account card */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

.btn-outline--sm {
  padding: 5px 10px;
}

.account-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}

.account-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.account-card__icon svg {
  width: 20px;
  height: 20px;
}

.account-card__info {
  flex: 1;
  min-width: 0;
}

.account-card__name {
  font-size: 15px;
  font-weight: 600;
}

.account-card__address {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.account-card__date {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.account-card--pending {
  opacity: 0.85;
}

.account-card__status {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 999px;
  vertical-align: middle;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--input-bg);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Transaction list */
.tx-list {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.tx-item + .tx-item {
  border-top: 1px solid var(--border);
}

.tx-item__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.tx-item__icon--income {
  background: var(--green-bg);
  color: var(--green);
}

.tx-item__icon--expense {
  background: #fee2e2;
  color: var(--red);
}

.tx-item__icon svg {
  width: 16px;
  height: 16px;
}

.tx-item__body {
  flex: 1;
  min-width: 0;
}

.tx-item__title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-item__time {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.tx-item__amount {
  text-align: right;
  flex-shrink: 0;
}

.tx-item__value {
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
}

.tx-item__type {
  margin-top: 2px;
  font-size: 11px;
  color: var(--green);
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 8px 12px calc(10px + var(--safe-bottom));
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  color: var(--text-muted);
}

.nav-item--active {
  color: var(--primary);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
}

/* Overlay & sheets */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 52, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.overlay[hidden] {
  display: none !important;
  pointer-events: none;
}

.overlay--visible {
  opacity: 1;
}

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 430px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(24px + var(--safe-bottom));
  z-index: 101;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  -webkit-overflow-scrolling: touch;
}

.sheet--visible {
  transform: translateX(-50%) translateY(0);
}

.sheet__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: #d1d5db;
  margin: 4px auto 12px;
}

.sheet__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet__header--simple {
  margin-bottom: 16px;
}

.sheet__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.sheet__title--solo {
  margin-bottom: 20px;
}

.sheet__subtitle {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.sheet__close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--input-bg);
  color: var(--text-muted);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.sheet__close svg {
  width: 16px;
  height: 16px;
}

/* Number detail sheet */
.info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--primary-soft);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--primary);
  margin-bottom: 12px;
}

.rental-info-card {
  border: 1.5px solid var(--primary-muted);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: rgba(232, 240, 254, 0.5);
  margin-bottom: 12px;
}

.rental-info-card__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

.rental-info-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
}

.rental-info-card__row + .rental-info-card__row {
  margin-top: 8px;
}

.rental-info-card__value {
  color: var(--primary);
  font-weight: 600;
}

.panel-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  margin-bottom: 12px;
}

.panel-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-card__title {
  font-size: 14px;
  font-weight: 600;
}

.panel-card__desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.panel-card__heading {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

/* Toggle */
.toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle__slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  transition: background 0.2s ease;
  cursor: pointer;
}

.toggle__slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle input:checked + .toggle__slider {
  background: var(--primary);
}

.toggle input:checked + .toggle__slider::before {
  transform: translateX(20px);
}

.btn-delist {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-delist:active {
  background: #fde8e8;
  color: #dc2626;
}

.btn-soft {
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
}

.btn-soft--full {
  width: 100%;
}

/* Price grid */
.price-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.price-item__label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.price-item__input {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 12px;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
}

.price-item__prefix {
  color: var(--text-muted);
}

/* Withdraw sheet */
.seg-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.seg-tab {
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.seg-tab--active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow);
}

.hint-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-label + .form-input,
.form-label + .form-textarea {
  margin-bottom: 14px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 14px;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input--readonly {
  opacity: 0.85;
  cursor: default;
}

.refund-amount-note {
  margin: -6px 0 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Mnemonic grid */
.mnemonic-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: -4px 0 10px;
  line-height: 1.4;
}

.mnemonic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.mnemonic-cell {
  position: relative;
}

.mnemonic-cell__index {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 1;
}

.mnemonic-cell__input {
  width: 100%;
  padding: 10px 6px 10px 22px;
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  border: 1.5px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mnemonic-cell__input:focus {
  border-color: var(--primary);
  background: var(--card);
}

.mnemonic-cell__input--filled {
  background: var(--primary-soft);
}

.sheet--tall {
  max-height: 95vh;
}

/* Ticket */
.category-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.category-btn {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--input-bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.category-btn--active {
  background: var(--primary);
  color: #fff;
}

.ticket-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  text-align: left;
  transition: background 0.12s ease;
}

.ticket-item:active {
  background: var(--primary-soft);
}

.ticket-item__body {
  flex: 1;
  min-width: 0;
}

.ticket-item__subject {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-item__meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}

.ticket-item__chevron {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.ticket-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.ticket-status--pending {
  background: #fef3c7;
  color: #b45309;
}

.ticket-status--replied {
  background: var(--green-bg);
  color: var(--green);
}

.ticket-status--closed {
  background: var(--input-bg);
  color: var(--text-muted);
}

[data-theme="dark"] .ticket-status--pending {
  background: #3d3018;
  color: #fbbf24;
}

.ticket-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
}

.ticket-detail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ticket-detail__subject {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.ticket-detail__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-msg {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  max-width: 92%;
}

.ticket-msg--user {
  align-self: flex-end;
  background: var(--primary-soft);
  border-bottom-right-radius: 4px;
}

.ticket-msg--support {
  align-self: flex-start;
  background: var(--input-bg);
  border-bottom-left-radius: 4px;
}

.ticket-msg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.ticket-msg__role {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
}

.ticket-msg--support .ticket-msg__role {
  color: var(--green);
}

.ticket-msg__time {
  font-size: 10px;
  color: var(--text-muted);
}

.ticket-msg__text {
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(100px + var(--safe-bottom));
  transform: translateX(-50%) translateY(12px);
  max-width: 340px;
  width: calc(100% - 32px);
  padding: 14px 18px;
  background: var(--toast-bg, var(--text));
  color: var(--toast-text, #fff);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  text-align: center;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast__message {
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0f1419;
  --primary-soft: #1a2744;
  --primary-muted: #3d5a99;
  --card: #1a2230;
  --text: #e8ecf2;
  --text-muted: #7a8494;
  --border: rgba(255, 255, 255, 0.08);
  --green-bg: #14301f;
  --input-bg: #252d3d;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --toast-bg: #2a3444;
  --toast-text: #e8ecf2;
}

[data-theme="dark"] .balance-card {
  background: #1e4dcc;
}

[data-theme="dark"] .metric-card--primary {
  background: #2563eb;
}

[data-theme="dark"] .btn-delist:active {
  background: #3d2020;
  color: #f87171;
}

[data-theme="dark"] body {
  background: #0a0e12;
}

[data-theme="dark"] .twofa-gate {
  background: var(--bg);
}

[data-theme="dark"] .twofa-steps .onboarding-step__label,
[data-theme="dark"] .twofa-gate__title,
[data-theme="dark"] .twofa-gate .form-label {
  color: var(--text);
}

[data-theme="dark"] .onboarding-step:not(.onboarding-step--active) .onboarding-step__label {
  color: var(--text-muted);
}

@media (min-width: 431px) {
  [data-theme="dark"] body {
    background: #0a0e12;
  }
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--input-bg);
  font-size: 13px;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.chip--active {
  background: var(--primary-soft);
  color: var(--primary);
}

.method-group {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.method-btn {
  flex: 1;
  padding: 12px 8px;
  border-radius: 999px;
  background: var(--input-bg);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.method-btn--active {
  background: var(--primary);
  color: #fff;
}

.btn-primary {
  padding: 14px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.btn-primary--full {
  width: 100%;
}

.btn-primary--muted {
  background: var(--primary-muted);
}

.empty-state {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

@media (min-width: 431px) {
  body {
    background: #e4eaf2;
  }

  .app {
    box-shadow: 0 0 40px rgba(28, 36, 52, 0.08);
  }
}
