:root {
  --bg: #06080f;
  --surface: #0f1624;
  --surface-2: #121b2f;
  --accent: #47f0c2;
  --accent-2: #7cc4ff;
  --text: #dbe8ff;
  --muted: #9ab0d2;
  --border: #1d2940;
  --error: #ff6b6b;
  font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 20% 20%, rgba(71, 240, 194, 0.08), transparent 30%),
              radial-gradient(circle at 80% 0%, rgba(124, 196, 255, 0.12), transparent 35%),
              var(--bg);
  min-height: 100%;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: transparent;
}

.hero-landing {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 24px;
  background: radial-gradient(circle at 30% 40%, rgba(71, 240, 194, 0.12), transparent 45%),
              radial-gradient(circle at 70% 50%, rgba(124, 196, 255, 0.18), transparent 40%),
              #050914;
  min-height: 520px;
  display: flex;
  align-items: center;
}

.hero-center {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.hero-phone {
  width: 100%;
  max-width: 520px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(71, 240, 194, 0.08), rgba(124, 196, 255, 0.08));
  padding: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-phone__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(6, 8, 15, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

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

.topbar__left .logo.small {
  width: 38px;
  height: 38px;
  font-size: 14px;
}

.brand {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.top-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  margin-left: 12px;
}
.top-link:hover {
  color: var(--text);
}

.topbar__right {
  display: flex;
  gap: 10px;
}

.top-auth {
  display: flex;
  gap: 10px;
}

.top-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, rgba(71, 240, 194, 0.12), rgba(124, 196, 255, 0.12));
  color: var(--text);
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.user-chip:hover {
  border-color: rgba(71, 240, 194, 0.5);
  transform: translateY(-1px);
}

.user-chip__avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(145deg, #47f0c2, #7cc4ff);
  color: #08101f;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.pill-btn {
  border-radius: 999px;
  padding: 10px 16px;
}

.page {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 18px 72px;
  min-height: 100vh;
}
.page.wide {
  max-width: none;
  width: 100%;
  padding-left: 8px;
  padding-right: 8px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(71, 240, 194, 0.06), rgba(18, 27, 47, 0.9));
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

.hero__brand {
  display: flex;
  gap: 18px;
  align-items: center;
}

.logo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(145deg, #47f0c2, #7cc4ff);
  color: #08101f;
  font-weight: 700;
  display: grid;
  place-items: center;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(71, 240, 194, 0.35);
}

h1 {
  margin: 4px 0 6px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.lede {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: var(--accent);
  margin: 0 0 6px;
}

.info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 11px;
  line-height: 1;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: help;
}

.hero__meta {
  display: none;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.pill.small {
  padding: 4px 8px;
  font-size: 12px;
}

.pill--green {
  border-color: rgba(71, 240, 194, 0.4);
  background: rgba(71, 240, 194, 0.12);
  color: var(--accent);
}

.pill--outline {
  color: var(--muted);
}

.ghost-button {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--text);
  cursor: pointer;
  transition: 0.2s ease;
}

.ghost-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.logout-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
}

.card-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 22px;
}

.login-card {
  max-width: 1100px;
  width: 90%;
}

.auth-stack {
  justify-items: center;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 18px;
  min-height: 60vh;
}

.sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  background: linear-gradient(180deg, rgba(71, 240, 194, 0.06), rgba(18, 27, 47, 0.9));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar__title {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.sidebar__link {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.sidebar__link:hover {
  border-color: rgba(71, 240, 194, 0.5);
  color: var(--accent);
}

.sidebar__link.active {
  border-color: rgba(71, 240, 194, 0.7);
  background: rgba(71, 240, 194, 0.08);
  color: var(--accent);
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.section-panel {
  display: none;
}

.section-panel.active {
  display: block;
}

.hidden {
  display: none !important;
}

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

  .sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .sidebar__link {
    flex: 1 1 calc(50% - 8px);
  }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25);
}

.trade-card,
.exchange-card {
  max-width: 960px;
  margin: 0 auto;
  border: 1px solid rgba(71, 240, 194, 0.2);
  background: linear-gradient(145deg, rgba(71, 240, 194, 0.05), rgba(12, 18, 32, 0.98));
}

.exchange-card {
  max-width: 880px;
}

.default-row {
  justify-content: space-between;
  align-items: center;
}

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

.card__header h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.user-card {
  border: 1px solid rgba(71, 240, 194, 0.16);
  background: linear-gradient(135deg, rgba(71, 240, 194, 0.05), rgba(12, 18, 32, 0.95));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.muted-panel {
  border: 1px dashed var(--border);
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.form input,
.form select {
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.trade-form {
  gap: 16px;
}

.user-form {
  gap: 16px;
}

.exchange-form {
  gap: 14px;
}

.trade-form__section {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 12px 12px 14px;
  background: rgba(255,255,255,0.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.trade-form__section--two {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.trade-form__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 6px;
}

.trade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}

.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px 16px;
}

.trade-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

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

.trade-block {
  border: 1px solid rgba(71, 240, 194, 0.18);
  border-radius: 12px;
  padding: 12px;
  background: rgba(6, 8, 15, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exchange-block {
  border: 1px solid rgba(71, 240, 194, 0.18);
  border-radius: 12px;
  padding: 12px;
  background: rgba(6, 8, 15, 0.6);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.exchange-block__header,
.trade-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.exchange-block--inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trade-form__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.user-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.user-meta {
  color: var(--muted);
}

.trade-default {
  border: 1px solid rgba(255,255,255,0.06);
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.02);
}

.exchange-footer {
  display: flex;
  justify-content: flex-end;
}

.flat-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(71, 240, 194, 0.28);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.flat-toggle:hover {
  border-color: rgba(71, 240, 194, 0.6);
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
  transform: translateY(-1px);
}

.flat-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.flat-toggle__track {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(9, 14, 26, 0.9);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: background 160ms ease, border-color 160ms ease;
}

.flat-toggle__thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 160ms ease, background 160ms ease;
}

.flat-toggle input:checked + .flat-toggle__track {
  background: linear-gradient(145deg, #47f0c2, #7cc4ff);
  border-color: transparent;
}

.flat-toggle input:checked + .flat-toggle__track .flat-toggle__thumb {
  transform: translateX(18px);
  background: #0a1423;
}

.flat-toggle__text {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.form input:focus,
.form select:focus {
  outline: 1px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(71, 240, 194, 0.2);
}

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

.form--grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px 16px;
}

.span-2 {
  grid-column: 1 / -1;
}

.primary-btn,
.secondary-btn {
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

.primary-btn {
  background: linear-gradient(135deg, #47f0c2, #7cc4ff);
  color: #08101f;
  box-shadow: 0 12px 30px rgba(71, 240, 194, 0.32);
}

.secondary-btn {
  background: rgba(124, 196, 255, 0.12);
  color: var(--text);
  border: 1px solid rgba(124, 196, 255, 0.35);
}

.inline {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.inline.mid {
  align-items: center;
  gap: 10px;
}

.flat-label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin: 0;
}

.m-0 { margin: 0; }

.flat-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline.spread {
  justify-content: space-between;
}

.flat-field span {
  min-width: 68px;
  color: var(--muted);
}

.flat-field input {
  flex: 1;
}

.admin-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 400px) auto;
  align-items: end;
  gap: 12px;
  max-width: 520px;
  padding: 0 0 6px;
}

.no-wrap {
  white-space: nowrap;
}

.flex-1 { flex: 1; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px 12px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
}
.admin-user-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.admin-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.admin-user-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.pill-box {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
}
.pill-box__label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.02em;
}
.pill-box__value {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}

.telegram-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.telegram-version {
  width: 100%;
  max-width: none;
  border: 1px solid rgba(71, 240, 194, 0.35);
  background: linear-gradient(140deg, rgba(71, 240, 194, 0.08), rgba(18, 27, 47, 0.92));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
}

.telegram-version__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.telegram-version__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.telegram-version__label {
  margin: 0;
  letter-spacing: 0.08em;
}

.telegram-form {
  margin: 0;
  width: 100%;
}

.tg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 18px;
}

.telegram-form .tg-field {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(71, 240, 194, 0.3);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.telegram-form .tg-field span {
  color: var(--muted);
  font-size: 13px;
}

.telegram-form .tg-field input {
  margin-top: 8px;
  width: 100%;
  border-color: rgba(71, 240, 194, 0.35);
  background: rgba(6, 8, 15, 0.6);
}

.tg-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 14px;
  border: 1px solid rgba(71, 240, 194, 0.25);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.tg-switch:hover {
  border-color: rgba(71, 240, 194, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  transform: translateY(-1px);
}

.tg-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tg-switch__track {
  width: 46px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(9, 14, 26, 0.9);
  display: inline-flex;
  align-items: center;
  padding: 3px;
  transition: background 160ms ease, border-color 160ms ease;
}

.tg-switch__thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  transition: transform 160ms ease, background 160ms ease;
}

.tg-switch input:checked + .tg-switch__track {
  background: linear-gradient(145deg, #47f0c2, #7cc4ff);
  border-color: transparent;
}

.tg-switch input:checked + .tg-switch__track .tg-switch__thumb {
  transform: translateX(18px);
  background: #0a1423;
}

.tg-switch__text {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tg-helper {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.tg-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}
.pill-field span {
  color: var(--muted);
  font-size: 12px;
}
.pill-field select,
.pill-field input {
  margin-top: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px;
}
.admin-actions {
  margin-top: 4px;
}
.strong { font-weight: 600; }
.tiny { font-size: 12px; margin: 0; }
.danger { border: 1px solid rgba(255, 107, 107, 0.5); color: #ff6b6b; }

.inline label {
  flex: 1;
}

.inline label input,
.inline label select {
  width: 100%;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.checkbox input {
  width: 16px;
  height: 16px;
}

.list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.chip small {
  color: var(--muted);
}

.admin-card .admin-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.toast {
  position: fixed;
  bottom: 28px;
  right: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--text);
  box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}

.toast.error {
  border-left-color: var(--error);
}

.hidden {
  display: none;
}

.market-page {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(71, 240, 194, 0.04), rgba(12, 18, 32, 0.92));
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
  padding: 16px;
}

.market-grid {
  display: grid;
  grid-template-columns: var(--market-grid, 1.4fr 10px 1fr);
  gap: 12px;
  min-height: 640px;
  position: relative;
}

.market-chart {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(71, 240, 194, 0.05), transparent 40%), #050914;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grid-resize-handle {
  width: 10px;
  margin: 0 -2px;
  cursor: col-resize;
  position: relative;
  display: grid;
  place-items: center;
  user-select: none;
  align-self: stretch;
}

.grid-resize-handle span {
  width: 2px;
  height: 80%;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  transition: background 120ms ease, transform 120ms ease, opacity 120ms ease;
  opacity: 0.6;
}

.grid-resize-handle:hover span,
.grid-resize-handle.dragging span {
  background: rgba(71, 240, 194, 0.7);
  opacity: 1;
  transform: scaleY(1.05);
}

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

.chart-timeframe,
.chart-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.chip-btn.active {
  background: linear-gradient(135deg, #7b5cff, #c55bff);
  border-color: #7b5cff;
}

.chip-btn.ghost {
  background: transparent;
}

.chart-placeholder {
  flex: 1;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 14px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(18, 27, 47, 0.6), rgba(6, 8, 15, 0.9));
}

.chart-wave {
  position: absolute;
  width: 140%;
  height: 180px;
  border-radius: 50%;
  background: none;
  border: 2px solid #47f0c2;
  opacity: 0.6;
  transform: rotate(-6deg);
  filter: drop-shadow(0 0 14px rgba(71, 240, 194, 0.3));
}

.chart-wave.muted {
  border-color: rgba(255,255,255,0.06);
  transform: rotate(2deg) translateY(40px);
}

.market-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(12, 18, 32, 0.9), rgba(6, 8, 15, 0.96));
  display: flex;
  flex-direction: column;
  height: 100%;
}

.market-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

.market-title {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
  position: relative;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot-purple { background: #8f6bff; }
.dot-green { background: #47f0c2; }

.caret { color: var(--muted); font-size: 12px; }

.market-exchange {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
  position: relative;
}

.exchange-label {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

.menu-dots {
  font-size: 18px;
  color: var(--muted);
}

.select-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

.select-control.ghost {
  background: transparent;
}

.select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 150px;
  background: #0d1422;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.45);
  overflow: hidden;
  z-index: 5;
}

.select-menu button {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  border: none;
  text-align: left;
  cursor: pointer;
}

.select-menu button:hover {
  background: rgba(71, 240, 194, 0.08);
}

.market-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.market-table__head {
  display: grid;
  grid-template-columns: var(--market-columns, 1.6fr 1.05fr 1.05fr 1.05fr 1.05fr 0.9fr 1.1fr);
  column-gap: 18px;
  padding: 12px 18px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

.sort-btn {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.sort-btn .sort-icon {
  font-size: 10px;
  color: var(--muted);
}

.sort-btn.active {
  color: var(--text);
}

.sort-btn.active .sort-icon {
  color: var(--accent);
}

.market-table__body {
  overflow: auto;
  max-height: 72vh;
  scrollbar-color: rgba(255,255,255,0.18) transparent;
  scrollbar-width: thin;
}

.market-row {
  display: grid;
  grid-template-columns: var(--market-columns, 1.6fr 1.05fr 1.05fr 1.05fr 1.05fr 0.9fr 1.1fr);
  align-items: center;
  padding: 12px 18px;
  column-gap: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.market-row:hover {
  background: rgba(71, 240, 194, 0.05);
}

.market-row.active {
  border-left: 3px solid #47f0c2;
  background: linear-gradient(90deg, rgba(71, 240, 194, 0.08), rgba(255,255,255,0));
}

.market-row .symbol {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, #47f0c2, #7cc4ff);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: #08101f;
  font-weight: 800;
}

.text-up { color: #45f0c0; }
.text-down { color: #ff7b7b; }

.market-preview {
  padding: 14px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
  background: rgba(255,255,255,0.02);
}

.preview-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.preview-symbol {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-circle {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, #1e2738, #162030);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text);
}

.preview-name {
  margin: 0 0 4px;
  font-weight: 700;
}

.preview-price .price {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.preview-right {
  text-align: right;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.preview-funding {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  display: flex;
  overflow: hidden;
}

.progress-long {
  background: linear-gradient(90deg, #47f0c2, #2abf9a);
  height: 100%;
  width: 50%;
}

.progress-short {
  background: linear-gradient(90deg, #ff7b7b, #c24747);
  height: 100%;
  width: 50%;
}

.progress-labels {
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.market-table__head .col,
.market-row .col {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
}

.market-table__body::-webkit-scrollbar {
  width: 10px;
}

.market-table__body::-webkit-scrollbar-track {
  background: rgba(12, 18, 32, 0.8);
}

.market-table__body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  border: 2px solid rgba(12, 18, 32, 0.8);
}

.market-table__body::-webkit-scrollbar-thumb:hover {
  background: rgba(71, 240, 194, 0.35);
}

.resize-handle {
  position: absolute;
  top: 0;
  right: -6px;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  opacity: 0;
  display: grid;
  place-items: center;
  transition: opacity 120ms ease, background 120ms ease;
}

.resize-handle::after {
  content: "";
  width: 2px;
  height: 60%;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.market-table__head .col:hover .resize-handle,
.market-table__head .col:focus-within .resize-handle {
  opacity: 0.8;
}

body.resizing {
  user-select: none;
  cursor: col-resize;
}

@media (max-width: 1080px) {
  .market-grid {
    grid-template-columns: 1fr;
  }
  .grid-resize-handle {
    display: none;
  }
  .market-preview {
    grid-template-columns: 1fr;
  }
  .market-row,
  .market-table__head {
    grid-template-columns: var(--market-columns, 1.5fr 0.95fr 0.95fr 0.95fr 0.95fr 0.9fr 1.05fr);
    column-gap: 12px;
  }
}

@media (max-width: 768px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .hero__meta {
    align-self: flex-end;
  }
}
