/* Arbital Cloud responsive stabilization layer.
   Loaded after legacy styles so mobile/tablet behavior has one source of truth. */

html,
body {
  max-width: 100%;
}

/* Keep semantic service icons crisp in both desktop and mobile menus. */
.arbital-shared-dropdown-icon svg,
.arbital-mobile-dropdown-icon svg {
  display: block !important;
  width: 23px !important;
  height: 23px !important;
  overflow: visible !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  opacity: 1 !important;
}

@media (max-width: 1100px) {
  /* Homepage hero: one image, readable text, predictable stacking. */
  body.home-no-js .home-v2,
  body.home-no-js .home-v2-top-block,
  body.home-no-js .home-v2 .section-container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.home-no-js .home-v2-top-block {
    width: calc(100% - 40px) !important;
    max-width: 960px !important;
    padding: 26px 0 38px !important;
    margin-inline: auto !important;
    overflow: hidden !important;
  }

  body.home-no-js .home-v2 .home-v2-hero.home-v2-hero-center {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    gap: 22px !important;
    overflow: hidden !important;
    text-align: center !important;
  }

  body.home-no-js .home-v2 .home-v2-hero::before,
  body.home-no-js .home-v2 .home-v2-hero::after {
    content: none !important;
    display: none !important;
    background: none !important;
  }

  body.home-no-js .home-v2-hero-centered-content {
    display: contents !important;
  }

  body.home-no-js .home-v2-hero-left h1,
  body.home-no-js .home-v2-hero-left h3,
  body.home-no-js .home-v2-description,
  body.home-no-js .home-v2-search-wrap,
  body.home-no-js .home-v2-actions,
  body.home-no-js .static-hero-art {
    width: 100% !important;
    max-width: 720px !important;
    min-width: 0 !important;
    margin-inline: auto !important;
  }

  body.home-no-js .home-v2-hero-left h1 {
    order: 1;
    font-size: clamp(48px, 8vw, 68px) !important;
    line-height: 1.02 !important;
    text-align: center !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
  }

  body.home-no-js .home-v2-hero-left h3 {
    order: 2;
    margin: 4px auto 0 !important;
    text-align: center !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
  }

  body.home-no-js .home-v2-hero-left h3::after {
    content: none !important;
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
  }

  body.home-no-js .static-hero-art {
    order: 3;
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: auto !important;
    min-height: 0 !important;
    margin-top: 4px !important;
    overflow: hidden !important;
  }

  body.home-no-js .static-hero-art img {
    display: block !important;
    width: min(650px, 86vw) !important;
    max-width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    transform: none !important;
    object-fit: contain !important;
  }

  body.home-no-js .home-v2-description {
    order: 4;
    margin-top: 0 !important;
    color: rgba(180, 188, 210, .82) !important;
    font: 500 17px/1.6 var(--font-body, "Manrope", sans-serif) !important;
    text-align: center !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  body.home-no-js .home-v2-search-wrap {
    order: 5;
    margin-top: 2px !important;
  }

  body.home-no-js .home-v2-search-wrap::before,
  body.home-no-js .home-v2-search-wrap::after {
    content: none !important;
    display: none !important;
  }

  body.home-no-js .home-v2-actions {
    order: 6;
    display: flex !important;
    flex-flow: row wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 12px !important;
    margin-top: 0 !important;
  }

  body.home-no-js .home-v2-actions .home-v2-btn {
    flex: 0 1 210px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding-inline: 18px !important;
    white-space: nowrap !important;
  }

  /* Statistics/current targets: retain the desktop table and swipe horizontally. */
  body.statistic-page main,
  body.targets-page main,
  body.statistic-page .site-wrap,
  body.targets-page .site-wrap {
    width: calc(100% - 28px) !important;
    max-width: 1500px !important;
    min-width: 0 !important;
    margin-inline: auto !important;
    overflow: visible !important;
  }

  body.statistic-page .hero,
  body.targets-page .hero {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 18px !important;
    width: 100% !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  body.statistic-page .toolbar,
  body.targets-page .toolbar {
    display: flex !important;
    flex-flow: row nowrap !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 8px !important;
    padding: 2px 2px 7px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.statistic-page .toolbar button,
  body.statistic-page .toolbar a,
  body.targets-page .toolbar button,
  body.targets-page .toolbar a {
    flex: 0 0 auto !important;
    min-width: max-content !important;
  }

  body.statistic-page .table-wrap,
  body.targets-page .table-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 12px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-radius: 22px !important;
    scrollbar-width: thin !important;
    -webkit-overflow-scrolling: touch !important;
  }

  body.statistic-page .table-wrap table,
  body.targets-page .table-wrap table {
    display: table !important;
    width: 1180px !important;
    min-width: 1180px !important;
    max-width: none !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    background: transparent !important;
  }

  body.statistic-page .table-wrap thead,
  body.targets-page .table-wrap thead {
    display: table-header-group !important;
  }

  body.statistic-page .table-wrap tbody,
  body.targets-page .table-wrap tbody {
    display: table-row-group !important;
  }

  body.statistic-page .table-wrap tr,
  body.targets-page .table-wrap tr {
    display: table-row !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  body.statistic-page .table-wrap th,
  body.statistic-page .table-wrap td,
  body.statistic-page .table-wrap tbody tr:nth-child(odd) > td,
  body.statistic-page .table-wrap tbody tr:nth-child(even) > td,
  body.targets-page .table-wrap th,
  body.targets-page .table-wrap td,
  body.targets-page .table-wrap tbody tr:nth-child(odd) > td,
  body.targets-page .table-wrap tbody tr:nth-child(even) > td {
    display: table-cell !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 13px 12px !important;
    border: 0 !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
    background: rgba(25, 38, 63, .94) !important;
    background-image: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  body.statistic-page .table-wrap thead th,
  body.targets-page .table-wrap thead th {
    min-height: 44px !important;
    color: rgba(181, 197, 226, .78) !important;
    background: rgba(23, 35, 58, .98) !important;
  }

  body.statistic-page .table-wrap tbody td:first-child,
  body.targets-page .table-wrap tbody td:first-child {
    border-radius: 15px 0 0 15px !important;
  }

  body.statistic-page .table-wrap tbody td:last-child,
  body.targets-page .table-wrap tbody td:last-child {
    border-radius: 0 15px 15px 0 !important;
  }

  body.statistic-page .table-wrap th:first-child,
  body.statistic-page .table-wrap td:first-child,
  body.targets-page .table-wrap th:first-child,
  body.targets-page .table-wrap td:first-child {
    width: 270px !important;
  }

  body.statistic-page .table-wrap td::before,
  body.statistic-page .table-wrap td::after,
  body.targets-page .table-wrap td::before,
  body.targets-page .table-wrap td::after,
  body.statistic-page .table-wrap tr::before,
  body.statistic-page .table-wrap tr::after,
  body.targets-page .table-wrap tr::before,
  body.targets-page .table-wrap tr::after {
    content: none !important;
    display: none !important;
  }
}

@media (max-width: 767px) {
  body.home-no-js .home-v2-top-block {
    width: calc(100% - 24px) !important;
    padding-top: 18px !important;
  }

  body.home-no-js .home-v2-hero-left h1 {
    font-size: clamp(34px, 9.5vw, 42px) !important;
    text-wrap: pretty !important;
  }

  body.home-no-js .home-v2-hero-left h3 {
    font-size: clamp(19px, 5.3vw, 23px) !important;
  }

  body.home-no-js .static-hero-art img {
    width: min(430px, 100%) !important;
  }

  body.home-no-js .home-v2-description {
    font-size: 15px !important;
    line-height: 1.55 !important;
  }

  body.home-no-js .home-v2-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.home-no-js .home-v2-actions .home-v2-btn {
    width: 100% !important;
    min-height: 48px !important;
  }

  body.statistic-page .title,
  body.targets-page .title {
    max-width: 100% !important;
    font-size: clamp(30px, 9vw, 38px) !important;
    line-height: 1.08 !important;
    text-align: center !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
  }

  body.statistic-page .sub,
  body.targets-page .sub {
    max-width: 100% !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
    text-align: center !important;
  }

  body.statistic-page .dashboard-summary-primary {
    grid-template-columns: 1fr !important;
  }

  body.statistic-page .table-wrap,
  body.targets-page .table-wrap {
    padding: 9px !important;
  }

  body.statistic-page .table-wrap table,
  body.targets-page .table-wrap table {
    width: 1100px !important;
    min-width: 1100px !important;
  }

  /* Override the legacy mobile card layout: keep the desktop table intact and scroll it. */
  html body.statistic-page.statistic-page .table-wrap.table-wrap table,
  html body.targets-page.targets-page .table-wrap.table-wrap table {
    display: table !important;
    width: 1100px !important;
    min-width: 1100px !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table thead,
  html body.targets-page.targets-page .table-wrap.table-wrap table thead {
    display: table-header-group !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody,
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody {
    display: table-row-group !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table thead tr:nth-child(n),
  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody tr:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table thead tr:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody tr:nth-child(n) {
    display: table-row !important;
    grid-template-columns: none !important;
    grid-template-areas: none !important;
    place-items: initial !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table thead tr:nth-child(n) > th:nth-child(n),
  html body.statistic-page.statistic-page .table-wrap.table-wrap table tbody tr:nth-child(n) > td:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table thead tr:nth-child(n) > th:nth-child(n),
  html body.targets-page.targets-page .table-wrap.table-wrap table tbody tr:nth-child(n) > td:nth-child(n) {
    display: table-cell !important;
    flex: none !important;
    grid-area: auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 13px 12px !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }

  html body.statistic-page.statistic-page .table-wrap.table-wrap table tr:nth-child(n) > :first-child,
  html body.targets-page.targets-page .table-wrap.table-wrap table tr:nth-child(n) > :first-child {
    width: 270px !important;
  }

  /* Token details must use the complete viewport width before the chart stacks. */
  html:has(.token-page),
  body:has(.token-page),
  body:has(.token-page) #root,
  body:has(.token-page) .app-shell,
  .token-page,
  .token-page main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  .token-page .container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding-inline: 12px !important;
  }

  .token-page .tp-grid,
  .token-page .token-page-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 16px !important;
  }

  .token-page .tp-col-info,
  .token-page .tp-col-chart,
  .token-page .tp-col-links,
  .token-page .token-sidebar,
  .token-page .chart-container,
  .token-page .chart-iframe {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
    transform: none !important;
  }

  .token-page .chart-container {
    overflow: hidden !important;
  }

  .token-page .chart-iframe {
    display: block !important;
    min-height: 760px !important;
    height: 88svh !important;
    border: 0 !important;
  }
}
