:root {
  --page-bg: #03060c;
  --panel: rgba(7, 12, 23, 0.72);
  --panel-strong: rgba(10, 16, 29, 0.88);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f7f9ff;
  --muted: #aeb6c7;
  --cyan: #2fc7ff;
  --green: #66f2bd;
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page-bg);
}

body {
  min-height: var(--bs-small-viewport-height, 100vh);
  margin: 0;
  color: var(--text);
  font-family: var(--bs-site-font, "Inter", "Segoe UI", Arial, sans-serif);
  background: var(--page-bg);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.background {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.background::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 4, 10, 0.18) 0%, rgba(2, 4, 10, 0.26) 52%, rgba(2, 4, 10, 0.48) 100%),
    rgba(8, 12, 24, 0.04);
  backdrop-filter: blur(1px) saturate(125%);
}

.market-page {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: var(--bs-small-viewport-height, 100vh);
  margin: 0 auto;
  padding: 116px 24px 54px;
}

.market-grid,
.market-empty {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.market-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.market-kicker {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.market-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.8rem, 7vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 18px 52px rgba(0, 0, 0, 0.56);
}

.market-heading p {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.market-type-slider {
  --market-type-width: clamp(150px, 20vw, 220px);
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.market-type-slider__viewport {
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}

.market-type-slider__track {
  display: flex;
  width: max-content;
  min-width: 100%;
  padding-inline: max(0px, calc(50% - var(--market-type-width) / 2));
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.market-type-slider[data-selected-type="localization"] .market-type-slider__track {
  transform: translate3d(calc(0px - var(--market-type-width)), 0, 0);
}

.market-type-slider__item {
  display: grid;
  align-items: center;
  justify-items: center;
  flex: 0 0 var(--market-type-width);
  gap: 3px;
  min-width: 0;
  min-height: 58px;
  padding: 6px 12px;
  color: rgba(255, 255, 255, 0.42);
  text-decoration: none;
  font-weight: 900;
  transition: color 0.24s ease, transform 0.24s ease, opacity 0.24s ease;
}

.market-type-slider__item span,
.market-type-slider__item small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-type-slider__item span {
  font-size: 15px;
}

.market-type-slider__item small {
  color: rgba(255, 255, 255, 0.34);
  font-size: 11px;
  line-height: 1.1;
}

.market-type-slider__item:hover,
.market-type-slider__item:focus-visible {
  color: rgba(255, 255, 255, 0.78);
  outline: none;
}

.market-type-slider__item.is-active {
  color: #fff;
  transform: scale(1.08);
}

.market-type-slider__item.is-active span {
  color: var(--cyan);
  font-size: 18px;
}

.market-type-slider__item.is-active small {
  color: rgba(255, 255, 255, 0.58);
}

.market-type-slider__arrow {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.market-type-slider__arrow:hover {
  color: var(--cyan);
}

.market-type-slider__arrow[data-market-type-previous]:hover {
  transform: translateX(-2px);
}

.market-type-slider__arrow[data-market-type-next]:hover {
  transform: translateX(2px);
}

.market-type-slider__arrow:focus-visible {
  color: var(--cyan);
  outline: 2px solid rgba(47, 199, 255, 0.65);
  outline-offset: 2px;
}

.market-grid {
  display: grid;
  gap: 0;
  padding: 0 24px;
  border-radius: var(--radius);
  background: var(--panel-strong);
}

.market-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  min-height: 170px;
  padding: 24px 0;
}

.market-card + .market-card {
  border-top: 1px solid rgba(255, 255, 255, 0.11);
}

.market-card--cfg {
  --market-accent: var(--cyan);
}

.market-card--localization {
  --market-accent: var(--green);
}

.market-card__body {
  min-width: 0;
}

.market-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.market-card__top p {
  margin: 0 0 5px;
  color: var(--market-accent, var(--cyan));
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.market-card__top h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.market-card__badge {
  color: var(--market-accent, var(--cyan));
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.market-card__description {
  margin: 14px 0;
  color: rgba(232, 238, 250, 0.76);
  line-height: 1.5;
}

.market-card__meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, max-content));
  gap: 18px 28px;
  margin: 0;
}

.market-card__meta div {
  min-width: 0;
}

.market-card__meta dt {
  margin-bottom: 4px;
  color: rgba(220, 229, 247, 0.5);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.market-card__meta dd {
  margin: 0;
  color: rgba(247, 249, 255, 0.84);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.market-card__actions {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  min-width: 150px;
}

.market-card__actions strong {
  color: #fff;
  font-size: 22px;
  white-space: nowrap;
}

.market-card__actions form {
  width: 100%;
}

.market-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(47, 199, 255, 0.36);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(47, 199, 255, 0.24), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.06);
  text-decoration: none;
  font-weight: 950;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.market-button:hover {
  border-color: rgba(47, 199, 255, 0.62);
  box-shadow: 0 0 30px rgba(47, 199, 255, 0.13);
}

.market-button--muted,
.market-button:disabled {
  cursor: default;
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(247, 249, 255, 0.72);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.market-empty {
  padding: 32px;
  border-radius: var(--radius);
}

.market-grid > .market-empty {
  padding-right: 8px;
  padding-left: 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.market-empty h2 {
  margin: 0 0 10px;
  font-size: 32px;
}

.market-empty p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .market-page {
    width: min(100%, 680px);
    padding: 98px 12px 54px;
  }

  .market-heading {
    display: block;
  }

  .market-card {
    grid-template-columns: 1fr;
  }

  .market-card__actions {
    grid-column: auto;
    align-items: stretch;
    min-width: 0;
  }

  .market-card__meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .market-page {
    width: min(100% - 18px, 480px);
  }

  .market-type-slider {
    --market-type-width: 150px;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .market-type-slider__arrow {
    width: 40px;
    height: 40px;
  }

  .market-card {
    grid-template-columns: 1fr;
  }

  .market-grid {
    padding: 0 18px;
  }

  .market-card__top {
    display: block;
  }

  .market-card__badge {
    margin-top: 10px;
  }

  .market-card__meta {
    grid-template-columns: 1fr 1fr;
  }
}
