:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --sidebar-bg: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --accent: #10b981;
  --profit: #0ecb81;
  --loss: #f6465d;
  --radius-xl: 24px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-lg: 0px 20px 40px -5px rgba(15, 23, 42, 0.08);
  --shadow-md: 0px 12px 28px -8px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  overflow-x: hidden;
}

body {
  font-family: "Inter", sans-serif;
}

button,
input {
  font-family: inherit;
}

.page-wrap {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

.page-wrap.app-locked {
  pointer-events: none;
  user-select: none;
  filter: blur(1px);
  opacity: 0.92;
}

.dotcoin-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  background: #f8fafc;
  border-radius: 0;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid #e2e8f0;
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
}

.brand {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin-bottom: 30px;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  min-height: 42px;
  border-radius: 12px;
  padding: 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  cursor: pointer;
  position: relative;
}

.nav-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  margin-left: auto;
}

.nav-item.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.25);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 8px;
}

.footer-link {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  min-height: 36px;
  border-radius: 12px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  cursor: pointer;
}

.footer-link:hover {
  color: #0f172a;
  background: #f8fafc;
}

.main-section {
  padding: 20px;
  background: #f8fafc;
  min-width: 0;
}

.topbar {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
  min-height: 70px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-field {
  flex: 1;
  min-height: 46px;
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: #94a3b8;
  border: 1px solid #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
}

.search-field input {
  border: none;
  background: transparent;
  width: 100%;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.search-field input:focus {
  outline: none;
}

.filter-btn,
.mini-btn {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  cursor: pointer;
}

.logout-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-status,
.user-pill {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  font-size: 0.77rem;
  font-weight: 700;
}

.user-pill {
  background: #f4f4f6;
  color: var(--text-primary);
}

.mini-status.online {
  background: rgba(14, 203, 129, 0.12);
  color: var(--profit);
}

.mini-status.offline {
  background: rgba(246, 70, 93, 0.12);
  color: var(--loss);
}

.dashboard-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1.5fr 0.95fr;
  gap: 12px;
}

.left-stack,
.right-stack {
  display: grid;
  gap: 12px;
  align-content: start;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
}

.top-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.balance-card,
.market-card,
.chart-card,
.positions-card,
.wallet-card,
.trade-card,
.recent-card {
  padding: 16px;
}

.eyebrow {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
}

#equity-value {
  margin: 10px 0 0;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.balance-meta {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pnl-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.pnl-value.profit {
  color: var(--profit);
}

.pnl-value.loss {
  color: var(--loss);
}

.pnl-value.neutral {
  color: var(--text-secondary);
}

.date {
  color: var(--text-secondary);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.market-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.market-card:focus-visible {
  outline: 2px solid #11142d;
  outline-offset: 2px;
}

.market-card h2 {
  margin: 6px 0 0;
  font-size: 1.3rem;
}

.market-price-wrap {
  text-align: right;
}

.asset-price {
  margin: 0;
  font-weight: 800;
  font-size: 1.04rem;
}

.asset-change {
  margin: 4px 0 0;
  font-size: 0.85rem;
  font-weight: 700;
}

.asset-change.profit {
  color: var(--profit);
}

.asset-change.loss {
  color: var(--loss);
}

.asset-change.neutral {
  color: var(--text-secondary);
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.chart-tabs {
  display: inline-flex;
  gap: 6px;
}

.chip-tab {
  border: none;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f2f3f6;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.chip-tab.active {
  background: #11142d;
  color: #fff;
}

.chart-status {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.chart-container {
  width: 100%;
  height: 330px;
  border-radius: 16px;
  overflow: hidden;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.section-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.section-head span {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.positions-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.position-card,
.empty-state {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.empty-state {
  padding: 14px;
  color: var(--text-secondary);
}

.position-card {
  padding: 12px;
}

.position-card.flash-tp {
  animation: flash-profit 0.45s ease 2;
}

.position-card.flash-sl {
  animation: flash-loss 0.45s ease 2;
}

.position-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.position-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.93rem;
}

.side-pill {
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
}

.side-pill.long {
  background: rgba(14, 203, 129, 0.14);
  color: var(--profit);
}

.side-pill.short {
  background: rgba(246, 70, 93, 0.14);
  color: var(--loss);
}

.close-btn {
  border: none;
  border-radius: 999px;
  min-height: 30px;
  padding: 0 11px;
  background: #11142d;
  color: #fff;
  font-size: 0.74rem;
  cursor: pointer;
}

.risk-label {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.74rem;
}

.tp-text {
  color: var(--profit);
}

.sl-text {
  color: var(--loss);
}

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

.metric {
  background: #f6f7fb;
  border-radius: 12px;
  padding: 8px;
}

.metric-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.metric-value {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  font-weight: 700;
}

.metric-value.profit {
  color: var(--profit);
}

.metric-value.loss {
  color: var(--loss);
}

.wallet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.wallet-head h3 {
  margin: 0;
  font-size: 1rem;
}

.credit-card {
  border-radius: 14px;
  background: linear-gradient(140deg, #11142d, #07070a);
  color: #fff;
  padding: 12px;
  min-height: 124px;
}

.card-dots {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.08em;
}

.card-number {
  margin: 28px 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
}

.card-owner {
  margin: 8px 0 0;
  font-size: 0.83rem;
  font-weight: 700;
}

.trade-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.trade-head h3 {
  margin: 0;
  font-size: 1rem;
}

.trade-head p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.trade-head strong {
  color: var(--text-primary);
}

.control-group {
  margin-top: 10px;
}

.control-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.control-label-row label {
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.control-label-row strong {
  color: var(--text-primary);
}

.leverage-slider {
  width: 100%;
  accent-color: #11142d;
}

.leverage-steps {
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.risk-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.risk-field {
  display: grid;
  gap: 4px;
}

.risk-field label {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

.amount-input {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: var(--radius-md);
  padding: 0 12px;
  background: #f2f4f7;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.amount-input:focus {
  outline: 2px solid rgba(17, 20, 45, 0.35);
}

.tp-input:focus {
  outline: 2px solid rgba(14, 203, 129, 0.45);
}

.sl-input:focus {
  outline: 2px solid rgba(246, 70, 93, 0.45);
}

.text-btn {
  border: none;
  border-radius: 999px;
  min-height: 26px;
  padding: 0 10px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
}

.trade-actions {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.trade-btn {
  border: none;
  border-radius: 999px;
  min-height: 41px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
}

.trade-btn.long {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.trade-btn.short {
  background: #fff;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px #cbd5e1;
}

.recent-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.activity-item {
  background: #f8f9fb;
  border-radius: 12px;
  padding: 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.activity-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
}

.activity-sub {
  margin: 4px 0 0;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.activity-value {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.activity-value.profit {
  color: var(--profit);
}

.activity-value.loss {
  color: var(--loss);
}

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 20, 45, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 60;
}

.sheet-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.asset-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 560px);
  margin: 0 auto;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  transform: translateY(112%);
  transition: transform 250ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet-overlay.open .asset-sheet {
  transform: translateY(0);
}

.asset-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.asset-sheet-head h3 {
  margin: 0;
  font-size: 1rem;
}

.asset-options {
  display: grid;
  gap: 8px;
}

.asset-option {
  width: 100%;
  border: none;
  border-radius: var(--radius-md);
  background: #f4f6f8;
  padding: 12px;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  color: var(--text-primary);
  cursor: pointer;
}

.asset-option.active {
  background: #11142d;
  color: #fff;
}

.asset-option .symbol {
  margin: 0;
  font-weight: 800;
}

.asset-option .meta {
  margin: 3px 0 0;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.asset-option.active .meta {
  color: rgba(255, 255, 255, 0.74);
}

.asset-option .quote {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.asset-option .delta {
  margin: 4px 0 0;
  text-align: right;
  font-size: 0.78rem;
}

.asset-option .delta.profit {
  color: var(--profit);
}

.asset-option .delta.loss {
  color: var(--loss);
}

.asset-option .delta.neutral {
  color: var(--text-secondary);
}

.bottom-nav {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  bottom: 26px;
  z-index: 80;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.profit {
  color: var(--profit);
}

.toast.loss {
  color: var(--loss);
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: #f8fafc;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
  overflow-y: auto;
}

.auth-screen.hidden {
  display: none;
}

.auth-card {
  width: min(100%, 460px);
  background: #ffffff;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.auth-eyebrow {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.auth-card h1 {
  margin: 10px 0 0;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.25;
}

.auth-sub {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-actions {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.auth-btn {
  width: 100%;
  min-height: 48px;
  border: none;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}

.auth-btn.google {
  background: #ffffff;
  color: #11142d;
  box-shadow: inset 0 0 0 1px #d9deea;
}

.auth-btn.apple {
  background: #11142d;
  color: #ffffff;
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-status {
  min-height: 18px;
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.auth-status.error {
  color: var(--loss);
}

.auth-status.success {
  color: var(--profit);
}

.landing-auth-screen {
  background-color: #f8fafc;
}

.landing-shell {
  width: 100%;
  min-height: 100%;
}

.hero-bg {
  background: radial-gradient(circle at 10% 20%, rgba(16, 185, 129, 0.08) 0%, rgba(255, 255, 255, 0) 50%),
    radial-gradient(circle at 90% 50%, rgba(99, 102, 241, 0.08) 0%, rgba(255, 255, 255, 0) 50%);
}

.glass-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 40px -5px rgba(15, 23, 42, 0.06);
}

.primary-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  transition: all 0.3s ease;
}

.primary-btn:hover {
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.accent-text {
  background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rank-badge {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.perspective-1000 {
  perspective: 1000px;
}

/* Dashboard Product Polish */
.dotcoin-shell {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.sidebar {
  width: 248px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
}

.brand-badge {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #0f172a;
  color: #34d399;
  font-size: 1rem;
  font-weight: 800;
  transform: rotate(3deg);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
}

.brand-accent {
  color: #10b981;
}

.sidebar-nav .nav-item {
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.sidebar-nav .nav-item:hover:not(.active) {
  color: #0f172a;
  background: #f1f5f9;
  transform: translateX(2px);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  backdrop-filter: blur(8px);
}

.filter-btn,
.mini-btn,
.text-btn,
.trade-btn,
.close-btn,
.footer-link {
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, color 180ms ease;
}

.filter-btn:hover,
.mini-btn:hover,
.text-btn:hover,
.trade-btn:hover,
.close-btn:hover {
  transform: translateY(-1px);
}

.mini-btn {
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

.search-field:focus-within {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.user-pill {
  background: #eef2ff;
  color: #0f172a;
}

.dashboard-grid {
  margin-top: 16px;
  gap: 16px;
}

.card {
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px -14px rgba(15, 23, 42, 0.24);
}

.balance-card {
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
  border-color: #d1fae5;
}

.market-card {
  background: linear-gradient(145deg, #ffffff 0%, #ecfeff 100%);
  border-color: #ccfbf1;
}

.market-price-wrap i {
  color: #10b981;
}

.chart-card {
  padding: 18px;
}

.chip-tab.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.chart-container {
  border: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.position-card,
.empty-state {
  border: 1px solid #e2e8f0;
  box-shadow: none;
}

.position-card {
  background: #ffffff;
}

.metric {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.close-btn {
  background: #0f172a;
}

.close-btn:hover {
  background: #111827;
}

.credit-card {
  background: linear-gradient(140deg, #0f172a, #111827 60%, #065f46 130%);
}

.amount-input {
  background: #ffffff;
  border: 1px solid #dbe3ef;
}

.amount-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.tp-input:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
}

.sl-input:focus {
  outline: none;
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.16);
}

.leverage-slider {
  accent-color: #10b981;
}

.trade-btn.long {
  box-shadow: 0 12px 22px rgba(16, 185, 129, 0.22);
}

.trade-btn.short:hover {
  background: #f8fafc;
}

.activity-item {
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.asset-option.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 700ms ease-out;
}

@keyframes flash-profit {
  0% {
    background: #e7fff4;
  }
  50% {
    background: #b8f5da;
  }
  100% {
    background: #fff;
  }
}

@keyframes flash-loss {
  0% {
    background: #ffeef2;
  }
  50% {
    background: #ffd1da;
  }
  100% {
    background: #fff;
  }
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .top-cards {
    grid-template-columns: 1fr;
  }

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

  .trade-card,
  .recent-card {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .page-wrap {
    padding: 0;
  }

  .dotcoin-shell {
    display: block;
    border-radius: 0;
    width: 100%;
    min-height: 100dvh;
    box-shadow: none;
    background: transparent;
  }

  .sidebar {
    display: none;
  }

  .main-section {
    padding: 10px 10px calc(88px + env(safe-area-inset-bottom));
    background: transparent;
  }

  .topbar {
    position: sticky;
    top: 8px;
    z-index: 10;
    min-height: 62px;
    padding: 8px 10px;
  }

  .topbar-right .user-pill {
    display: none;
  }

  .dashboard-grid {
    margin-top: 10px;
    gap: 10px;
  }

  .left-stack,
  .right-stack {
    gap: 10px;
  }

  .top-cards {
    gap: 10px;
  }

  .balance-card,
  .market-card,
  .chart-card,
  .positions-card,
  .wallet-card,
  .trade-card,
  .recent-card {
    padding: 14px;
  }

  .right-stack {
    grid-template-columns: 1fr;
  }

  .trade-card,
  .recent-card {
    grid-column: auto;
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    box-shadow: var(--shadow-lg);
  }

  .bottom-nav .nav-item {
    min-height: 50px;
    padding: 0;
    border-radius: 12px;
    flex-direction: column;
    justify-content: center;
    font-size: 0.68rem;
    gap: 4px;
  }

  .bottom-nav .nav-item.active {
    background: #000;
    color: #fff;
  }

  .toast {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  .main-section {
    padding: 8px 8px calc(90px + env(safe-area-inset-bottom));
  }

  .topbar {
    border-radius: 14px;
  }

  .search-field {
    min-width: 0;
    min-height: 42px;
    padding: 0 12px;
  }

  .filter-btn,
  .mini-btn:not(.logout-btn),
  .mini-status {
    display: none;
  }

  .chart-container {
    height: 240px;
  }

  .position-grid {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    padding: 12px;
  }

  .auth-card {
    border-radius: 24px;
    padding: 20px;
  }

}
