:root {
  color-scheme: light;
  --ink: #121821;
  --muted: #5b6573;
  --line: #d9e1ea;
  --panel: #ffffff;
  --surface: #f4f7fb;
  --brand: #d71920;
  --brand-dark: #9f1117;
  --nav: #111827;
  --gold: #c69a2b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--surface);
  line-height: 1.55;
  overflow-x: hidden;
}

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

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

.topbar,
.nav {
  background: var(--nav);
  color: #fff;
}

.topbar-inner,
.nav-inner,
.section-inner,
.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  font-size: 13px;
  color: #d7dde7;
}

.topbar-links,
.nav-links,
.actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mobile-only,
.mobile-nav-button,
.nav-backdrop,
.drawer-backdrop {
  display: none;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 76px;
  gap: 28px;
}

.logo {
  display: block;
  height: 42px;
  width: auto;
}

.nav-links {
  justify-content: center;
  font-size: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}

.btn-primary {
  color: #fff;
  background: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-secondary {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn:not(.btn-primary):not(.btn-secondary) {
  color: #17213a;
  background: #fff;
  border-color: #cfd8e5;
}

.full-width {
  width: 100%;
}

.link-button {
  color: #fff;
  background: var(--brand);
}

.hero {
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.72)),
    url("/assets/bonus-offerings.webp") center/cover;
  color: #fff;
}

.hero-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: min(680px, calc(100vh - 112px));
  display: grid;
  align-items: center;
  padding: 72px 0 52px;
}

.hero-copy {
  max-width: 690px;
}

.eyebrow {
  margin: 0 0 16px;
  color: #f5d87a;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  font-size: 13px;
}

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

h1 {
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
  margin-bottom: 22px;
  letter-spacing: 0;
}

h2 {
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 14px;
}

h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.lead {
  color: #e8edf4;
  font-size: 20px;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 30px 0 34px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  max-width: 620px;
  gap: 12px;
}

.metric {
  border-left: 3px solid var(--brand);
  background: rgba(255, 255, 255, 0.08);
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 22px;
}

.metric span {
  color: #dce3ec;
  font-size: 13px;
}

.band {
  padding: 72px 0;
}

.band.white {
  background: #fff;
}

.section-head {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-head p,
.card p,
.risk p {
  color: var(--muted);
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  min-height: 190px;
}

.card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 16px;
}

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 42px;
  align-items: center;
}

.split img {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.market-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.market-table th,
.market-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

.market-table th {
  color: var(--muted);
  background: #f8fafc;
}

.risk {
  border-top: 4px solid var(--gold);
  background: #fff;
  padding: 26px;
  border-radius: 8px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

footer {
  background: #111827;
  color: #d7dde7;
  padding: 44px 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
}

.footer-inner p {
  color: #aeb7c5;
  margin-bottom: 8px;
}

@media (max-width: 860px) {
  .topbar-links {
    display: none;
  }

  .nav-inner {
    grid-template-columns: auto auto 1fr;
    min-height: 68px;
    gap: 12px;
  }

  .mobile-nav-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #fff;
    background: transparent;
    font-weight: 700;
  }

  .nav-links {
    position: fixed;
    z-index: 30;
    top: 104px;
    left: 12px;
    right: 12px;
    display: none;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 4px;
    max-height: calc(100vh - 126px);
    overflow-y: auto;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  }

  .nav-links a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 6px;
  }

  .nav-links a:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-only {
    display: flex;
  }

  .public-nav-open .nav-links {
    display: grid;
  }

  .public-nav-open,
  .drawer-open {
    overflow: hidden;
  }

  .public-nav-open .nav-backdrop {
    display: block;
    position: fixed;
    z-index: 20;
    inset: 104px 0 0;
    width: 100%;
    border: 0;
    background: rgba(8, 13, 22, 0.42);
  }

  .actions {
    gap: 8px;
    justify-self: end;
  }

  .btn {
    min-height: 42px;
    padding: 0 12px;
    font-size: 14px;
  }

  .hero-inner {
    min-height: auto;
    padding: 58px 0;
  }

  .metrics,
  .grid,
  .copy-grid,
  .filter-grid,
  .split,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .band {
    padding: 52px 0;
  }
}

/* Auth portal */
.portal-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #eef0f4;
  color: #08142b;
}

.portal-header {
  background: #101010;
  color: #fff;
  min-height: 66px;
}

.portal-header-inner {
  width: min(1450px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.portal-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
}

.portal-tools {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #aeb4bf;
  font-size: 12px;
  font-weight: 700;
}

.language-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(135deg, #1d3e8a 0 45%, #fff 45% 55%, #c8102e 55%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.auth-main {
  flex: 1;
  width: min(1450px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  place-items: start center;
  padding: 66px 0 54px;
}

.auth-card {
  width: min(448px, 100%);
  background: #fff;
  border-radius: 5px;
  box-shadow: 0 16px 34px rgba(23, 31, 47, 0.08);
  padding: 36px 30px 34px;
}

.auth-card.register {
  width: min(448px, 100%);
  padding-top: 8px;
}

.auth-title {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
  color: #061332;
}

.auth-copy {
  margin-bottom: 24px;
  color: #6d7684;
  font-size: 14px;
}

.field-group {
  margin-bottom: 18px;
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.field-row label,
.field-group > label {
  display: block;
  color: #111b38;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.field-row label {
  margin-bottom: 0;
}

.minor-link {
  color: #d60000;
  font-size: 13px;
  font-weight: 700;
}

.input-control,
.select-control,
.textarea-control {
  width: 100%;
  border: 1px solid #d7deea;
  border-radius: 5px;
  color: #07142f;
  background: #fff;
  font: inherit;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-control,
.select-control {
  height: 44px;
  padding: 0 14px;
}

.textarea-control {
  min-height: 126px;
  padding: 12px 14px;
  resize: vertical;
}

.input-control::placeholder {
  color: #9aa3b2;
}

.input-control:focus,
.select-control:focus {
  border-color: #8fb1de;
  box-shadow: 0 0 0 3px rgba(45, 107, 181, 0.12);
}

.password-wrap {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #7d8797;
  font-weight: 700;
  cursor: pointer;
  min-height: 36px;
  padding: 6px 8px;
}

.resend-form {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.phone-control {
  display: grid;
  grid-template-columns: 38px 1fr;
}

.phone-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7deea;
  border-right: 0;
  border-radius: 5px 0 0 5px;
  background: #f4f7fb;
  color: #0b1630;
}

.phone-control .input-control {
  border-radius: 0 5px 5px 0;
}

.checkbox-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: #29364f;
  font-size: 13px;
  line-height: 1.45;
  margin: 8px 0 18px;
}

.checkbox-line input {
  margin-top: 3px;
}

.submit-wide {
  width: 100%;
  min-height: 44px;
  background: #0f9146;
  color: #fff;
  border: 0;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
}

.submit-wide:hover {
  background: #0a7b39;
}

.submit-inline {
  display: flex;
  justify-content: flex-end;
}

.submit-inline .submit-wide {
  width: auto;
  min-width: 78px;
  padding: 0 16px;
  background: #84bd9b;
}

.auth-switch {
  margin: 34px 0 0;
  color: #17213a;
  font-size: 15px;
}

.auth-switch a {
  color: #d60000;
  font-weight: 800;
}

.form-message {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 5px;
  font-size: 13px;
  line-height: 1.4;
}

.form-message.error {
  background: #fff1f1;
  color: #9f1117;
  border: 1px solid #f1bbbb;
}

.form-message.success {
  background: #edf9f2;
  color: #126335;
  border: 1px solid #b8e2c8;
}

.trust-panel {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid #dbe2ec;
  border-radius: 5px;
  background: #f8fafc;
}

.trust-panel strong {
  display: block;
  margin-bottom: 6px;
  color: #101a33;
}

.trust-panel p {
  margin: 0;
  color: #667181;
  font-size: 12px;
}

.legal-footer {
  width: min(1450px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 22px;
  background: transparent;
  color: #8a93a3;
  font-size: 12px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
  color: #061332;
}

.legal-links a {
  color: #061332;
}

.legal-links a:not(:last-child)::after {
  content: "|";
  margin-left: 10px;
  color: #061332;
}

.legal-footer p {
  max-width: 1280px;
  margin-bottom: 14px;
}

/* App dashboards */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
  background: #f3f6fa;
}

.side-nav {
  background: #0d1320;
  color: #dce4ee;
  padding: 22px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.side-brand img {
  width: 82px;
  height: auto;
}

.side-brand span {
  font-size: 12px;
  color: #8f9bad;
}

.side-nav a,
.quick-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  color: #c8d2df;
  margin-bottom: 6px;
}

.side-nav a.active,
.side-nav a:hover,
.quick-link:hover {
  background: #172235;
  color: #fff;
}

.app-main {
  min-width: 0;
}

.app-topbar {
  min-height: 72px;
  background: #fff;
  border-bottom: 1px solid #dfe6ef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
}

.drawer-button {
  display: none;
  border: 1px solid #d7deea;
  background: #fff;
  border-radius: 6px;
  min-height: 44px;
  padding: 0 12px;
  font-weight: 700;
}

.profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d7deea;
  border-radius: 999px;
  padding: 7px 12px;
  color: #17213a;
  background: #fff;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d71920;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.workspace {
  padding: 28px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-heading h1 {
  color: #111827;
  font-size: 30px;
  margin-bottom: 6px;
}

.page-heading p {
  color: #667181;
  margin-bottom: 0;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card,
.panel {
  background: #fff;
  border: 1px solid #dfe6ef;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.04);
}

.stat-card {
  padding: 20px;
}

.stat-label {
  color: #667181;
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 26px;
  line-height: 1.1;
  color: #111827;
  font-weight: 800;
}

.stat-note {
  margin-top: 8px;
  color: #0f9146;
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 18px;
  min-width: 0;
}

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

.copy-card {
  min-width: 0;
}

.copy-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.copy-metrics div {
  padding: 12px;
  border: 1px solid #edf1f6;
  border-radius: 7px;
  background: #fbfcfe;
}

.copy-metrics strong,
.copy-metrics span {
  display: block;
}

.copy-metrics span {
  color: #6b7483;
  font-size: 12px;
}

.risk-validation {
  border: 1px solid #e7edf5;
  border-radius: 7px;
  background: #fbfcfe;
  padding: 14px;
  margin-bottom: 14px;
}

.risk-validation.warning {
  border-color: #f1d38a;
  background: #fffaf0;
}

.risk-validation.blocked {
  border-color: #f0b8bd;
  background: #fff6f7;
}

.risk-validation ul {
  margin: 10px 0 0 18px;
  color: #384152;
  font-size: 13px;
}

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

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

.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
  min-width: 0;
}

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

.panel-head h2 {
  font-size: 18px;
  margin: 0;
}

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

.table-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.scroll-hint {
  display: none;
  margin: -6px 0 10px;
  color: #7a8494;
  font-size: 12px;
}

.table-lite th,
.table-lite td {
  padding: 12px 10px;
  border-bottom: 1px solid #edf1f6;
  text-align: left;
  font-size: 14px;
}

.table-lite th {
  color: #6b7483;
  font-size: 12px;
  text-transform: uppercase;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.table-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #d7deea;
  border-radius: 6px;
  color: #17213a;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.table-actions button:hover {
  border-color: #b9c6d7;
  background: #f4f7fb;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge.green {
  background: #eaf8f0;
  color: #126335;
}

.badge.amber {
  background: #fff8e5;
  color: #85600f;
}

.badge.red {
  background: #fff1f1;
  color: #9f1117;
}

.watch-list,
.activity-list,
.quick-list {
  display: grid;
  gap: 10px;
}

.quick-list .quick-link {
  color: #17213a;
  background: #fbfcfe;
  border: 1px solid #edf1f6;
}

.quick-list .quick-link:hover {
  background: #f2f6fb;
  color: #0d1320;
}

.watch-row,
.activity-row,
.kyc-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid #edf1f6;
  border-radius: 7px;
  background: #fbfcfe;
  min-width: 0;
}

.symbol {
  font-weight: 800;
  color: #101a33;
}

.muted {
  color: #6b7483;
  font-size: 13px;
}

.positive {
  color: #0f9146;
}

.negative {
  color: #c6262e;
}

.risk-strip {
  border-left: 4px solid #c69a2b;
  background: #fffaf0;
  color: #6f530f;
  padding: 14px 16px;
  border-radius: 7px;
  font-size: 13px;
}

.admin-shell .side-nav {
  background: #161018;
}

.admin-shell .side-nav a.active,
.admin-shell .side-nav a:hover {
  background: #2a1a2b;
}

.admin-shell .avatar,
.admin-accent {
  background: #7c2d8f;
}

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

  .side-nav {
    position: fixed;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(292px, calc(100vw - 48px));
    transform: translateX(-100%);
    transition: transform 180ms ease;
    display: none;
  }

  .drawer-open .side-nav {
    display: block;
    transform: translateX(0);
  }

  .drawer-open .drawer-backdrop {
    display: block;
    position: fixed;
    z-index: 15;
    inset: 0;
    width: 100%;
    border: 0;
    background: rgba(9, 14, 23, 0.48);
  }

  .drawer-button {
    display: inline-flex;
    align-items: center;
  }

  .dashboard-grid,
  .content-grid,
  .risk-question-grid {
    grid-template-columns: 1fr;
  }

  .app-topbar strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .portal-header-inner,
  .auth-main,
  .legal-footer {
    width: min(100% - 24px, 1450px);
  }

  .auth-main {
    padding: 30px 0 34px;
  }

  .auth-card,
  .auth-card.register {
    padding: 26px 18px;
  }

  .legal-footer {
    font-size: 11px;
  }

  .app-topbar,
  .workspace {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-heading {
    display: block;
  }

  .page-heading .actions {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
  }

  .page-heading .btn {
    width: 100%;
  }

  .panel {
    padding: 16px;
  }

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

  .stat-card {
    padding: 16px;
  }

  .stat-value {
    font-size: 23px;
  }

  .watch-row,
  .activity-row,
  .kyc-card {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .table-lite {
    min-width: 0;
  }

  .table-lite thead {
    display: none;
  }

  .table-lite,
  .table-lite tbody,
  .table-lite tr,
  .table-lite td {
    display: block;
    width: 100%;
  }

  .table-lite tr {
    border: 1px solid #edf1f6;
    border-radius: 7px;
    background: #fbfcfe;
    padding: 10px;
    margin-bottom: 10px;
  }

  .table-lite th,
  .table-lite td {
    padding: 7px 0;
    border-bottom: 0;
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .table-lite td {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    text-align: right;
  }

  .table-lite td::before {
    content: attr(data-label);
    color: #6b7483;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
  }

  .table-scroll {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }

  .scroll-hint {
    display: none;
  }

  .market-table {
    display: block;
    max-width: 100%;
    table-layout: fixed;
    overflow-x: hidden;
  }

  .market-table th,
  .market-table td {
    padding: 10px 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .topbar {
    display: none;
  }

  .nav-inner {
    width: min(100% - 24px, 1180px);
  }

  .nav-inner > .actions {
    display: none;
  }

  .nav-links {
    top: 76px;
    max-height: calc(100vh - 96px);
  }

  .public-nav-open .nav-backdrop {
    inset: 76px 0 0;
  }

  .logo {
    max-width: 118px;
    height: auto;
  }

  .hero-inner,
  .section-inner,
  .footer-inner {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: 38px;
  }

  h2 {
    font-size: 27px;
  }

  .lead {
    font-size: 17px;
  }

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

  .hero-actions .btn {
    width: 100%;
  }

  .card,
  .risk {
    padding: 18px;
  }

  .portal-logo {
    max-width: 120px;
    height: auto;
  }

  .portal-tools {
    gap: 10px;
  }

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

  .legal-links a::after {
    content: "" !important;
    margin: 0 !important;
  }

  .app-topbar {
    min-height: 64px;
    gap: 10px;
  }

  .profile-pill {
    padding: 6px;
  }

  .profile-pill span:not(.avatar) {
    display: none;
  }

  .workspace {
    padding-top: 20px;
  }
}

@media (max-width: 360px) {
  .portal-header-inner,
  .auth-main,
  .legal-footer,
  .hero-inner,
  .section-inner,
  .footer-inner {
    width: min(100% - 20px, 1450px);
  }

  .auth-card,
  .auth-card.register {
    padding: 22px 14px;
  }

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

  .workspace,
  .app-topbar {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Institutional client portal extensions */
.portal-topbar {
  gap: 14px;
}

.topbar-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.topbar-account > span,
.topbar-account > strong,
.notification-bell {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #d7deea;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  white-space: nowrap;
}

.topbar-account button,
.trade-ticket button,
.market-card button,
.inline-message-form button,
.table-actions button {
  min-height: 38px;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
  background: #fff;
  color: #17213a;
  font-weight: 700;
  padding: 0 12px;
}

.topbar-account button:hover,
.trade-ticket button:hover,
.market-card button:hover,
.inline-message-form button:hover,
.table-actions button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.trading-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.85fr) minmax(320px, 2fr) minmax(250px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.trade-side-panel,
.trade-chart-panel,
.trade-ticket,
.market-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.trade-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.chart-placeholder {
  min-height: 430px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(17, 24, 39, 0.04) 1px, transparent 1px),
    #f8fafc;
  background-size: 36px 36px;
  color: #111827;
  text-align: center;
}

.chart-placeholder span {
  font-size: 22px;
  font-weight: 800;
}

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

.segmented button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.trade-ticket form {
  display: grid;
  gap: 12px;
}

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

.activity-list.compact {
  margin: 14px 0;
}

.chat-transcript {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.chat-transcript p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inline-message-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 10px;
}

.support-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  width: min(320px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.2);
}

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

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

@media (max-width: 760px) {
  .portal-topbar {
    align-items: stretch;
  }

  .topbar-account {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .topbar-account .profile-pill {
    max-width: 100%;
  }

  .trade-toolbar,
  .market-card-grid,
  .inline-message-form {
    grid-template-columns: 1fr;
  }

  .chart-placeholder {
    min-height: 280px;
  }
}

@media (max-width: 420px) {
  .topbar-account > span,
  .topbar-account > strong,
  .notification-bell,
  .topbar-account button {
    width: 100%;
    justify-content: center;
  }

  .chart-placeholder span {
    font-size: 18px;
  }
}
