/* ==========================================================================
   stable.com — front-end replica
   ========================================================================== */

/* ---------- font ---------- */
@font-face {
  font-family: "Nekst";
  src: url("../assets/fonts/nekst-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- design tokens ---------- */
:root {
  --stb-border-radius: 4px;

  --stb-primitive-neutral-white: #ffffff;
  --stb-primitive-neutral-50: #fafafa;
  --stb-primitive-neutral-100: #f3f3f3;
  --stb-primitive-neutral-200: #e6e6e6;
  --stb-primitive-neutral-300: #c8c8c8;
  --stb-primitive-neutral-400: #a8a8a8;
  --stb-primitive-neutral-500: #808080;
  --stb-primitive-neutral-600: #626262;
  --stb-primitive-neutral-700: #404040;
  --stb-primitive-neutral-800: #212121;
  --stb-primitive-neutral-900: #0f0f0f;
  --stb-primitive-neutral-950: #000000;

  --stb-primitive-brand-50: #f0fdfa;
  --stb-primitive-brand-100: #dbf8f2;
  --stb-primitive-brand-200: #99ffe6;
  --stb-primitive-brand-300: #00ffcc;
  --stb-primitive-brand-400: #00e7b8;
  --stb-primitive-brand-500: #00c8a0;
  --stb-primitive-brand-600: #009779;
  --stb-primitive-brand-700: #006954;
  --stb-primitive-brand-800: #004336;
  --stb-primitive-brand-900: #002e25;
  --stb-primitive-brand-950: #001a15;

  --stb-primitive-error-500: #ff4747;
  --stb-primitive-warning-500: #ffc300;
}

/* dark (default) */
:root,
:root[data-theme="dark"] {
  --stb-color-bg-page: var(--stb-primitive-neutral-950);
  --stb-color-bg-surface: var(--stb-primitive-neutral-900);
  --stb-color-bg-elevated: var(--stb-primitive-neutral-800);
  --stb-color-bg-subtle: var(--stb-primitive-neutral-900);
  --stb-color-text-primary: var(--stb-primitive-neutral-white);
  --stb-color-text-secondary: var(--stb-primitive-neutral-400);
  --stb-color-text-tertiary: var(--stb-primitive-neutral-600);
  --stb-color-text-disabled: var(--stb-primitive-neutral-700);
  --stb-color-border-default: var(--stb-primitive-neutral-700);
  --stb-color-border-subtle: var(--stb-primitive-neutral-800);
  --stb-color-border-strong: var(--stb-primitive-neutral-600);
  --stb-color-border-focus: var(--stb-primitive-brand-300);
  --stb-color-brand-default: var(--stb-primitive-brand-300);
  --stb-color-brand-hover: var(--stb-primitive-brand-400);
  --stb-color-brand-subtle-bg: var(--stb-primitive-brand-800);
  --stb-color-brand-subtle-hover-bg: var(--stb-primitive-brand-900);
  --stb-color-brand-on-brand: var(--stb-primitive-neutral-950);
  --stb-color-overlay-page: #00000080;
  --stb-asset-background-image: url("../assets/images/bg-grid-cell-dark.svg");
  --stb-asset-ibank-background-image: url("../assets/images/ibank-dark.webp");
}

/* light */
:root[data-theme="light"] {
  --stb-color-bg-page: var(--stb-primitive-neutral-50);
  --stb-color-bg-surface: var(--stb-primitive-neutral-100);
  --stb-color-bg-elevated: var(--stb-primitive-neutral-white);
  --stb-color-bg-subtle: var(--stb-primitive-neutral-100);
  --stb-color-text-primary: var(--stb-primitive-neutral-950);
  --stb-color-text-secondary: var(--stb-primitive-neutral-600);
  --stb-color-text-tertiary: var(--stb-primitive-neutral-400);
  --stb-color-text-disabled: var(--stb-primitive-neutral-300);
  --stb-color-border-default: var(--stb-primitive-neutral-300);
  --stb-color-border-subtle: var(--stb-primitive-neutral-200);
  --stb-color-border-strong: var(--stb-primitive-neutral-600);
  --stb-color-border-focus: var(--stb-primitive-brand-600);
  --stb-color-brand-default: var(--stb-primitive-brand-600);
  --stb-color-brand-hover: var(--stb-primitive-brand-700);
  --stb-color-brand-subtle-bg: var(--stb-primitive-brand-100);
  --stb-color-brand-subtle-hover-bg: var(--stb-primitive-brand-50);
  --stb-color-brand-on-brand: var(--stb-primitive-neutral-white);
  --stb-color-overlay-page: #ffffff80;
  --stb-asset-background-image: url("../assets/images/bg-grid-cell-light.svg");
  --stb-asset-ibank-background-image: url("../assets/images/ibank-light.webp");
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

:where(html, body, div, span, h1, h2, h3, p, a, ul, ol, li, img, svg, button, input, footer, header, nav, main, aside, section) {
  margin: 0;
  padding: 0;
  border: 0;
  font: inherit;
  vertical-align: baseline;
}

:where(ol, ul) { list-style: none; }
:where(a) { text-decoration: none; color: inherit; }
:where(button) { padding: 0; margin: 0; border: none; background: none; font: inherit; color: inherit; }
:where(input) { border: none; padding: 0; margin: 0; background: none; }
:where(input:focus) { outline: none; }

html { height: 100%; scroll-behavior: smooth; }

body {
  height: 100%;
  background-color: var(--stb-color-bg-page);
  background-image: var(--stb-asset-background-image);
  background-position: center center;
  background-size: 100px auto;
  background-repeat: repeat;
  color: var(--stb-color-text-primary);
  position: relative;
  font-family: Inter, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- animations ---------- */
@keyframes geowJn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fuvUJC {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes maskReveal {
  from { mask-position: 0 100%; }
  to   { mask-position: 0 0; }
}
@keyframes bgFade {
  from { opacity: 0; filter: blur(0px); }
  to   { opacity: 1; filter: blur(10px); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- layout ---------- */
.app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
}
.layout {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header {
  margin: auto;
  max-width: 100%;
  width: 1520px;
  padding: 20px 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  position: relative;
  opacity: 1;
  transition: opacity 0.4s;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo {
  margin-right: 112px;
  display: inline-flex;
}
.logo__img {
  display: block;
  width: 160px;
  height: 46px;
}
.logo__img--dark { display: none; }
[data-theme="dark"] .logo__img--light { display: none; }
[data-theme="dark"] .logo__img--dark { display: block; }

/* blurred segmented nav (as on the live site) */
.nav-pill {
  display: flex;
  align-items: center;
  padding: 2px;
  background: var(--stb-color-bg-elevated);
  position: relative;
  width: 224px;
  height: 34px;
  filter: blur(6px);
  pointer-events: none;
  border-radius: var(--stb-border-radius);
}
.nav-pill::after {
  content: "";
  width: 110px;
  height: 30px;
  background: var(--stb-color-bg-page);
  position: absolute;
  top: 2px;
  left: 2px;
  opacity: 0;
  transform: translateX(0);
  transition: opacity 0.2s, transform 0.3s;
  border-radius: var(--stb-border-radius);
}
.nav-pill__item {
  width: 110px;
  text-align: center;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--stb-color-text-primary);
  z-index: 5;
  font-size: 14px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-mobile {
  display: none;
  align-items: center;
  gap: 12px;
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  text-align: center;
  font-weight: 400;
  background: var(--stb-color-brand-subtle-bg);
  color: var(--stb-color-brand-default);
  overflow: hidden;
  border-radius: 0 4px 0 4px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}
.btn:hover { background: var(--stb-color-brand-subtle-hover-bg); }
.btn:disabled { background: var(--stb-color-bg-surface); color: var(--stb-color-text-disabled); }

.btn--header {
  padding: 13px 17px;
  font-size: 14px;
  width: auto;
  white-space: nowrap;
}
.btn--header-link { display: inline-flex; }

.btn--cta {
  width: 240px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  background: var(--stb-color-brand-subtle-bg);
  color: var(--stb-color-brand-default);
  border-radius: 0 4px 0 4px;
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.btn--cta:hover { background: var(--stb-color-brand-subtle-hover-bg); }

/* ---------- theme button + popover ---------- */
.theme-btn {
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--stb-color-brand-subtle-bg);
  position: relative;
  flex: 0 0 auto;
}
.theme-btn:hover { background: var(--stb-color-brand-subtle-hover-bg); }
.theme-btn svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.theme-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-btn .icon-sun { display: block; }

.theme-popover {
  position: fixed;
  top: 0;
  left: 0;
  padding: 4px;
  width: max-content;
  min-width: 168px;
  background: var(--stb-color-bg-page);
  border: 1px solid var(--stb-color-border-default);
  border-radius: var(--stb-border-radius);
  z-index: 200;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.theme-popover[hidden] { display: none; }
.theme-popover__item {
  padding: 16px 24px;
  cursor: pointer;
  font-size: 16px;
  line-height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  border-radius: var(--stb-border-radius);
  opacity: 0;
  animation: fadeIn 0.12s ease forwards;
}
.theme-popover__item:nth-child(2) { animation-delay: 0.05s; }
.theme-popover__item:nth-child(3) { animation-delay: 0.1s; }
.theme-popover__item:hover { background: var(--stb-color-bg-surface); }
.theme-popover__check { visibility: hidden; color: var(--stb-color-text-primary); }
.theme-popover__item.is-selected .theme-popover__check { visibility: visible; }

/* ==========================================================================
   MAIN / HERO
   ========================================================================== */
.main {
  display: flex;
  flex: 1;
  position: relative;
  min-height: 80vh;
  z-index: 10;
}
.main-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  z-index: 10;
  pointer-events: auto;
}
.hero-layout {
  position: relative;
  overflow: hidden;
  max-width: 1360px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: block;
  flex: 1;
}

.hero-bg {
  max-width: 1380px;
  width: 100%;
  max-height: 900px;
  height: 100%;
  background-image: var(--stb-asset-ibank-background-image);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  position: absolute;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  /* opacity: 0;
  filter: blur(0px);
  -webkit-mask-image: linear-gradient(#000 0%, #000 25%, transparent 50%);
  mask-image: linear-gradient(#000 0%, #000 25%, transparent 50%);
  -webkit-mask-size: 100% 300%;
  mask-size: 100% 300%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: 0 100%;
  mask-position: 0 100%;
  animation: maskReveal 1s ease forwards, bgFade 0.4s ease 1.5s forwards; */
}

.hero {
  margin-top: 56px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.hero-title {
  padding: 0 16px;
  font-family: "Roboto Mono", monospace;
  font-size: 60px;
  font-weight: 700;
  line-height: 72px;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  animation: geowJn 0.4s ease 1.5s forwards;
}
.hero-title span {
  font-family: "Roboto Mono", monospace;
  color: var(--stb-color-brand-default);
  white-space: nowrap;
}
.glyph {
  display: inline-block;
  height: 0.72em;
  width: auto;
  margin: 0 0.04em;
  vertical-align: baseline;
  transform: translateY(0);
  flex: 0 0 auto;
  overflow: visible;
}
.glyph--o {
  height: 0.74em;
  transform: translateY(0.015em);
}

.hero-sub {
  padding: 0 16px;
  font-size: 20px;
  line-height: 30px;
  margin: 32px auto 0;
  max-width: 972px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  animation: geowJn 0.4s ease 2.1s forwards;
}

.hero-cta {
  text-align: center;
  margin: 40px auto 0;
  width: 240px;
  opacity: 0;
  transform: translateY(18px);
  animation: fuvUJC 0.4s ease 2.1s forwards;
}

.hero-note {
  color: var(--stb-color-text-secondary);
  font-size: 14px;
  line-height: 20px;
  margin-top: 12px;
  text-align: center;
  opacity: 0;
  transform: translateY(18px);
  animation: fuvUJC 0.4s ease 2.1s forwards;
}

/* ==========================================================================
   SWAP WIDGET
   ========================================================================== */
.widget-wrap {
  opacity: 0;
  transform: translateY(8px);
  animation: geowJn 0.4s ease 2.7s forwards;
  display: flex;
  justify-content: center;
  position: relative;
}
.widget {
  width: 100%;
  display: flex;
  justify-content: center;
}
.widget.is-hidden { display: none; }

.widget-card-wrap {
  padding: 80px 8px 0;
  display: flex;
  justify-content: center;
  width: 100%;
}
.widget-card {
  width: 100%;
  max-width: 580px;
  padding: 64px 40px 48px;
  background: var(--stb-color-bg-page);
  border: 1px solid var(--stb-color-border-default);
  border-radius: var(--stb-border-radius);
  position: relative;
  display: block;
  box-shadow: 0 -36px 32px -12px var(--stb-color-bg-page);
}

.widget-tabs {
  padding: 0 18px;
  position: absolute;
  top: 0;
  left: 32px;
  transform: translateY(-50%);
  display: flex;
  gap: 12px;
  color: var(--stb-color-text-secondary);
  font-size: 18px;
  line-height: 28px;
  isolation: isolate;
}
.widget-tabs::before {
  content: "";
  width: 100%;
  height: 3px;
  background: var(--stb-color-bg-page);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  z-index: -1;
}
.tab {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: color 0.15s;
}
.tab:hover { color: var(--stb-color-text-primary); }
.tab--active { color: var(--stb-color-text-primary); }

.widget-reset {
  padding: 0 18px;
  position: absolute;
  top: 0;
  right: 32px;
  transform: translateY(-50%);
  color: var(--stb-color-text-secondary);
  cursor: pointer;
  font-size: 18px;
  line-height: 28px;
  isolation: isolate;
}
.widget-reset::before {
  content: "";
  width: 100%;
  height: 3px;
  background: var(--stb-color-bg-page);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  z-index: -1;
}
.widget-reset:hover { color: var(--stb-color-text-primary); }

.widget-promo {
  text-align: center;
  font-size: 32px;
  font-style: normal;
  font-weight: 700;
  font-family: Nekst, sans-serif;
  line-height: 42px;
  white-space: pre-line;
  margin-bottom: 56px;
  color: var(--stb-color-text-primary);
}

.swap-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  column-gap: 16px;
  align-items: center;
}
.selector-wrap { position: relative; }

.selector {
  width: 100%;
  padding: 21px 20px;
  border: none;
  border-radius: var(--stb-border-radius);
  cursor: pointer;
  position: relative;
  font-size: 18px;
  line-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.selector__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.selector__icon + .selector__label { margin-right: auto; }
.selector__chevron { flex: 0 0 auto; }

.selector--sell {
  background: var(--stb-color-brand-default);
  color: var(--stb-color-brand-on-brand);
}
.selector--sell:hover { background: var(--stb-color-brand-hover); }
.selector--sell .selector__chevron path { stroke: var(--stb-color-brand-on-brand); }
.selector--sell .selector__icon path,
.selector--sell .selector__icon circle,
.selector--sell .selector__icon rect { fill: var(--stb-color-brand-on-brand); }

.selector--buy {
  background: var(--stb-color-bg-page);
  border: 1px solid var(--stb-color-border-default);
  color: inherit;
}
.selector--buy:hover { background: var(--stb-color-bg-surface); }
.selector--buy .selector__chevron path { stroke: var(--stb-color-text-secondary); }

/* corner marks on the buy selector */
.corner {
  width: 8px;
  height: 8px;
  position: absolute;
}
.corner--tl { top: -1px; left: -1px; border-top: 1px solid var(--stb-color-text-secondary); border-left: 1px solid var(--stb-color-text-secondary); border-top-left-radius: var(--stb-border-radius); }
.corner--tr { top: -1px; right: -1px; border-top: 1px solid var(--stb-color-text-secondary); border-right: 1px solid var(--stb-color-text-secondary); border-top-right-radius: var(--stb-border-radius); }
.corner--bl { bottom: -1px; left: -1px; border-bottom: 1px solid var(--stb-color-text-secondary); border-left: 1px solid var(--stb-color-text-secondary); border-bottom-left-radius: var(--stb-border-radius); }
.corner--br { bottom: -1px; right: -1px; border-bottom: 1px solid var(--stb-color-text-secondary); border-right: 1px solid var(--stb-color-text-secondary); border-bottom-right-radius: var(--stb-border-radius); }

.selector__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.amount-input {
  width: 100%;
  padding: 19px 24px 19px 12px;
  color: var(--stb-color-text-primary);
  text-align: right;
  background: var(--stb-color-bg-surface);
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  caret-color: var(--stb-color-brand-default);
  border: 1px solid var(--stb-color-bg-surface);
  border-radius: var(--stb-border-radius);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.amount-input::placeholder { color: var(--stb-color-text-tertiary); }
.amount-input:hover { background: var(--stb-color-bg-elevated); border: 1px solid var(--stb-color-bg-elevated); }
.amount-input:focus { background: var(--stb-color-bg-page); border: 1px solid var(--stb-color-border-focus); }

.revert-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  cursor: pointer;
  border-radius: var(--stb-border-radius);
}
.revert-btn:hover { background: var(--stb-color-bg-surface); }
.revert-btn svg { width: 20px; height: 20px; }
.revert-btn svg path { stroke: var(--stb-color-text-primary); }
.revert-btn.is-rotated svg { transform: rotate(180deg); }

.max-btn {
  visibility: hidden;
  max-width: 100%;
  justify-self: end;
  padding: 4px 24px;
  background: var(--stb-color-bg-surface);
  border: 1px solid var(--stb-color-border-default);
  color: var(--stb-color-text-primary);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  border-radius: var(--stb-border-radius);
}
.max-btn span { margin-right: 8px; }
.max-btn:hover { background: var(--stb-color-bg-elevated); }
.max-btn.is-visible { visibility: visible; }

.widget-submit { margin-top: 40px; }

.btn-submit {
  width: 100%;
  position: relative;
  padding: 20px 24px;
  font-size: 18px;
  line-height: 28px;
  cursor: not-allowed;
  text-align: center;
  font-weight: 400;
  background: var(--stb-color-brand-default);
  color: var(--stb-color-brand-on-brand);
  overflow: hidden;
  border-radius: 0 4px 0 4px;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  transition: background 0.15s;
}
.btn-submit:disabled {
  background: var(--stb-color-bg-surface);
  color: var(--stb-color-text-disabled);
}
.btn-submit:not(:disabled) { cursor: pointer; }
.btn-submit:not(:disabled):hover { background: var(--stb-color-brand-hover); }

/* ==========================================================================
   TOKEN SELECT PANEL
   ========================================================================== */
.widget-panel-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  height: 600px;
  padding: 80px 8px 0;
}
.widget-panel-wrap[hidden] { display: none; }

.widget-panel {
  width: 100%;
  max-width: 580px;
  max-height: 720px;
  background: var(--stb-color-bg-page);
  border: 1px solid var(--stb-color-border-default);
  border-radius: var(--stb-border-radius);
  position: relative;
  box-shadow: 0 -36px 32px -12px var(--stb-color-bg-page);
}

.panel-title {
  padding: 0 18px;
  position: absolute;
  top: 0;
  left: 32px;
  transform: translateY(-50%);
  font-size: 18px;
  line-height: 28px;
  color: var(--stb-color-text-secondary);
  border-radius: var(--stb-border-radius);
  background: var(--stb-color-bg-page);
}
.panel-close {
  padding: 0 18px;
  position: absolute;
  top: 0;
  right: 32px;
  transform: translateY(-50%);
  font-size: 18px;
  line-height: 28px;
  cursor: pointer;
  border-radius: var(--stb-border-radius);
  background: var(--stb-color-bg-page);
  color: var(--stb-color-text-primary);
}
.panel-close:hover { color: var(--stb-color-text-secondary); }

.panel-list {
  height: calc(100% - 56px);
  padding-right: 24px;
  position: absolute;
  top: 56px;
  left: 24px;
  right: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--stb-color-border-subtle) transparent;
}
.panel-list::-webkit-scrollbar { width: 8px; margin-right: 8px; }
.panel-list::-webkit-scrollbar-thumb {
  background: var(--stb-color-border-subtle);
  border-radius: var(--stb-border-radius);
}
.panel-list::-webkit-scrollbar-track { background: transparent; }

.chain-group {
  border-bottom: 1px solid var(--stb-color-border-subtle);
  opacity: 0;
  animation: fadeIn 0.12s ease forwards;
}
.chain-group:last-child { border-bottom: none; }

.chain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  cursor: pointer;
  color: var(--stb-color-brand-default);
  border-radius: var(--stb-border-radius);
  width: 100%;
  text-align: left;
}
.chain-row svg[id="chain-icon"] path { fill: var(--stb-color-text-primary); }
.chain-row svg[id="chevron-icon"] { rotate: 0deg; transition: rotate 0.2s ease; flex: 0 0 auto; }
.chain-row svg[id="chevron-icon"] path { stroke: var(--stb-color-text-secondary); }
.chain-row:hover { color: var(--stb-color-text-primary); }
.chain-row:hover svg[id="chevron-icon"] path { stroke: var(--stb-color-text-primary); }
.chain-group.is-open .chain-row svg[id="chevron-icon"] { rotate: 180deg; }

.chain-name {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  line-height: 28px;
}
.chain-name svg[id="chain-icon"] { width: 20px; height: 20px; flex: 0 0 auto; }

.token-list {
  padding-bottom: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.2s ease-in-out, padding-bottom 0.2s ease-in-out, opacity 0.35s ease-in-out;
}
.chain-group.is-open .token-list {
  max-height: 500px;
  opacity: 1;
  padding-bottom: 8px;
}

.token-item {
  padding: 20px 20px 20px 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--stb-border-radius);
  width: 100%;
  text-align: left;
  font-size: 18px;
  line-height: 28px;
}
.token-item:hover { background: var(--stb-color-bg-surface); }
.token-item img { width: 20px; height: 20px; }
.token-item span { min-width: 60px; }

.chain-row--disabled {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 16px;
  cursor: not-allowed;
  color: var(--stb-color-text-secondary);
  border-radius: var(--stb-border-radius);
  width: 100%;
  text-align: left;
}
.chain-row--disabled svg[id="chain-icon"] path { fill: var(--stb-color-text-secondary); }
.chain-row--disabled svg[id="chevron-icon"] { rotate: 0deg; }
.chain-row--disabled svg[id="chevron-icon"] path { stroke: var(--stb-color-text-secondary); }

.badge-soon {
  padding: 2px 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--stb-color-text-secondary);
  background: var(--stb-color-bg-elevated);
  border-radius: var(--stb-border-radius);
  white-space: nowrap;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
  text-align: center;
  padding: 64px 40px 24px;
  font-size: 12px;
  line-height: 18px;
  color: var(--stb-color-text-secondary);
  z-index: 10;
  position: relative;
  opacity: 1;
  transition: opacity 0.4s;
}
.footer a { color: var(--stb-color-brand-default); }
.footer a:hover { color: var(--stb-color-text-primary); }

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
  gap: 32px;
}
.footer-links a,
.footer-links div { white-space: nowrap; }
.footer-cookie-settings { cursor: pointer; color: var(--stb-color-brand-default); }
.footer-cookie-settings:hover { color: var(--stb-color-text-primary); }
.footer-email { color: var(--stb-color-text-secondary) !important; }
.footer-email:hover { color: var(--stb-color-text-primary) !important; }

.footer-legal {
  max-width: 1360px;
  margin: 64px auto 0;
  white-space: pre-line;
}

/* ==========================================================================
   MOBILE MENU
   ========================================================================== */
.burger {
  width: 24px;
  height: 24px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 1.5px;
  width: 18px;
  margin-left: auto;
  background: var(--stb-color-text-primary);
  transition: transform 0.2s;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 300;
}
.menu-overlay.is-open { opacity: 1; visibility: visible; }

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 82%;
  max-width: 420px;
  background: var(--stb-color-bg-page);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 310;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu.is-open { transform: translateX(0); }

.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}
.mobile-menu__head .logo__img { width: 140px; height: 40px; }
.mobile-menu__close {
  font-size: 16px;
  color: var(--stb-color-text-primary);
  cursor: pointer;
}

.mobile-menu__body {
  padding: 8px 24px 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.mobile-menu__label {
  font-size: 16px;
  line-height: 24px;
  color: var(--stb-color-text-secondary);
  margin: 16px 0 12px;
}
.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--stb-color-bg-surface);
  border-radius: var(--stb-border-radius);
}
.segmented__item {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  color: var(--stb-color-text-primary);
  border-radius: var(--stb-border-radius);
  cursor: pointer;
}
.segmented__item.is-active {
  background: var(--stb-color-brand-default);
  color: var(--stb-color-brand-on-brand);
}

.mobile-menu__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0 40px;
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--stb-color-text-primary);
  cursor: pointer;
  text-align: left;
}
.menu-row svg { color: var(--stb-color-text-secondary); flex: 0 0 auto; }

.mobile-menu__links {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
  line-height: 20px;
}
.mobile-menu__links a { color: var(--stb-color-brand-default); }
.mobile-menu__mail { color: var(--stb-color-text-secondary) !important; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1345px) {
  .header { padding: 20px 32px; }
  .theme-popover { right: 128px; }
}

@media (max-width: 1500px) {
  .footer-links {
    margin: 40px auto 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    justify-items: center;
  }
}

@media (max-width: 1200.98px) {
  .header { padding: 20px 32px; }
  .hero-bg { top: 20px; }
  .hero-sub { margin: 20px auto 0; font-size: 16px; line-height: 24px; }
  .hero-note { font-size: 12px; line-height: 18px; }
  .widget-card-wrap { padding: 64px 8px 0; }
  .widget-panel-wrap { padding: 64px 8px 0; }
  body { background-size: 65px auto; }
  .footer-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .theme-popover { right: 128px; }
}

@media (max-width: 960.98px) {
  .header { padding: 16px 32px; }
  .footer { padding: 48px 32px 24px; }
  .footer-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget-card-wrap { padding: 48px 8px 0; }
  .widget-panel-wrap { padding: 48px 8px 0; height: 520px; }
  .widget-panel { max-height: 600px; }
}

@media (max-width: 880px) {
  .logo { margin-right: 0; }
  .nav-pill { display: none; }
  .header-actions { display: none; }
  .header-mobile { display: flex; }
  .theme-popover { right: 96px; }
}

@media (max-width: 620.98px), (max-height: 620.98px) {
  body { background-size: 50px auto; }
  .header { padding: 9px 12px; }
  .header-right { gap: 12px; }
  .btn--header { padding: 8px 12px; font-size: 12px; }
  .logo__img { width: 120px; height: 35px; }

  .hero-title { font-size: 32px; line-height: 42px; }
  .hero-sub { margin: 16px auto 0; font-size: 12px; line-height: 18px; max-width: 336px; }
  .hero-cta { width: 176px; margin: 32px auto 0; }
  .btn--cta { width: 176px; }
  .hero-note { font-size: 10px; line-height: 15px; }

  .widget-card-wrap { padding: 48px 8px 0; }
  .widget-card { padding: 48px 12px 40px; max-width: 440px; }
  .widget-tabs { left: 16px; font-size: 14px; line-height: 20px; gap: 8px; padding: 0 12px; }
  .widget-reset { right: 16px; font-size: 14px; line-height: 20px; padding: 0 12px; }
  .widget-promo { font-size: 18px; line-height: 28px; margin-bottom: 36px; }
  .swap-grid { column-gap: 8px; grid-template-columns: 140px 1fr; }
  .selector { padding: 14px 12px; font-size: 14px; line-height: 20px; }
  .amount-input { padding: 14px 12px; font-size: 18px; line-height: 26px; }
  .revert-btn { height: 44px; }
  .max-btn { padding: 4px 16px; font-size: 12px; line-height: 20px; }
  .widget-submit { margin-top: 24px; }
  .btn-submit { padding: 14px 16px; font-size: 16px; line-height: 24px; }

  .widget-panel-wrap { padding: 48px 8px 0; }
  .widget-panel { max-height: 100%; max-width: 440px; }
  .panel-title { left: 16px; font-size: 14px; line-height: 20px; padding: 0 12px; }
  .panel-close { right: 16px; font-size: 14px; line-height: 20px; padding: 0 12px; }
  .panel-list { height: calc(100% - 32px); padding-right: 12px; top: 32px; left: 12px; }
  .chain-row, .chain-row--disabled { padding: 16px; }
  .chain-name { font-size: 14px; line-height: 20px; }
  .token-item { padding: 16px 16px 16px 48px; font-size: 14px; line-height: 20px; gap: 12px; }
  .badge-soon { padding: 1px 8px; font-size: 12px; line-height: 18px; }

  .footer { padding: 48px 16px 24px; }
  .footer-links { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .footer-legal { margin: 48px auto 0; }
}

@media (max-width: 620.98px) {
  .hero-bg { display: none; }
}

@media (max-width: 440px) {
  .widget-panel { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
  }
}
