:root {
  --ink: #17211f;
  --muted: #75807d;
  --cream: #f2efe8;
  --paper: #fbfaf7;
  --surface: #fff;
  --line: #e5e0d7;
  --green: #14765a;
  --green2: #e5f2ec;
  --red: #bd443d;
  --red2: #fae9e6;
  --gold: #a98743;
  --shadow: 0 12px 34px rgba(31, 39, 36, .07);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.75 Vazirmatn, Tahoma, sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  min-width: 0;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

header,
footer {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
}

header {
  min-height: 88px;
  padding: 10px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
}

.brand > span:last-child {
  min-width: 0;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 450;
}

.brand-copy b {
  display: block;
}

.market {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding: 68px 30px 76px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-head h2 {
  margin: 4px 0 0;
  font-size: clamp(29px, 3.2vw, 40px);
  line-height: 1.25;
  letter-spacing: -.035em;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}

.section-head button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 15px;
  background: var(--surface);
  color: var(--ink);
}

.section-head button:hover {
  border-color: color-mix(in srgb, var(--green) 38%, var(--line));
}

.toolbar {
  margin: 27px 0 16px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background: var(--cream);
}

.tabs {
  min-width: 0;
  display: flex;
  gap: 3px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.tabs button {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.tabs .active {
  background: var(--surface);
  color: var(--green);
  box-shadow: 0 3px 12px rgba(39, 32, 18, .055);
}

.toolbar label {
  width: min(270px, 34%);
  min-width: 180px;
  padding: 7px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  color: var(--muted);
}

.toolbar label:focus-within {
  border-color: color-mix(in srgb, var(--green) 38%, transparent);
}

.toolbar input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(195px, 100%), 1fr));
  gap: 10px;
}

.card {
  min-width: 0;
  padding: 15px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.card:hover {
  border-color: color-mix(in srgb, var(--green) 26%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.card-top {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.asset {
  min-width: 0;
}

.asset h3 {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.trend {
  flex: 0 0 auto;
  padding: 3px 5px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 650;
  line-height: 1.55;
  white-space: nowrap;
}

.trend::before {
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
  content: "";
  vertical-align: 1px;
}

.trend.up {
  background: var(--green2);
  color: var(--green);
}

.trend.down {
  background: var(--red2);
  color: var(--red);
}

.trend.flat {
  background: var(--cream);
  color: var(--muted);
}

.prices {
  min-width: 0;
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 5px;
  direction: rtl;
}

.price-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.price-value {
  min-width: 0;
  display: flex;
  align-items: flex-end;
  justify-content: end;
  flex-direction: column;
  gap: 0;
  direction: ltr;
}

.price-value strong {
  max-width: 100%;
  color: var(--ink);
  font-size: clamp(18px, 1.65vw, 23px);
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  letter-spacing: -.035em;
  line-height: 1.2;
  white-space: nowrap;
}

.price-value.price-long strong {
  font-size: clamp(16px, 1.4vw, 20px);
}

.price-value.price-xlong strong {
  font-size: clamp(13px, 1.15vw, 17px);
}

.price-value.price-xxlong strong {
  font-size: clamp(11px, 1vw, 15px);
}

.price-value small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
  direction: rtl;
}

.state {
  padding: 56px 12px;
  text-align: center;
  color: var(--muted);
}

.site-footer {
  position: relative;
  padding: 24px 30px 34px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.concealed-site-note {
  position: absolute;
  inset-inline-start: 2px;
  bottom: 1px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  color: var(--paper);
  font-size: 1px;
  line-height: 1;
  user-select: none;
}

.footer-brand {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.footer-brand > strong {
  color: var(--ink);
  font-size: 14px;
}

.footer-brand > span {
  font-size: 10px;
}

.source-note {
  margin-top: 5px;
  color: color-mix(in srgb, var(--muted) 70%, transparent);
  font-size: 8px;
  line-height: 1.7;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-link {
  min-width: 118px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.social-link svg {
  width: 25px;
  height: 25px;
  flex: 0 0 auto;
  fill: currentColor;
}

.social-link span {
  display: grid;
  line-height: 1.3;
}

.social-link small {
  color: var(--muted);
  font-size: 7px;
}

.social-link strong {
  font-size: 10px;
}

.social-link.telegram {
  color: #229ed9;
}

.social-link.whatsapp {
  color: #20b85a;
}

.social-link.instagram {
  color: #d62976;
}

.social-link:hover {
  border-color: currentColor;
  box-shadow: 0 8px 24px color-mix(in srgb, currentColor 12%, transparent);
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  .market {
    padding: 52px 18px 60px;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar label {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .market {
    padding-inline: 14px;
  }

  .section-head {
    align-items: center;
  }

  .section-head h2 {
    font-size: 29px;
  }

  .section-head button {
    padding-inline: 11px;
    font-size: 11px;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .card {
    padding: 12px;
    border-radius: 13px;
  }

  .asset h3 {
    font-size: 14px;
  }

  .price-value strong {
    font-size: clamp(16px, 4.8vw, 19px);
  }

  .price-value.price-long strong {
    font-size: clamp(14px, 4vw, 17px);
  }

  .price-value.price-xlong strong {
    font-size: clamp(11px, 3.4vw, 14px);
  }

  .price-value.price-xxlong strong {
    font-size: clamp(9px, 2.8vw, 12px);
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 14px;
  }

  .social-links {
    width: 100%;
    flex-wrap: wrap;
  }

  .social-link {
    min-width: min(118px, 100%);
    flex: 1 1 118px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
