:root {
  --bg:      oklch(98% 0.005 250);
  --surface: oklch(100% 0 0);
  --fg:      oklch(22% 0.02 240);
  --muted:   oklch(50% 0.018 240);
  --border:  oklch(90% 0.008 240);
  --accent:  oklch(58% 0.16 145);

  --font-display: "SF Pro Display", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-body:    "SF Pro Text", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono:    "DIN Alternate", "SFMono-Regular", ui-monospace, Menlo, monospace;

  /* --- AXIS Cyber Dark — v2 design tokens --- */
  --canvas: #04060c;
  --panel: rgba(10, 18, 32, 0.72);
  --panel-glass: rgba(12, 22, 38, 0.64);
  --panel-raised: rgba(17, 30, 52, 0.80);
  --panel-pressed: rgba(26, 44, 70, 0.88);
  --text: #eef5ff;
  --text-soft: #8aa4c0;
  --text-faint: #4e6580;
  --line: rgba(100, 180, 255, 0.10);
  --line-strong: rgba(80, 200, 255, 0.22);

  /* Cyan neon brand */
  --brand: #34e8ff;
  --brand-dim: #0ea5c5;
  --brand-ink: #021620;
  --brand-glow: rgba(52, 232, 255, 0.28);
  --brand-glow-sm: rgba(52, 232, 255, 0.16);

  /* Secondary accent: electric violet */
  --accent2: #8b5cf6;
  --accent2-glow: rgba(139, 92, 246, 0.22);

  --positive: #4ade80;
  --positive-soft: rgba(74, 222, 128, 0.12);
  --positive-glow: rgba(74, 222, 128, 0.24);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger-glow: rgba(248, 113, 113, 0.22);
  --warning: #fbbf24;

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  --font-weight-display: 700;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Glass / blur */
  --blur-panel: blur(18px) saturate(140%);
  --blur-topbar: blur(24px) saturate(160%);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: #02040a;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  background: #02040a;
  color: var(--text);
  font-family: var(--font-body), "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
}

/* Deep space grid background */
body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #02040a;
  background-image:
    linear-gradient(rgba(52, 232, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(52, 232, 255, 0.025) 1px, transparent 1px),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(52, 232, 255, 0.06) 0%, transparent 70%);
  background-size: 52px 52px, 52px 52px, 100% 100%;
  content: "";
  pointer-events: none;
}

/* Subtle scanline overlay */
body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  content: "";
  pointer-events: none;
  opacity: 0.5;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  transition-property: transform, background-color, color, border-color, opacity, box-shadow;
  transition-duration: 160ms;
  transition-timing-function: var(--ease-out);
}

button:active,
a:active {
  transform: scale(0.96);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 50%;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--canvas);
  transform: translate(-50%, -160%);
}

.skip-link:focus-visible {
  transform: translate(-50%, 0);
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: hidden;
  background: rgba(4, 6, 12, 0.92);
  box-shadow:
    0 0 0 1px rgba(52, 232, 255, 0.06),
    0 32px 80px rgba(0, 0, 0, 0.72),
    0 0 120px rgba(52, 232, 255, 0.04);
}

.app-main {
  min-height: 100dvh;
  padding: 0 20px calc(102px + env(safe-area-inset-bottom));
}

.app-main.flush {
  padding-inline: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: calc(10px + env(safe-area-inset-top)) 20px 10px;
  background: rgba(4, 6, 12, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: var(--blur-topbar);
  -webkit-backdrop-filter: var(--blur-topbar);
}

/* Cyan accent line bottom of topbar */
.topbar::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 72px;
  height: 1px;
  background: linear-gradient(90deg, var(--brand), transparent);
  box-shadow: 0 0 14px var(--brand-glow);
  content: "";
  pointer-events: none;
}

.topbar-title {
  margin: 0;
  font-family: var(--font-display), "PingFang SC", sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-wrap: balance;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(10, 20, 36, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(52, 232, 255, 0.08),
    0 0 12px rgba(52, 232, 255, 0.10);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--brand);
}

.brand-mark::after {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 6px var(--positive-glow);
  content: "";
}

.brand-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.env-label {
  display: block;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.topbar-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-button,
.back-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(10, 18, 32, 0.72);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.section {
  padding-top: 28px;
}

.section + .section {
  padding-top: 32px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display), "PingFang SC", sans-serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-wrap: balance;
}

.section-note,
.caption,
.helper {
  margin: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

.text-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

button.text-link {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.balance-block {
  padding-top: 26px;
}

.eyebrow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--positive);
  box-shadow: 0 0 0 3px var(--positive-soft), 0 0 10px var(--positive-glow);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 3px var(--positive-soft), 0 0 10px var(--positive-glow); }
  50%       { box-shadow: 0 0 0 5px rgba(74, 222, 128, 0.06), 0 0 18px rgba(74, 222, 128, 0.36); }
}

.balance-value,
.quote-price,
.asset-total {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
}

.balance-value {
  font-size: clamp(30px, 9vw, 38px);
}

.balance-change {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--danger);
}

.muted {
  color: var(--text-soft);
}

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

.quick-action {
  display: flex;
  min-width: 0;
  min-height: 72px;
  padding: 12px 6px 10px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.quick-action.primary {
  border-color: var(--brand-dim);
  background: linear-gradient(160deg, rgba(52, 232, 255, 0.18) 0%, rgba(14, 165, 197, 0.10) 100%);
  color: var(--brand);
  box-shadow:
    inset 0 1px 0 rgba(52, 232, 255, 0.14),
    0 4px 20px rgba(52, 232, 255, 0.14);
}

.quick-action .icon {
  width: 19px;
  height: 19px;
}

.market-visual {
  position: relative;
  display: block;
  min-height: 190px;
  margin-top: 20px;
  overflow: hidden;
  isolation: isolate;
  border-radius: var(--radius-xl);
  background: var(--panel-glass);
  box-shadow:
    inset 0 0 0 1px var(--line-strong),
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(52, 232, 255, 0.06);
}

.market-visual img,
.market-visual-scrim,
.market-visual-copy {
  position: absolute;
  inset: 0;
}

.market-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 64% center;
  opacity: 0.82;
  outline: 1px solid oklch(100% 0 0 / 0.08);
  outline-offset: -1px;
  transition: transform 240ms var(--ease-out), opacity 180ms ease;
}

.market-visual-scrim {
  z-index: 1;
  background: linear-gradient(90deg, oklch(9% 0.012 240 / 0.98) 0%, oklch(9% 0.012 240 / 0.77) 48%, oklch(9% 0.012 240 / 0.12) 100%);
}

.market-visual-copy {
  z-index: 2;
  display: flex;
  width: 76%;
  padding: 20px;
  justify-content: flex-end;
  flex-direction: column;
  align-items: flex-start;
}

.market-visual-kicker {
  display: inline-flex;
  align-items: center;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.market-visual-copy > strong {
  margin-top: 7px;
  font-family: var(--font-display), "PingFang SC", "Noto Sans SC", sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  text-wrap: balance;
}

.market-visual-copy > span:not(.market-visual-kicker):not(.market-visual-action) {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.market-visual-action {
  display: inline-flex;
  min-height: 40px;
  margin-top: 14px;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.market-visual-action i {
  color: var(--brand);
  font-family: var(--font-mono);
  font-style: normal;
}

.segment {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--panel);
}

.segment-button {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.segment-button.is-active {
  background: var(--panel-raised);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 1px 4px rgba(0,0,0,0.3);
}

.segment-button.brand-active.is-active {
  background: var(--brand);
  color: var(--brand-ink);
}

.market-panel {
  margin-top: 14px;
}

.ticker-feature {
  position: relative;
  min-height: 186px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
}

.ticker-copy {
  position: relative;
  z-index: 2;
  padding: 18px 18px 0;
}

.ticker-symbol {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.ticker-badge {
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  background: var(--panel-raised);
  color: var(--text-soft);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.02em;
}

.ticker-price {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.chart-backdrop {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 112px;
}

.chart-grid line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-area-positive {
  fill: var(--positive-soft);
}

.chart-area-danger {
  fill: var(--danger-soft);
}

.chart-line-positive,
.chart-line-danger {
  fill: none;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-line-positive {
  stroke: var(--positive);
}

.chart-line-danger {
  stroke: var(--danger);
}

.market-list,
.activity-list,
.settings-list {
  border-top: 1px solid var(--line);
}

.market-row,
.activity-row,
.setting-row {
  display: grid;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

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

.asset-id {
  min-width: 0;
}

.asset-code {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-overflow: clip;
  white-space: nowrap;
}

.asset-name {
  display: block;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.5;
  text-overflow: clip;
  white-space: nowrap;
}

.price-stack,
.change-stack {
  min-width: 80px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.price-stack strong,
.change-stack strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
}

.price-stack span,
.change-stack span {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 10px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 12px;
}

.product-tile {
  display: flex;
  min-height: 146px;
  padding: 16px;
  justify-content: space-between;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out);
}

.product-tile.compact {
  min-height: 132px;
}

.product-tile h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.product-tile p {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.65;
  text-wrap: pretty;
}

.tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: grid;
  width: min(100%, 430px);
  min-height: calc(72px + env(safe-area-inset-bottom));
  padding: 7px 10px env(safe-area-inset-bottom);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: rgba(4, 8, 18, 0.88);
  border-top: 1px solid var(--line-strong);
  backdrop-filter: var(--blur-topbar);
  -webkit-backdrop-filter: var(--blur-topbar);
  transform: translateX(-50%);
}

.nav-item {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 56px;
  padding: 7px 2px 5px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.nav-item::before {
  position: absolute;
  top: 1px;
  width: 18px;
  height: 2px;
  border-radius: var(--radius-pill);
  background: transparent;
  content: "";
}

.nav-item.is-active {
  color: var(--brand);
}

.nav-item.is-active::before {
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand-glow);
}

.nav-item .icon {
  width: 19px;
  height: 19px;
}

.search-wrap {
  position: relative;
  margin-top: 18px;
}

.search-wrap .icon {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input,
.field-input,
.field-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  caret-color: var(--brand);
}

.search-input {
  padding: 10px 14px 10px 44px;
}

.search-input::placeholder,
.field-input::placeholder {
  color: var(--text-faint);
}

.filter-tabs,
.time-tabs,
.network-tabs,
.leverage-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0 2px;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar,
.time-tabs::-webkit-scrollbar,
.network-tabs::-webkit-scrollbar,
.leverage-list::-webkit-scrollbar {
  display: none;
}

.filter-chip,
.time-chip,
.network-chip,
.leverage-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.filter-chip.is-active,
.time-chip.is-active,
.network-chip.is-active,
.leverage-chip.is-active {
  border-color: var(--line-strong);
  background: var(--panel-raised);
  color: var(--text);
}
