/* ==========================================================================
   AstralSwap x Tonchain Integration Stylesheet (astral-tonchain.css)
   Loaded AFTER AstralSwap CSS (3c20-x7b5ysvb.css, 42ftf4ygmnu95.css)
   and AFTER Tonchain CSS (libs.min.css, style.min.css, exchangeStyle.css)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700;800&family=Syne:wght@500;600;700;800&display=swap');

:root,
html,
body,
[data-theme="dark"],
[data-theme="light"] {
  --bg-primary: var(--background);
  --font-onest: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-syne: 'Syne', 'Onest', sans-serif;
  --font-noto-sans: 'Onest', sans-serif;

  /* Tonchain Brand Colors (Black + TON Blue from Exchange Form) */
  --cta-accent: #0098ea !important;
  --cta-accent-hover: #00a6ff !important;
  --accent-foreground: #ffffff !important;
  --accent-primary: #0098ea !important;
  --rk-colors-accentColor: #0098ea !important;
  --rk-colors-accentColorForeground: #ffffff !important;
  --why-lime-a: #0098ea !important;
  --why-lime-b: #00a6ff !important;
  --why-lime-deep: #004d7a !important;
  --hero-glow-primary: #0098ea !important;
  --hero-glow-accent: #00a6ff !important;
  --glass-pill-glow: rgba(0, 152, 234, 0.1) !important;
  --flow-button-base-bg: #0098ea !important;
  --field-border-focus: #0098ea !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-onest);
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  overflow-x: clip !important;
}

/* Override legacy #root wrapper from Tonchain style.min.css */
#root {
  background: transparent !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}

canvas.tsparticles-canvas-el,
#tsparticles {
  display: none !important;
}

/* ==========================================================================
   1. Header, Brand Lockup, Lang Dropdown & Mobile Drawer
   ========================================================================== */

/* Always show the header logo cleanly without waiting for Next.js JS measurement */
body:has(.hero-home-section[data-logo-overlay-active]) .site-header .header-logo--stack,
.site-header .header-brand-link {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none !important;
  color: var(--text-primary) !important;
  font-family: var(--font-syne);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.brand-lockup:hover {
  opacity: 0.92;
}

.brand-lockup__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.65rem;
  background: rgba(0, 152, 234, 0.14);
  border: 1px solid rgba(0, 152, 234, 0.34);
  color: #0098ea;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(0, 152, 234, 0.16);
}

[data-theme="light"] .brand-lockup__icon {
  background: rgba(0, 152, 234, 0.1);
  border-color: rgba(0, 152, 234, 0.28);
  color: #0098ea;
  box-shadow: none;
}

.brand-lockup__icon svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.brand-lockup__name {
  font-family: var(--font-onest);
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-transform: uppercase;
}

/* Language Dropdown Menu Popover */
.lang-dropdown-wrap {
  position: relative;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 9.5rem;
  padding: 0.375rem;
  border-radius: 0.875rem;
  background: var(--bg-elevated, #12131a);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  z-index: 150;
  display: none;
  flex-direction: column;
  gap: 0.2rem;
}

[data-theme="light"] .lang-dropdown-menu {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(15, 23, 42, 0.1);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12);
}

.lang-dropdown-wrap.is-open .lang-dropdown-menu {
  display: flex;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary) !important;
}

[data-theme="light"] .lang-dropdown-item:hover {
  background: rgba(15, 23, 42, 0.05);
}

.lang-dropdown-item.is-active {
  background: rgba(0, 152, 234, 0.15);
  color: #00a6ff !important;
  font-weight: 600;
}

[data-theme="light"] .lang-dropdown-item.is-active {
  background: rgba(0, 152, 234, 0.12);
  color: #0088cc !important;
}

.lang-dropdown-item__code {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.75;
  text-transform: uppercase;
}

/* Mobile Navigation Drawer Links & Preferences */
.mobile-nav-drawer__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem 0.25rem;
}

.mobile-nav-drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary) !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease;
}

.mobile-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .mobile-nav-link:hover {
  background: rgba(15, 23, 42, 0.05);
}

.mobile-nav-drawer__prefs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.mobile-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

/* ==========================================================================
   2. Hero Section & Tonchain Exchange Widget Container
   ========================================================================== */

.hero-home-section {
  padding-top: calc(var(--header-offset, 5.25rem) + 1.5rem) !important;
  padding-bottom: 4.5rem !important;
}

.hero-main {
  max-width: 52rem !important;
  width: 100% !important;
  margin-left: auto;
  margin-right: auto;
}

.hero-brand-heading {
  font-family: var(--font-syne);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  text-align: center;
}

/* Widen hero-widget & hero-widget-beam to fit Tonchain's #trade form cleanly, without animated beam */
.hero-widget,
.hero-widget.hero-widget-beam {
  max-width: 720px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  overflow: visible !important;
}

.hero-widget-beam::before,
.hero-widget-beam::after,
.hero-widget.spotlight-border::before,
.hero-widget.spotlight-border::after {
  display: none !important;
  content: none !important;
  animation: none !important;
}

.hero-widget-beam .hero-widget-beam-inner {
  overflow: visible !important;
  padding: 1.25rem !important;
  border-radius: 20px !important;
  border: 1px solid rgba(0, 152, 234, 0.22) !important;
  background: #0b0c12 !important;
}

@media (max-width: 640px) {
  .hero-widget-beam .hero-widget-beam-inner {
    padding: 0.5rem !important;
    border-radius: 16px !important;
  }
}

/* Header Support CTA & Non-overlapping Mobile Header Layout */
.site-header .header-support-cta {
  gap: 0.5rem !important;
  padding: 0 1.125rem !important;
  min-width: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.site-header .header-support-cta__icon {
  position: relative;
  z-index: 3;
  width: 1rem !important;
  height: 1rem !important;
  flex-shrink: 0;
  display: block;
}

.site-header .header-support-cta .flow-button-label--header,
.site-header .header-support-cta:hover .flow-button-label--header {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  transform: none !important;
  margin: 0 !important;
}

@media (max-width: 1023px) {
  .site-header .header-inline-divider--toolbar {
    display: none !important;
  }

  .site-header .header-bar-grid {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    column-gap: 0.45rem !important;
  }

  .site-header .header-bar-zone--center {
    max-width: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-self: center !important;
    overflow: hidden !important;
  }

  .site-header .header-brand-slot,
  .site-header .header-brand-link {
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 0.4rem !important;
  }

  .site-header .brand-lockup__icon {
    width: 1.8rem !important;
    height: 1.8rem !important;
    border-radius: 0.5rem !important;
  }

  .site-header .brand-lockup__icon svg {
    width: 1.05rem !important;
    height: 1.05rem !important;
  }

  .site-header .brand-lockup__name {
    font-size: clamp(0.88rem, 3.6vw, 1.12rem) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .site-header .header-support-cta {
    min-width: auto !important;
    max-width: none !important;
    width: auto !important;
    height: 2.25rem !important;
    min-height: 2.25rem !important;
    max-height: 2.25rem !important;
    padding: 0 0.7rem !important;
    font-size: 0.8rem !important;
    gap: 0.35rem !important;
    /* border-radius: 0.75rem !important; */
  }
}

@media (max-width: 360px) {
  .site-header .header-support-cta {
    padding: 0 0.55rem !important;
  }

  .site-header .header-support-cta .flow-button-label--header {
    display: none !important;
  }
}

/* Ensure smooth anchor scroll targets clear the fixed header */
#trade,
#networks,
#about {
  scroll-margin-top: 5.75rem;
}

/* Eliminate excessive horizontal side padding on mobile across the entire page */
@media (max-width: 767px) {

  .site-bar-shell-outer,
  .section-container,
  .home-trust-stats__inner,
  .home-curve-section__shell {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .site-bar-shell {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .hero-widget .main-page,
  .hero-widget .cexwidget,
  .hero-widget .startPage__main-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.hero-widget .main-page {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 0 !important;
}

/* ==========================================================================
   3. Preservation of Tonchain Exchange Form (#trade, .aboveform-switcher, #makerModal)
   ========================================================================== */

/* Prevent Tailwind img/svg block reset from breaking inline icons inside #trade */
#trade img,
#trade svg,
.aboveform-switcher img,
.aboveform-switcher svg,
#makerModal img,
#makerModal svg,
.exchange_proccess img,
.exchange_proccess svg {
  display: inline-block;
  vertical-align: middle;
}

/* Ensure Sender / Maker switcher looks sharp inside the hero card */
.aboveform-switcher {
  margin-bottom: 1rem !important;
}

.aboveform-switcher .switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Ensure #trade widget container has proper dark presentation & border radius */
#trade .widget__content {
  border-radius: 1.25rem;
  position: relative;
  z-index: 5;
}

[data-theme="dark"] #trade .crypto-search .input-query {
  background: var(--cdarkblue, #1d2633);
  color: var(--text-primary);
  caret-color: currentColor;
}

#trade .crypto-search .input-query::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

/* Light Theme support for #trade exchange form, .aboveform-switcher, #makerModal */
[data-theme="light"] .hero-widget-beam .hero-widget-beam-inner {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .aboveform-switcher,
[data-theme="light"] #trade {
  color: #0f172a !important;
  --cdarkblue: #f1f5f9;
  --c2: #f8fafc;
}

[data-theme="light"] .aboveform-switcher .switch-options {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

[data-theme="light"] .aboveform-switcher .option-item {
  color: #475569 !important;
}

[data-theme="light"] .aboveform-switcher .option-item.active {
  background: #0098ea !important;
  color: #ffffff !important;
}

[data-theme="light"] #trade .baseLayout,
[data-theme="light"] #trade .startPage,
[data-theme="light"] #trade .enterAddressPage,
[data-theme="light"] #trade .checkDetails,
[data-theme="light"] #trade .emailModalWidget,
[data-theme="light"] #trade .modalWidgetMEMO,
[data-theme="light"] #trade .msi,
[data-theme="light"] #trade .startPage__content-background {
  background: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="light"] #trade .moneyChooserInput__wrapper,
[data-theme="light"] #trade .input__main,
[data-theme="light"] #trade .transactionDetails,
[data-theme="light"] #trade .refundAddress,
[data-theme="light"] #trade .btnOpenEmailModal,
[data-theme="light"] #trade .msi__list,
[data-theme="light"] #trade .crypto-search {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
}

[data-theme="light"] #trade .moneyChooserInput__element,
[data-theme="light"] #trade .input__main--input,
[data-theme="light"] #trade .transactionDetails__row--value,
[data-theme="light"] #trade .wrapper__input,
[data-theme="light"] #trade .input-query {
  color: #0f172a !important;
  background: transparent !important;
}

[data-theme="light"] #trade .moneyChooserInputLabel__text,
[data-theme="light"] #trade .stepper__title,
[data-theme="light"] #trade .widget-header,
[data-theme="light"] #trade .amounts__itemAmount,
[data-theme="light"] #trade .amounts__itemCurrency--text,
[data-theme="light"] #trade .btnOpenEmailModal__text,
[data-theme="light"] #trade .moneyChooserInput__select__name__code,
[data-theme="light"] #trade .itemListModal__info__code--code,
[data-theme="light"] #trade .itemListModal__info__code--text,
[data-theme="light"] #trade .itemListModal__offerBlock--amount,
[data-theme="light"] #trade .label,
[data-theme="light"] #trade .memo-modal__text,
[data-theme="light"] #trade .memo-modal__list__title,
[data-theme="light"] #trade .memo-modal__list__wrapper li,
[data-theme="light"] #trade .modalBlockInfo span,
[data-theme="light"] #trade .modalBlockInfo> :nth-child(2),
[data-theme="light"] #trade .modalBlockInfo> :nth-child(3),
[data-theme="light"] #trade .transactionDetails__row--value,
[data-theme="light"] #trade .transactionDetails__row--copy__action span,
[data-theme="light"] #trade .paste_btn,
[data-theme="light"] #trade .paste_btn span,
[data-theme="light"] #trade .btn.ghost,
[data-theme="light"] #trade .btn.ghost span {
  color: #0f172a !important;
}

/* Left-align amount and currency in the Send (.amounts__left) block */
#trade .amounts__left {
  text-align: left !important;
  align-items: flex-start !important;
}

#trade .amounts__left .amounts__itemLabel,
#trade .amounts__left .amounts__itemAmount {
  text-align: left !important;
  width: 100%;
}

#trade .amounts__left .amounts__itemCurrency {
  justify-content: flex-start !important;
}

[data-theme="light"] #trade .moneyChooserInput__select {
  background: #e2e8f0 !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
}

[data-theme="light"] #trade .moneyChooserInput__select:hover {
  background: #cbd5e1 !important;
}

[data-theme="light"] #trade .moneyChooserInput__select__chevron {
  filter: brightness(0) saturate(100%) opacity(0.75);
}

[data-theme="light"] #trade .amounts__itemLabel,
[data-theme="light"] #trade .send-coin__cur,
[data-theme="light"] #trade .sendCoinNetwork,
[data-theme="light"] #trade .getCoinNetwork,
[data-theme="light"] #trade .transactionDetails__row--label,
[data-theme="light"] #trade .input__main--label,
[data-theme="light"] #trade .itemListModal__offerBlock--price {
  color: #475569 !important;
}

[data-theme="light"] #trade .itemListModal:hover,
[data-theme="light"] #trade .itemListModal:hover .itemListModal__info__code--code,
[data-theme="light"] #trade .itemListModal:hover .itemListModal__info__code--text {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] #trade .alert.warning {
  background: rgba(245, 158, 11, 0.12) !important;
  color: #92400e !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

[data-theme="light"] #trade .roundArrows__container {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #0098ea !important;
}

[data-theme="light"] #trade .roundArrows__icon,
[data-theme="light"] #trade .iconBtn svg,
[data-theme="light"] #trade .baseLayout__header svg {
  color: #0f172a !important;
}

[data-theme="light"] #trade .second_row svg {
  fill: #475569 !important;
}

[data-theme="light"] #trade .itemListModal:hover {
  background: #e2e8f0 !important;
}

[data-theme="light"] #trade .btn.primary,
[data-theme="light"] #trade .startPage__button {
  background: #0098ea !important;
  color: #ffffff !important;
}

[data-theme="light"] #trade .btn.primary span,
[data-theme="light"] #trade .startPage__button span {
  color: #ffffff !important;
}

[data-theme="light"] #makerModal {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15) !important;
}

[data-theme="light"] #makerModal .makerTitle,
[data-theme="light"] #makerModal .ml-item,
[data-theme="light"] #makerModal .makerLink {
  color: #0f172a !important;
}

/* Ensure currency selector dropdowns (.msi) appear above surrounding sections */
#trade .msi {
  z-index: 100 !important;
}

#trade input,
#trade button,
#trade select,
#trade textarea {
  font-family: 'Rubik', var(--font-onest), sans-serif;
}

/* Ensure Maker Modal (#makerModal) overlays properly above fixed header */
#makerModal {
  z-index: 9999 !important;
}

/* ==========================================================================
   4. Landing Page Sections (How It Works, Demo Statistics, Networks, Why, CTA)
   ========================================================================== */

.home-trust-stats__inner {
  flex-direction: column;
  align-items: center;
}

.home-trust-stats__heading {
  margin: 0 0 1rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
}

/* Ensure no ancestor breaks position: sticky on .home-how-stack-slot */
#main,
.site-main-content,
.site-main-content>.content,
.site-main-content>.content>.content-wrap,
.home-how-section,
.home-how-stack-track {
  overflow: visible !important;
}

.home-how-stack-slot {
  position: sticky !important;
  top: 0 !important;
}

/* Make sure How It Works title is visible immediately */
.home-how-stack-section-title:not(.home-how-stack-section-title--spacer) {
  opacity: 1 !important;
  filter: none !important;
  transform: none !important;
}

/* Smooth hardware-accelerated transitions for sticky card stacking */
.home-how-stack-card-wrap {
  will-change: transform;
}

.home-how-stack-card-dim {
  pointer-events: none;
  transition: opacity 0.08s linear;
}

/* Prevent text overflow inside .home-how-stack-copy on all viewports & languages */
.home-how-stack-card {
  height: auto !important;
  overflow: hidden;
}

.home-how-stack-card-inner {
  height: auto !important;
  min-width: 0;
}

.home-how-stack-copy {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden;
}

.home-how-step-heading,
.home-how-stack-card-title,
.home-how-step-desc {
  min-width: 0 !important;
  max-width: 100% !important;
  white-space: normal !important;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

/* How It Works preview images inside sticky cards */
.home-how-preview,
.home-how-preview--compact {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: radial-gradient(circle at 50% 50%, rgba(0, 152, 234, 0.12), rgba(10, 11, 16, 0.96));
  border: 1px solid rgba(0, 152, 234, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Recolor CTA flow buttons, trust stats & how-it-works accents to Tonchain Blue + Black */
.flow-button,
.swap-card-cta.flow-button,
.ui-button--primary,
.btn-primary {
  background-color: #0098ea !important;
  border-color: #0098ea !important;
  color: #ffffff !important;
}

.flow-button:hover,
.swap-card-cta.flow-button:hover,
.ui-button--primary:hover,
.btn-primary:hover {
  background-color: #00a6ff !important;
  border-color: #00a6ff !important;
  color: #ffffff !important;
}

.flow-button-fill {
  background-color: #00a6ff !important;
}

.flow-button .flow-button-label,
.flow-button svg {
  color: #ffffff !important;
}

.footer-support-btn {
  background: rgba(0, 152, 234, 0.14) !important;
  border: 1px solid rgba(0, 152, 234, 0.38) !important;
  color: #37bcff !important;
}

.footer-support-btn:hover {
  background: #0098ea !important;
  border-color: #0098ea !important;
  color: #ffffff !important;
}

.home-how-icon,
.home-why-card__icon,
.home-how-stack-card-num {
  color: #00a6ff !important;
}

.home-how-icon,
.home-why-card__icon {
  background: rgba(0, 152, 234, 0.12) !important;
  border-color: rgba(0, 152, 234, 0.28) !important;
}

[data-theme="light"] .home-how-preview,
[data-theme="light"] .home-how-preview--compact {
  background: #0b0c10;
  border-color: rgba(15, 23, 42, 0.12);
}

.home-how-preview img.home-how-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-how-stack-card:hover .home-how-preview img.home-how-preview-img {
  transform: scale(1.03);
}

/* ==========================================================================
   5. Internal Tonchain Pages Compatibility (exchange_proccess, terms, privacy, etc.)
   ========================================================================== */

.site-main-content {
  flex: 1 0 auto;
  width: 100%;
}

/* When not on the home page or support page, add top & bottom padding so fixed header doesn't overlap */
body:not(.is-home-page):not(.is-support-page) .site-main-content>.content>.content-wrap {
  padding-top: calc(var(--header-offset, 5.25rem) + 2.25rem);
  padding-bottom: 4rem;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* On home page and support page, let sections span full width without legacy .content-wrap constraints */
body.is-home-page .site-main-content>.content,
body.is-home-page .site-main-content>.content>.content-wrap,
body.is-support-page .site-main-content>.content,
body.is-support-page .site-main-content>.content>.content-wrap {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Preserve readable styling on internal text pages (.text-page, .exchange_proccess) */
.text-page {
  background: var(--home-block-bg, #0d0f17) !important;
  border: 1px solid var(--home-block-border, rgba(255, 255, 255, 0.1)) !important;
  border-radius: 1.25rem !important;
  padding: clamp(1.25rem, 3vw, 2.25rem) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32) !important;
  color: var(--text-primary) !important;
  line-height: 1.65;
}

.text-page .text-header,
.text-page h1,
.text-page h2,
.text-page h3,
.text-page h4 {
  color: var(--text-primary) !important;
  font-family: var(--font-syne), var(--font-onest), sans-serif;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.text-page .text-header {
  margin-top: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
}

.text-page p,
.text-page li {
  color: var(--text-secondary) !important;
}

.text-page ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
  list-style: disc;
}

[data-theme="light"] .text-page {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

[data-theme="light"] .text-page .text-header,
[data-theme="light"] .text-page h1,
[data-theme="light"] .text-page h2,
[data-theme="light"] .text-page h3,
[data-theme="light"] .text-page h4 {
  color: #0f172a !important;
}

[data-theme="light"] .text-page p,
[data-theme="light"] .text-page li {
  color: #334155 !important;
}

/* ==========================================================================
   7. Exchange Order Processing Page (.exchange-order-shell) - Home Style + Dual Theme
   ========================================================================== */

.exchange-order-shell {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.exchange-order-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.exchange-order-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(0, 152, 234, 0.12);
  border: 1px solid rgba(0, 152, 234, 0.3);
  color: #37bcff;
  font-size: 0.8rem;
  font-weight: 600;
}

[data-theme="light"] .exchange-order-badge {
  color: #0077b8;
  background: rgba(0, 152, 234, 0.1);
}

.exchange-order-badge__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #0098ea;
}

.exchange-order-title {
  margin: 0;
  font-family: var(--font-onest), sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 800;
  color: var(--text-primary);
}

.exchange-order-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.exchange-order-card {
  background: var(--home-block-bg, #0d0f17) !important;
  border: 1px solid var(--home-block-border, rgba(255, 255, 255, 0.1)) !important;
  border-radius: 1.25rem !important;
  padding: clamp(1.15rem, 3vw, 1.75rem) !important;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35) !important;
  color: var(--text-primary) !important;
}

[data-theme="light"] .exchange-order-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

.exchange-order-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.exchange-order-pair {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .exchange-order-pair {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.1);
}

.exchange-order-pair__col {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.exchange-order-pair__col--right {
  text-align: right;
  align-items: flex-end;
}

.exchange-order-pair__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.exchange-order-pair__amount {
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 700;
  color: var(--text-primary);
  /* word-break: break-all; */
}

.exchange-order-pair__amount--accent {
  color: #0098ea;
}

.exchange-order-pair__name {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.exchange-order-pair__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background: rgba(0, 152, 234, 0.12);
  color: #0098ea;
  flex-shrink: 0;
}

.exchange-order-rows {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.exchange-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .exchange-order-row {
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

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

.exchange-order-row__label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.exchange-order-row__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  word-break: break-all;
}

.exchange-order-timer {
  color: #0098ea;
}

.exchange-order-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 152, 234, 0.12);
  color: #37bcff;
  font-size: 0.8rem;
}

[data-theme="light"] .exchange-order-status-pill {
  color: #0077b8;
}

.exchange-order-deposit {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1rem;
  border-radius: 1rem;
  background: rgba(0, 152, 234, 0.06);
  border: 1px solid rgba(0, 152, 234, 0.22);
}

.exchange-order-deposit__title {
  margin: 0 !important;
  font-size: 0.9rem !important;
  color: var(--text-primary) !important;
}

.exchange-order-copy-wrap {
  width: 100%;
}

.exchange-order-copy-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .exchange-order-copy-box {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
}

.exchange-order-copy-input {
  flex: 1 1 auto;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  color: var(--text-primary) !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  outline: none !important;
}

.exchange-order-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.5rem;
  border: none;
  background: #0098ea;
  color: #ffffff;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.exchange-order-copy-btn:hover {
  background: #00a6ff;
}

.exchange-order-card-owner {
  margin: 0 !important;
  font-size: 0.85rem !important;
  color: var(--text-secondary) !important;
}

.exchange-order-actions {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.75rem;
  margin: 0.25rem 0 0 !important;
}

@media (max-width: 480px) {
  .exchange-order-actions {
    flex-direction: column !important;
    align-items: stretch;
  }
}

.exchange-order-btn-paid {
  flex: 1 1 auto;
  min-height: 2.85rem;
  border-radius: 0.875rem;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.exchange-order-btn-cancel {
  min-height: 2.85rem;
  padding: 0 1.25rem;
  border-radius: 0.875rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

[data-theme="light"] .exchange-order-btn-cancel {
  border-color: rgba(15, 23, 42, 0.16);
  color: #475569;
}

.exchange-order-btn-cancel:hover {
  background: rgba(255, 55, 70, 0.1);
  border-color: rgba(255, 55, 70, 0.35);
  color: #ff3746;
}

/* ==========================================================================
   6. Support Window & Language Selector (.support-page-shell / .support-lang-selector)
   ========================================================================== */

.support-page-root {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-height: calc(100vh - 12rem);
}

.support-entry-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.25rem !important;
}

.support-form-fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 1.15rem !important;
}

.support-form-fields .ui-field-group,
.support-form-fields .ui-field {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
}

.support-lang-selector {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem !important;
  margin-top: 0.25rem;
}

@media (max-width: 520px) {
  .support-lang-selector {
    grid-template-columns: 1fr;
    gap: 0.625rem !important;
  }
}

.support-lang-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.65rem 0.875rem;
  border-radius: 0.875rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
  color: var(--text-secondary);
  font-family: var(--font-onest);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

[data-theme="light"] .support-lang-option {
  background: rgba(15, 23, 42, 0.03);
  border-color: rgba(15, 23, 42, 0.12);
}

.support-lang-option:hover {
  background: rgba(0, 152, 234, 0.08);
  border-color: rgba(0, 152, 234, 0.35);
  color: var(--text-primary);
}

[data-theme="light"] .support-lang-option:hover {
  background: rgba(0, 152, 234, 0.08);
  border-color: rgba(0, 152, 234, 0.4);
}

.support-lang-option.is-active {
  background: rgba(0, 152, 234, 0.14);
  border-color: #0098ea;
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(0, 152, 234, 0.25), 0 8px 24px -8px rgba(0, 152, 234, 0.3);
}

[data-theme="light"] .support-lang-option.is-active {
  background: rgba(0, 152, 234, 0.12);
  border-color: #0098ea;
  color: #005c94;
  box-shadow: 0 0 0 1px rgba(0, 152, 234, 0.2);
}

.support-lang-option__label,
.support-lang-option__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.support-lang-option__badge,
.support-lang-option__code {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 0.375rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  margin-left: auto;
}

[data-theme="light"] .support-lang-option__badge,
[data-theme="light"] .support-lang-option__code {
  background: rgba(15, 23, 42, 0.08);
}

.support-lang-option.is-active .support-lang-option__badge,
.support-lang-option.is-active .support-lang-option__code {
  background: rgba(0, 152, 234, 0.24);
  color: #37bcff;
}

[data-theme="light"] .support-lang-option.is-active .support-lang-option__badge,
[data-theme="light"] .support-lang-option.is-active .support-lang-option__code {
  background: #0098ea;
  color: #ffffff;
}

.support-lang-select-wrap {
  position: relative;
  width: 100%;
  margin-top: 0.25rem;
}

.support-lang-select {
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 2.5rem 0.7rem 0.95rem;
  border-radius: 0.875rem;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
  color: var(--text-primary);
  font-family: var(--font-onest), sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.support-lang-select:focus {
  border-color: #0098ea;
  box-shadow: 0 0 0 3px rgba(0, 152, 234, 0.2);
}

.support-lang-select option {
  background: #0d0f17;
  color: #ffffff;
}

[data-theme="light"] .support-lang-select {
  background-color: #f8fafc;
  border-color: rgba(15, 23, 42, 0.16);
  color: #0f172a;
}

[data-theme="light"] .support-lang-select option {
  background: #ffffff;
  color: #0f172a;
}

.support-primary-action {
  min-height: 3rem !important;
  padding: 0.75rem 1.25rem !important;
  border-radius: 0.875rem !important;
  font-weight: 600 !important;
  margin-top: 0.25rem !important;
  transition: opacity 0.18s ease, filter 0.18s ease, background-color 0.18s ease !important;
}

.support-primary-action.is-disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  filter: grayscale(0.45);
}
