:root {
  --bg: #0B0E11;
  --surface: #1E2026;
  --surface-2: #2B2F36;
  --surface-3: #181A20;
  --accent: #F0B90B;
  --accent-hover: #D4A107;
  --text: #EAECEF;
  --muted: #848E9C;
  --success: #03A66D;
  --danger: #CF304A;
  --border: #2B2F36;
  --telegram: #229ED9;
  --max: #5B55F7;
  --radius: 8px;
  --radius-small: 4px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.menu-open,
body.modal-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

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

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

button {
  cursor: pointer;
}

.mono {
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(24, 26, 32, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.navbar__inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.logo__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-small);
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-left: auto;
  color: var(--muted);
  font-size: 14px;
}

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

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

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-small);
}

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: var(--radius-small);
  border: 1px solid transparent;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  user-select: none;
}

.btn:not(:disabled):active {
  transform: translateY(1px) scale(0.985);
}

.btn:focus-visible,
.filter-btn:focus-visible,
.exchange-choice:focus-visible {
  outline: 3px solid rgba(240, 185, 11, 0.3);
  outline-offset: 3px;
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(240, 185, 11, 0.13);
}

.btn--primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 12px 30px rgba(240, 185, 11, 0.22);
  transform: translateY(-2px);
}

.btn--primary[data-exchange-open] {
  overflow: hidden;
  animation: cta-breathe 4.8s ease-in-out infinite;
}

.btn--primary[data-exchange-open]::after {
  content: "";
  position: absolute;
  z-index: 0;
  top: -70%;
  bottom: -70%;
  left: -42%;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.52), transparent);
  opacity: 0.55;
  transform: skewX(-18deg) translateX(-250%);
  animation: cta-shine 4.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes cta-breathe {
  0%, 58%, 100% { box-shadow: 0 8px 24px rgba(240, 185, 11, 0.13); }
  72% { box-shadow: 0 12px 34px rgba(240, 185, 11, 0.3); }
}

@keyframes cta-shine {
  0%, 58% { transform: skewX(-18deg) translateX(-250%); }
  76%, 100% { transform: skewX(-18deg) translateX(650%); }
}

.btn--outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--outline:hover {
  background: rgba(240, 185, 11, 0.08);
}

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

.btn--dark:hover {
  background: var(--surface-2);
}

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

.is-disabled {
  pointer-events: none;
  opacity: 0.55;
}

.btn--block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ticker {
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
  overflow: hidden;
}

.ticker__track {
  display: flex;
  gap: 28px;
  padding: 10px 0;
  animation: ticker 28s linear infinite;
  width: max-content;
}

.ticker:hover .ticker__track {
  animation-play-state: paused;
}

.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.ticker__symbol {
  color: var(--text);
  font-weight: 600;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero {
  padding: 86px 0 62px;
  border-bottom: 1px solid rgba(43, 47, 54, 0.6);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -220px -160px auto auto;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(240, 185, 11, 0.14), transparent 62%);
  pointer-events: none;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  background: rgba(240, 185, 11, 0.08);
  border: 1px solid rgba(240, 185, 11, 0.26);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.12;
  font-weight: 600;
}

h1 {
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: -1.8px;
  margin-top: 18px;
}

h2 {
  font-size: clamp(28px, 3vw, 42px);
  letter-spacing: -0.8px;
}

h3 {
  font-size: 20px;
}

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

.hero__lead {
  max-width: 660px;
  margin: 18px 0 0;
  font-size: clamp(17px, 2vw, 20px);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 38px;
}

.hero__stats--compact {
  margin-top: 18px;
  margin-bottom: 18px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat__value {
  display: block;
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
}

.stat__label {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.exchange-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

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

.exchange-card__rate {
  font-family: "IBM Plex Mono", Consolas, monospace;
  color: var(--accent);
  font-weight: 600;
}

.swap-box {
  display: grid;
  gap: 12px;
}

.swap-field {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  padding: 14px;
}

.swap-field label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.swap-field__row {
  display: flex;
  gap: 12px;
}

.swap-field input,
.swap-field select,
.form-control {
  width: 100%;
  min-height: 42px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-small);
  padding: 10px 12px;
  outline: none;
}

.swap-field input {
  background: transparent;
  border: 0;
  padding-left: 0;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 22px;
}

.swap-field select {
  max-width: 118px;
}

.swap-icon {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
}

.swap-icon.is-swapping {
  animation: swap-turn 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.swap-field input.is-calculating,
.exchange-card__rate.is-calculating {
  animation: value-pop 0.3s ease;
}

@keyframes swap-turn {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(180deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes value-pop {
  0% { opacity: 0.55; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

.form-control:focus,
.swap-field:focus-within {
  border-color: var(--accent);
}

.section {
  padding: 74px 0;
}

.section--surface {
  background: var(--surface-3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section__head p {
  max-width: 600px;
  margin-bottom: 0;
}

.rates-status {
  margin: -14px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.rates-status--warning {
  color: var(--accent);
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-small);
  padding: 8px 12px;
  transition: 0.2s ease;
}

.filter-btn:hover,
.filter-btn.active {
  color: var(--bg);
  border-color: var(--accent);
  background: var(--accent);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

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

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

.market-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  background: var(--surface-3);
}

.market-table tr:nth-child(even) td {
  background: #181A20;
}

.market-table tbody tr:hover td {
  background: var(--surface-2);
}

.rate-buy {
  color: var(--success);
}

.rate-sell {
  color: var(--accent);
}

.rate-action {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 13px;
}

.is-unavailable::placeholder {
  color: var(--danger);
  opacity: 1;
}

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

.coin__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(240, 185, 11, 0.12);
  color: var(--accent);
  font-weight: 700;
}

.coin__name {
  display: block;
  font-weight: 600;
}

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

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

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

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

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

.office-card,
.info-card,
.ref-card,
.dashboard-card,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.office-list {
  display: grid;
  gap: 12px;
  margin: 22px 0;
}

.office-list__item {
  display: flex;
  gap: 10px;
  color: var(--muted);
}

.office-list__item strong {
  color: var(--text);
}

.map-placeholder {
  min-height: 320px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, rgba(43,47,54,0.55) 1px, transparent 1px),
    linear-gradient(rgba(43,47,54,0.55) 1px, transparent 1px);
  background-size: 38px 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 22px;
}

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

.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.step__num {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 800;
  margin-bottom: 18px;
}

.ref-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr) auto;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, rgba(240,185,11,0.12), rgba(30,32,38,1) 42%);
  border: 1px solid rgba(240,185,11,0.28);
  border-radius: var(--radius);
  padding: 30px;
}

.launch-countdown {
  width: 100%;
  padding: 18px;
  border: 1px solid rgba(240, 185, 11, 0.3);
  border-radius: var(--radius);
  background: rgba(11, 14, 19, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.launch-countdown--hero {
  max-width: 640px;
  margin-top: 26px;
}

.launch-countdown__label {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.launch-countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(54px, 1fr));
  gap: 8px;
}

.launch-countdown__grid[hidden] {
  display: none;
}

.launch-countdown__item {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 10px 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface-2);
}

.launch-countdown__item strong {
  color: var(--accent);
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1;
}

.launch-countdown__item strong.is-ticking {
  animation: countdown-tick 0.26s ease;
}

@keyframes countdown-tick {
  0% { opacity: 0.45; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.launch-countdown__item small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.launch-countdown__date,
.launch-countdown__launched {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.launch-countdown__launched {
  color: var(--success);
  font-size: 15px;
  font-weight: 600;
}

.launch-countdown__launched[hidden] {
  display: none;
}

.launch-countdown.is-launched {
  border-color: rgba(3, 166, 109, 0.42);
}

.launch-countdown.is-launched .launch-countdown__label,
.launch-countdown.is-launched .launch-countdown__date {
  display: none;
}

.motion-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.58s ease var(--reveal-delay, 0ms), transform 0.58s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0ms);
}

.motion-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.exchange-modal:not([hidden]) .exchange-modal__backdrop {
  animation: modal-fade 0.2s ease both;
}

.exchange-modal:not([hidden]) .exchange-modal__dialog {
  animation: modal-enter 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

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

@media (hover: hover) and (pointer: fine) {
  .exchange-card:hover,
  .stat:hover,
  .step:hover,
  .office-card:hover,
  .launch-countdown:hover {
    border-color: rgba(240, 185, 11, 0.34);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
    transform: translateY(-4px);
  }

  .stat,
  .step,
  .office-card,
  .launch-countdown {
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ticker__track,
  .btn--primary[data-exchange-open],
  .btn--primary[data-exchange-open]::after,
  .swap-icon.is-swapping,
  .swap-field input.is-calculating,
  .exchange-card__rate.is-calculating,
  .launch-countdown__item strong.is-ticking,
  .exchange-modal:not([hidden]) .exchange-modal__backdrop,
  .exchange-modal:not([hidden]) .exchange-modal__dialog {
    animation: none;
  }

  .motion-reveal,
  .motion-reveal.is-visible {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.footer {
  background: var(--surface-3);
  border-top: 1px solid var(--border);
  padding: 42px 0 28px;
}

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

.footer h4 {
  margin: 0 0 14px;
  color: var(--text);
}

.footer a,
.footer p {
  color: var(--muted);
  margin: 0;
}

.footer a:hover {
  color: var(--accent);
}

.footer__links {
  display: grid;
  gap: 10px;
}

.footer-link-button {
  width: fit-content;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.footer-link-button:hover {
  color: var(--accent);
}

.footer__bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.support-float {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--accent);
  font-weight: 600;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.support-float__icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-weight: 900;
}

.support-float__badge {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.support-chat {
  position: fixed;
  z-index: 120;
  right: 18px;
  bottom: 78px;
  width: min(390px, calc(100vw - 24px));
  height: min(640px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-3);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.58);
}

.support-chat__header {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.support-chat__avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent);
  color: var(--bg);
  font-size: 20px;
  font-weight: 900;
}

.support-chat__header strong,
.support-chat__header small {
  display: block;
}

.support-chat__header small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.support-chat__close {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-size: 23px;
  line-height: 1;
}

.support-chat__messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-height: 160px;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at top right, rgba(240, 185, 11, 0.06), transparent 42%),
    var(--bg);
}

.support-chat__message {
  align-self: flex-start;
  max-width: 86%;
  padding: 9px 11px 7px;
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 3px;
  background: var(--surface);
  color: var(--text);
  overflow-wrap: anywhere;
}

.support-chat__message--visitor {
  align-self: flex-end;
  border-color: rgba(240, 185, 11, 0.35);
  border-radius: 12px 12px 3px 12px;
  background: rgba(240, 185, 11, 0.12);
}

.support-chat__message p {
  margin: 0;
  white-space: pre-wrap;
}

.support-chat__message time {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

.support-chat__form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-3);
}

.support-chat__identity {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 7px;
}

.support-chat__identity .form-control,
.support-chat__textarea {
  padding: 9px 10px;
  font-size: 13px;
}

.support-chat__textarea {
  min-height: 60px;
  max-height: 120px;
  resize: vertical;
}

.support-chat__send-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.support-chat__status {
  flex: 1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.support-chat__status.is-error {
  color: #ff9dad;
}

.support-chat__consent {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.support-chat__fallback {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
}

.support-chat__fallback a {
  color: var(--accent);
}

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

.exchange-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.exchange-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(6px);
}

.exchange-modal__dialog {
  position: relative;
  width: min(100%, 650px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-3);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  outline: none;
}

.exchange-modal__dialog h2 {
  margin: 12px 44px 8px 0;
  font-size: clamp(25px, 5vw, 34px);
}

.exchange-modal__dialog > div > p {
  margin-top: 0;
}

.exchange-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
}

.exchange-modal__close:hover {
  border-color: var(--accent);
}

.exchange-modal__back {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.exchange-choice-grid {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.exchange-choice {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  transition: 0.2s ease;
}

.exchange-choice:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--surface-2);
}

.exchange-choice__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 20px;
  font-weight: 800;
}

.exchange-choice--telegram .exchange-choice__icon {
  background: var(--telegram);
  color: #fff;
}

.exchange-choice--max .exchange-choice__icon {
  background: var(--max);
  color: #fff;
}

.exchange-choice--form .exchange-choice__icon {
  background: var(--accent);
  color: var(--bg);
}

.exchange-choice strong,
.exchange-choice small {
  display: block;
}

.exchange-choice small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.exchange-choice__arrow {
  color: var(--muted);
  font-size: 22px;
}

.exchange-request-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 20px 0 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--border);
}

.exchange-request-summary div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
}

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

.exchange-request-summary span {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.exchange-request-summary strong {
  overflow-wrap: anywhere;
  font-size: 14px;
}

.exchange-request-form__comment {
  min-height: 90px;
  resize: vertical;
}

.exchange-request-form__website {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.exchange-request-form__status {
  margin: 0;
}

.auth-page {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 54px 0;
}

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

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 12px;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--text);
  border-color: var(--accent);
}

.form {
  display: grid;
  gap: 14px;
}

.form-group label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 7px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.code-inputs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.code-inputs input {
  min-width: 0;
  height: 48px;
  text-align: center;
  padding: 6px;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 20px;
}

.form-note {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.hidden {
  display: none !important;
}

.alert {
  padding: 12px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface-3);
}

.alert--success {
  border-color: rgba(3,166,109,0.4);
  color: var(--success);
}

.alert--danger {
  border-color: rgba(207,48,74,0.4);
  color: var(--danger);
}

.alert--error {
  border-color: rgba(207,48,74,0.4);
  color: var(--danger);
}

.site-alert {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.site-alert--success {
  border-color: rgba(3,166,109,0.4);
  color: var(--success);
}

.site-alert--error {
  border-color: rgba(207,48,74,0.4);
  color: var(--danger);
}

.dashboard {
  padding: 48px 0 74px;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.status-badge,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(240,185,11,0.12);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.badge--success {
  background: rgba(3,166,109,0.12);
  color: var(--success);
}

.badge--danger {
  background: rgba(207,48,74,0.12);
  color: var(--danger);
}

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

.dashboard-card--wide {
  grid-column: 1 / -1;
}

.dashboard-title,
.page-title {
  margin-top: 14px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: 0;
}

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

.big-number {
  margin: 10px 0 18px;
  color: var(--accent);
  font-size: 38px;
  font-weight: 700;
  font-family: "IBM Plex Mono", Consolas, monospace;
}

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

.mini-table th,
.mini-table td {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  color: var(--muted);
  font-size: 14px;
}

.mini-table th {
  color: var(--text);
  font-weight: 500;
}

.mini-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.inline-form,
.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-form .form-control {
  flex: 1;
}

.btn--small {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.status {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--surface-2);
}

.status--completed {
  color: var(--success);
}

.status--cancelled {
  color: var(--danger);
}

.checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 13px;
}

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

.divider {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border);
}

.setup-card {
  width: min(100% - 24px, 620px);
}

.legal-note {
  margin-top: 22px;
  padding: 16px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.legal-note a,
.checkbox-row a,
.footer__bottom a,
.support-chat__consent a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-page {
  padding: 24px 0 64px;
}

.legal-layout {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.legal-layout--single {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

.legal-toc {
  position: sticky;
  top: 88px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal-toc h1 {
  margin: 12px 0 4px;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.03em;
}

.legal-toc nav {
  display: grid;
  gap: 3px;
  margin-top: 18px;
}

.legal-toc nav a {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.legal-toc nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.legal-document {
  padding: clamp(22px, 4vw, 42px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.legal-document > h1 {
  margin: 14px 0 6px;
  font-size: clamp(30px, 4vw, 46px);
}

.legal-document section {
  scroll-margin-top: 92px;
}

.legal-document section + section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.legal-document h2 {
  margin: 0 0 16px;
  font-size: clamp(22px, 2.5vw, 30px);
  letter-spacing: -0.02em;
}

.legal-document p,
.legal-document li,
.legal-document dd {
  color: var(--muted);
  line-height: 1.65;
}

.legal-document p {
  margin: 0 0 12px;
}

.legal-document ul {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 22px;
}

.legal-document strong,
.legal-document dt {
  color: var(--text);
}

.legal-document a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-intro {
  margin-bottom: 30px;
  padding: 18px;
  border: 1px solid rgba(240,185,11,0.35);
  border-radius: var(--radius-small);
  background: rgba(240,185,11,0.08);
  color: var(--muted);
  line-height: 1.55;
}

.legal-table-wrap {
  margin: 18px 0;
  overflow-x: auto;
}

.legal-details {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
  overflow: hidden;
}

.legal-details > div {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 16px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}

.legal-details > div:last-child {
  border-bottom: 0;
}

.legal-details dt,
.legal-details dd {
  margin: 0;
}

.cookie-banner {
  position: fixed;
  z-index: 1000;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100% - 36px, 960px);
  margin: 0 auto;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 16px 50px rgba(0,0,0,0.28);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.cookie-banner a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  flex: none;
  gap: 8px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.support-admin {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.support-admin__list {
  max-height: 650px;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface-3);
}

.support-admin__empty {
  padding: 18px;
}

.support-admin__item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
  transition: 0.15s ease;
}

.support-admin__item:hover,
.support-admin__item.is-active {
  background: var(--surface-2);
}

.support-admin__item.is-active {
  box-shadow: inset 3px 0 var(--accent);
}

.support-admin__item-head,
.support-admin__item-meta,
.support-admin__thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.support-admin__item-head time,
.support-admin__thread-head small {
  color: var(--muted);
  font-size: 11px;
}

.support-admin__preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-admin__item-meta {
  justify-content: flex-start;
  font-size: 11px;
}

.support-admin__state,
.support-admin__unread {
  display: inline-flex;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

.support-admin__state--open {
  background: rgba(3, 166, 109, 0.12);
  color: var(--success);
}

.support-admin__unread {
  background: rgba(240, 185, 11, 0.12);
  color: var(--accent);
}

.support-admin__thread {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 520px;
}

.support-admin__placeholder {
  flex: 1;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.support-admin__placeholder strong {
  color: var(--text);
}

.support-admin__thread-head {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-3);
}

.support-admin__thread-head strong,
.support-admin__thread-head small {
  display: block;
}

.support-admin__messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 480px;
  overflow-y: auto;
  padding: 16px;
}

.support-admin__reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 13px;
  border-top: 1px solid var(--border);
  background: var(--surface-3);
}

.support-admin__reply textarea {
  min-height: 78px;
  resize: vertical;
}

.exchange-requests-table {
  min-width: 980px;
}

.exchange-requests-table td {
  padding: 12px;
  vertical-align: top;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1;
}

.referral-qr {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(240, 185, 11, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(240, 185, 11, 0.08), rgba(24, 26, 32, 0.86));
}

.referral-qr__canvas {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  padding: 8px;
  border-radius: var(--radius-small);
  background: #fff;
}

.referral-qr__canvas canvas,
.referral-qr__canvas img {
  width: 116px !important;
  height: 116px !important;
  display: block;
}

.referral-qr__canvas img {
  object-fit: contain;
}

.referral-qr__content {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.referral-qr__content strong {
  color: var(--text);
  font-size: 16px;
}

.referral-qr__content .btn {
  justify-self: start;
}

.referral-share {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.referral-share label {
  color: var(--muted);
  font-size: 13px;
}

.referral-message {
  min-height: 124px;
  resize: vertical;
  line-height: 1.45;
}

.referral-share__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.levels-table td,
.levels-table th {
  text-align: center;
}

.ref-hero {
  padding: 70px 0 40px;
}

.ref-hero__grid {
  max-width: 820px;
}

@media (max-width: 920px) {
  .navbar__inner {
    min-height: 64px;
  }

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

  .nav {
    position: fixed;
    inset: 64px 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    background: var(--surface-3);
    border-bottom: 1px solid var(--border);
    padding: 18px 16px 22px;
  }

  body.menu-open .nav {
    display: flex;
  }

  .nav a {
    padding: 12px 0;
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__grid,
  .grid-2,
  .ref-hero__grid,
  .legal-layout {
    grid-template-columns: 1fr;
  }

  .legal-toc {
    position: static;
  }

  .legal-toc nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .support-admin {
    grid-template-columns: 1fr;
  }

  .support-admin__list {
    max-height: 270px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .steps,
  .dashboard-grid,
  .admin-stats,
  .footer__grid {
    grid-template-columns: 1fr;
  }

  .ref-banner {
    grid-template-columns: 1fr;
  }

  .ref-banner > .btn {
    justify-self: start;
  }

  .section__head,
  .dashboard-hero {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 22px, var(--container));
  }

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

  .legal-toc,
  .legal-document {
    padding: 18px;
  }

  .legal-toc nav {
    grid-template-columns: 1fr;
  }

  .legal-details > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .cookie-banner {
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: grid;
    width: calc(100% - 20px);
    padding: 14px;
  }

  .cookie-banner__actions {
    display: grid;
  }

  h1 {
    letter-spacing: -1px;
  }

  .hero {
    padding: 54px 0 40px;
  }

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

  .swap-field__row,
  .form-row,
  .copy-row,
  .referral-qr,
  .referral-share__actions,
  .inline-form,
  .action-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .support-admin__reply {
    grid-template-columns: 1fr;
  }

  .referral-qr__canvas {
    width: 100%;
    height: auto;
    min-height: 176px;
  }

  .referral-qr__canvas canvas,
  .referral-qr__canvas img {
    width: 156px !important;
    height: 156px !important;
  }

  .swap-field select {
    max-width: none;
  }

  .section {
    padding: 52px 0;
  }

  .footer {
    padding-bottom: 80px;
  }

  .support-float {
    left: 12px;
    right: 12px;
    justify-content: center;
  }

  .support-chat {
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(82dvh, 680px);
    max-height: 82vh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
  }

  body.support-chat-open {
    overflow: hidden;
  }

  body.support-chat-open .support-float {
    visibility: hidden;
  }

  .support-chat__identity {
    grid-template-columns: 1fr;
  }

  .exchange-modal {
    align-items: end;
    padding: 0;
  }

  .exchange-modal__dialog {
    width: 100%;
    max-height: 92vh;
    padding: 24px 18px;
    border-radius: 18px 18px 0 0;
  }

  .exchange-request-summary {
    grid-template-columns: 1fr;
  }
}
