@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600&family=Geist+Mono:wght@300;400;500&family=Inter:wght@400;500;600&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f5f5f1;
  --bg-deep: #e5e5de;
  --surface: #ffffff;
  --surface-soft: #f4f4ef;
  --surface-raised: #e9e9e2;
  --panel: rgba(255, 255, 252, 0.78);
  --panel-soft: rgba(255, 255, 252, 0.52);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --ink: #171819;
  --muted: #606467;
  --subtle: #8b9094;
  --line: rgba(23, 24, 25, 0.11);
  --line-strong: rgba(23, 24, 25, 0.24);
  --accent: #ff5c45;
  --accent-2: #2a1916;
  --accent-warm: #f6b44b;
  --positive: #2f9f6a;
  --cyan: #1d98b6;
  --violet: #7f6cff;
  --danger: #ff5c45;
  --cta: #171819;
  --cta-ink: #e6e6e6;
  --shadow: rgba(17, 24, 28, 0.08) 0 18px 54px;
  --key-shadow: rgba(0, 0, 0, 0.16) 0px 1.5px 0.5px 2.5px, rgba(0, 0, 0, 0.1) 0px 0px 0.5px 1px,
    rgba(0, 0, 0, 0.08) 0px 2px 1px 1px inset, rgba(255, 255, 255, 0.75) 0px 1px 1px 1px inset;
  --ring-shadow: rgba(255, 255, 255, 0.5) 0px 1px 0px 0px inset, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,
    rgba(0, 0, 0, 0.08) 0px -1px 0px 0px inset;
  --radius: 8px;
  --radius-large: 8px;
  --font-sans: "Geist", "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: var(--font-sans);
  --font-data: "Geist Mono", "IBM Plex Mono", "SFMono-Regular", "Roboto Mono", "Cascadia Mono", monospace;
  --type-micro: 0.6875rem;
  --type-caption: 0.75rem;
  --type-label: 0.8125rem;
  --type-body-sm: 0.875rem;
  --type-body: 1rem;
  --type-body-lg: 1.0625rem;
  --type-title-sm: 1.125rem;
  --type-title: 1.375rem;
  --type-heading: 1.875rem;
  --type-heading-lg: 2.875rem;
  --type-display: 3.5rem;
  --type-display-xl: 6.75rem;
  --leading-tight: 1.06;
  --leading-title: 1.16;
  --leading-body: 1.64;
  --leading-caption: 1.5;
}

body.dark {
  color-scheme: dark;
  --bg: #050706;
  --bg-deep: #0a0d0d;
  --surface: #0d1011;
  --surface-soft: #141819;
  --surface-raised: #1d2324;
  --panel: rgba(10, 13, 13, 0.78);
  --panel-soft: rgba(18, 23, 24, 0.68);
  --panel-strong: rgba(23, 29, 30, 0.9);
  --ink: #ffffff;
  --muted: #a2aaae;
  --subtle: #6c7377;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.22);
  --accent: #ff6a52;
  --accent-2: #321b16;
  --accent-warm: #f3bd54;
  --positive: #61d394;
  --cyan: #43c3d6;
  --violet: #9a88ff;
  --danger: #ff6a52;
  --cta: #e6e6e6;
  --cta-ink: #2f3031;
  --shadow: rgba(0, 0, 0, 0.28) 0px 1.189px 2.377px 0px;
  --key-shadow: rgba(0, 0, 0, 0.4) 0px 1.5px 0.5px 2.5px, rgb(0, 0, 0) 0px 0px 0.5px 1px,
    rgba(0, 0, 0, 0.25) 0px 2px 1px 1px inset, rgba(255, 255, 255, 0.2) 0px 1px 1px 1px inset;
  --ring-shadow: rgba(255, 255, 255, 0.05) 0px 1px 0px 0px inset, rgba(255, 255, 255, 0.25) 0px 0px 0px 1px,
    rgba(0, 0, 0, 0.2) 0px -1px 0px 0px inset;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--bg-deep) 68%, transparent) 0%, var(--bg) 38%, var(--bg) 100%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent), transparent 34%, color-mix(in srgb, var(--cyan) 12%, transparent) 65%, transparent 100%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--type-body);
  font-weight: 400;
  line-height: var(--leading-body);
  font-feature-settings: "calt", "kern", "liga", "ss03";
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
strong,
b {
  font-family: var(--font-display);
  font-feature-settings: "calt", "kern", "liga", "ss03";
}

h1,
h2,
h3 {
  text-wrap: balance;
  word-break: auto-phrase;
  overflow-wrap: break-word;
}

p,
small,
li {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

strong,
b {
  font-weight: 600;
}

code,
kbd,
pre,
table,
.status-pill,
.terminal-strip,
.metric-card strong,
.balance-panel h3,
.risk-result h3,
.score-badge,
.wallet-button,
.utility-button {
  font-variant-numeric: tabular-nums;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--ink) 4%, transparent) 1px, transparent 1px),
    linear-gradient(180deg, transparent 56%, color-mix(in srgb, var(--bg-deep) 86%, transparent));
  background-size:
    48px 48px,
    48px 48px,
    auto;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.72) 52%, transparent 100%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.16;
  background: linear-gradient(180deg, transparent 0, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
  animation: ambient-scan 8s linear infinite;
}

@keyframes ambient-scan {
  0% {
    transform: translateY(-30%);
  }
  100% {
    transform: translateY(30%);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glow-pulse {
  0%,
  100% {
    box-shadow: var(--key-shadow);
  }
  50% {
    box-shadow:
      var(--key-shadow),
      rgba(255, 255, 255, 0.06) 0px 0px 20px 5px;
  }
}

@keyframes bar-in {
  from {
    transform: scaleY(0.18);
    opacity: 0.45;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

button,
input,
select {
  font: inherit;
}

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

button {
  cursor: pointer;
}

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

main {
  width: min(1200px, calc(100% - 36px));
  margin: 0 auto;
}

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

.risk-strip {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 7px 16px;
  color: var(--muted);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: 0;
  line-height: var(--leading-caption);
  backdrop-filter: blur(22px);
}

.risk-strip span:first-child {
  color: var(--ink);
}

.risk-strip span:first-child::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--accent);
  border-radius: 99999px;
}

.topbar {
  position: sticky;
  top: 35px;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  width: min(1200px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(36px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 210px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 38px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 99999px;
  box-shadow: var(--ring-shadow);
  font-family: var(--font-data);
  font-size: var(--type-label);
  font-weight: 500;
  text-transform: uppercase;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.05;
}

.brand strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: var(--type-body-lg);
  font-weight: 600;
  letter-spacing: 0;
  text-shadow: none;
}

.brand small {
  margin-top: 5px;
  color: var(--muted);
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: 0;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 2px;
  overflow-x: auto;
}

.nav a {
  padding: 8px 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: var(--type-label);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.nav a:hover {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
}

body[data-page="ai"] .nav a[href$="ai.html"],
body[data-page="dashboard"] .nav a[href$="dashboard.html"],
body[data-page="markets"] .nav a[href$="markets.html"],
body[data-page="risk"] .nav a[href$="risk.html"],
body[data-page="portfolio"] .nav a[href$="portfolio.html"],
body[data-page="learn"] .nav a[href$="learn.html"] {
  color: var(--ink);
  border-color: var(--line);
  background: var(--panel-soft);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.icon-button,
.utility-button,
.wallet-button,
.primary-button,
.ghost-button,
.chat-form button,
.quick-add button,
.primary-link,
.secondary-link,
.compare-button,
.prompt-chips button,
.lesson-grid button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--key-shadow);
  font-size: var(--type-body-sm);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
  transition:
    transform 140ms ease,
    background 140ms ease,
    color 140ms ease,
    border-color 140ms ease;
}

.icon-button:hover,
.utility-button:hover,
.wallet-button:hover,
.primary-button:hover,
.ghost-button:hover,
.chat-form button:hover,
.quick-add button:hover,
.primary-link:hover,
.secondary-link:hover,
.compare-button:hover,
.prompt-chips button:hover,
.lesson-grid button:hover {
  transform: translateY(-1px);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
}

.utility-button {
  padding: 0 14px;
  color: var(--muted);
  background: transparent;
}

.icon-sun {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.icon-sun::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.wallet-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  color: var(--cta-ink);
  background: var(--cta);
  border-color: var(--cta);
  animation: none;
}

.wallet-dot {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 999px;
}

.wallet-button.connected .wallet-dot {
  background: var(--positive);
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(520px, 1.05fr);
  gap: 18px;
  min-height: calc(100vh - 130px);
  padding: 28px 0 22px;
}

.home-command,
.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(440px, 1.05fr);
  gap: 18px;
  padding: 28px 0 22px;
}

.page-shell {
  align-items: stretch;
  min-height: calc(100vh - 170px);
}

.page-section {
  min-height: calc(100vh - 210px);
  animation: rise-in 520ms ease both;
}

.hero-copy,
.page-hero,
.terminal-preview,
.feature-card,
.assistant-panel,
.metric-card,
.balance-panel,
.suggestion-panel,
.alerts-panel,
.simulator-panel,
.risk-result,
.history-panel,
.holdings-panel,
.education-panel,
.pricing-panel,
.table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow);
  backdrop-filter: blur(36px);
  animation: rise-in 520ms ease both;
}

.hero-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 680px;
  padding: clamp(22px, 4vw, 52px);
  overflow: hidden;
}

.home-hero {
  min-height: 650px;
}

.page-hero {
  position: relative;
  min-height: 620px;
  padding: clamp(22px, 4vw, 46px);
  overflow: hidden;
}

.compact-hero::before,
.terminal-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cyan) 10%, transparent), transparent 42%),
    linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 8%, transparent));
}

.page-hero h1,
.page-section h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: 0;
}

.page-hero h1 {
  max-width: 760px;
  font-size: var(--type-display);
}

.page-section h1 {
  max-width: 900px;
  font-size: var(--type-heading-lg);
}

.page-hero p {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: var(--type-body-lg);
  font-weight: 400;
  line-height: var(--leading-body);
}

.terminal-preview {
  position: relative;
  min-height: 650px;
  padding: 14px;
  overflow: hidden;
}

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

.cockpit-preview > * {
  position: relative;
  z-index: 1;
}

.terminal-header,
.route-card,
.risk-feed {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 14px;
}

.terminal-label,
.route-row span,
.route-meta span,
.feed-row span,
.feed-row small {
  color: var(--muted);
  font-family: var(--font-data);
  font-size: var(--type-micro);
  font-weight: 400;
  line-height: var(--leading-caption);
  text-transform: uppercase;
}

.terminal-header strong {
  display: block;
  margin-top: 5px;
  font-size: var(--type-title);
  font-weight: 600;
  line-height: var(--leading-title);
}

.status-pill.live::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--positive);
  border-radius: 999px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--positive) 18%, transparent);
}

.route-card {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.route-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.route-row strong {
  max-width: 66%;
  text-align: right;
  font-family: var(--font-data);
  font-size: var(--type-label);
  font-weight: 500;
  line-height: var(--leading-caption);
}

.route-score {
  height: 9px;
  overflow: hidden;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.route-score span {
  display: block;
  width: var(--score);
  height: 100%;
  background: linear-gradient(90deg, var(--positive), var(--cyan), var(--accent-warm));
}

.route-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.route-meta span {
  min-height: 34px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
}

.preview-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.preview-grid article {
  min-height: 126px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.preview-grid article:hover,
.feature-card:hover,
.metric-card:hover,
.suggestion-item:hover,
.holding-item:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  background: var(--panel-strong);
}

.preview-grid span,
.preview-grid small {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 500;
  line-height: var(--leading-caption);
}

.preview-grid strong {
  display: block;
  margin: 20px 0 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: var(--type-heading);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--leading-tight);
}

.risk-feed {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.feed-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
}

.feed-row:first-child {
  border-top: 0;
}

.feed-row strong {
  font-size: var(--type-body-sm);
  font-weight: 500;
  line-height: var(--leading-caption);
}

.hero-copy::before {
  content: "DEFIWISE";
  position: absolute;
  right: -0.1em;
  bottom: 0.07em;
  z-index: 0;
  color: rgba(255, 255, 255, 0.025);
  font-size: var(--type-display-xl);
  font-weight: 600;
  line-height: 0.86;
  pointer-events: none;
}

.hero-copy > * {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--subtle);
  font-size: var(--type-micro);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  background: var(--accent);
  border-radius: 99999px;
  vertical-align: 1px;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: 0;
}

.hero-copy h1 span {
  display: block;
}

.hero-copy p {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: var(--type-body-lg);
  font-weight: 400;
  line-height: var(--leading-body);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 154px;
  padding: 0 18px;
}

.primary-link,
.primary-button,
.chat-form button,
.quick-add button {
  color: var(--cta-ink);
  background: var(--cta);
  border-color: var(--cta);
}

.secondary-link,
.ghost-button,
.compare-button {
  color: var(--muted);
  background: transparent;
}

.terminal-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0;
}

.terminal-ticker span {
  animation: none;
}

.terminal-ticker span:nth-child(2) {
  animation-delay: 0.35s;
}

.terminal-ticker span:nth-child(3) {
  animation-delay: 0.7s;
}

.terminal-ticker span:nth-child(4) {
  animation-delay: 1.05s;
}

.terminal-strip span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--muted);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-data);
  font-size: var(--type-micro);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

.strategy-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
}

.strategy-board article {
  min-height: 126px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
}

.strategy-board span,
.strategy-board small,
.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 500;
  line-height: var(--leading-caption);
}

.strategy-board strong {
  display: block;
  margin: 16px 0 10px;
  color: var(--ink);
  font-size: var(--type-heading-lg);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--leading-tight);
}

.assistant-panel {
  display: flex;
  flex-direction: column;
  min-height: 680px;
  padding: 18px;
}

.panel-header,
.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-header h2,
.panel-header h3,
.section-title h2,
.education-panel h2,
.pricing-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--type-heading);
  line-height: var(--leading-title);
  letter-spacing: 0;
}

.panel-header h3 {
  font-size: var(--type-title-sm);
}

.section-title h1,
.section-title h2,
.panel-header h2,
.panel-header h3 {
  max-width: 820px;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.prompt-chips button,
.lesson-grid button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--surface-raised);
  border-color: var(--line);
  font-family: var(--font-data);
  font-size: var(--type-caption);
  font-weight: 400;
  letter-spacing: 0;
}

.chat-window {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-height: 410px;
  max-height: 540px;
  padding: 14px;
  overflow: auto;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--cyan) 8%, transparent), transparent 46%),
    var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 99999px;
  box-shadow: var(--ring-shadow);
  font-family: var(--font-data);
  font-size: var(--type-micro);
  font-weight: 400;
}

.message.user .message-avatar {
  color: var(--cta-ink);
  background: var(--cta);
  border-color: var(--cta);
}

.message-body {
  width: min(88%, 680px);
  padding: 16px;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
  font-size: var(--type-body);
  line-height: var(--leading-body);
}

.message-body strong {
  color: var(--ink);
}

.message.user .message-body {
  background: var(--panel-strong);
}

.message-body p,
.message-body ul,
.message-body ol {
  margin: 8px 0 0;
}

.message-body ul,
.message-body ol {
  padding-left: 20px;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  margin-top: 12px;
}

.chat-form input,
.quick-add input,
.filter-bar select {
  min-height: 44px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.chat-form input::placeholder,
.quick-add input::placeholder {
  color: color-mix(in srgb, var(--muted) 75%, transparent);
}

.chat-form input:focus,
.quick-add input:focus,
.filter-bar select:focus {
  border-color: var(--line-strong);
  box-shadow: var(--ring-shadow);
}

.market-snapshot,
.dashboard,
.markets,
.tools,
.portfolio,
.learn-pricing,
.feature-grid-section {
  padding: 42px 0;
}

.section-title {
  margin-bottom: 18px;
}

.section-title p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: 400;
  line-height: var(--leading-body);
}

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

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.feature-card {
  display: grid;
  gap: 12px;
  min-height: 210px;
  padding: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.feature-card span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--type-heading);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--leading-tight);
}

.feature-card strong {
  font-family: var(--font-display);
  font-size: var(--type-title);
  font-weight: 600;
  letter-spacing: 0;
}

.feature-card small {
  color: var(--muted);
  font-size: var(--type-body-sm);
  font-weight: 400;
  line-height: var(--leading-body);
}

.metric-card {
  min-height: 146px;
  padding: 18px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.metric-card strong {
  display: block;
  margin: 12px 0 10px;
  color: var(--ink);
  font-size: var(--type-heading-lg);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--leading-tight);
}

.gauge {
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 99999px;
}

.gauge span {
  display: block;
  width: 61%;
  height: 100%;
  background: linear-gradient(90deg, var(--danger), var(--accent-warm), var(--positive));
  transition: width 500ms ease;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 14px;
}

.balance-panel,
.suggestion-panel,
.alerts-panel,
.simulator-panel,
.risk-result,
.history-panel,
.holdings-panel,
.education-panel,
.pricing-panel {
  padding: 18px;
}

.balance-panel h3 {
  margin: 0;
  color: var(--ink);
  font-size: var(--type-display);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--leading-tight);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
}

.mini-stats span {
  min-height: 78px;
  padding: 12px;
  color: var(--muted);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
  font-family: var(--font-data);
  font-size: var(--type-caption);
  font-weight: 400;
  letter-spacing: 0;
  line-height: var(--leading-caption);
}

.mini-stats b {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: var(--type-title);
}

.allocation {
  display: flex;
  align-items: center;
  gap: 22px;
}

.donut {
  flex: 0 0 172px;
  width: 172px;
  height: 172px;
  background: conic-gradient(
    var(--cyan) 0 46%,
    var(--violet) 46% 80%,
    var(--positive) 80% 94%,
    var(--danger) 94% 100%
  );
  border: 16px solid var(--surface-raised);
  border-radius: 50%;
  box-shadow: inset 0 0 0 22px var(--surface), var(--ring-shadow);
  transition: transform 260ms ease;
}

.donut:hover {
  transform: rotate(8deg) scale(1.02);
}

.allocation ul {
  display: grid;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--type-label);
  font-weight: 400;
  line-height: var(--leading-caption);
}

.dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 8px;
}

.dot.stable {
  background: var(--cyan);
}

.dot.eth {
  background: var(--violet);
}

.dot.lp {
  background: var(--positive);
}

.dot.rwa {
  background: var(--danger);
}

.suggestion-panel {
  grid-row: span 2;
}

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

.suggestion-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.suggestion-item strong,
.suggestion-item small {
  display: block;
}

.suggestion-item strong {
  line-height: var(--leading-caption);
}

.suggestion-item small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.55;
}

.score-badge {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  height: 58px;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 99999px;
  box-shadow: var(--ring-shadow);
  font-size: var(--type-title);
  font-weight: 600;
  letter-spacing: 0;
  animation: none;
}

.alerts-panel {
  min-height: 216px;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: var(--type-label);
  font-weight: 400;
  line-height: var(--leading-caption);
}

.toggle-row:first-of-type {
  margin-top: 10px;
}

.toggle-row input {
  accent-color: var(--danger);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  background: var(--panel-soft);
  font-family: var(--font-data);
  font-size: var(--type-caption);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

td {
  color: var(--ink);
  font-size: var(--type-body-sm);
  font-weight: 500;
}

td small {
  color: var(--muted);
}

tbody tr:hover {
  background: var(--panel-soft);
}

.apy {
  color: var(--positive);
  font-weight: 600;
}

.risk-low,
.risk-medium,
.risk-high {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid currentColor;
  border-radius: 6px;
  font-family: var(--font-data);
  font-size: var(--type-caption);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.risk-medium {
  color: var(--cyan);
}

.risk-high {
  color: var(--danger);
}

.tool-grid,
.portfolio-grid,
.learn-pricing {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.slider-row {
  margin-bottom: 20px;
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: var(--type-label);
  font-weight: 400;
  line-height: var(--leading-caption);
}

.slider-row input {
  width: 100%;
  accent-color: var(--danger);
}

.risk-result h3 {
  margin: 0;
  color: var(--danger);
  font-size: var(--type-display);
  font-weight: 600;
  letter-spacing: 0;
  line-height: var(--leading-tight);
}

.risk-result p {
  color: var(--muted);
  font-size: var(--type-body);
  line-height: var(--leading-body);
}

.loss-bars {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.loss-bars span {
  position: relative;
  min-height: 34px;
  padding: 8px 10px;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-data);
  font-size: var(--type-caption);
  font-weight: 400;
  letter-spacing: 0;
  isolation: isolate;
  text-transform: uppercase;
}

.loss-bars span::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: var(--bar);
  background: rgba(255, 99, 99, 0.18);
  transition: width 260ms ease;
}

.quick-add {
  display: grid;
  grid-template-columns: 160px 150px 76px;
  gap: 8px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 260px;
  padding: 18px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
}

.chart span {
  flex: 1;
  min-width: 22px;
  background: linear-gradient(180deg, var(--positive), var(--cyan), var(--accent));
  border-radius: 99999px 99999px 4px 4px;
  transform-origin: bottom;
  animation: bar-in 620ms ease both;
}

.chart span:nth-child(2) {
  animation-delay: 80ms;
}

.chart span:nth-child(3) {
  animation-delay: 160ms;
}

.chart span:nth-child(4) {
  animation-delay: 240ms;
}

.chart span:nth-child(5) {
  animation-delay: 320ms;
}

.chart span:nth-child(6) {
  animation-delay: 400ms;
}

.chart span:nth-child(7) {
  animation-delay: 480ms;
}

.chart-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--type-label);
  font-weight: 400;
  line-height: var(--leading-caption);
}

.chart-caption b {
  color: var(--ink);
}

.holdings-panel > div {
  display: grid;
  gap: 10px;
}

.holding-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.holding-item strong,
.holding-item span {
  display: block;
}

.holding-item strong {
  line-height: var(--leading-caption);
}

.holding-item span {
  margin-top: 5px;
  color: var(--muted);
  font-size: var(--type-caption);
  font-weight: 400;
  line-height: var(--leading-caption);
}

.lesson-grid,
.plan-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.lesson-grid {
  grid-template-columns: repeat(3, 1fr);
}

.lesson-output {
  min-height: 118px;
  margin-top: 14px;
  padding: 14px;
  color: var(--muted);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
  font-size: var(--type-body);
  line-height: var(--leading-body);
}

.plan-list div {
  padding: 14px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--ring-shadow);
}

.plan-list b,
.plan-list span {
  display: block;
}

.plan-list b {
  color: var(--ink);
  font-size: var(--type-title-sm);
  font-weight: 600;
  letter-spacing: 0;
}

.plan-list span {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--type-body-sm);
  line-height: var(--leading-caption);
}

.learn-pricing h1 {
  max-width: 620px;
  font-size: var(--type-heading);
  line-height: var(--leading-title);
}

.featured-plan {
  border-color: var(--line-strong) !important;
  box-shadow: var(--ring-shadow);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  padding: 32px 16px 48px;
  color: var(--muted);
  border-top: 0;
  font-family: var(--font-data);
  font-size: var(--type-micro);
  font-weight: 400;
  letter-spacing: 0;
  line-height: var(--leading-caption);
}

@media (max-width: 1100px) {
  :root {
    --type-heading-lg: 2.625rem;
    --type-display: 3.125rem;
    --type-display-xl: 6rem;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 14px;
  }

  .nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
  }

  .command-center,
  .home-command,
  .page-shell,
  .dashboard-grid,
  .tool-grid,
  .portfolio-grid,
  .learn-pricing {
    grid-template-columns: 1fr;
  }

  .assistant-panel,
  .hero-copy,
  .page-hero,
  .terminal-preview {
    min-height: 620px;
  }

  .snapshot-grid,
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .suggestion-panel {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  :root {
    --type-body-lg: 1rem;
    --type-title: 1.375rem;
    --type-heading: 1.5rem;
    --type-heading-lg: 2rem;
    --type-display: 2.375rem;
    --type-display-xl: 5rem;
  }

  .risk-strip {
    position: static;
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    top: 0;
    gap: 10px;
    padding: 10px;
  }

  main {
    width: min(100% - 20px, 1200px);
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 46px;
    height: 34px;
  }

  .brand small {
    display: none;
  }

  .top-actions {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: minmax(82px, 1fr) 42px 42px;
    width: 100%;
    justify-content: stretch;
  }

  .icon-button,
  .utility-button,
  .wallet-button {
    min-height: 40px;
  }

  .icon-button {
    width: 42px;
  }

  .utility-button,
  .wallet-button {
    flex: 1;
    justify-content: center;
  }

  .wallet-button {
    min-width: 0;
    padding: 0;
  }

  .wallet-button span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .command-center {
    min-height: auto;
    padding-top: 18px;
  }

  .hero-copy,
  .assistant-panel {
    min-height: 560px;
    padding: 14px;
  }

  .hero-copy h1 {
    font-size: var(--type-display);
  }

  .strategy-board,
  .preview-grid,
  .snapshot-grid,
  .feature-grid,
  .mini-stats,
  .lesson-grid {
    grid-template-columns: 1fr;
  }

  .terminal-header,
  .route-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .route-row strong {
    max-width: none;
    text-align: left;
  }

  .route-meta {
    grid-template-columns: 1fr;
  }

  .feed-row {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 8px 12px;
  }

  .feed-row small {
    grid-column: 2;
  }

  .panel-header,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .allocation {
    align-items: flex-start;
    flex-direction: column;
  }

  .donut {
    width: 146px;
    height: 146px;
    flex-basis: 146px;
  }

  .filter-bar {
    justify-content: stretch;
  }

  .filter-bar select {
    flex: 1 1 100%;
  }

  .quick-add {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .chart-caption {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.assistant-panel.standalone {
  min-height: calc(100vh - 210px);
}
