:root {
  color-scheme: dark;
  --bg: #050807;
  --panel: #0c1214;
  --panel-2: #10181b;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(40, 255, 174, 0.38);
  --text: #f4f7f5;
  --muted: #9aa3a7;
  --soft: #c6cdd0;
  --green: #24f0a5;
  --green-2: #12b987;
  --red: #ff5263;
  --amber: #f7bd3b;
  --sidebar: 280px;
  --header: 70px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 78% 24%, rgba(24, 151, 111, 0.14), transparent 30%),
    linear-gradient(180deg, #050807 0%, #081011 56%, #050807 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.side-menu {
  width: var(--sidebar);
  height: 100dvh;
  position: sticky;
  top: 0;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(10, 18, 21, 0.96), rgba(7, 11, 13, 0.98)),
    radial-gradient(circle at 40% 12%, rgba(36, 240, 165, 0.1), transparent 28%);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.brand-small,
.brand-large {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 720;
}

.brand-small {
  height: 34px;
  font-size: 16px;
}

.brand-large {
  padding: 16px 4px 22px;
  font-size: 28px;
  border-bottom: 1px solid rgba(36, 240, 165, 0.14);
}

.brand-mark {
  width: 36px;
  height: 20px;
  position: relative;
  display: inline-block;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #eef1ed 42%, transparent);
}

.brand-mark::after {
  height: 20px;
  background:
    linear-gradient(20deg, transparent 44%, #eef1ed 46% 53%, transparent 55%),
    linear-gradient(40deg, transparent 44%, #eef1ed 46% 53%, transparent 55%),
    linear-gradient(60deg, transparent 44%, #eef1ed 46% 53%, transparent 55%),
    linear-gradient(80deg, transparent 44%, #eef1ed 46% 53%, transparent 55%),
    linear-gradient(100deg, transparent 44%, #eef1ed 46% 53%, transparent 55%);
  opacity: 0.9;
}

.beta {
  border: 1px solid rgba(36, 240, 165, 0.55);
  background: rgba(36, 240, 165, 0.12);
  color: var(--green);
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 6px;
}

.red-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ff5c66;
}

.nav-list {
  display: grid;
  gap: 7px;
}

.nav-item,
.campaign-entry,
.wallet-pill,
.recent-item,
.icon-button,
.select,
.input,
.tab,
.pagination button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--soft);
}

.nav-item,
.campaign-entry {
  min-height: 48px;
  border-radius: 8px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.nav-item.active,
.campaign-entry.active {
  border-color: rgba(36, 240, 165, 0.22);
  background: linear-gradient(90deg, rgba(36, 240, 165, 0.16), rgba(36, 240, 165, 0.04));
  color: var(--text);
  box-shadow: inset 3px 0 0 var(--green);
}

.nav-icon,
.tool-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: var(--green);
}

.campaign-entry {
  min-height: 76px;
  margin-top: 8px;
}

.campaign-entry small,
.recent-head span,
.muted {
  color: var(--muted);
}

.recents {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  min-height: 220px;
}

.recent-head {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
}

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

.recent-item {
  height: 40px;
  border-radius: 8px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
}

.recent-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #566067;
}

.side-spacer {
  flex: 1;
}

.wallet-pill {
  height: 52px;
  border-radius: 10px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.wallet-dot,
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: linear-gradient(135deg, #15f5a7, #72e1bf);
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.top-header {
  height: var(--header);
  flex: 0 0 var(--header);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  background: rgba(5, 8, 7, 0.72);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 6;
}

.mobile-menu-button {
  display: none;
}

.header-title {
  font-size: 15px;
  color: var(--muted);
}

.content {
  width: 100%;
  min-width: 0;
  padding: 24px 16px;
}

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.container.home {
  max-width: 1120px;
  min-height: calc(100dvh - var(--header) - 48px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-stack {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 28px;
}

.home-title {
  text-align: center;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.05;
  font-weight: 520;
  margin: 0;
}

.green-text {
  color: var(--green);
}

.chat-composer {
  width: min(100%, 980px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01)),
    repeating-linear-gradient(90deg, transparent 0 59px, rgba(255, 255, 255, 0.025) 60px),
    repeating-linear-gradient(0deg, transparent 0 59px, rgba(255, 255, 255, 0.025) 60px);
  min-height: 190px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.composer-placeholder {
  color: #64707a;
  font-size: 18px;
}

.composer-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.composer-token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cad2d7;
  font-weight: 650;
}

.send-button,
.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 720;
}

.send-button,
.primary-button {
  background: linear-gradient(135deg, #24f0a5, #18c98d);
  color: #04100c;
  box-shadow: 0 12px 34px rgba(36, 240, 165, 0.2);
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.danger-button {
  border: 1px solid rgba(255, 82, 99, 0.45);
  background: rgba(255, 82, 99, 0.08);
  color: #ff7b85;
}

.send-button {
  width: 54px;
  height: 54px;
  margin-left: auto;
  font-size: 20px;
}

.tool-row {
  width: min(100%, 980px);
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-pill {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
  min-height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #dce7f2;
}

.campaign-banner {
  width: min(100%, 560px);
  border: 1px solid rgba(36, 240, 165, 0.46);
  border-radius: 10px;
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(11, 36, 31, 0.96), rgba(5, 14, 13, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 44px, rgba(255, 255, 255, 0.025) 45px);
  box-shadow: 0 0 36px rgba(36, 240, 165, 0.12);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 120px;
  gap: 20px;
  align-items: center;
  cursor: pointer;
}

.banner-kicker,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid rgba(36, 240, 165, 0.24);
  background: rgba(36, 240, 165, 0.08);
  color: var(--green);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.banner-title {
  display: block;
  margin: 12px 0 6px;
  font-size: 22px;
  line-height: 1.05;
  font-weight: 780;
}

.banner-copy {
  margin: 0;
  color: #bcc6c9;
  font-size: 13px;
  line-height: 1.35;
}

.mini-chart {
  min-height: 100px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  position: relative;
}

.mini-chart span {
  width: 20px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, #39ffc0, #16a779);
  box-shadow: 0 0 18px rgba(36, 240, 165, 0.25);
}

.mini-chart span:nth-child(1) {
  height: 28px;
}

.mini-chart span:nth-child(2) {
  height: 48px;
}

.mini-chart span:nth-child(3) {
  height: 72px;
}

.banner-stats {
  display: grid;
  gap: 8px;
}

.banner-stat,
.metric-card,
.panel,
.hero-panel,
.bot-card,
.trade-card {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(7, 12, 13, 0.88);
  border-radius: 10px;
}

.banner-stat {
  padding: 10px 12px;
}

.label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
}

.value {
  color: var(--text);
  font-size: 18px;
  font-weight: 780;
}

.hero-panel {
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
}

.hero-panel h1 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
  margin: 18px 0 14px;
}

.hero-panel p {
  color: #c1c9cc;
  line-height: 1.6;
  margin: 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-stats .wide {
  grid-column: span 2;
}

.stat-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-height: 86px;
  background: rgba(0, 0, 0, 0.14);
}

.stat-box strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.panel {
  padding: 20px;
  margin-top: 16px;
}

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

.section-title h2,
.section-title h3 {
  margin: 0;
}

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

.metric-card {
  padding: 18px;
  min-height: 92px;
}

.metric-card strong {
  display: block;
  margin-top: 16px;
  font-size: 26px;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.leaderboard th,
.leaderboard td,
.orders th,
.orders td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 13px 12px;
  text-align: left;
  white-space: nowrap;
}

.leaderboard th,
.orders th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.leaderboard tr.you {
  outline: 1px solid rgba(36, 240, 165, 0.5);
  background: rgba(36, 240, 165, 0.08);
}

.user-badge,
.state-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 800;
  color: #04100c;
  background: var(--green);
  margin-left: 8px;
}

.state-badge {
  color: var(--green);
  background: rgba(36, 240, 165, 0.1);
  border: 1px solid rgba(36, 240, 165, 0.35);
}

.state-badge.amber {
  color: var(--amber);
  background: rgba(247, 189, 59, 0.1);
  border-color: rgba(247, 189, 59, 0.35);
}

.dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  margin-right: 12px;
  vertical-align: middle;
}

.dot.cyan {
  background: #55d9ff;
}
.dot.violet {
  background: #b6a4ff;
}
.dot.pink {
  background: #ff81df;
}
.dot.rose {
  background: #ff7da7;
}
.dot.orange {
  background: #ffad5b;
}
.dot.lime {
  background: #d8df31;
}
.dot.green {
  background: #8fe34d;
}
.dot.teal {
  background: #28d7c7;
}
.dot.mint {
  background: #35e0a5;
}

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

.bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 16px;
  max-width: 620px;
}

.tab {
  min-height: 44px;
  border-radius: 0;
  cursor: pointer;
}

.tab:first-child {
  border-radius: 8px 0 0 8px;
}

.tab:last-child {
  border-radius: 0 8px 8px 0;
}

.tab.active {
  color: var(--green);
  border-color: rgba(36, 240, 165, 0.44);
  background: rgba(36, 240, 165, 0.08);
}

.asset-table {
  width: 100%;
  border-collapse: collapse;
}

.asset-table td,
.asset-table th {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.trade-layout {
  max-width: 1720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 0.85fr);
  gap: 16px;
}

.market-strip {
  height: 70px;
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) repeat(4, auto);
  gap: 18px;
  align-items: center;
  padding: 0 16px;
}

.trade-card {
  overflow: hidden;
}

.chart-toolbar,
.history-toolbar,
.chat-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-area {
  padding: 12px;
}

#chart {
  width: 100%;
  height: 360px;
  display: block;
  border-radius: 8px;
  background: #0b1113;
}

.history {
  margin-top: 8px;
  padding: 16px;
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, 150px) minmax(180px, 1fr) auto auto;
  gap: 10px;
  margin-bottom: 12px;
}

.select,
.input {
  height: 40px;
  border-radius: 6px;
  padding: 0 12px;
}

.input {
  min-width: 0;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}

.summary-row div {
  padding: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-row div:last-child {
  border-right: 0;
}

.orders-wrap {
  width: 100%;
  overflow-x: auto;
}

.orders {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.buy {
  color: var(--green);
}

.sell {
  color: var(--red);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.pagination button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
}

.pagination .active {
  color: var(--green);
  border-color: rgba(36, 240, 165, 0.56);
}

.chat-panel {
  min-height: calc(100dvh - 118px);
  display: grid;
  grid-template-rows: auto auto minmax(300px, 1fr) auto;
}

.bot-policy {
  margin: 16px;
  padding: 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: #d6dddf;
  line-height: 1.6;
}

.policy-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.policy-tags span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
}

.messages {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px;
  overflow: auto;
}

.message {
  max-width: 86%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  color: #e5ecee;
  background: rgba(255, 255, 255, 0.045);
}

.message.user {
  margin-left: auto;
  border-color: rgba(36, 240, 165, 0.32);
  background: rgba(36, 240, 165, 0.08);
}

.message.error {
  border-color: rgba(255, 82, 99, 0.42);
  color: #ffb2b8;
}

.chat-box {
  margin: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-prompts button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--soft);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  border: 1px solid rgba(36, 240, 165, 0.42);
  background: rgba(8, 15, 15, 0.96);
  color: var(--text);
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  z-index: 40;
}

.drawer-backdrop {
  display: none;
}

@media (min-width: 768px) {
  .content {
    padding: 24px 32px;
  }
}

@media (max-width: 1180px) {
  .hero-panel,
  .trade-layout {
    grid-template-columns: 1fr;
  }

  .chat-panel {
    min-height: 720px;
  }

  .market-strip {
    height: auto;
    padding: 16px;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .side-menu {
    position: fixed;
    z-index: 20;
    left: 0;
    top: 0;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.32);
  }

  body.drawer-open .side-menu {
    transform: translateX(0);
  }

  .drawer-backdrop {
    display: block;
    pointer-events: none;
    opacity: 0;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 19;
    transition: opacity 180ms ease;
  }

  body.drawer-open .drawer-backdrop {
    pointer-events: auto;
    opacity: 1;
  }

  .mobile-menu-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
  }

  .top-header {
    padding: 0 16px;
  }

  .tool-row,
  .status-grid,
  .hero-stats,
  .summary-row,
  .filters,
  .tab-row {
    grid-template-columns: 1fr;
  }

  .hero-stats .wide {
    grid-column: auto;
  }

  .campaign-banner {
    grid-template-columns: 1fr;
  }

  .send-button {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  :root {
    --header: 64px;
  }

  .content {
    padding: 16px;
  }

  .home-title {
    font-size: 34px;
  }

  .chat-composer,
  .hero-panel,
  .panel {
    padding: 16px;
  }

  .composer-row,
  .bot-head,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .market-strip {
    grid-template-columns: 1fr;
  }

  #chart {
    height: 300px;
  }
}
