:root {
  --bg: #f5f2f6;
  --card: #eaedee;
  --card-2: #f1f1ed;

  --text: #171717;
  --muted: #737373;
  --line: #deded8;

  --primary: #171717;
  --primary-text: #ffffff;

  --success: #247a49;
  --danger: #b73b3b;

  --shadow: 0 18px 45px rgba(0,0,0,.07);
  --radius: 18px;
  --radius-sm: 12px;

  --sidebar: 250px;
  --header: 72px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

body.dark {
  --bg: #101010;
  --card: #171717;
  --card-2: #202020;
  --text: #f7f7f7;
  --muted: #999;
  --line: #303030;
  --primary: #ffffff;
  --primary-text: #111111;
  --shadow: 0 18px 50px rgba(0,0,0,.25);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

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

.container {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.hidden {
  display: none !important;
}

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

/* ==================================================
   PUBLIC HEADER
================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.nav-container {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary);
  color: var(--primary-text);
  font-weight: 800;
}

.brand-name {
  font-size: 18px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 25px;
}

.desktop-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: .2s;
}

.desktop-nav a:hover {
  color: var(--text);
}

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

.btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  transition: transform .18s, opacity .18s, background .18s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.btn-secondary {
  background: var(--card);
  color: var(--text);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text);
}

.btn-large {
  min-height: 52px;
  padding-inline: 23px;
}

.full {
  width: 100%;
}

.mobile-menu-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  display: none;
  position: relative;
  z-index: 1150;
  cursor: pointer;
  pointer-events: auto;
}

.mobile-nav {
  display: none;
}

/* ==================================================
   HERO
================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding: 110px 0 100px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 80px;
}

.hero-copy h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(52px, 7vw, 86px);
  line-height: .98;
  letter-spacing: -4px;
  margin: 20px 0;
}

.hero-copy h1 span {
  display: block;
  color: var(--muted);
}

.hero-copy p {
  max-width: 650px;
  color: var(--muted);
  font-size: 18px;
}

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

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .12;
  pointer-events: none;
}

.hero-glow-one {
  top: -150px;
  right: 10%;
  background: #999;
}

.hero-glow-two {
  bottom: -220px;
  left: 10%;
  background: #555;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.hero-card-top,
.hero-card-bottom,
.market-card-top,
.panel-heading,
.balance-card-top,
.wallet-address-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.hero-price {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  margin-top: 5px;
}

.market-change {
  font-size: 13px;
  font-weight: 700;
}

.market-change.positive {
  color: var(--success);
}

.market-change.negative {
  color: var(--danger);
}

.mini-chart {
  height: 230px;
  margin: 30px 0;
}

.mini-chart svg {
  width: 100%;
  height: 100%;
}

.chart-area {
  fill: url(#chartFill);
}

.chart-line {
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
}

.hero-card-bottom {
  color: var(--muted);
  font-size: 12px;
}

/* ==================================================
   SECTIONS
================================================== */

.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--card-2);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  margin-bottom: 35px;
}

.section-heading.centred {
  display: block;
  text-align: center;
}

.section-heading h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(34px, 4vw, 50px);
  letter-spacing: -2px;
  margin: 10px 0;
}

.section-heading p {
  color: var(--muted);
  max-width: 650px;
}

.section-heading.centred p {
  margin-inline: auto;
}

.live-badge {
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

/* ==================================================
   MARKETS
================================================== */

.market-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.market-card,
.supported-coin,
.feature-card,
.settings-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.market-card {
  padding: 22px;
}

.asset-info {
  display: flex;
  align-items: center;
  gap: 11px;
}

.asset-info small,
.supported-coin small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.asset-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-weight: 800;
}

.market-price {
  display: block;
  margin-top: 25px;
  font-size: 25px;
  font-family: "Space Grotesk", sans-serif;
}

.market-spark {
  height: 35px;
  margin-top: 20px;
  border-bottom: 2px solid currentColor;
  opacity: .2;
  transform: skewY(-5deg);
}

.market-table-wrapper {
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.market-table-head,
.market-table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 15px;
  padding: 16px 20px;
}

.market-table-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: var(--card-2);
}

.market-table-row {
  border-top: 1px solid var(--line);
}

/* ==================================================
   GENERAL CONTENT
================================================== */

.trade-preview-grid,
.security-grid,
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.trade-preview-copy h2,
.security-grid h2,
.about-grid h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(35px, 5vw, 55px);
  line-height: 1.03;
  letter-spacing: -2px;
}

.trade-preview-copy p,
.security-grid p,
.about-grid p {
  color: var(--muted);
}

.feature-list,
.security-points {
  display: grid;
  gap: 13px;
  margin-top: 28px;
}

.feature-list div,
.security-points div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-list span,
.security-points span {
  font-weight: 800;
}

.calculator-card,
.form-card,
.trade-terminal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.trade-tabs {
  display: flex;
  gap: 5px;
  background: var(--card-2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}

.trade-tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px;
  border-radius: 9px;
  font-weight: 700;
  cursor: pointer;
}

.trade-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

textarea {
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--text);
}

input:disabled,
input[readonly] {
  opacity: .75;
  cursor: not-allowed;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  padding-right: 65px;
}

.input-wrap span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.calculator-result,
.quote {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border-radius: 13px;
  background: var(--card-2);
  margin-bottom: 18px;
}

.calculator-result span,
.quote span {
  color: var(--muted);
  font-size: 13px;
}

.supported-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.supported-coin {
  padding: 20px 12px;
  text-align: center;
}

.supported-coin .asset-icon {
  margin: 0 auto 10px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.feature-card {
  padding: 27px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card-2);
  font-weight: 800;
}

.feature-card p,
.step p {
  color: var(--muted);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.step-number {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  color: var(--muted);
}

.security-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 45px;
  text-align: center;
  box-shadow: var(--shadow);
}

.security-shield {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card-2);
  font-size: 25px;
  font-weight: 800;
}

.fees-card {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
}

.fees-card div {
  padding: 25px;
  border-right: 1px solid var(--line);
}

.fees-card div:last-child {
  border-right: 0;
}

.fees-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.fees-card strong {
  display: block;
  margin-top: 8px;
}

.faq-container {
  max-width: 850px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}

summary {
  cursor: pointer;
  font-weight: 700;
}

details p {
  color: var(--muted);
}

/* ==================================================
   CTA / FOOTER
================================================== */

.cta-section {
  padding: 80px 0;
}

.cta-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
  padding: 45px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 25px;
}

.cta-card h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 40px;
  margin: 10px 0;
}

.cta-card p {
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 60px 0 20px;
  background: var(--card);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-grid > div {
  display: grid;
  align-content: start;
  gap: 10px;
}

.footer-grid strong {
  margin-bottom: 7px;
}

.footer-grid p,
.footer-grid a,
.footer-grid button {
  color: var(--muted);
}

.footer-grid button {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 0;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.social-links a {
  border: 1px solid var(--line);
  padding: 7px 10px;
  border-radius: 8px;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 45px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

/* ==================================================
   DASHBOARD
================================================== */

.dashboard-page {
  min-height: 100vh;
}

/* ==================================================
   FIXED SIDEBAR STACKING
================================================== */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar);
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;

  /* FIX */
  z-index: 1200;

  overflow-y: auto;
  pointer-events: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px 25px;
}

.sidebar-close {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 27px;
  cursor: pointer;
  pointer-events: auto;
}

.sidebar-section {
  margin-bottom: 25px;
}

.sidebar-label {
  display: block;
  padding: 0 12px 8px;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--muted);
}

.side-link {
  width: 100%;
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 12px;
  margin-bottom: 3px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  pointer-events: auto;
}

.side-link span {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.side-link:hover,
.side-link.active {
  background: var(--card-2);
  color: var(--text);
}

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

.logout-link {
  color: var(--danger);
}

/* ==================================================
   DASHBOARD SHELL
================================================== */

.dashboard-shell {
  margin-left: var(--sidebar);
  min-height: 100vh;
}

/* ==================================================
   DASHBOARD HEADER
================================================== */

/*
   IMPORTANT FIX:

   Header must be ABOVE the sidebar overlay.
   Otherwise the transparent overlay blocks the
   menu button from receiving clicks.
*/

.dashboard-header {
  height: var(--header);
  position: sticky;
  top: 0;

  /* FIXED STACKING */
  z-index: 1150;

  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(18px);
}

.dashboard-title {
  display: flex;
  flex-direction: column;
}

.dashboard-title span {
  font-size: 11px;
}

.dashboard-title strong {
  font-family: "Space Grotesk", sans-serif;
}

.dashboard-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
}

.notification-svg {
  width: 20px;
  height: 20px;
}

.notification-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 100px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: var(--bg);
  border: 2px solid var(--bg);
  font-size: 9px;
  font-weight: 800;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 13px;
}

/* ==================================================
   DASHBOARD MENU BUTTON
================================================== */

/*
   This is deliberately above the overlay.
*/

#menu-btn,
#mobile-menu-btn,
.menu-btn,
.hamburger-btn,
[data-open-sidebar] {
  position: relative;
  z-index: 1190;
  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none;
}

/*
   Make sure icons inside the button don't steal
   the click from the button.
*/

#menu-btn *,
#mobile-menu-btn *,
.menu-btn *,
.hamburger-btn * {
  pointer-events: none;
}

/* ==================================================
   DASHBOARD CONTENT
================================================== */

.dashboard-content {
  width: min(1250px, calc(100% - 50px));
  margin: 0 auto;
  padding: 45px 0;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 25px;
  margin-bottom: 30px;
}

.page-heading h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 42px;
  letter-spacing: -2px;
  margin: 6px 0;
}

.page-heading p {
  color: var(--muted);
  margin: 0;
}

/* ==================================================
   BALANCES
================================================== */

.balance-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 15px;
}

.balance-card,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  padding: 24px;
}

.main-balance {
  background: var(--primary);
  color: var(--primary-text);
}

.main-balance .balance-note,
.main-balance .balance-card-top {
  opacity: .65;
}

.main-balance > strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 35px;
  margin: 22px 0 5px;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin: 18px 0 5px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 23px;
}

/* ==================================================
   QUICK ACTIONS
================================================== */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.quick-action {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  display: grid;
  gap: 3px;
  cursor: pointer;
}

.quick-action > span {
  font-size: 20px;
}

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

/* ==================================================
   DASHBOARD PANELS
================================================== */

.dashboard-grid,
.send-grid,
.kyc-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.panel-heading {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h3 {
  margin: 0;
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
}

.text-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.table-list {
  display: grid;
}

.table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 10px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

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

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

.empty {
  padding: 35px;
  text-align: center;
  color: var(--muted);
}

/* ==================================================
   WALLETS
================================================== */

.wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
}

.wallet-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
}

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

.wallet-card strong {
  display: block;
  margin-top: 22px;
  font-size: 24px;
  font-family: "Space Grotesk", sans-serif;
}

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


/* ==================================================
   WALLET LIST (rows, not cards)
   Used for Portfolio and Wallets pages.
================================================== */

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.wallet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--card);
}

.wallet-row-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-row-identity strong {
  display: block;
  font-size: 14px;
}

.wallet-row-identity small {
  color: var(--muted);
  font-size: 12px;
}

.wallet-row-value {
  text-align: right;
}

.wallet-row-value strong {
  display: block;
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
}

.wallet-row-value small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 600px) {

  .wallet-row {
    padding: 13px 15px;
  }

  .wallet-row-identity strong {
    font-size: 13px;
  }

  .wallet-row-value strong {
    font-size: 14px;
  }

}

/* ==================================================
   TRADING
================================================== */

.trading-chart-card {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  min-height: 400px;
}

#tradingview-chart {
  min-height: 320px;
}

.trade-layout {
  max-width: 700px;
}

.swap-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 25px;
  margin: -5px 0 12px;
}

/* ==================================================
   DEPOSIT / SEND / WITHDRAW
================================================== */

.deposit-mode-tabs {
  max-width: 700px;
  display: flex;
  gap: 5px;
  background: var(--card-2);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 15px;
}

.deposit-mode-tabs .trade-tab {
  flex: 1;
}

.wallet-address-box {
  padding: 20px;
  background: var(--card-2);
  border-radius: 15px;
  margin-bottom: 18px;
}

.wallet-address-box code {
  display: block;
  word-break: break-all;
  margin: 15px 0;
  font-size: 13px;
}

.wallet-address-box small {
  color: var(--muted);
}

.network-warning {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--card-2);
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 18px;
}

/* ==================================================
   KYC
================================================== */

.kyc-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 20px 0;
}

.kyc-step-number {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

.kyc-step h3 {
  margin: 0;
}

.kyc-step p {
  color: var(--muted);
  margin: 4px 0;
  font-size: 13px;
}

.kyc-camera,
.face-video {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #050505;
  margin: 15px 0;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.kyc-preview {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
  margin-top: 15px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.face-camera-wrapper {
  position: relative;
}

.face-guide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 55%;
  aspect-ratio: .78;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 50%;
  pointer-events: none;
}

.verification-box {
  display: flex;
  gap: 15px;
  padding: 18px;
  background: var(--card-2);
  border-radius: 15px;
}

.verification-box p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ==================================================
   SETTINGS
================================================== */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.settings-card {
  padding: 25px;
}

.settings-card p {
  color: var(--muted);
}

.field-note {
  color: var(--muted);
  font-size: 11px;
}

/* ==================================================
   SUPPORT
================================================== */

.support-socials {
  display: grid;
  gap: 10px;
}

.support-socials a {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-weight: 700;
}

.support-socials small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}

/* ==================================================
   NOTIFICATIONS
================================================== */

.notification-item {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.notification-item.unread {
  background: var(--card-2);
}

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

/* ==================================================
   SIDEBAR OVERLAY
================================================== */

/*
   IMPORTANT FIX:

   The overlay must NEVER intercept clicks while closed.
*/

#sidebar-overlay,
.sidebar-overlay {
  position: fixed;
  inset: 0;

  /* BELOW HEADER AND SIDEBAR */
  z-index: 1100;

  background: rgba(0,0,0,.45);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity .25s ease,
    visibility .25s ease;
}

/*
   Only when open should it receive clicks.
*/

#sidebar-overlay.open,
.sidebar-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/*
   Hidden class still wins.
*/

#sidebar-overlay.hidden,
.sidebar-overlay.hidden {
  display: none !important;
  pointer-events: none !important;
}

/* ==================================================
   MODAL
================================================== */

.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(5px);
}

.modal-box {
  position: relative;
  width: min(520px, calc(100% - 30px));
  max-height: 90vh;
  overflow-y: auto;
  margin: 5vh auto;
  padding: 30px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0,0,0,.2);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card-2);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
}

/* ==================================================
   AUTH
================================================== */

.auth-box {
  padding-top: 40px;
}

.auth-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
  margin: 0 0 5px;
}

.auth-subtitle {
  color: var(--muted);
  margin-bottom: 25px;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 80px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.human-check {
  border: 1px solid var(--line);
  background: var(--card-2);
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 18px;
}

.human-check label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
}

.human-check input {
  width: 18px;
  min-height: 18px;
}

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

.auth-switch button {
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.forgot-password {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.forgot-password button {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
}

.forgot-password button:hover {
  text-decoration: underline;
}

.auth-success {
  width: 100%;
}

.auth-success .verification-box {
  margin-bottom: 18px;
}

/* ==================================================
   TOAST
================================================== */

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3000;
  max-width: 360px;
}

.toast-message {
  background: var(--primary);
  color: var(--primary-text);
  border-radius: 12px;
  padding: 13px 17px;
  margin-top: 8px;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 600;
}

.toast-message.error {
  background: var(--danger);
  color: white;
}

/* ==================================================
   DARK MODE
================================================== */

body.dark .market-card,
body.dark .market-card .asset-info,
body.dark .market-card .asset-info strong,
body.dark .market-card .market-price,
body.dark .supported-coin,
body.dark .supported-coin strong {
  color: #ffffff;
}

body.dark .market-card .asset-info small,
body.dark .supported-coin small {
  color: #b0b0b0;
}

body.dark .market-table-row,
body.dark .market-table-row strong,
body.dark .market-table-row span {
  color: #ffffff;
}

body.dark .market-table-row small {
  color: #b0b0b0;
}

/* ==================================================
   RESPONSIVE
================================================== */

@media (max-width: 1050px) {

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: grid;
    place-items: center;
  }

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

  .supported-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

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

  /* ==================================================
     MOBILE SIDEBAR
  ================================================== */

  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;

    /* ALWAYS ABOVE OVERLAY */
    z-index: 1200;

    pointer-events: auto;
  }

  .sidebar.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .sidebar-close {
    display: block;
    position: relative;
    z-index: 1210;
    cursor: pointer;
    pointer-events: auto;
  }

  /*
     Header remains above overlay so menu button
     can ALWAYS be clicked.
  */

  .dashboard-header {
    z-index: 1150;
  }

  .sidebar-overlay {
    display: block;
  }

  #sidebar-overlay {
    display: block;
  }

  .dashboard-shell {
    margin-left: 0;
  }
}

/* ==================================================
   TABLET
================================================== */

@media (max-width: 800px) {

  .hero-grid,
  .trade-preview-grid,
  .security-grid,
  .about-grid,
  .dashboard-grid,
  .send-grid,
  .kyc-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 75px;
  }

  .hero-copy h1 {
    letter-spacing: -3px;
  }

  .balance-grid {
    grid-template-columns: 1fr 1fr;
  }

  .main-balance {
    grid-column: 1 / -1;
  }

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

  .wallet-grid {
    grid-template-columns: 1fr 1fr;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .fees-card {
    grid-template-columns: 1fr 1fr;
  }

  .fees-card div:nth-child(2) {
    border-right: 0;
  }

  .fees-card div:nth-child(-n+2) {
    border-bottom: 1px solid var(--line);
  }

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

/* ==================================================
   MOBILE
================================================== */

@media (max-width: 600px) {

  .container {
    width: min(100% - 28px, 1180px);
  }

  .nav-container {
    height: 65px;
  }

  .nav-actions .btn {
    display: none;
  }

  .mobile-nav {
    padding: 15px;
    border-top: 1px solid var(--line);
    background: var(--card);
  }

  .mobile-nav.open {
    display: grid;
    gap: 10px;
  }

  .mobile-nav > a {
    padding: 11px;
  }

  .mobile-nav-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-top: 8px;
  }

  .hero {
    padding: 65px 0;
  }

  .hero-copy h1 {
    font-size: 53px;
  }

  .hero-actions {
    display: grid;
  }

  .section {
    padding: 70px 0;
  }

  .section-heading,
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-grid,
  .features-grid,
  .supported-grid,
  .steps-grid,
  .wallet-grid {
    grid-template-columns: 1fr 1fr;
  }

  .supported-coin {
    padding: 15px 7px;
  }

  .balance-grid {
    grid-template-columns: 1fr;
  }

  .main-balance {
    grid-column: auto;
  }

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

  .dashboard-content {
    width: min(100% - 28px, 1250px);
    padding: 30px 0;
  }

  /*
     Keep dashboard header above overlay.
  */

  .dashboard-header {
    z-index: 1150;
    padding: 0 14px;
  }

  /*
     Menu button is explicitly clickable.
  */

  #menu-btn,
  #mobile-menu-btn,
  .menu-btn,
  .hamburger-btn {
    z-index: 1190;
    pointer-events: auto !important;
    cursor: pointer !important;
  }

  .user-menu-name {
    display: none;
  }

  .dashboard-title {
    min-width: 0;
  }

  .page-heading h1 {
    font-size: 34px;
  }

  .fees-card {
    grid-template-columns: 1fr;
  }

  .fees-card div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .fees-card div:last-child {
    border-bottom: 0;
  }

  .market-table-head,
  .market-table-row {
    grid-template-columns: 1.4fr 1fr 1fr;
    padding-inline: 12px;
  }

  .table-row {
    grid-template-columns: 1fr 1fr;
  }

  .table-row > :last-child {
    grid-column: 1 / -1;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .cta-card {
    padding: 28px;
  }

  .cta-card h2 {
    font-size: 31px;
  }
}

/* ==================================================
   SMALL MOBILE
================================================== */

@media (max-width: 420px) {

  .market-grid,
  .features-grid,
  .supported-grid,
  .steps-grid,
  .wallet-grid {
    grid-template-columns: 1fr;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header-actions {
    gap: 4px;
  }
}

/* ==================================================
   FINAL CLICK SAFETY
================================================== */

/*
   These rules are intentionally at the very end
   so nothing later in the stylesheet can override
   them.
*/

#menu-btn,
#mobile-menu-btn,
.menu-btn,
.hamburger-btn,
[data-open-sidebar] {
  pointer-events: auto !important;
  cursor: pointer !important;
}

#menu-btn *,
#mobile-menu-btn *,
.menu-btn *,
.hamburger-btn * {
  pointer-events: none !important;
}

.dashboard-header {
  position: sticky;
  z-index: 1150 !important;
}

.sidebar {
  z-index: 1200 !important;
}

#sidebar-overlay,
.sidebar-overlay {
  z-index: 1100 !important;
}

#sidebar-overlay:not(.open),
.sidebar-overlay:not(.open) {
  pointer-events: none !important;
}

#sidebar-overlay.open,
.sidebar-overlay.open {
  pointer-events: auto !important;
}

/* ==================================================
   kashkoin
   STACKED CRYPTO MARKET WIDGET
================================================== */

.crypto-widget {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: 22px;

  border: 1px solid rgba(255,255,255,.09);
  border-radius: 28px;

  background:
    linear-gradient(
      145deg,
      rgba(255,255,255,.075),
      rgba(255,255,255,.025)
    );

  box-shadow:
    0 30px 80px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.08);

  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}


/* HEADER */

.crypto-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.crypto-widget-header h3 {
  margin: 5px 0 0;
  font-size: 19px;
  font-weight: 700;
}

.crypto-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;

  padding: 9px 13px;

  background: rgba(255,255,255,.06);
  color: inherit;

  font-size: 12px;
  font-weight: 700;

  cursor: pointer;

  transition:
    transform .2s ease,
    background .2s ease,
    border-color .2s ease;
}

.crypto-add-btn span {
  font-size: 18px;
  line-height: 1;
}

.crypto-add-btn:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.11);
  border-color: rgba(255,255,255,.2);
}


/* STACK */

.crypto-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* CARD */

.crypto-stack-card {
  position: relative;

  min-height: 150px;
  padding: 18px;

  overflow: hidden;

  border-radius: 21px;
  border: 1px solid rgba(255,255,255,.09);

  background:
    linear-gradient(
      135deg,
      rgba(255,255,255,.085),
      rgba(255,255,255,.025)
    );

  transition:
    transform .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}

.crypto-stack-card:hover {
  transform: translateY(-2px);

  border-color: rgba(255,255,255,.16);

  box-shadow:
    0 15px 40px rgba(0,0,0,.18);
}


/* CARD TOP */

.crypto-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.crypto-card-asset {
  display: flex;
  align-items: center;
  gap: 11px;
}

.crypto-card-asset-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.crypto-card-asset-info strong {
  font-size: 14px;
}

.crypto-card-asset-info small {
  font-size: 11px;
  opacity: .5;
}


/* ICON */

.crypto-stack-card .asset-icon {
  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  border-radius: 13px;

  font-size: 18px;
  font-weight: 800;

  flex-shrink: 0;
}


/* REMOVE */

.crypto-remove-btn {
  width: 28px;
  height: 28px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 9px;

  background: rgba(255,255,255,.05);
  color: inherit;

  opacity: .45;

  cursor: pointer;

  transition:
    opacity .2s ease,
    background .2s ease;
}

.crypto-remove-btn:hover {
  opacity: 1;
  background: rgba(255,70,70,.14);
}


/* PRICE */

.crypto-card-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  margin-top: 17px;
}

.crypto-card-price {
  font-size: 26px;
  line-height: 1;

  font-weight: 800;
  letter-spacing: -.7px;
}

.crypto-card-change {
  font-size: 12px;
  font-weight: 700;
}


/* CHART */

.crypto-card-chart {
  position: absolute;

  right: 15px;
  bottom: 12px;

  width: 46%;
  height: 55px;

  opacity: .35;

  pointer-events: none;
}

.crypto-card-chart svg {
  width: 100%;
  height: 100%;
}


/* ADD PICKER */

.crypto-picker {
  margin-top: 12px;

  padding: 16px;

  border-radius: 18px;

  background: rgba(0,0,0,.18);
  border: 1px solid rgba(255,255,255,.08);

  animation: cryptoPickerIn .2s ease;
}

.crypto-picker.hidden {
  display: none;
}

@keyframes cryptoPickerIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.crypto-picker-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  margin-bottom: 13px;
}

.crypto-picker-header div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.crypto-picker-header strong {
  font-size: 13px;
}

.crypto-picker-header span {
  font-size: 11px;
  opacity: .5;
}

.crypto-picker-close {
  width: 28px;
  height: 28px;

  border: 0;
  border-radius: 8px;

  background: rgba(255,255,255,.06);
  color: inherit;

  font-size: 18px;

  cursor: pointer;
}


/* ASSET OPTIONS */

.crypto-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.crypto-asset-option {
  display: flex;
  align-items: center;
  gap: 9px;

  width: 100%;

  padding: 10px;

  border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px;

  background: rgba(255,255,255,.035);
  color: inherit;

  text-align: left;

  cursor: pointer;

  transition:
    background .2s ease,
    border-color .2s ease,
    transform .2s ease;
}

.crypto-asset-option:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.15);
}

.crypto-asset-option .asset-icon {
  width: 30px;
  height: 30px;

  display: grid;
  place-items: center;

  border-radius: 9px;

  font-size: 13px;
  font-weight: 800;

  flex-shrink: 0;
}

.crypto-asset-option span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.crypto-asset-option strong {
  font-size: 11px;
}

.crypto-asset-option small {
  font-size: 9px;
  opacity: .5;
}


/* MOBILE */

@media (max-width: 700px) {

  .crypto-widget {
    max-width: none;
    padding: 16px;
    border-radius: 22px;
  }

  .crypto-widget-header {
    align-items: flex-start;
  }

  .crypto-widget-header h3 {
    font-size: 17px;
  }

  .crypto-add-btn {
    padding: 8px 10px;
  }

  .crypto-stack-card {
    min-height: 135px;
    padding: 15px;
  }

  .crypto-card-price {
    font-size: 22px;
  }

  .crypto-picker-grid {
    grid-template-columns: 1fr;
  }

}


/* VERY SMALL PHONES */

@media (max-width: 400px) {

  .crypto-widget-header {
    flex-direction: column;
  }

  .crypto-add-btn {
    width: 100%;
    justify-content: center;
  }

}

/* ==================================================
   MOBILE MENU — GLASS + BACKGROUND BLUR
================================================== */

/*
   The page blur sits BELOW the mobile menu.
   It does NOT make the menu itself black.
*/

@media (max-width: 600px) {

  /* --------------------------------------------------
     MOBILE MENU
  -------------------------------------------------- */

  .mobile-nav {
    position: relative;
    z-index: 10001;

    background: rgba(255, 255, 255, 0.08) !important;

    border: 1px solid rgba(255, 255, 255, 0.14);

    border-radius: 0 0 18px 18px;

    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);

    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.10);

    isolation: isolate;
  }


  /* --------------------------------------------------
     MENU LINKS
  -------------------------------------------------- */

  .mobile-nav > a {
    position: relative;
    z-index: 2;

    border-radius: 10px;

    transition:
      background .2s ease,
      transform .2s ease;
  }

  .mobile-nav > a:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
  }


  /* --------------------------------------------------
     MENU BUTTON AREA
  -------------------------------------------------- */

  .mobile-nav-buttons {
    position: relative;
    z-index: 2;
  }


  /* --------------------------------------------------
     GLASS BUTTONS
  -------------------------------------------------- */

  .mobile-nav-buttons .btn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }


  /* --------------------------------------------------
     BLUR EVERYTHING BEHIND THE MENU
     
     IMPORTANT:
     .open is used because your JS/CSS opens
     the mobile menu with .open.
  -------------------------------------------------- */

  body:has(.mobile-nav.open)::before {
    content: "";

    position: fixed;
    inset: 0;

    z-index: 9998;

    background: rgba(0, 0, 0, 0.08);

    backdrop-filter: blur(8px) saturate(115%);
    -webkit-backdrop-filter: blur(8px) saturate(115%);

    pointer-events: none;

    animation: mobilePageBlur .22s ease forwards;
  }


  /* --------------------------------------------------
     KEEP HEADER ABOVE BACKDROP
  -------------------------------------------------- */

  .site-header {
    position: sticky;
    z-index: 10000;
  }


  /* --------------------------------------------------
     KEEP MOBILE MENU ABOVE EVERYTHING
  -------------------------------------------------- */

  .mobile-nav.open {
    position: relative;
    z-index: 10001;

    display: grid;
    gap: 10px;
  }


  /* --------------------------------------------------
     ANIMATION
  -------------------------------------------------- */

  @keyframes mobilePageBlur {

    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }

  }

}


/* ==================================================
   DARK MODE MOBILE GLASS
================================================== */

@media (max-width: 600px) {

  body.dark .mobile-nav {

    background: rgba(20, 20, 20, 0.48) !important;

    border-color: rgba(255, 255, 255, 0.10);

    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.40),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }


  body.dark:has(.mobile-nav.open)::before {

    background: rgba(0, 0, 0, 0.18);

    backdrop-filter: blur(8px) saturate(110%);
    -webkit-backdrop-filter: blur(8px) saturate(110%);
  }

}


/* ==================================================
   SAFETY — MENU BUTTON ALWAYS CLICKABLE
================================================== */

@media (max-width: 600px) {

  .mobile-menu-btn {
    position: relative;
    z-index: 10002;

    pointer-events: auto !important;
  }

  .mobile-menu-btn * {
    pointer-events: none !important;
  }

}

/* ==================================================
   MOBILE MENU — KEEP PRIMARY BUTTON BLACK
================================================== */

@media (max-width: 600px) {

  .mobile-nav-buttons .btn-primary {
    background: var(--primary) !important;
    color: var(--primary-text) !important;
    border-color: var(--primary) !important;

    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .mobile-nav-buttons .btn-secondary {
    background: var(--card) !important;
    color: var(--text) !important;
    border-color: var(--line) !important;
  }

}

/* ==================================================
   AUTH MODAL — ALWAYS ABOVE MOBILE MENU
================================================== */

.modal {
  z-index: 20000 !important;
}

.modal-backdrop {
  z-index: 20001;
}

.modal-box {
  position: relative;
  z-index: 20002;
}

/*
 * The toast (used for "invalid login credentials" and
 * every other success/error message) must always be
 * visible above the auth modal, otherwise messages like
 * a failed login render invisibly behind the modal blur
 * and the user has no idea why nothing happened.
 */
#toast {
  z-index: 20010 !important;
}

/* Mobile menu must sit below the auth modal */
@media (max-width: 600px) {

  .mobile-nav {
    z-index: 10001 !important;
  }

  body:has(.mobile-nav.open) .modal {
    z-index: 20000 !important;
  }

}

/* ==================================================
   STAR RATING PICKER
   Used on the dashboard "Reviews" page and reused
   (read-only) to render stars on submitted reviews.
================================================== */

.star-picker {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
}

.star-btn {
  background: none;
  border: 0;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  color: var(--line);
  transition: color 0.15s ease, transform 0.1s ease;
}

.star-btn:hover {
  transform: scale(1.12);
}

.star-btn.filled {
  color: #f5b301;
}

.form-hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

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

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

.star-display {
  color: #f5b301;
  letter-spacing: 2px;
  font-size: 15px;
}


/* ==================================================
   PUBLIC REVIEWS SECTION (landing page)
================================================== */

.reviews-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.reviews-summary-score {
  font-size: 44px;
  font-weight: 800;
}

.reviews-summary-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.review-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.review-tile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.review-tile-name {
  font-weight: 800;
  font-size: 14px;
}

.review-tile-date {
  font-size: 11px;
  color: var(--muted);
}

.review-tile p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.reviews-grid .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 30px;
  color: var(--muted);
  font-size: 13px;
}


/* ==================================================
   DEPOSIT REQUEST FLOW
================================================== */

.deposit-status-box {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-2, var(--card));
  margin-bottom: 18px;
  font-size: 13px;
}

.deposit-status-box strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.payment-method-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  cursor: pointer;
}

.payment-method-option.selected {
  border-color: var(--primary);
}

.payment-method-option strong {
  display: block;
  font-size: 13px;
}

.payment-method-option small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}


/* ==================================================
   WITHDRAW CHECKBOX ROW
================================================== */

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0;
  cursor: pointer;
}

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


/* =========================
   COOKIE CONSENT
========================= */

.cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    display: none;
    animation: cookieSlideUp 0.35s ease;
}

.cookie-content {
    max-width: 1100px;
    margin: auto;
    padding: 20px 22px;
    display: flex;
    align-items: center;
    gap: 18px;

    background: #17191d;
    border: 1px solid #2c3037;
    border-radius: 16px;

    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.cookie-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #22252b;
    border-radius: 12px;
    font-size: 24px;
}

.cookie-text {
    flex: 1;
}

.cookie-text h3 {
    margin: 0 0 5px;
    color: #fff;
    font-size: 16px;
}

.cookie-text p {
    margin: 0;
    color: #a8adb7;
    font-size: 13px;
    line-height: 1.5;
}

.cookie-settings {
    margin-top: 7px;
    padding: 0;
    border: 0;
    background: none;
    color: #cfd3da;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 11px 18px;
    border-radius: 9px;
    border: 1px solid #343840;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s ease;
}

.cookie-decline {
    background: transparent;
    color: #d4d7dc;
}

.cookie-decline:hover {
    background: #24272d;
}

.cookie-accept {
    background: #fff;
    color: #111;
    border-color: #fff;
}

.cookie-accept:hover {
    background: #e8e8e8;
}

/* =========================
   COOKIE MODAL
========================= */

.cookie-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.cookie-modal-box {
    position: relative;
    width: 100%;
    max-width: 500px;

    padding: 28px;

    background: #17191d;
    border: 1px solid #2c3037;
    border-radius: 18px;

    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.55);
}

.cookie-modal-box h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 21px;
}

.cookie-modal-box > p {
    margin: 0 0 22px;
    color: #9da3ad;
    font-size: 13px;
    line-height: 1.5;
}

.cookie-close {
    position: absolute;
    top: 15px;
    right: 18px;

    border: 0;
    background: transparent;

    color: #888e98;
    font-size: 27px;
    cursor: pointer;
}

.cookie-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 17px 0;
    border-top: 1px solid #292d33;
}

.cookie-option strong {
    display: block;
    margin-bottom: 4px;
    color: #fff;
    font-size: 14px;
}

.cookie-option span {
    display: block;
    color: #8e949e;
    font-size: 12px;
    line-height: 1.4;
}

/* Toggle */

.cookie-switch {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 24px;
}

.cookie-switch input {
    display: none;
}

.cookie-switch span {
    position: absolute;
    inset: 0;

    background: #343840;
    border-radius: 30px;
    cursor: pointer;

    transition: 0.2s ease;
}

.cookie-switch span::before {
    content: "";

    position: absolute;
    width: 18px;
    height: 18px;

    left: 3px;
    top: 3px;

    background: #fff;
    border-radius: 50%;

    transition: 0.2s ease;
}

.cookie-switch input:checked + span {
    background: #666c76;
}

.cookie-switch input:checked + span::before {
    transform: translateX(20px);
}

.cookie-switch.disabled {
    opacity: 0.5;
}

.cookie-save {
    width: 100%;
    margin-top: 20px;
    padding: 12px;

    border: 0;
    border-radius: 9px;

    background: #fff;
    color: #111;

    font-weight: 700;
    cursor: pointer;
}

/* Animation */

@keyframes cookieSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */

@media (max-width: 650px) {
    .cookie-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }

    .cookie-content {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 18px;
    }

    .cookie-icon {
        display: none;
    }

    .cookie-actions {
        width: 100%;
    }

    .cookie-btn {
        flex: 1;
    }
}

/* ==================================================
   MARKETS UNAVAILABLE BANNER
================================================== */

.markets-unavailable-banner {
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(229, 168, 59, 0.12);
  border: 1px solid rgba(229, 168, 59, 0.35);
  color: #e5a83b;
  font-size: 13px;
  margin-bottom: 16px;
}


/* ==================================================
   MARKET LIST / REAL-TIME MARKET UI
================================================== */
.market-controls{
  display:flex;
  gap:12px;
  margin:18px 0;
  flex-wrap:wrap;
}
.market-controls input,
.market-controls select{
  min-height:44px;
  border-radius:10px;
}
.market-controls input{flex:1;min-width:220px;}
.market-controls select{min-width:170px;}
.market-table-head-wide{
  grid-template-columns:minmax(220px,2fr) minmax(140px,1fr) minmax(90px,.6fr) 80px;
}
.market-table-row,
.market-row{
  display:grid;
  grid-template-columns:minmax(220px,2fr) minmax(140px,1fr) minmax(90px,.6fr) 80px;
  align-items:center;
  gap:16px;
  padding:14px 16px;
  border-bottom:1px solid rgba(127,127,127,.14);
  cursor:pointer;
}
.market-table-row:hover,.market-row:hover{background:rgba(127,127,127,.06);}
.market-table-row button,.market-row button{
  background:none;border:0;font-size:20px;cursor:pointer;
}
.market-list{max-height:720px;overflow:auto;}
.market-row .asset-info{min-width:0;}
.market-row .asset-info small{display:block;opacity:.65;margin-top:2px;}
.settings-grid-wide{grid-template-columns:repeat(auto-fit,minmax(300px,1fr));}
.settings-card{display:flex;flex-direction:column;gap:10px;}
.settings-card .btn{align-self:flex-start;}
.settings-toggle{display:flex;align-items:center;gap:9px;cursor:pointer;margin:5px 0;}
.settings-toggle input{accent-color:currentColor;}
.btn-danger{background:#9f2f2f;color:#fff;border:0;}
@media(max-width:700px){
  .market-table-head-wide,.market-table-row,.market-row{
    grid-template-columns:minmax(150px,1.5fr) minmax(110px,1fr) 75px 50px;
    gap:8px;
    padding:11px 8px;
    font-size:13px;
  }
}

.rate-panel{padding:10px 12px;border-radius:10px;background:rgba(127,127,127,.08);font-size:13px;opacity:.9;margin-top:10px;}

.avatar.has-image{overflow:hidden;position:relative}.avatar.has-image img,.avatar-image{width:100%;height:100%;object-fit:cover;object-position:center;display:block;border-radius:50%;min-width:100%;min-height:100%;max-width:none}


/* ==================================================
   SETTINGS: COMPACT ACTION SWITCHES
================================================== */
.settings-list{display:flex;flex-direction:column;border-top:1px solid var(--line);margin-top:8px}
.setting-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}
.setting-row>div:first-child{min-width:0;flex:1}
.setting-row strong{display:block;font-size:13px;font-weight:700}
.setting-row small{display:block;color:var(--muted);font-size:11px;line-height:1.45;margin-top:3px}
.setting-switch{width:34px;height:20px;min-width:34px;padding:2px;border:0;border-radius:999px;background:#c9c9c9;display:inline-flex;align-items:center;justify-content:flex-start;transition:.18s ease;box-shadow:none}
.setting-switch span{width:16px;height:16px;border-radius:50%;background:#fff;display:block;transition:.18s ease;box-shadow:0 1px 3px rgba(0,0,0,.22)}
.setting-switch[aria-pressed="true"]{background:#171717;justify-content:flex-end}
body.dark .setting-switch[aria-pressed="false"]{background:#3b3b3b}
body.dark .setting-switch[aria-pressed="true"]{background:#fff}
body.dark .setting-switch[aria-pressed="true"] span{background:#111}
.setting-select{max-width:180px}
.btn-small{padding:8px 12px;font-size:12px}
.profile-photo-picker{display:flex;align-items:center;gap:14px}
.settings-avatar-preview{width:52px;height:52px;border-radius:50%;overflow:hidden;background:var(--card-2);border:1px solid var(--line);display:flex;align-items:center;justify-content:center;font-weight:800}
.settings-avatar-preview img{width:100%;height:100%;object-fit:cover}
.field-note{display:block;margin-top:5px;color:var(--muted);font-size:11px}
.settings-grid-wide .settings-card .btn{margin-top:6px;margin-right:6px}

.demo-mode-panel{border:1px solid rgba(80,120,180,.18)}.demo-mode-panel.demo-active{border-color:rgba(30,160,100,.45)}.demo-mode-panel p{color:var(--muted,#77808c);font-size:13px}#admin-demo-funds-card label{display:block;margin:10px 0 5px;font-size:12px;font-weight:600}#admin-demo-funds-card select,#admin-demo-funds-card input{width:100%;box-sizing:border-box;margin-bottom:4px;padding:10px;border:1px solid rgba(128,128,128,.2);border-radius:8px;background:inherit}#admin-demo-funds-card small{display:block;margin-top:8px}

/* Wallet mode switch */
.wallet-mode-switcher {
  display: flex;
  align-items: center;
  justify-content: center;
}

.wallet-mode-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border-color, rgba(255,255,255,.10));
  border-radius: 12px;
  background: var(--card-bg, rgba(255,255,255,.04));
  color: var(--text-color, #fff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 17px;
  transition: .2s ease;
}

.wallet-mode-btn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.08);
}

.wallet-mode-btn:active {
  transform: scale(.95);
}

#wallet-mode-icon {
  pointer-events: none;
}

/* ============================================================
   REAL / DEMO WALLET MODE SWITCHER
   ============================================================ */

.wallet-mode-switcher {
  display: flex;
  align-items: center;
  position: relative;
}

.wallet-mode-btn {
  appearance: none;
  -webkit-appearance: none;

  border: 1px solid rgba(255, 255, 255, 0.12);

  background: rgba(255, 255, 255, 0.055);

  color: rgba(255, 255, 255, 0.82);

  height: 38px;
  min-width: 82px;

  padding: 0 14px;

  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.wallet-mode-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.wallet-mode-btn:active {
  transform: scale(0.96);
}

.wallet-mode-btn:focus-visible {
  outline: 2px solid rgba(108, 92, 231, 0.8);
  outline-offset: 3px;
}

/* Small indicator before REAL / DEMO */

.wallet-mode-btn::before {
  content: "";
  width: 7px;
  height: 7px;

  margin-right: 8px;

  border-radius: 50%;

  background: currentColor;

  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.06);

  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}

/* ============================================================
   REAL MODE
   ============================================================ */

body[data-wallet-mode="real"] .wallet-mode-btn {
  color: #f4f6fb;

  background: rgba(255, 255, 255, 0.06);

  border-color: rgba(255, 255, 255, 0.14);
}

body[data-wallet-mode="real"] .wallet-mode-btn::before {
  background: #67e8a5;

  box-shadow:
    0 0 0 3px rgba(103, 232, 165, 0.10),
    0 0 12px rgba(103, 232, 165, 0.28);
}

/* ============================================================
   DEMO MODE
   ============================================================ */

body[data-wallet-mode="demo"] .wallet-mode-btn {
  color: #ffffff;

  background: rgba(108, 92, 231, 0.18);

  border-color: rgba(108, 92, 231, 0.55);

  box-shadow:
    0 0 0 1px rgba(108, 92, 231, 0.08),
    0 6px 20px rgba(108, 92, 231, 0.12);
}

body[data-wallet-mode="demo"] .wallet-mode-btn::before {
  background: #8b7cf6;

  box-shadow:
    0 0 0 3px rgba(139, 124, 246, 0.12),
    0 0 14px rgba(139, 124, 246, 0.42);
}

body[data-wallet-mode="demo"] .wallet-mode-btn:hover {
  background: rgba(108, 92, 231, 0.25);

  border-color: rgba(139, 124, 246, 0.7);
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 700px) {

  .wallet-mode-btn {
    height: 36px;
    min-width: 76px;
    padding: 0 11px;

    font-size: 10px;
  }

  .wallet-mode-btn::before {
    width: 6px;
    height: 6px;

    margin-right: 7px;
  }

}