/* —— Marketplace: Domains & Servers —— */

body[data-view="domains"],
body[data-view="servers"] {
  --mk-surface: rgba(12, 12, 20, 0.78);
  --mk-surface-2: rgba(255, 255, 255, 0.035);
  --mk-line: rgba(255, 255, 255, 0.08);
  --mk-line-2: rgba(255, 255, 255, 0.14);
  --mk-text-2: #c4c4d0;
  --mk-radius: 14px;
}

body[data-view="domains"] .bg,
body[data-view="servers"] .bg {
  opacity: 0.4;
}

body[data-view="domains"] .landing,
body[data-view="servers"] .landing {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  height: 100dvh;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}

body[data-view="domains"] .topbar--landing,
body[data-view="servers"] .topbar--landing {
  position: sticky;
  top: 0;
  z-index: 20;
  flex-shrink: 0;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background 0.28s ease,
    border-color 0.28s ease;
}

body.is-topbar-solid[data-view="domains"] .topbar--landing,
body.is-topbar-solid[data-view="servers"] .topbar--landing {
  background: rgba(6, 6, 11, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--mk-line);
}

body[data-view="domains"] .page,
body[data-view="servers"] .page {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px) 56px;
  box-sizing: border-box;
  flex: 0 0 auto;
}

.page--market {
  font-variant-numeric: tabular-nums;
}

/* Hero */
.mk-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: clamp(40px, 7vw, 76px) 0 clamp(28px, 4vw, 40px);
}

.mk-eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--violet-hot);
}

.mk-title {
  margin: 0;
  max-width: 24ch;
  text-wrap: balance;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text);
}

.mk-lead {
  margin: 16px 0 0;
  max-width: 54ch;
  text-wrap: balance;
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.55;
  color: var(--muted);
}

/* Search */
.mk-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(680px, 100%);
  margin-top: 32px;
  padding: 6px 6px 6px 50px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.mk-search__ico {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b6b7b;
}

.mk-search input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  color: #0c0c14;
}

.mk-search input::placeholder {
  color: #9898a6;
}

.mk-search .mk-btn {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
}

.mk-quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.mk-quick button {
  padding: 4px 2px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.mk-quick button b {
  font-weight: 600;
  color: var(--text);
}

.mk-quick button:hover {
  color: var(--text);
}

/* Buttons */
.mk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.mk-btn--primary {
  background: var(--violet);
  color: #fff;
}

.mk-btn--primary:hover {
  background: #7c4ef0;
}

.mk-btn--ghost {
  background: transparent;
  border-color: var(--mk-line-2);
  color: var(--text);
}

.mk-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.24);
}

.mk-btn--sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 8px;
}

.mk-btn:focus-visible,
.mk-tab:focus-visible,
.mk-seg__btn:focus-visible,
.mk-quick button:focus-visible {
  outline: 2px solid var(--violet-hot);
  outline-offset: 2px;
}

/* Search results */
.mk-results {
  margin: 0 0 40px;
  padding: 20px 24px 8px;
  background: var(--mk-surface);
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mk-results[hidden] {
  display: none;
}

.mk-results__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--mk-line);
}

.mk-results__head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.mk-results__error {
  margin: 0 0 12px;
  color: #fca5a5;
  font-size: 14px;
}

.mk-results__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mk-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--mk-line);
}

.mk-result:last-child {
  border-bottom: 0;
}

.mk-result.is-first .mk-domain {
  font-size: 19px;
}

.mk-result__price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.mk-result__price strong {
  font-size: 15px;
  font-weight: 600;
}

.mk-result__price em {
  font-style: normal;
  font-weight: 400;
  font-size: 13px;
  color: var(--muted);
}

.mk-result__price small {
  font-size: 12px;
  color: var(--muted);
}

.mk-domain {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.mk-domain span {
  color: var(--violet-hot);
}

/* Tabs */
.mk-tabs {
  display: flex;
  gap: 28px;
  margin: 8px 0 0;
  border-bottom: 1px solid var(--mk-line);
  overflow-x: auto;
  scrollbar-width: none;
}

.mk-tabs::-webkit-scrollbar {
  display: none;
}

.mk-tab {
  position: relative;
  flex-shrink: 0;
  padding: 14px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.mk-tab:hover {
  color: var(--text);
}

.mk-tab[aria-selected="true"] {
  color: var(--text);
}

.mk-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--violet);
}

/* Panels */
.mk-panel {
  padding-top: 28px;
}

.mk-panel[hidden] {
  display: none;
}

.mk-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 18px;
}

.mk-h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.mk-h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.mk-sub {
  margin: 6px 0 0;
  max-width: 62ch;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.mk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mk-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 4px 0 12px;
  border: 1px solid var(--mk-line-2);
  border-radius: 9px;
  background: var(--mk-surface);
  font-size: 13px;
  color: var(--muted);
}

.mk-field select {
  height: 100%;
  padding: 0 26px 0 2px;
  border: 0;
  outline: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c4c4d0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.mk-field select option {
  background: #12121a;
  color: var(--text);
}

/* Segmented control */
.mk-seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--mk-line-2);
  border-radius: 10px;
  background: var(--mk-surface);
}

.mk-seg__btn {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.mk-seg__btn:hover {
  color: var(--text);
}

.mk-seg__btn[aria-selected="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* Tables */
.mk-table-wrap {
  overflow-x: auto;
  background: var(--mk-surface);
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mk-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--mk-text-2);
}

.mk-table th {
  padding: 13px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--mk-surface-2);
  border-bottom: 1px solid var(--mk-line);
  white-space: nowrap;
}

.mk-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--mk-line);
  vertical-align: middle;
  white-space: nowrap;
}

.mk-table tbody tr:last-child td {
  border-bottom: 0;
}

.mk-table tbody tr {
  transition: background 0.12s ease;
}

.mk-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

.mk-table tbody tr.is-hl {
  background: rgba(139, 92, 246, 0.07);
}

.mk-table strong {
  font-weight: 600;
  color: var(--text);
}

.mk-table small {
  font-size: 12px;
  color: var(--muted);
}

.mk-table .is-num {
  text-align: right;
}

.mk-table .is-act {
  width: 1%;
  text-align: right;
}

.mk-table .is-muted {
  color: var(--muted);
}

.mk-empty {
  padding: 28px 20px !important;
  text-align: center;
  color: var(--muted);
}

.mk-ext,
.mk-plan {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mk-tag {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--violet-hot);
  background: rgba(139, 92, 246, 0.14);
  vertical-align: 1px;
}

.mk-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.mk-pill--rent {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.12);
}

.mk-pill--sale {
  color: #86efac;
  background: rgba(74, 222, 128, 0.12);
}

/* Callout */
.mk-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius);
  background: var(--mk-surface);
}

.mk-callout strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mk-callout p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* Sell */
.mk-sell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  padding: 32px;
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius);
  background: var(--mk-surface);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.mk-checks {
  margin: 20px 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.mk-checks li {
  position: relative;
  padding-left: 26px;
  font-size: 14px;
  color: var(--mk-text-2);
}

.mk-checks li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 12px;
  height: 7px;
  border-left: 2px solid var(--violet-hot);
  border-bottom: 2px solid var(--violet-hot);
  transform: rotate(-45deg);
}

.mk-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: mkstep;
  display: grid;
  gap: 0;
  align-content: start;
}

.mk-steps li {
  position: relative;
  padding: 0 0 22px 48px;
  counter-increment: mkstep;
}

.mk-steps li:last-child {
  padding-bottom: 0;
}

.mk-steps li::before {
  content: counter(mkstep);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--mk-line-2);
  background: rgba(12, 12, 20, 0.9);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.mk-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 30px;
  bottom: 0;
  width: 1px;
  background: var(--mk-line-2);
}

.mk-steps strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mk-steps p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

/* Sections */
.mk-section {
  margin-top: 64px;
}

.mk-section > .mk-h2 {
  margin-bottom: 20px;
}

.mk-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin: 0;
  padding: 24px 0 0;
  list-style: none;
  border-top: 1px solid var(--mk-line);
}

.mk-features__ico {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid var(--mk-line-2);
  color: var(--violet-hot);
}

.mk-features strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mk-features p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}

.mk-regions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--mk-line);
  border-radius: var(--mk-radius);
  background: var(--mk-surface);
  overflow: hidden;
}

.mk-regions li {
  padding: 20px;
}

.mk-regions li + li {
  border-left: 1px solid var(--mk-line);
}

.mk-regions strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.mk-regions span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.mk-facts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: 32px 0 0;
  padding: 0;
  list-style: none;
}

.mk-facts li {
  padding: 0 28px;
  text-align: center;
}

.mk-facts li + li {
  border-left: 1px solid var(--mk-line-2);
}

.mk-facts strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.mk-facts span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}

/* FAQ */
.mk-faq {
  border-top: 1px solid var(--mk-line);
}

.mk-faq details {
  border-bottom: 1px solid var(--mk-line);
}

.mk-faq summary {
  position: relative;
  padding: 18px 40px 18px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.mk-faq summary::-webkit-details-marker {
  display: none;
}

.mk-faq summary::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.mk-faq details[open] summary::after {
  transform: rotate(-135deg);
  margin-top: -2px;
}

.mk-faq details p {
  margin: -4px 0 18px;
  max-width: 70ch;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.mk-note {
  margin: 48px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Toast */
.mk-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 200;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--mk-line-2, rgba(255, 255, 255, 0.14));
  background: rgba(16, 16, 24, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  font-size: 14px;
  color: var(--text);
  transform: translate(-50%, 12px);
  opacity: 0;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.mk-toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mk-toast[hidden] {
  display: none;
}

/* Responsive */
@media (max-width: 900px) {
  .mk-features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mk-regions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mk-regions li:nth-child(3) {
    border-left: 0;
  }
  .mk-regions li:nth-child(n + 3) {
    border-top: 1px solid var(--mk-line);
  }
  .mk-sell {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px;
  }
}

@media (max-width: 600px) {
  .mk-search {
    flex-wrap: wrap;
    padding: 6px;
  }
  .mk-search__ico {
    top: 30px;
  }
  .mk-search input {
    padding-left: 42px;
  }
  .mk-search .mk-btn {
    width: 100%;
  }
  .mk-features,
  .mk-regions {
    grid-template-columns: minmax(0, 1fr);
  }
  .mk-regions li + li {
    border-left: 0;
    border-top: 1px solid var(--mk-line);
  }
  .mk-facts li {
    padding: 8px 16px;
  }
  .mk-result {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
  }
  .mk-result .mk-btn {
    grid-column: 1 / -1;
  }
  .mk-result__price {
    align-items: flex-end;
  }
  .mk-results {
    padding: 16px 16px 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mk-toast,
  .mk-tab,
  .mk-btn {
    transition: none;
  }
}

.no-market [data-nav="domains"],
.no-market [data-nav="servers"],
.no-market .page--market {
  display: none !important;
}
