:root {
  color-scheme: light;
  --ink: #17211e;
  --ink-soft: #46534e;
  --muted: #74807b;
  --canvas: #f3f4f0;
  --paper: #ffffff;
  --paper-soft: #f8f9f6;
  --line: #dde2dc;
  --line-strong: #cad1ca;
  --green: #153f35;
  --green-bright: #1b735f;
  --green-soft: #deeee7;
  --red: #b24a42;
  --red-soft: #fae8e5;
  --amber: #af7334;
  --blue: #366b91;
  --shadow-sm: 0 1px 2px rgba(18, 33, 28, 0.05), 0 4px 12px rgba(18, 33, 28, 0.035);
  --shadow-lg: 0 24px 64px rgba(15, 31, 25, 0.18);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 236px;
  --topbar: 72px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

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

button {
  color: inherit;
}

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

svg {
  display: block;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 999;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(27, 115, 95, 0.28);
  outline-offset: 2px;
}

.app-loader {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.brand-logo {
  width: 40px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  left: var(--sidebar);
  height: var(--topbar);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 30px;
  border-bottom: 1px solid rgba(202, 209, 202, 0.8);
  background: rgba(243, 244, 240, 0.92);
  backdrop-filter: blur(16px);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.topbar-search {
  height: 42px;
  width: min(450px, 42vw);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.topbar-search:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.topbar-search span {
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

kbd {
  min-width: 24px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-bottom-color: var(--line-strong);
  border-radius: 6px;
  background: var(--paper-soft);
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  text-align: center;
}

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

.session-chip {
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.session-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.session-chip.open .session-dot {
  background: #2e9b73;
  box-shadow: 0 0 0 4px rgba(46, 155, 115, 0.12);
}

.session-chip.pre-open .session-dot {
  background: var(--amber);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--paper-soft);
}

.icon-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.avatar-button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  cursor: pointer;
  font-weight: 750;
}

.sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 20px;
  border-right: 1px solid var(--line);
  background: var(--paper);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px;
}

.brand-name {
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 4px;
  margin-top: 42px;
}

.nav-button {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 590;
  text-align: left;
  transition: background 150ms ease, color 150ms ease;
}

.nav-button:hover {
  background: var(--paper-soft);
  color: var(--ink);
}

.nav-button.active {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 720;
}

.nav-button .nav-pill {
  margin-left: auto;
  min-width: 21px;
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(21, 63, 53, 0.08);
  font-size: 10px;
  text-align: center;
}

.sidebar-foot {
  margin-top: auto;
}

.demo-notice {
  padding: 14px;
  border: 1px solid #e7d6b9;
  border-radius: 14px;
  background: #fffaf0;
}

.demo-notice-top {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7f552a;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.demo-notice p {
  margin: 8px 0 0;
  color: #806b52;
  font-size: 11px;
  line-height: 1.5;
}

.language-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.language-button:hover {
  background: var(--paper-soft);
}

.language-button strong {
  margin-left: auto;
  color: var(--ink-soft);
}

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar);
  padding: calc(var(--topbar) + 34px) 30px 54px;
}

.page {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  animation: page-in 240ms ease-out;
}

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

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.page-head h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3.1vw, 44px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.page-head p {
  max-width: 560px;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.page-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.74fr);
  gap: 22px;
  align-items: start;
}

.dashboard-main,
.dashboard-side {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.portfolio-card {
  position: relative;
  min-height: 354px;
  overflow: hidden;
  padding: 24px 26px 18px;
}

.card-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow,
.card-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.privacy-button {
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.portfolio-value {
  margin: 15px 0 0;
  font-size: clamp(32px, 5vw, 47px);
  font-weight: 650;
  letter-spacing: -0.052em;
  line-height: 1;
}

.portfolio-delta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 11px;
  font-size: 13px;
}

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

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

.delta-pill {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 720;
}

.delta-pill.negative {
  background: var(--red-soft);
}

.chart-wrap {
  position: relative;
  height: 150px;
  margin: 12px -4px 0;
}

.line-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: #edf0ec;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.chart-line {
  fill: none;
  stroke: var(--green-bright);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.chart-area {
  fill: rgba(27, 115, 95, 0.065);
}

.chart-endpoint {
  fill: var(--paper);
  stroke: var(--green-bright);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.chart-periods {
  display: flex;
  gap: 3px;
  margin-top: 5px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.chart-period {
  min-width: 38px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.chart-period:hover,
.chart-period.active {
  background: var(--green-soft);
  color: var(--green);
}

.section-card {
  overflow: hidden;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 15px;
}

.section-head h2,
.side-card h2,
.detail-section h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 0;
  background: transparent;
  color: var(--green-bright);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

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

.market-table th {
  padding: 9px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-align: right;
  text-transform: uppercase;
}

.market-table th:first-child {
  text-align: left;
}

.market-table td {
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  vertical-align: middle;
}

.market-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.market-table tbody tr:hover {
  background: #fafbf8;
}

.market-table tbody tr:last-child td {
  border-bottom: 0;
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
}

.asset-logo {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: color-mix(in srgb, var(--asset-color, var(--green)) 12%, white);
  color: var(--asset-color, var(--green));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.asset-symbol {
  display: block;
  font-size: 13px;
  font-weight: 740;
}

.asset-name {
  display: block;
  max-width: 180px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 670;
}

.change-value {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 680;
}

.sparkline {
  width: 70px;
  height: 30px;
  margin-left: auto;
}

.sparkline polyline {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.side-card {
  padding: 20px;
}

.market-status-card {
  background: var(--green);
  color: white;
  box-shadow: none;
}

.market-status-card .card-label,
.market-status-card .market-secondary {
  color: rgba(255, 255, 255, 0.62);
}

.market-status-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-status-title span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 680;
}

.market-index-value {
  margin-top: 20px;
  font-size: 30px;
  font-weight: 620;
  letter-spacing: -0.045em;
}

.market-index-delta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: #81d4b2;
  font-size: 12px;
  font-weight: 680;
}

.market-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  margin-top: 23px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.market-stat strong {
  display: block;
  font-size: 13px;
  font-weight: 660;
}

.market-stat span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
  text-transform: uppercase;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.quick-action {
  min-height: 70px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.quick-action:hover {
  border-color: var(--line-strong);
  background: white;
}

.news-list {
  display: grid;
  gap: 0;
  margin-top: 8px;
}

.news-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.news-item:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.news-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.news-item h3 {
  margin: 7px 0 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.news-symbol {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--paper-soft);
  color: var(--muted);
  font-size: 9px;
  font-weight: 720;
}

.insight-card {
  overflow: hidden;
  display: flex;
  min-height: 130px;
  border: 1px solid #d8e4de;
  background: #eff6f2;
}

.insight-content {
  padding: 21px;
}

.insight-content h3 {
  margin: 7px 0 5px;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.insight-content p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.insight-art {
  position: relative;
  flex: 0 0 34%;
  overflow: hidden;
}

.insight-art::before,
.insight-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(21, 63, 53, 0.24);
  border-radius: 50%;
}

.insight-art::before {
  width: 130px;
  height: 130px;
  top: 24px;
  right: -32px;
}

.insight-art::after {
  width: 84px;
  height: 84px;
  top: 47px;
  right: -8px;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 17px;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 710;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: white;
}

.primary-button:hover {
  background: #0e342b;
}

.primary-button:disabled {
  border-color: #9faaa6;
  background: #9faaa6;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--ink);
}

.secondary-button:hover {
  background: var(--paper-soft);
}

.danger-button {
  border: 1px solid var(--red);
  background: var(--red);
  color: white;
}

.button-group {
  display: flex;
  gap: 10px;
}

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

.stat-card {
  padding: 18px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 20px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.stat-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.field-search {
  height: 42px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--muted);
}

.field-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
}

.filter-button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.filter-button.active {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.market-list-card .market-table th,
.market-list-card .market-table td {
  padding-left: 20px;
  padding-right: 20px;
}

.watch-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--muted);
  cursor: pointer;
}

.watch-button.active {
  border-color: #dfc58d;
  background: #fff9ea;
  color: #9a6a23;
}

.portfolio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 22px;
  align-items: start;
}

.allocation-list {
  display: grid;
  gap: 13px;
  margin-top: 18px;
}

.allocation-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  font-size: 12px;
}

.allocation-bar {
  grid-column: 1 / -1;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.allocation-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--asset-color, var(--green));
}

.holding-return {
  font-size: 11px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state h3 {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 16px;
}

.empty-state p {
  max-width: 360px;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.order-list {
  display: grid;
}

.order-row {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.8fr 0.8fr 0.75fr;
  align-items: center;
  gap: 16px;
  padding: 17px 21px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.order-row:last-child {
  border-bottom: 0;
}

.order-side {
  font-weight: 720;
  text-transform: capitalize;
}

.status-badge {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-bright);
  font-size: 10px;
  font-weight: 720;
  text-transform: capitalize;
}

.status-badge.open {
  background: #fff3dd;
  color: #9b641f;
}

.status-badge.partially_filled {
  background: #e6f2ff;
  color: #245f94;
}

.status-badge.cancelled {
  background: #eef0ed;
  color: #66716a;
}

.status-badge.rejected {
  background: #fdebe8;
  color: var(--red);
}

.order-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.order-status-actions .text-button {
  font-size: 10px;
}

.order-reason {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.learn-hero {
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 38px;
  border: 0;
  background: var(--green);
  color: white;
}

.learn-hero-content {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.learn-hero h1 {
  margin: 12px 0 12px;
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.learn-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.6;
}

.learn-hero-art {
  position: absolute;
  right: -70px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.learn-hero-art::before,
.learn-hero-art::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.learn-hero-art::before {
  inset: 55px;
}

.learn-hero-art::after {
  inset: 110px;
}

.learn-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.lesson-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 23px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 33, 28, 0.08);
}

.lesson-card.mint { background: #edf6f1; }
.lesson-card.sand { background: #fbf2e4; }
.lesson-card.blue { background: #edf3f8; }

.lesson-number {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: Georgia, serif;
  opacity: 0.55;
}

.lesson-card h2 {
  margin: auto 0 8px;
  font-family: Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.lesson-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.lesson-source {
  margin-top: 16px;
  color: var(--green-bright);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.ecma-resource {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-top: 18px;
  padding: 26px 28px;
}

.ecma-resource h2 {
  margin: 7px 0 8px;
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.025em;
}

.ecma-resource p:not(.eyebrow) {
  max-width: 670px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.ecma-resource-links {
  display: grid;
  gap: 8px;
}

.ecma-resource-links a,
.lesson-source-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.ecma-resource-links a {
  min-width: 185px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--green-soft);
}

.ecma-resource-links a:hover,
.lesson-source-link:hover {
  color: var(--green-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lesson-body {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.lesson-source-link {
  width: fit-content;
  margin-top: 17px;
}

.detail-page {
  max-width: 1200px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.detail-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.detail-header .asset-logo {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  font-size: 13px;
}

.detail-header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.035em;
}

.detail-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-actions {
  margin-left: auto;
  display: flex;
  gap: 9px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(290px, 0.55fr);
  gap: 22px;
  margin-top: 22px;
  align-items: start;
}

.detail-chart-card {
  min-height: 430px;
  padding: 25px;
}

.detail-price {
  margin-top: 24px;
  font-size: 38px;
  font-weight: 650;
  letter-spacing: -0.05em;
}

.detail-chart {
  height: 220px;
  margin-top: 20px;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}

.quote-item {
  padding: 15px 5px 2px;
}

.quote-item span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.quote-item strong {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}

.trade-card {
  padding: 20px;
}

.trade-tabs,
.segmented-control,
.order-type-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--paper-soft);
}

.trade-tab,
.segment-button,
.order-type-button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 710;
}

.trade-tab.active,
.segment-button.active,
.order-type-button.active {
  background: white;
  color: var(--green);
  box-shadow: var(--shadow-sm);
}

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

.form-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.form-field .form-label,
.form-field label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 680;
}

.order-type-tabs {
  border: 1px solid var(--line);
  background: white;
}

.order-type-button {
  height: 36px;
}

.order-type-button.active {
  background: var(--green-soft);
  color: var(--green);
  box-shadow: none;
}

.input-shell,
.select-shell {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.input-shell:focus-within {
  border-color: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(27, 115, 95, 0.1);
}

.input-shell input,
.select-shell select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.input-prefix,
.input-suffix {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.order-summary {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  color: var(--muted);
  font-size: 11px;
}

.summary-row strong {
  color: var(--ink);
  font-size: 12px;
}

.trade-card .primary-button,
.trade-card .danger-button {
  width: 100%;
}

.ticket-guidance {
  min-height: 45px;
  margin: -5px 0 14px;
  padding: 10px 11px;
  border-radius: 9px;
  background: var(--paper-soft);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.trade-footnote {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
  text-align: center;
}

.detail-section {
  margin-top: 22px;
  padding: 23px;
}

.detail-section p {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.order-book-card .card-heading-row {
  align-items: flex-start;
}

.order-book-card h2 {
  margin: 0;
}

.order-book-card .book-caption {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.order-book-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 19px;
}

.book-side {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-soft);
}

.book-side-head,
.book-level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.book-side-head {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.book-side-head strong {
  color: var(--ink);
  font-size: 10px;
}

.book-level {
  border-bottom: 1px solid rgba(202, 209, 202, .62);
  font-size: 11px;
}

.book-level:last-child {
  border-bottom: 0;
}

.book-level span {
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.book-level strong {
  color: var(--green-bright);
  font-variant-numeric: tabular-nums;
}

.book-side.asks .book-level strong {
  color: var(--red);
}

.book-empty {
  padding: 24px 12px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(11, 20, 17, 0.46);
  backdrop-filter: blur(4px);
  animation: fade-in 160ms ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(460px, 100%);
  max-height: min(740px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  background: white;
  box-shadow: var(--shadow-lg);
  animation: modal-in 180ms ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 21px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.modal-body {
  padding: 21px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 21px;
  border-top: 1px solid var(--line);
}

.review-asset {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.review-asset h3 {
  margin: 0;
  font-size: 14px;
}

.review-asset p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 12px;
}

.review-row strong {
  color: var(--ink);
  font-weight: 680;
}

.review-total {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.review-total strong {
  font-size: 16px;
}

.modal-disclaimer {
  margin-top: 18px;
  padding: 11px;
  border-radius: 9px;
  background: #fff8eb;
  color: #7b6243;
  font-size: 10px;
  line-height: 1.45;
}

.search-modal {
  align-self: start;
  margin-top: min(14vh, 110px);
}

.search-input {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 19px;
  border-bottom: 1px solid var(--line);
}

.search-input input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  font-size: 16px;
}

.search-results {
  max-height: 420px;
  overflow: auto;
  padding: 8px;
}

.search-result {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.search-result:hover,
.search-result:focus-visible {
  background: var(--paper-soft);
}

.search-result-price {
  margin-left: auto;
  text-align: right;
}

.search-empty {
  padding: 30px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.toast-root {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow-lg);
  font-size: 12px;
  pointer-events: auto;
  animation: toast-in 200ms ease-out;
}

.toast.success .toast-icon {
  color: #7fddb8;
}

.toast.error .toast-icon {
  color: #f0a29b;
}

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

.mobile-nav {
  display: none;
}

.mobile-only {
  display: none;
}

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

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1.02fr) minmax(480px, 0.98fr);
  background: var(--paper);
}

.auth-story {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 34px clamp(34px, 5vw, 78px);
  background: var(--green);
  color: white;
}

.auth-story::before,
.auth-story::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  pointer-events: none;
}

.auth-story::before {
  width: 520px;
  height: 520px;
  right: -245px;
  bottom: -145px;
}

.auth-story::after {
  width: 350px;
  height: 350px;
  right: -160px;
  bottom: -60px;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-brand .brand-logo {
  width: 46px;
  height: 56px;
  padding: 3px;
  border-radius: 12px;
  background: white;
}

.auth-brand .brand-subtitle,
.auth-story .eyebrow {
  color: rgba(255, 255, 255, 0.62);
}

.auth-story-content {
  position: relative;
  z-index: 1;
  width: min(600px, 100%);
  margin: auto 0;
  padding: 52px 0;
}

.auth-story-content h1 {
  margin: 16px 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(46px, 5.6vw, 78px);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.98;
}

.auth-story-content > p:not(.eyebrow) {
  max-width: 500px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
  line-height: 1.65;
}

.auth-benefits {
  display: grid;
  gap: 17px;
  max-width: 520px;
  margin-top: 42px;
  padding-top: 27px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.auth-benefits > div {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.auth-benefits svg {
  flex: 0 0 auto;
  margin-top: 2px;
  color: #93d5ba;
}

.auth-benefits span,
.auth-benefits strong,
.auth-benefits small {
  display: block;
}

.auth-benefits strong {
  font-size: 13px;
  font-weight: 680;
}

.auth-benefits small {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 11px;
  line-height: 1.45;
}

.auth-disclaimer {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

.auth-panel {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background: var(--paper-soft);
}

.auth-card {
  width: min(410px, 100%);
}

.auth-card h2 {
  margin: 10px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 37px;
  font-weight: 500;
  letter-spacing: -0.045em;
}

.auth-intro {
  margin: 11px 0 27px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.auth-card .form-field {
  margin-top: 15px;
}

.auth-card .input-shell {
  height: 48px;
  background: white;
}

.password-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.form-error {
  margin-top: 14px;
  padding: 10px 11px;
  border: 1px solid #ebc7c2;
  border-radius: 9px;
  background: var(--red-soft);
  color: #8e3e38;
  font-size: 11px;
  line-height: 1.4;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 21px;
}

.auth-switch {
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.auth-switch button {
  padding: 2px;
  border: 0;
  background: transparent;
  color: var(--green-bright);
  cursor: pointer;
  font-weight: 700;
}

.demo-login {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding: 14px 15px;
  border: 1px solid #d6e4dd;
  border-radius: 13px;
  background: #edf6f1;
  color: var(--green);
  cursor: pointer;
  text-align: left;
}

.demo-login span { flex: 1; }
.demo-login strong, .demo-login small { display: block; }
.demo-login strong { font-size: 12px; }
.demo-login small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.demo-login:hover { border-color: #bcd6c9; background: #e6f2ec; }

.profile-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-summary .avatar-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
}

.profile-summary strong,
.profile-summary span {
  display: block;
}

.profile-summary strong { font-size: 14px; }
.profile-summary div span { margin-top: 3px; color: var(--muted); font-size: 11px; }

.profile-details {
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1100px) {
  :root { --sidebar: 210px; }
  .dashboard-grid,
  .detail-grid,
  .portfolio-layout { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-side > :last-child { grid-column: 1 / -1; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learn-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; --topbar: 64px; }

  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: auto; padding: 18px 20px; }
  .auth-story-content, .auth-disclaimer { display: none; }
  .auth-panel { min-height: calc(100vh - 76px); place-items: start center; padding: 38px 20px; }
  .auth-card h2 { font-size: 33px; }

  .sidebar { display: none; }

  .topbar {
    left: 0;
    gap: 11px;
    padding: 0 16px;
  }

  .mobile-brand { display: flex; }
  .mobile-brand .brand-logo { width: 30px; height: 38px; }
  .mobile-brand > span:not(.brand-logo) { display: none; }

  .topbar-search {
    width: auto;
    flex: 1;
  }

  .topbar-search kbd,
  .session-chip,
  .topbar-actions .icon-button {
    display: none;
  }

  .main-area {
    margin-left: 0;
    padding: calc(var(--topbar) + 24px) 16px 92px;
  }

  .page-head {
    align-items: flex-start;
    margin-bottom: 21px;
  }

  .page-head h1 { font-size: 32px; }
  .page-date { display: none; }

  .dashboard-side { grid-template-columns: 1fr; }
  .dashboard-side > :last-child { grid-column: auto; }

  .portfolio-card { min-height: 330px; padding: 20px 18px 15px; }
  .portfolio-value { font-size: 36px; }
  .chart-wrap { height: 135px; }

  .section-head { padding: 18px 17px 13px; }

  .market-table th,
  .market-table td {
    padding-left: 16px;
    padding-right: 16px;
  }

  .market-table th:nth-child(3),
  .market-table td:nth-child(3),
  .market-table th:nth-child(4),
  .market-table td:nth-child(4) {
    display: none;
  }

  .sparkline { width: 58px; }
  .side-card { padding: 18px; }

  .stat-grid { gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 17px; }

  .toolbar {
    flex-wrap: wrap;
  }

  .field-search { flex-basis: 100%; }

  .market-list-card .market-table th:nth-child(4),
  .market-list-card .market-table td:nth-child(4),
  .market-list-card .market-table th:nth-child(5),
  .market-list-card .market-table td:nth-child(5) {
    display: none;
  }

  .learn-grid { grid-template-columns: 1fr; }
  .learn-hero { min-height: 310px; padding: 27px; }
  .learn-hero-art { right: -230px; }
  .ecma-resource { grid-template-columns: 1fr; padding: 22px; }

  .detail-header { flex-wrap: wrap; }
  .detail-actions { width: 100%; margin-left: 0; }
  .detail-actions > * { flex: 1; }
  .detail-chart-card { min-height: 390px; padding: 20px 17px; }
  .quote-grid { grid-template-columns: repeat(2, 1fr); }
  .order-book-grid { grid-template-columns: 1fr; }

  .order-row {
    grid-template-columns: 1.2fr 0.8fr 0.75fr;
    padding: 15px 16px;
  }
  .order-row > :nth-child(3),
  .order-row > :nth-child(4) { display: none; }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 12px;
    bottom: 10px;
    left: 12px;
    height: 66px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 5px;
    border: 1px solid rgba(202, 209, 202, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(18, 33, 28, 0.17);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-button {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 8px;
    font-weight: 680;
  }

  .mobile-nav-button.active {
    background: var(--green-soft);
    color: var(--green);
  }

  .toast-root {
    right: 14px;
    bottom: 88px;
    left: 14px;
  }

  .toast { min-width: 0; width: 100%; }
  .mobile-only { display: initial; }
}

@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
  .topbar-search span { font-size: 0; }
  .topbar-search span::after { content: "Search"; font-size: 12px; }
  .portfolio-value { font-size: 32px; }
  .chart-period { min-width: 0; flex: 1; padding-inline: 4px; }
  .quick-actions { gap: 6px; }
  .quick-action { min-height: 64px; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); border-radius: 17px; }
}

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