@import url("https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap");

:root {
  --orange: #0b0d10;
  --orange-dark: #000000;
  --amber: #8f98a3;
  --ink: #1e2228;
  --muted: #666d78;
  --line: #e9eaed;
  --soft: #f4f4f5;
  --panel: #ffffff;
  --success: #0b7a4b;
  --danger: #b3261e;
  --shadow: 0 24px 70px rgba(29, 33, 39, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: #f9f9f9;
  color: var(--ink);
  font-family: "Google Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0.5px;
  overflow-x: hidden;
}

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

button,
input,
select {
  font: inherit;
}

body[data-page="how-it-works"] {
  background: #f9f9f9;
}

.topbar {
  align-items: center;
  background: white;
  border: 0;
  border-bottom: 1px solid #e7eaee;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
  margin: 0;
  max-width: 100%;
  min-height: 70px;
  padding: 10px 18px;
  width: 100%;
}

.brand {
  align-items: center;
  color: var(--orange);
  display: flex;
  gap: 12px;
  white-space: nowrap;
}

.brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1.05;
}

.brand-name {
  font-size: 20px;
  font-weight: 700;
}

.brand-badge {
  color: #98a2b3;
  font-size: 13px;
  font-weight: 600;
}

.brand-mark {
  align-items: center;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  overflow: hidden;
  width: 38px;
}

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

.desktop-nav {
  align-items: center;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 18px 28px;
  justify-content: center;
  min-width: 0;
}

.desktop-nav a {
  color: #3d4148;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 0;
  position: relative;
}

.desktop-nav a.is-active {
  color: var(--orange);
  font-weight: 800;
}

.desktop-nav a.is-active::after {
  background: #16a34a;
  border-radius: 999px;
  bottom: -9px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  width: 100%;
}

.top-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.profile-pill {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-radius: 999px;
  color: #282c31;
  cursor: pointer;
  display: flex;
  gap: 10px;
  padding: 8px 12px 8px 8px;
}

.profile-pill.is-authenticated {
  background: #fff;
  box-shadow: none;
}

.profile-pill.is-guest {
  background: #111111;
  color: #ffffff;
  gap: 0;
  padding: 10px 16px;
}

.profile-pill.is-guest .avatar,
.profile-pill.is-guest .profile-caret {
  display: none;
}

.avatar {
  align-items: center;
  background: #e9f8ef;
  border-radius: 50%;
  color: #16a34a;
  display: inline-flex;
  font-weight: 700;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.token-icon-image {
  display: block;
  height: 18px;
  object-fit: contain;
  width: 18px;
}

.profile-caret {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}

main {
  background: #f9f9f9;
  margin: 0;
  max-width: none;
  padding: 32px 20px 56px;
  width: 100%;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.eyebrow {
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 10px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(40px, 5vw, 72px);
  letter-spacing: 0;
  line-height: 1.03;
  margin-bottom: 26px;
}

h2 {
  font-size: 32px;
  letter-spacing: 0;
  line-height: 1.15;
  margin-bottom: 10px;
}

h3 {
  font-size: 22px;
  margin-bottom: 24px;
}

.primary-button,
.secondary-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 54px;
  padding: 0 26px;
}

.primary-button {
  background: #16c784;
  color: #fff;
}

.primary-button:hover {
  background: #11b67c;
}

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

.compact-button {
  min-height: 42px;
  padding: 0 16px;
}

#signOutButton {
  min-width: 42px;
  padding: 0;
}

#signOutButton svg {
  color: #ef4444;
  height: 18px;
  width: 18px;
}

.full-width {
  width: 100%;
}

.mobile-navbar {
  display: none;
}

.dashboard-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.input-label {
  color: #3f454d;
  display: block;
  font-weight: 800;
  margin-bottom: 10px;
}

.amount-input {
  align-items: center;
  border: 1px solid #d7d9dd;
  border-radius: 8px;
  display: flex;
  margin-bottom: 22px;
  min-height: 64px;
  padding: 0 18px;
}

.amount-input input {
  border: 0;
  color: var(--ink);
  flex: 1;
  font-size: 26px;
  font-weight: 800;
  min-width: 0;
  outline: 0;
}

.amount-input input::-webkit-outer-spin-button,
.amount-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.amount-input input[type="number"] {
  -moz-appearance: textfield;
}

.amount-input span {
  color: var(--muted);
  font-weight: 800;
}

.amount-stepper {
  display: none;
}

.auth-input input {
  font-size: 18px;
}

.form-message {
  color: var(--muted);
  font-weight: 700;
}

.form-message.success {
  color: var(--success);
}

.form-message.error {
  color: var(--danger);
}

.table-wrap {
  margin-top: 24px;
  overflow-x: auto;
}

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

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

th {
  color: #525962;
  font-size: 13px;
  text-transform: uppercase;
}

td {
  font-weight: 600;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.status.completed,
.status.approved {
  background: #e7f5ee;
  color: var(--success);
}

.status.pending {
  background: #fff5de;
  color: #9b5d00;
}

.status.rejected {
  background: #fdeceb;
  color: var(--danger);
}

.confirm-modal {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 1200;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal-backdrop {
  background: rgba(17, 24, 39, 0.42);
  inset: 0;
  position: absolute;
}

.confirm-dialog {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.2);
  max-width: 420px;
  padding: 20px;
  position: relative;
  width: min(100%, 420px);
}

.confirm-dialog-head {
  align-items: flex-start;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 14px;
}

.confirm-dialog-head span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  grid-column: 1;
  text-transform: uppercase;
}

.confirm-dialog-head h3 {
  font-size: 24px;
  grid-column: 1;
  line-height: 1.15;
  margin: 0;
}

.confirm-close {
  align-items: center;
  background: #f4f5f7;
  border: 0;
  border-radius: 999px;
  color: #344054;
  cursor: pointer;
  display: inline-flex;
  font-size: 22px;
  grid-column: 2;
  grid-row: 1 / span 2;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.confirm-dialog-body p {
  color: #475467;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 14px;
}

.confirm-summary {
  display: grid;
  gap: 10px;
  margin: 0;
}

.confirm-summary div {
  align-items: baseline;
  border-bottom: 1px solid #eef0f3;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding-bottom: 10px;
}

.confirm-summary div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.confirm-summary dt {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.confirm-summary dd {
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  text-align: right;
}

.confirm-dialog-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-top: 18px;
}

.confirm-cancel,
.confirm-submit {
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  min-height: 48px;
  padding: 0 16px;
}

.confirm-cancel {
  background: #eef1f4;
  color: #344054;
}

.confirm-submit {
  background: #111418;
  color: #ffffff;
}

.confirm-submit.is-buy {
  background: #16c784;
}

.confirm-submit.is-sell {
  background: #ea3943;
}

.quote-list {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.quote-list div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding-bottom: 12px;
}

.quote-list dt {
  color: var(--muted);
  flex: 1 1 auto;
  font-weight: 700;
  min-width: 0;
}

.quote-list dd {
  font-weight: 800;
  margin: 0;
  max-width: 50%;
  overflow-wrap: anywhere;
  text-align: right;
}

.quote-label-with-help {
  align-items: center;
  display: inline-flex;
  gap: 8px;
  position: relative;
}

.help-tooltip-wrap {
  display: inline-flex;
  position: relative;
}

.help-indicator {
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #d7dbe2;
  border-radius: 999px;
  color: #475467;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 20px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 20px;
}

.help-indicator:hover {
  background: #e9edf3;
  color: var(--ink);
}

.help-tooltip {
  background: rgba(17, 24, 39, 0.96);
  border-radius: 10px;
  bottom: calc(100% + 10px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.18);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  left: 50%;
  line-height: 1.45;
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%) translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  visibility: hidden;
  width: min(280px, calc(100vw - 32px));
  z-index: 30;
}

.help-tooltip::after {
  background: rgba(17, 24, 39, 0.96);
  bottom: -5px;
  content: "";
  height: 10px;
  left: 50%;
  position: absolute;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
}

.help-tooltip strong {
  color: #ffffff;
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.help-tooltip-wrap:hover .help-tooltip,
.help-tooltip-wrap:focus-within .help-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  visibility: visible;
}

.empty-state {
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}

footer {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  gap: 14px;
  justify-content: center;
  padding: 28px;
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 18px;
  }

  .desktop-nav {
    flex-wrap: nowrap;
    gap: 18px;
    order: 3;
    overflow-x: auto;
    width: 100%;
  }
}

@media (max-width: 700px) {
  th,
  td {
    padding-left: 10px;
    padding-right: 10px;
  }

  .confirm-dialog-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  body {
    padding-bottom: 88px;
  }

  body {
    background: #ffffff;
    color: var(--ink);
  }

  .topbar {
    background: #ffffff;
    border: 0;
    border-bottom: 1px solid #e6e8ec;
    border-radius: 0;
    gap: 10px;
    justify-content: space-between;
    margin: 0;
    min-height: 58px;
    padding: 8px 12px;
    width: 100%;
  }

  .brand {
    color: var(--orange);
    flex: 1 1 auto;
    font-size: 16px;
    min-width: 0;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-mark {
    background: var(--orange);
    border-radius: 50%;
    color: #ffffff;
    font-size: 20px;
    height: 32px;
    width: 32px;
  }

  .desktop-nav {
    display: none;
  }

  .top-actions {
    flex: 0 0 auto;
    gap: 8px;
  }

  .profile-pill {
    background: #ffffff;
    border: 0;
    color: var(--ink);
    padding: 6px;
  }

  .profile-pill span:last-child {
    display: none;
  }

  .avatar {
    background: var(--orange);
    color: #ffffff;
    height: 32px;
    width: 32px;
  }

  .top-actions .compact-button {
    background: #ececee;
    border-radius: 8px;
    color: var(--ink);
    min-height: 38px;
    padding: 0 12px;
  }

  .top-actions #signOutButton {
    min-width: 38px;
    padding: 0;
  }

  main {
    background: #ffffff;
    padding: 0 0 28px;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 12px 108px;
  }

  .mobile-navbar {
    align-items: stretch;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #e5e7eb;
    bottom: 0;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    left: 0;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    z-index: 120;
  }

  .mobile-navbar a {
    align-items: center;
    border-radius: 14px;
    color: #667085;
    display: grid;
    gap: 4px;
    justify-items: center;
    min-height: 56px;
    padding: 6px 4px;
    text-align: center;
  }

  .mobile-navbar a svg {
    height: 18px;
    width: 18px;
  }

  .mobile-navbar a span {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.15;
  }

  .mobile-navbar a.is-active {
    background: #f3f4f6;
    color: #111827;
  }

  .confirm-modal {
    padding: 12px;
  }

  .confirm-dialog {
    border-radius: 16px;
    padding: 16px;
  }

  .confirm-dialog-head h3 {
    font-size: 20px;
  }

  .input-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 0;
    opacity: 0.9;
  }

  .amount-input {
    background: #ffffff;
    border: 1px solid #d7dbe1;
    border-radius: 12px;
    gap: 8px;
    min-height: 56px;
    padding: 8px 10px 9px;
  }

  .amount-input input {
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
  }

  .amount-input span {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
  }
}


body[data-page="market"] {
  background: #f9f9f9;
}

.chart-price-head,
.order-balance-line {
  font-family: "Google Sans", sans-serif;
}

.terminal-page {
  padding-top: 8px;
}

.terminal-shell {
  margin: 0 auto;
  max-width: 100%;
}

.market-info-banner {
  align-items: center;
  background: #f2fff3;
  border: 1px solid #e7eaee;
  border-radius: 18px;
  display: flex;
  gap: 20px;
  padding: 20px 18px;
}

.market-info-banner-icon {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: inherit;
  display: inline-flex;
  flex: 0 0 auto;
  height: 44px;
  justify-content: center;
  overflow: hidden;
  width: 44px;
}

.market-info-banner-icon svg {
  height: 18px;
  width: 18px;
}

.market-info-banner-icon .token-icon-image {
  height: 100%;
  width: 100%;
}

.market-info-banner-copy {
  display: grid;
  gap: 3px;
}

.market-info-banner-copy strong {
  color: #111827;
  font-size: 25px;
  line-height: 1.25;
}

.market-info-banner-copy small {
  color: #667085;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.market-terminal {
  align-items: start;
  display: grid;
  gap: clamp(14px, 2vw, 24px);
  grid-template-columns: minmax(0, 0.4fr) minmax(0, 1.55fr) minmax(0, 0.9fr);
  width: 100%;
}

.market-terminal-v2 {
  background: transparent;
  border-radius: 24px;
  box-shadow: none;
  gap: 14px;
  grid-template-columns: 224px minmax(0, 0.88fr) 520px;
  padding: 12px 14px 14px;
}

.asset-panel,
.chart-panel,
.trade-panel,
.activity-card,
.sidebar-card,
.market-main {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.metric-rail {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 18px;
  box-shadow: none;
  padding: 12px;
  position: static;
}

.panel-heading {
  color: #111827;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}

.panel-heading-tight {
  margin-bottom: 10px;
}

.market-metrics-v2 {
  gap: 0;
}

.market-metrics-v2 .metric-rail-item {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  gap: 12px;
  min-height: 72px;
  padding: 13px 8px;
}

.market-metrics-v2 .metric-rail-item:last-child {
  border-bottom: 0;
}

.market-metrics-v2 .metric-rail-item > div {
  background: transparent;
  border: 0;
  min-width: 0;
  padding: 0;
}

.market-metrics-v2 .metric-rail-item > div span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.market-metrics-v2 .metric-rail-item > div strong {
  display: block;
  font-size: 16px;
}

.metric-rail-icon {
  align-items: center;
  border-radius: 11px;
  color: #16a34a;
  display: inline-flex;
  flex: 0 0 auto;
  height: 38px;
  justify-content: center;
  background-color: #f1f9f1;
  width: 38px;
}

.metric-rail-icon svg {
  height: 18px;
  width: 18px;
}

.market-main-v2 {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 16px;
}

.market-main-v2 .market-board,
.market-main-v2 .transaction-board,
.market-sidebar-v2 .order-panel {
  background: #fff;
  border: 1px solid #e8ebef;
  border-radius: 18px;
  box-shadow: none;
}

.market-main-v2 .market-board {
  padding: 20px 20px 14px;
}

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

.chart-head-v2 {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.chart-price-head {
  display: grid;
  gap: 6px;
}

.chart-price-head-v2 .eyebrow {
  color: #111827;
  font-size: 18px;
  margin-bottom: 8px;
  text-transform: none;
}

.chart-title-eyebrow {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.chart-title-token-icon {
  display: block;
  flex: 0 0 auto;
  height: 20px;
  object-fit: contain;
  width: 20px;
}

.chart-quote-row {
  align-items: flex-start;
  display: flex;
  gap: 14px;
}

.chart-price-head strong {
  font-size: clamp(26px, 2.6vw, 31px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.chart-price-head-v2 strong {
  color: #16a34a;
  font-size: clamp(34px, 3.2vw, 46px);
  font-weight: 700;
}

.chart-price-head strong.is-up {
  color: var(--success);
}

.chart-price-head strong.is-down,
.chart-price-head-v2 strong.is-down {
  color: #ea3943;
}

.chart-change-stack {
  display: grid;
  gap: 2px;
  padding-top: 3px;
}

.chart-price-head span,
.chart-price-head-v2 span {
  color: var(--success);
  display: inline-block;
  font-size: 15px;
  font-weight: 700;
}

.chart-price-head span.is-down {
  color: var(--danger);
}

.chart-price-unit {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.range-tabs {
  background: #f1f2f3;
  border-radius: 8px;
  display: flex;
  gap: 4px;
  padding: 4px;
}

.range-tabs button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #59616d;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  min-height: 36px;
  min-width: 48px;
  padding: 0 12px;
}

.range-tabs .is-selected {
  background: #fff;
  box-shadow: 0 6px 18px rgba(21, 26, 34, 0.08);
  color: var(--orange);
}

.chart-canvas-wrap {
  background: #ffffff;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  height: clamp(320px, 46vw, 500px);
  overflow: hidden;
}

.chart-canvas-wrap-v2 {
  border-radius: 16px;
  height: clamp(340px, 38vw, 440px);
}

.chart-scroll-region {
  cursor: grab;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chart-scroll-region::-webkit-scrollbar {
  display: none;
}

.chart-scroll-region.is-dragging {
  cursor: grabbing;
}

.chart-axis-overlay {
  background: #ffffff;
  height: 100%;
  position: relative;
  z-index: 2;
}

.chart-axis-svg,
#priceChart,
.chart-svg {
  display: block;
  height: 100%;
  width: 100%;
}

.price-chart {
  height: 100%;
  position: relative;
  width: 100%;
}

.chart-bg {
  fill: #ffffff;
}

.chart-grid-line {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.chart-grid-vertical {
  stroke: #eef2f7;
  stroke-width: 1;
}

.chart-y-label,
.chart-x-label {
  fill: #6b7280;
  font-family: "Google Sans", sans-serif;
  font-size: 12px;
  letter-spacing: 0;
}

.chart-y-label {
  font-size: 11px;
}

.chart-x-label {
  text-anchor: middle;
}

.chart-segment {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

.chart-segment.is-up {
  stroke: #16c784;
}

.chart-segment.is-down {
  stroke: #ea3943;
}

.chart-area-segment {
  pointer-events: none;
}

.chart-last-bubble-text {
  fill: #ffffff;
  font-family: "Google Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.chart-hover-target {
  cursor: crosshair;
  fill: transparent;
}

.chart-hover-guide {
  stroke: rgba(107, 114, 128, 0.6);
  stroke-dasharray: 4 4;
  stroke-width: 1.5;
}

.chart-hover-point {
  stroke: #ffffff;
  stroke-width: 2.5;
}

.chart-tooltip {
  background: rgba(17, 24, 39, 0.94);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
  color: #ffffff;
  left: 0;
  min-width: 112px;
  padding: 10px 12px;
  pointer-events: none;
  position: absolute;
  top: 0;
  transform: translate(-50%, calc(-100% - 18px));
  white-space: nowrap;
  z-index: 3;
}

.chart-tooltip-time {
  font-size: 11px;
  opacity: 0.78;
}

.chart-tooltip-price {
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
}

.chart-empty {
  align-content: start;
  color: #6b7280;
  display: grid;
  gap: 8px;
  height: 100%;
  padding: 24px;
}

.chart-empty strong {
  color: #111827;
  font-size: 14px;
}

.transaction-board {
  padding: 18px 18px 14px;
}

.transaction-board .sidebar-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.transaction-board .sidebar-card-head h3 {
  font-size: 20px;
  margin: 0;
}

.transaction-board .sidebar-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  text-align: right;
}

.transaction-section {
  margin-top: 24px;
}

.transaction-table-wrap {
  margin-top: 0;
}

.transaction-table-wrap th,
.transaction-table-wrap td {
  font-size: 11px;
  line-height: 1.35;
  padding: 8px 10px;
  vertical-align: top;
  white-space: nowrap;
}

.transaction-table-wrap th {
  font-size: 10px;
}

.transaction-actions {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.transaction-link-all {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.transaction-link-all:hover {
  color: #111827;
}

.transaction-row.is-buy td {
  color: var(--success);
}

.transaction-row.is-sell td {
  color: var(--danger);
}

.market-sidebar-v2 {
  align-self: stretch;
  gap: 0;
  justify-self: stretch;
  width: 100%;
}

.order-panel {
  align-self: stretch;
  display: grid;
  gap: 5px;
  justify-self: stretch;
  padding: 18px 16px 16px;
  width: 100%;
}

.order-panel .panel-heading {
  font-size: 16px;
}

.order-panel-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.order-panel-link {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  color: #111827;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  min-height: 30px;
  padding: 0 14px;
}

.order-panel-link svg {
  color: #16c784;
  height: 18px;
  width: 18px;
}

.order-balance-strip {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.order-balance-cards {
  border: 1px solid #edf0f3;
  border-radius: 16px;
  margin-bottom: 6px;
  overflow: hidden;
}

.order-balance-card {
  align-items: center;
  border-bottom: 0;
  border-right: 1px solid #edf0f3;
  display: grid;
  gap: 12px;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon copy arrow"
    "icon value arrow"
    "icon sub arrow";
  min-height: 102px;
  padding: 10px 14px;
}

.order-balance-card:last-child {
  border-bottom: 0;
  border-right: 0;
}

.order-balance-card-icon {
  grid-area: icon;
  align-items: center;
  background: linear-gradient(180deg, #f4fffa 0%, #eef8f1 100%);
  border-radius: 20px;
  color: #16c784;
  display: inline-flex;
  height: 60px;
  justify-content: center;
  width: 60px;
}

.order-balance-card-icon svg,
.order-balance-card-icon .token-icon-image {
  height: 30px;
  width: 30px;
}

.order-balance-card-copy {
  display: grid;
  gap: 2px;
  grid-area: copy;
  min-width: 0;
}

.order-balance-card-title {
  color: #42526f;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
}

.order-balance-card-sub {
  color: #667085;
  display: block;
  font-size: 14px;
  font-weight: 500;
  grid-area: sub;
  line-height: 1.35;
}

.order-balance-card-value-wrap {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  grid-area: value;
  justify-content: flex-start;
  min-width: 0;
}

.order-balance-card-value {
  color: #111827;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  text-align: left;
}

.order-balance-card-arrow {
  color: #94a3b8;
  flex: 0 0 auto;
  grid-area: arrow;
  height: 22px;
  width: 22px;
}

.order-section-heading {
  margin: 0;
}

.order-balance-line {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.order-balance-line span {
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.order-balance-line strong {
  color: #16a34a;
  font-size: 25px;
  font-weight: 800;
}

.order-balance-token-icon {
  display: inline-block;
  height: 24px;
  margin-left: 8px;
  object-fit: contain;
  vertical-align: -2px;
  width: 24px;
}

.order-balance-sub {
  color: #98a2b3;
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.order-trade-shell {
  background: linear-gradient(180deg, #ffffff 0%, #fbfffc 100%);
  border-radius: 18px;
  display: grid;
  gap: 14px;
}

.order-trade-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.order-trade-title-wrap {
  align-items: center;
  display: inline-flex;
  gap: 10px;
}

.order-trade-icon {
  align-items: center;
  color: #16a34a;
  display: inline-flex;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.order-trade-icon svg {
  height: 24px;
  width: 24px;
}

.order-trade-badge {
  align-items: center;
  background: #f6f7f9;
  border-radius: 999px;
  color: #475467;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
}

.order-trade-badge svg {
  height: 18px;
  width: 18px;
}

.order-input-label {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
  margin: 0;
}

.order-amount-input {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d7dde5;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 0;
  padding: 12px 14px 9px;
}

.order-amount-input input {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0;
}

.order-amount-unit {
  align-items: center;
  color: #475467;
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 10px;
}

.order-amount-unit .token-icon-image {
  height: 28px;
  width: 28px;
}

.order-amount-input .amount-stepper {
  grid-column: 1 / -1;
  margin-top: -2px;
}

.order-total-preview {
  background: rgb(221, 255, 217);
  border-radius: 0 0 16px 16px;
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -14px;
  min-height: 50px;
  padding: 14px 16px 12px;
  border: solid 1px #d7dde5;
  border-top: 0;
}

.order-total-preview-label {
  color: #16a34a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.order-total-preview-value {
  color: #16a34a;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}


.quote-list-v2 {
  margin-bottom: 0;
}

.quote-list-v2 div {
  padding-bottom: 10px;
}

.order-quote-list {
  gap: 0;
}

.order-quote-list dt {
  align-items: center;
  color: #42526f;
  display: inline-flex;
  font-size: 12px;
  gap: 12px;
}

.quote-row-title {
  align-items: center;
  display: inline-flex;
  gap: 12px;
}

.quote-row-icon {
  align-items: center;
  color: #667085;
  display: inline-flex;
  flex: 0 0 auto;
  height: 20px;
  justify-content: center;
  width: 20px;
}

.quote-row-icon svg,
.quote-row-icon .token-icon-image {
  height: 16px;
  width: 16px;
}

.order-quote-list dd {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
}

.trade-action-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 8px;
}

.trade-action-grid-v2 {
  gap: 14px;
  grid-template-columns: 1fr 1fr;
  margin-top: 5px;
}

.trade-action-button {
  align-items: stretch;
  border: 1px solid rgba(17, 24, 39, 0.08);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  min-height: 118px;
  overflow: hidden;
  padding: 14px 16px 12px;
  text-align: left;
  position: relative;
}

.trade-action-top,
.trade-action-bottom {
  align-items: center;
  display: grid;
}

.trade-action-top {
  column-gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
}

.trade-action-bottom {
  column-gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.trade-action-icon,
.trade-action-arrow {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 46px;
  line-height: 0;
  position: relative;
  width: 46px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.08);
  align-self: center;
}

.trade-action-icon svg,
.trade-action-arrow svg {
  display: block;
  height: 18px;
  left: 50%;
  position: absolute;
  stroke-width: 3.5;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
}

.trade-action-buy .trade-action-icon,
.trade-action-buy .trade-action-arrow,
.trade-action-buy.is-selected .trade-action-icon,
.trade-action-buy.is-selected .trade-action-arrow {
  color: #16a34a !important;
}

.trade-action-sell .trade-action-icon,
.trade-action-sell .trade-action-arrow,
.trade-action-sell.is-selected .trade-action-icon,
.trade-action-sell.is-selected .trade-action-arrow {
  color: #ef3740 !important;
}

.trade-action-copy {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.trade-action-button strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0;
}

.trade-action-button span {
  color: rgba(255, 255, 255, 0.88);
  display: block;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.22;
}

.trade-action-total-label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.trade-action-grid-v2 .trade-action-button {
  border-radius: 20px;
}

.trade-action-buy,
.trade-action-buy.is-selected {
  background: linear-gradient(135deg, #1fc98a 0%, #1cc47d 100%);
  border-color: rgba(14, 115, 76, 0.2);
}

.trade-action-sell,
.trade-action-sell.is-selected {
  background: linear-gradient(135deg, #ef4b53 0%, #ef3740 100%);
  border-color: rgba(153, 27, 27, 0.18);
}

.trade-action-grid-v2 .trade-action-button span,
.trade-action-grid-v2 .trade-action-button strong {
  color: #ffffff;
}

.trade-action-button:hover {
  transform: translateY(-1px);
}

.trade-action-button:active {
  transform: translateY(0);
}

.trade-action-copy span:last-child {
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 2px;
}

.trade-action-bottom > span[id$="TradeTotal"] {
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
}

.order-security-note {
  align-items: center;
  background: linear-gradient(180deg, #fbfcfe 0%, #f7f9fc 100%);
  border-radius: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px 14px;
}

.order-security-icon {
  align-items: center;
  background: #eefaf2;
  border-radius: 12px;
  color: #16a34a;
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.order-security-icon svg {
  height: 20px;
  width: 20px;
}

.order-security-note strong {
  color: #111827;
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.order-security-note small {
  color: #667085;
  display: block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.45;
}

@media (max-width: 1180px) {
  .topbar {
    width: calc(100% - 20px);
  }

  .market-terminal-v2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-rail {
    order: 2;
  }

  .market-main-v2 {
    order: 1;
  }

  .market-sidebar-v2 {
    order: 3;
  }

  .market-metrics-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .market-terminal-v2 {
    border-radius: 18px;
    padding: 14px;
  }

  .market-metrics-v2,
  .trade-action-grid-v2 {
    grid-template-columns: 1fr;
  }

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

  .range-tabs {
    overflow-x: auto;
    width: 100%;
  }

  .order-balance-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .order-balance-card-value-wrap {
    grid-column: 2;
    justify-content: space-between;
  }
}

@media (max-width: 700px) {
  .market-info-banner {
    align-items: flex-start;
    border-radius: 14px;
    gap: 12px;
    padding: 12px 14px;
  }

  .market-info-banner-copy strong {
    font-size: 16px;
  }

  .chart-canvas-wrap {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  .chart-y-label,
  .chart-x-label {
    font-size: 11px;
  }

  .trade-panel,
  .asset-panel,
  .sidebar-card,
  .activity-card {
    padding: 16px;
  }

  .order-panel-link {
    min-height: 48px;
    padding: 0 14px;
  }

  .order-balance-card {
    min-height: 102px;
  }

  .order-balance-card-icon {
    border-radius: 16px;
    height: 60px;
    width: 60px;
  }

  .order-balance-card-icon svg,
  .order-balance-card-icon .token-icon-image {
    height: 30px;
    width: 30px;
  }

  .order-balance-card-title {
    font-size: 16px;
  }

  .order-balance-card-value {
    font-size: 26px;
  }

  .trade-action-arrow {
    display: none !important;
  }
}

@media (max-width: 520px) {
  .terminal-page {
    padding-top: 0;
  }

  .terminal-shell {
    max-width: none;
  }

  .market-terminal-v2 {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 10px;
    padding: 0;
  }

  .market-main-v2 {
    gap: 10px;
  }

  .market-main-v2 .market-board,
  .market-main-v2 .transaction-board,
  .market-sidebar-v2 .order-panel {
    border-radius: 14px;
    border-color: transparent;
    box-shadow: none;
  }

  .trade-action-grid-v2{
    margin-top: 0;
  }

  .market-main-v2 .market-board{
       padding: 10px 12px 8px;
  }

  .metric-rail {
    border-color: transparent;
    order: 4;
    padding: 8px 12px;
  }

  .market-metrics-v2 {
    display: grid;
    gap: 0;
  }

  .panel-heading {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .market-metrics-v2 .metric-rail-item {
    gap: 8px;
    min-height: 44px;
    padding: 6px 2px;
  }

  .market-metrics-v2 .metric-rail-item > div span {
    font-size: 9px;
    margin-bottom: 2px;
  }

  .market-metrics-v2 .metric-rail-item > div strong {
    font-size: 11px;
    line-height: 1.2;
  }

  .metric-rail-icon {
    border-radius: 8px;
    height: 26px;
    width: 26px;
  }

  .metric-rail-icon svg {
    height: 12px;
    width: 12px;
  }

  .chart-price-head-v2 strong {
    font-size: 36px;
  }

  .chart-canvas-wrap {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .chart-canvas-wrap-v2 {
    height: auto;
    min-height: 0;
  }

  .transaction-board,
  .market-info-strip {
    display: none;
  }

  .trade-panel {
    background: #ffffff;
    border: 1px solid #e8eaee;
    border-radius: 14px;
    box-shadow: none;
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) minmax(136px, 1.2fr) minmax(0, 1fr);
    grid-template-areas:
      "panelhead panelhead panelhead"
      "balances balances balances"
      "buy input sell"
      "message message message"
      "security security security";
    margin: 0;
    order: 3;
    padding: 10px 12px 12px;
  }

  .order-panel-head {
    grid-area: panelhead;
  }

  .order-balance-strip {
    grid-area: balances;
  }

  .order-panel-head,
  .order-trade-head {
    align-items: stretch;
    flex-direction: column;
  }

  .order-panel-link,
  .order-trade-badge {
    justify-content: center;
    width: 100%;
  }

  .order-panel-link {
    display: none;
  }

  .order-trade-badge {
    display: none;
  }

  .order-balance-card {
    gap: 10px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "icon copy arrow"
      "icon value arrow";
    min-height: 0;
    padding: 8px 10px;
  }

  .order-balance-card-icon {
    border-radius: 14px;
    height: 40px;
    width: 40px;
  }

  .order-balance-card-icon svg,
  .order-balance-card-icon .token-icon-image {
    height: 24px;
    width: 24px;
  }

  .order-balance-card-value-wrap {
    gap: 6px;
  }

  .order-balance-card-value {
    font-size: 16px;
  }

  .order-balance-card-title {
    font-size: 12px;
  }

  .order-balance-card-sub {
    display: none;
  }

  .order-balance-card-arrow {
    height: 14px;
    width: 14px;
  }

  .order-trade-shell {
    display: contents;
  }

  .order-trade-shell > * {
    min-width: 0;
  }

  .order-trade-head,
  .order-input-label {
    display: none;
  }

  .quote-list-v2.order-quote-list {
    display: none;
  }

  .order-amount-input {
    align-self: stretch;
    border: 1px solid #d7dde5;
    border-radius: 12px;
    gap: 8px;
    grid-area: input;
    min-height: 68px;
    padding: 8px 10px;
  }

  .order-amount-input input {
    font-size: 22px;
  }

  .chart-price-unit {
    display: none;
  }

  .market-info-banner {
    display: none;
  }

  .order-total-preview {
    display: none;
  }

  .quote-list {
    gap: 7px;
    margin-bottom: 4px;
    order: 1;
  }

  .quote-list div {
    align-items: start;
    border-bottom-color: #e5e7eb;
    display: grid;
    gap: 6px 12px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-bottom: 9px;
  }

  .quote-list dt {
    font-size: 11px;
  }

  .quote-list dd {
    font-size: 13px;
    max-width: none;
  }

  .trade-action-grid {
    display: contents;
  }

  .trade-action-button {
    gap: 6px;
    min-height: 68px;
    padding: 8px 10px;
  }

  .trade-action-icon,
  .trade-action-arrow {
    height: 24px;
    width: 24px;
  }

  .trade-action-icon svg,
  .trade-action-arrow svg {
    height: 12px;
    width: 12px;
  }

  #buyTradeButton {
    grid-area: buy;
  }

  #sellTradeButton {
    grid-area: sell;
  }

  #buyTradeButton,
  #sellTradeButton {
    align-content: center;
    border-radius: 12px;
    grid-template-rows: auto auto;
  }

  #buyTradeButton .trade-action-top,
  #sellTradeButton .trade-action-top {
    align-items: center;
    column-gap: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  #buyTradeButton .trade-action-bottom,
  #sellTradeButton .trade-action-bottom {
    align-items: end;
    column-gap: 6px;
    grid-template-columns: minmax(0, 1fr);
  }

  #buyTradeButton .trade-action-icon,
  #sellTradeButton .trade-action-icon,
  #buyTradeButton .trade-action-copy span,
  #sellTradeButton .trade-action-copy span {
    display: none;
  }

  #buyTradeButton .trade-action-copy strong,
  #sellTradeButton .trade-action-copy strong {
    display: block;
    font-size: 12px;
    line-height: 1.1;
    text-align: center;
  }

  #buyTradeButton .trade-action-total-label,
  #sellTradeButton .trade-action-total-label {
    display: none;
  }

  #buyTradeButton #buyTradeTotal,
  #sellTradeButton #sellTradeTotal {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
  }

  .order-security-note {
    grid-area: security;
  }

  #tradeMessage {
    grid-area: message;
    margin: 0;
  }

  .form-message {
    font-size: 12px;
    grid-column: 1 / -1;
    grid-row: 6;
    order: 6;
  }

  .market-info-banner{
    border-radius: 0;
  }
  .chart-canvas-wrap-v2{
    height: 240px;
  }
  .order-panel{
    padding-top: 0;
  }
  .order-amount-unit .token-icon-image{
    height: 20px;
    width: 20px;
  }
}
