  :root {
      --bg: #0b0b0d;
      --panel: #111215;
      --muted: #9aa0a6;
      --accent: #26d39a;
      --accent-2: #5c5bff;
      --surface: #0f1013;
      --border: rgba(255, 255, 255, 0.08);
      --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  }

  html,
  body {
      height: 100%;
      margin: 0;
      background: radial-gradient(circle at 20% 20%, rgba(92, 91, 255, 0.08), transparent 35%), radial-gradient(circle at 80% 10%, rgba(38, 211, 154, 0.06), transparent 30%), var(--bg);
      color: #eee;
      font-family: Inter, Arial, Helvetica, sans-serif
  }

  .global-common-header {
      backdrop-filter: blur(6px);
      background: rgba(15, 16, 19, 0.75);
      border-bottom: 1px solid var(--border);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }

  .global-common-header .header-wrap {
      padding: 10px 18px;
      align-items: center;
  }

  #app-name {
      margin: 0;
      font-size: 20px;
      letter-spacing: 0.4px;
      background: linear-gradient(120deg, var(--accent), var(--accent-2));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
  }

  .app {
      display: flex;
      height: 100vh;
      overflow: hidden
  }

  #chart-container {
      flex: 1;
      min-width: 0;
      position: relative
  }



  /* Orderbook */
  #orderbook {
      width: 320px;
      background: var(--panel);
      border-left: 1px solid #222;
      padding: 10px;
      box-sizing: border-box;
      font-size: 13px;
      color: #ddd;
      display: flex;
      flex-direction: column;
  }

  .ob-title {
      font-weight: 600;
      text-align: center;
      color: #bbb;
      margin-bottom: 8px
  }

  .ob-headers {
      display: flex;
      justify-content: space-between;
      font-size: 12px;
      color: var(--muted);
      padding: 4px 2px;
      border-bottom: 1px solid #222;
      margin-bottom: 6px
  }

  .ob-body {
      flex: 1;
      overflow: auto;
      padding-right: 6px
  }

  .ob-tick-selector {
      position: relative;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      padding: 4px 6px;
  }

  .ob-tick-selector .tick-display {
      background: transparent;
      border: none;
      color: #eee;
      font-weight: 600;
      cursor: pointer;
      padding: 4px 8px;
      border-radius: 6px;
      width: 64px;
      transition: background 160ms ease, transform 160ms ease;
      }

  .ob-tick-selector .tick-display:hover {
      background: rgba(255, 255, 255, 0.08);
      transform: translateY(-1px);
  }

  .ob-tick-selector .tick-options {
      position: absolute;
      top: 110%;
      left: 0;
      right: 0;
      background: #111218;
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 8px;
      overflow: hidden;
      opacity: 0;
      pointer-events: none;
      transform: translateY(-6px);
      width: 80px;
      transition: opacity 140ms ease, transform 140ms ease;
      box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  }

  .ob-tick-selector .tick-options.open {
      opacity: 1;
      pointer-events: auto;
      transform: translateY(0);
      z-index: 10000;
  }

  .ob-tick-selector .tick-options button {
      width: 100%;
      background: transparent;
      border: none;
      color: #ddd;
      padding: 6px 10px;
      cursor: pointer;
      text-align: left;
      transition: background 140ms ease, color 140ms ease;
  }

  .ob-tick-selector .tick-options button:hover {
      background: rgba(255, 255, 255, 0.08);
      color: #fff;
  }

  .connection-status {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 8px;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      border-radius: 10px;
  }

  .connection-status .status-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
      display: inline-block;
      background: #ff9f1a;
      box-shadow: 0 0 0 4px rgba(255, 159, 26, 0.15);
  }

  .connection-status .status-dot.ok {
      background: #26d39a;
      box-shadow: 0 0 0 4px rgba(38, 211, 154, 0.15);
  }

  .connection-status .status-dot.down {
      background: #ff4d4d;
      box-shadow: 0 0 0 4px rgba(255, 77, 77, 0.15);
  }

  .connection-status .status-label {
      font-size: 12px;
      color: #cfd2da;
      margin-right: 4px;
  }

  .asks,
  .bids {
      display: flex;
      flex-direction: column;
      gap: 2px
  }

  .row {
      position: relative;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 2px 6px;
      height: 22px;
      cursor: pointer;
      border-radius: 4px;
      overflow: hidden;
      transition: background 160ms linear;
      font-family: monospace;
      font-size: 12px;
  }

  .row:hover {
      background: rgba(255, 255, 255, 0.03)
  }

  .amount-bar {
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      opacity: 0.22;
      transition: width 240ms linear, background-color 160ms linear
  }

  .amount-bar.animate-fill {
      animation: obFill 260ms ease;
  }

  .col-price {
      width: 40%;
      text-align: left;
      padding-left: 6px;
      z-index: 2
  }

  .col-size {
      width: 30%;
      text-align: right;
      padding-right: 10px;
      z-index: 2
  }

  .col-total {
      width: 30%;
      text-align: right;
      padding-right: 2px;
      z-index: 2;
      color: var(--muted)
  }

  .amount-bar-red {
      background: #ff4d4d
  }

  .amount-bar-green {
      background: #2cd1a2
  }

  @keyframes obFill {
      0% {
          opacity: 0.05;
      }
      100% {
          opacity: 0.22;
      }
  }

  /* small flash on update */
  .flash-ask {
      box-shadow: inset 0 0 10px rgba(255, 77, 77, 0.25);
      transition: box-shadow 700ms ease-out
  }

  .flash-bid {
      box-shadow: inset 0 0 10px rgba(44, 209, 162, 0.22);
      transition: box-shadow 700ms ease-out
  }

  .divider {
      height: 1px;
      background: #222;
      margin: 8px 0
  }

  /* spread area */
  .spread-box {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 6px 4px;
      border-radius: 6px;
      margin: 8px 0;
      color: #cfcfcf;
      font-size: 13px;
      background: linear-gradient(0deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.01));
      border: 1px solid rgba(255, 255, 255, 0.02)
  }

  .spread-value {
      font-weight: 700
  }

  .last-price-marker {
      margin-left: 8px;
      padding: 3px 8px;
      border-radius: 16px;
      background: rgba(255, 255, 255, 0.03);
      font-size: 12px;
      color: #fff;
      border: 1px solid rgba(255, 255, 255, 0.02)
  }

  /* popup tooltip */
  #ob-popup {
      position: fixed;
      display: none;
      pointer-events: none;
      z-index: 30;
      background: #111218;
      border: 1px solid #2a2a2a;
      padding: 8px 10px;
      border-radius: 6px;
      color: #ddd;
      font-size: 13px;
      min-width: 140px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6)
  }

  #ob-popup .label {
      color: #9aa0a6;
      font-size: 12px;
      margin-right: 6px
  }

  /* header labels style */
  .header-label {
      color: var(--muted);
      font-size: 12px
  }

  /* end */

  body {
      margin: 0;
      background: #0f131a;
      font-family: Inter, sans-serif;
  }

  /* --- UI micro interactions --- */
  .wallet-connect-button {
      transition: transform 160ms ease, box-shadow 200ms ease;
  }

  .wallet-connect-button:hover {
      transform: translateY(-1px);
      box-shadow: 0 10px 30px rgba(255, 0, 128, 0.2);
  }

  .wallet-connect-button .border-gradient-top,
  .wallet-connect-button .border-gradient-bottom {
      animation: pulseGlow 3600ms ease-in-out infinite;
      opacity: 0.85;
  }

  .wallet-connect-button .inner-content {
      transition: transform 160ms ease;
  }

  .wallet-connect-button:hover .inner-content {
      transform: translateY(-1px);
  }

  @keyframes pulseGlow {
      0% { opacity: 0.65; transform: scale(0.98); }
      50% { opacity: 1; transform: scale(1.02); }
      100% { opacity: 0.65; transform: scale(0.98); }
  }

  .dex-mc-kline-header-radio-container-label {
      position: relative;
      cursor: pointer;
      transition: color 160ms ease, background-color 160ms ease;
  }

  .dex-mc-kline-header-radio-container-label::after {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      bottom: -6px;
      height: 2px;
      background: linear-gradient(90deg, #26d39a, #2962ff);
      transform-origin: left;
      transform: scaleX(0);
      transition: transform 200ms ease;
  }

  .dex-mc-kline-header-radio-container-label:hover {
      color: #fff;
  }

  .dex-mc-kline-header-radio-container-label:hover::after,
  .dex-mc-kline-header-radio-container-label.dex-mc-kline-header-radio-container-label-active::after {
      transform: scaleX(1);
  }

  .dex-mc-kline-header-radio-container-label.dex-mc-kline-header-radio-container-label-active {
      color: #26d39a;
  }

  .dex-mc-kline-header-radio-container-button {
      transition: transform 140ms ease, background-color 160ms ease;
  }

  .dex-mc-kline-header-radio-container-button .dex-icon-next {
      transition: transform 140ms ease;
  }

  .dex-mc-kline-header-radio-container-button:hover {
      transform: translateY(-1px) scale(1.03);
  }

  .dex-mc-kline-header-radio-container-button:hover .dex-icon-next {
      transform: rotate(-6deg);
  }

  #chart-wrapper {
      position: relative;
      width: 100%;
      height: 100vh;
  }

  .dex-mc-kline-container,
  .dex-mc-kline-header {
      position: relative;
      z-index: 1000;
  }

  /* график */
  #chart {
      width: 100%;
      height: calc(100vh - 50px);
      background: #131722;
  }

  /* Верхняя панель */
  .tv-top-panel {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #131722;
      padding: 8px 12px;
      border-bottom: 1px solid #2a2e39;
  }

  /* Таймфреймы */
  .tv-timeframes button {
      background: #1e222d;
      border: 1px solid #2a2e39;
      color: #d1d4dc;
      padding: 6px 10px;
      margin-right: 6px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 13px;
  }

  .tv-timeframes button.active {
      background: #2962ff;
      border-color: #2962ff;
      color: #fff;
  }

  .tv-timeframes button:hover {
      background: #2a2e39;
  }

  /* Действия справа */
  .tv-actions button {
      background: #1e222d;
      border: 1px solid #2a2e39;
      color: #d1d4dc;
      padding: 6px;
      margin-left: 6px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 15px;
  }

  .tv-actions button:hover {
      background: #2a2e39;
  }

  /* Лоадер */

  #loading-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(000, 000, 000, 0.7);
      /* Прозрачный фон */
      display: flex;
      justify-content: center;
      align-items: center;
      z-index: 500;
      /* Ставим на передний план */
  }

  #loading-text {
      text-align: center;
  }

  /* Стили для графика и интерфейса */
  .app {
      display: flex;
      justify-content: space-between;
      padding: 20px;
  }

  #chart-container {
      position: relative;
      width: 75%;
  }

  .tv-top-panel {
      display: flex;
      justify-content: space-between;
      padding: 10px;
      background-color: #333;
      color: white;
  }

  .tv-sidebar {
      display: flex;
      flex-direction: column;
      padding: 10px;
      background-color: #333;
      color: white;
  }

  #orderbook {
      width: 25%;
      background-color: #1e1e1e;
      padding: 15px;
      color: white;
  }

  .ob-title {
      font-size: 18px;
      margin-bottom: 10px;
  }

  .ob-headers {
      display: flex;
      justify-content: space-between;
      font-weight: bold;
      margin-bottom: 10px;
      margin-left: 10px;
      margin-right: 10px;
  }

  .spread-box {
      margin-bottom: 15px;
  }

  .spread-label {
      font-size: 14px;
  }

  .spread-value {
      font-size: 16px;
      color: #28a745;
  }

  .last-price-marker {
      font-size: 14px;
      color: #e74c3c;
  }

  .ob-body {
      margin-top: 10px;
  }

  .asks,
  .bids {
      margin-bottom: 10px;
  }

  .row {
      display: flex;
      justify-content: space-between;
  }

  .row .amount-bar {
      height: 8px;
      background-color: #3498db;
      border-radius: 4px;
  }

  .row .col-price,
  .col-size,
  .col-total {
      font-size: 14px;
  }

  .container-c37158b6.merged-f8bdd554 {
      display: flex;
      gap: 12px;
      align-items: flex-start;
  }

  .trade-panel {
      width: 220px;
      background: linear-gradient(180deg, #111215 0%, #0d0e12 100%);
      border-left: 1px solid #1b1c23;
      padding: 12px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      gap: 10px;
      border-radius: 10px;
      box-shadow: var(--shadow);
  }

  .trade-panel__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
  }

  .trade-panel__header h3 {
      margin: 0;
      font-size: 14px;
      color: #fff;
  }

  .leverage {
      display: flex;
      align-items: center;
      gap: 8px;
      width: 100%;
      background: rgba(255, 255, 255, 0.03);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 10px;
  }

  .leverage label {
      font-size: 11px;
      color: #c0c4cc;
      white-space: nowrap;
  }

  .leverage input[type="range"] {
      flex: 1;
      -webkit-appearance: none;
      appearance: none;
      height: 6px;
      border-radius: 999px;
      background: linear-gradient(90deg, #26d39a 0%, #26d39a 50%, #1f2026 50%, #1f2026 100%);
      outline: none;
  }

  .leverage input[type="range"]::-webkit-slider-thumb {
      -webkit-appearance: none;
      appearance: none;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #fff;
      border: 2px solid #26d39a;
      box-shadow: 0 6px 16px rgba(38, 211, 154, 0.35);
      cursor: pointer;
      transition: transform 120ms ease, box-shadow 160ms ease;
  }

  .leverage input[type="range"]::-moz-range-thumb {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      background: #fff;
      border: 2px solid #26d39a;
      box-shadow: 0 6px 16px rgba(38, 211, 154, 0.35);
      cursor: pointer;
      transition: transform 120ms ease, box-shadow 160ms ease;
  }

  .leverage input[type="range"]::-moz-range-track {
      height: 6px;
      border-radius: 999px;
      background: transparent;
  }

  .leverage input[type="range"]:hover::-webkit-slider-thumb,
  .leverage input[type="range"]:hover::-moz-range-thumb {
      transform: scale(1.05);
      box-shadow: 0 8px 20px rgba(38, 211, 154, 0.45);
  }

  .leverage span {
      font-size: 12px;
      color: #fff;
      min-width: 40px;
      text-align: right;
      padding: 2px 8px;
      background: rgba(38, 211, 154, 0.12);
      border: 1px solid rgba(38, 211, 154, 0.25);
      border-radius: 999px;
  }

  .trade-panel__body {
      display: flex;
      flex-direction: column;
      gap: 8px;
  }

  .trade-panel .field {
      display: flex;
      flex-direction: column;
      gap: 4px;
  }

  .trade-panel .field label {
      font-size: 12px;
      color: #9aa0a6;
  }

  .trade-panel .field input {
      background: #0f1013;
      border: 1px solid #1f2026;
      border-radius: 8px;
      padding: 7px 10px;
      color: #fff;
      font-size: 14px;
      outline: none;
      transition: border-color 140ms ease, box-shadow 140ms ease;
  }

  .trade-panel .field input:focus {
      border-color: #26d39a;
      box-shadow: 0 0 0 2px rgba(38, 211, 154, 0.15);
  }

  .trade-panel__actions {
      display: flex;
      flex-direction: column;
      gap: 6px;
      align-items: center;
      justify-content: center;
  }

  @media (max-width: 1400px) {
      .container-c37158b6.merged-f8bdd554 {
          flex-direction: column;
      }
      .dex-mc-orderbook,
      .trade-panel {
          flex: 1 1 auto;
          width: 100%;
      }
      .chain-buttons,
      .trade-btn {
          width: 100%;
          max-width: none;
      }
  }

  /* Mobile / Tablet: stack orderbook and trade panel under chart full width */
  @media (max-width: 1024px) {
      .container-c37158b6 {
          flex-direction: column;
          width: 100%;
      }
      .container-c37158b6 .dex-mc-orderbook,
      .container-c37158b6 .trade-panel {
          width: 100% !important;
          max-width: none;
          flex: 1 1 auto;
      }
      .chart-c89a8f63,
      #chart {
          width: 100% !important;
          height: 75vh;
      }
  }

  .chain-buttons {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      width: 90%;
      max-width: 220px;
  }

  .trade-panel .wallet-connect-button {
      width: 100%;
  }

  .trade-btn {
      width: 90%;
      max-width: 220px;
      border: none;
      border-radius: 10px;
      padding: 8px 10px;
      font-weight: 700;
      font-size: 12px;
      cursor: pointer;
      transition: transform 120ms ease, box-shadow 160ms ease, opacity 140ms ease;
  }

  .trade-btn-primary {
      background: linear-gradient(135deg, var(--accent-2), var(--accent));
      color: #fff;
      box-shadow: 0 8px 28px rgba(38, 211, 154, 0.25);
  }

  .trade-btn-ghost {
      background: rgba(255, 255, 255, 0.03);
      color: #e5e7ef;
      border: 1px solid var(--border);
  }

  .trade-btn:hover {
      transform: translateY(-1px);
      opacity: 0.95;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }

  /* Scrollable tabs */
  .dex-tabs-nav.layout-dragable {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
  }

  .dex-tabs-nav.layout-dragable .dex-tabs-nav-wrap,
  .dex-tabs-nav.layout-dragable .dex-tabs-nav-list {
      min-width: max-content;
  }

  /* Лоадер ордербука внутри контейнера */
  #orderbook-loading-container {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.7);
      /* Полупрозрачный фон, чтобы было видно содержимое */
      display: flex;
      justify-content: center;
      align-items: center;
      color: white;
      font-size: 24px;
      font-weight: bold;
      z-index: 10;
      /* Лоадер будет внутри блока ордербука */
      display: none;
      /* По умолчанию скрыт */
  }

  #orderbook-loading-text {
      text-align: center;
  }

  /* Контейнер ордербука */
  #orderbook {
      position: relative;
      /* Обязательно для правильной работы абсолютного позиционирования лоадера */
      width: 25%;
      background-color: #1e1e1e;
      padding: 15px;
      color: white;
  }


  /* HTML: <div class="loader"></div> */
  .loader {
      width: 50px;
      aspect-ratio: 1;
      color: #fff;
      border: 2px solid;
      display: grid;
      box-sizing: border-box;
      animation: l1 4s infinite linear;
  }

  .loader::before,
  .loader::after {
      content: "";
      grid-area: 1/1;
      margin: auto;
      width: 70.7%;
      aspect-ratio: 1;
      border: 2px solid;
      box-sizing: content-box;
      animation: inherit;
  }

  .loader::after {
      width: 50%;
      aspect-ratio: 1;
      border: 2px solid;
      animation-duration: 2s;
  }

  @keyframes l1 {
      100% {
          transform: rotate(1turn)
      }
  }

  /* market cap  */

  #market-data {
      font-family: monospace;
      color: #ddd;
      margin-top: 20px;
  }

  #market-data div {
      margin: 4px 0;
  }

  #market-data div span {
      font-weight: bold;
  }

  .modal {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.0001);
      /* Полупрозрачный фон */
      justify-content: center;
      align-items: center;
      z-index: 999;
      /* Модалка выше лоадера */
      backdrop-filter: blur(2.2px);
      /* Размытие фона */
      -webkit-backdrop-filter: blur(2.2px);
      /* Для Webkit-браузеров */

  }

  /* Анимация для модального контента */
  @keyframes modal-content-animation {
      0% {
          transform: scale(0.8);
          /* Начальный масштаб */
          opacity: 0;
          /* Начальная невидимость */
      }

      100% {
          transform: scale(1);
          /* Конечный масштаб */
          opacity: 1;
          /* Полная видимость */
      }
  }

  /* Контент внутри модалки */
  .modal-content {
      background-color: #333333c1;
      padding: 15px 20px 20px 20px;
      border-radius: 30px;
      width: 380px;
      max-width: 90%;
      position: relative;
      opacity: 0;
      /* Изначально невидимый */
      transform: scale(0.8);
      /* Изначально уменьшен */
      animation: modal-content-animation 0.12s ease-out forwards;
      /* Применяем анимацию */

  }

  /* Кнопка для закрытия модалки (крестик) */
  .close-btn {
      position: absolute;
      top: 8px;
      right: 22px;
      font-size: 30px;
      font-weight: bold;
      cursor: pointer;
      color: #333;
      transition: color 0.3s ease;
  }

  .close-btn {
      color: #fff;
      /* Цвет крестика при наведении */
  }
