.market-header {
  position: sticky;
  top: 0;
  z-index: 1050;
  background: var(--mk-surface);
  border-bottom: 1px solid var(--mk-border);
}

.market-notify-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
  line-height: 1;
}

.market-header-top {
  min-height: 28px;
  border-bottom: 1px solid var(--mk-border);
  background: var(--mk-surface);
  font-size: 0.78rem;
}

.market-header-top a {
  color: var(--mk-muted);
  text-decoration: none;
  line-height: 28px;
}

.market-header-top a:hover {
  color: #1d4ed8;
}

.market-header-main {
  background: var(--mk-surface);
}

.market-header-row {
  min-height: 56px;
  display: grid;
  grid-template-columns: auto 38px minmax(420px, 620px) auto;
  gap: 5px;
  align-items: center;
}

.market-menu-btn {
  width: 34px;
  height: 34px;
  border: 1px solid #d3dae5 !important;
  background: #fff !important;
  color: #243041 !important;
  border-radius: 6px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.market-menu-btn i {
  font-size: 1.3rem;
}

.market-logo-link {
  text-decoration: none;
  color: #111827;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  min-width: 132px;
  margin-left: 0;
  min-height: 34px;
}

.market-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

.market-search {
  width: 100%;
  max-width: 580px;
  justify-self: start;
}

.market-search .input-group {
  border: 1px solid #cfd8e6;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  min-height: 34px;
  align-items: stretch;
}

.market-search .form-control {
  border: 0 !important;
  min-height: 34px;
  font-size: 0.83rem;
  padding-left: 10px;
}

.market-search-cat {
  max-width: 145px;
  border: 0 !important;
  border-left: 1px solid #e2e8f0 !important;
  min-height: 34px;
  font-size: 0.78rem;
  background: #f8fafc;
}

.market-search-btn {
  min-width: 34px;
  height: 34px;
  border: 0 !important;
  background: #1f6fe5 !important;
  color: #fff !important;
  border-radius: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.market-search-btn:hover {
  background: #1b63cc !important;
}

.market-actions {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  justify-self: end;
  padding-left: 2px;
  min-height: 34px;
  margin-right: 0;
}

.market-account-menu {
  min-width: 280px;
  padding: 8px;
  margin-top: 5px;
}

.market-account-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 9px 10px;
}

.market-account-link i {
  width: 18px;
  text-align: center;
  color: #1f6fe5;
  font-size: 1.08rem;
}

.market-hover-menu {
  position: relative;
}

.market-hover-menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 7px;
}

.market-hover-menu:focus-within .dropdown-menu {
  display: block;
  margin-top: 5px;
}

.market-action {
  min-height: 34px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--mk-text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.76rem;
  line-height: 1;
  white-space: nowrap;
}

.market-account-trigger {
  gap: 8px;
  padding: 4px 8px;
}

.market-account-avatar {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e7f0ff;
  border: 1px solid #cfe1ff;
  color: #1f6fe5;
  flex: 0 0 auto;
}

.market-account-avatar i {
  font-size: 0.92rem;
}

.market-account-copy {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.05;
}

.market-account-copy strong {
  font-size: 0.75rem;
  font-weight: 700;
  color: #0f172a;
}

.market-account-copy small {
  font-size: 0.65rem;
  color: #64748b;
}

.market-action span {
  line-height: 1.1;
}

.market-action i {
  font-size: 1.08rem;
  color: var(--mk-primary);
}

.market-action:hover {
  background: color-mix(in srgb, var(--mk-surface) 84%, var(--mk-primary) 16%);
  color: var(--mk-text);
}

.market-theme-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #d3dae5 !important;
  background: #fff !important;
  color: #334155 !important;
  border-radius: 6px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.market-theme-btn i {
  font-size: 1.02rem;
}

.market-hover-menu .dropdown-menu,
.market-cat-drop .dropdown-menu {
  display: none;
}

.market-cat-drop {
  position: relative;
}

.market-cat-drop::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 6px;
}

@media (min-width: 992px) {
  .market-hover-menu:hover .dropdown-menu,
  .market-cat-drop:hover .dropdown-menu {
    display: block;
    margin-top: 5px;
  }
}

.market-mini-menu {
  border: 1px solid #d9dfeb;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.15);
  padding: 6px;
  min-width: 180px;
}

.market-categories-menu {
  min-width: 980px;
  max-width: 1080px;
  width: min(1080px, calc(100vw - 36px));
  border: 1px solid #d9dfeb;
  border-radius: 10px;
  box-shadow: 0 9px 20px rgba(2, 10, 28, 0.13);
  padding: 10px;
  margin-top: 8px;
  left: 0;
  right: auto;
}

.market-categories-shell {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  min-height: 420px;
}

.market-categories-left {
  border-right: 1px solid #e2e8f0;
  padding: 6px;
  max-height: 360px;
  overflow-y: auto;
}

.market-categories-filter-wrap {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  padding: 0 0 8px;
}

.market-categories-filter {
  border-radius: 8px;
  border-color: #d5dfec;
  font-size: 0.78rem;
}

.market-root-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  color: #1f2937;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.market-root-item i {
  font-size: 0.72rem;
  color: #64748b;
}

.market-root-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-root-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.market-root-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  color: #1f6fe5;
  background: #e4eeff;
}

.market-root-item:hover,
.market-root-item.is-active {
  background: #eef4ff;
  border-color: #d7e7ff;
  color: #1f6fe5;
  transform: translateX(2px);
}

.market-categories-right {
  padding: 10px 12px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.market-categories-head {
  padding: 2px 0 8px;
  border-bottom: 1px solid #edf2f7;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.market-root-link {
  color: #0b1b35;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.01em;
  text-shadow: 0 0 0 transparent;
  line-height: 1.28;
  display: block;
  width: 100%;
  text-align: center;
  padding: 1px 0;
  white-space: nowrap;
  overflow: visible;
}

.market-root-link:hover {
  color: #1f6fe5;
}

.market-categories-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.market-sub-list {
  list-style: none;
  margin: 0;
  padding: 2px 0 0;
  columns: 2;
  column-gap: 18px;
}

.market-sub-list li {
  break-inside: avoid;
  margin-bottom: 5px;
}

.market-sub-list a {
  text-decoration: none;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.42;
}

.market-sub-list a:hover {
  color: #1f6fe5;
}

.market-categories-left::-webkit-scrollbar {
  width: 8px;
}

.market-categories-left::-webkit-scrollbar-thumb {
  background: #d8e2f0;
  border-radius: 999px;
}

.market-lang-menu {
  left: auto !important;
  right: 0 !important;
  min-width: 128px;
}

.market-hover-menu .market-lang-menu {
  transform: none !important;
}

.market-lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.market-lang-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid #d5dfec;
  background: #f8fafc;
  color: #1f6fe5;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.market-sub-empty {
  color: #94a3b8;
  font-size: 0.8rem;
}

.market-category-preview img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dbe5f1;
}

[data-ui-mode="dark"] .market-header,
[data-ui-mode="dark"] .market-header-top,
[data-ui-mode="dark"] .market-header-main,
[data-bs-theme="dark"] .market-header,
[data-bs-theme="dark"] .market-header-top,
[data-bs-theme="dark"] .market-header-main {
  background: #13233f;
  border-color: #2f4668;
}

html[data-ui-mode="dark"] body.theme-root .market-header,
html[data-ui-mode="dark"] body.theme-root .market-header-top,
html[data-ui-mode="dark"] body.theme-root .market-header-main,
html[data-bs-theme="dark"] body.theme-root .market-header,
html[data-bs-theme="dark"] body.theme-root .market-header-top,
html[data-bs-theme="dark"] body.theme-root .market-header-main {
  background: #13233f !important;
  border-color: #2f4668 !important;
}

[data-ui-mode="dark"] .market-header-top a,
[data-bs-theme="dark"] .market-header-top a {
  color: #a8b6c9;
}

[data-ui-mode="dark"] .market-logo-link,
[data-bs-theme="dark"] .market-logo-link {
  color: #e5edf8;
}

[data-ui-mode="dark"] .market-menu-btn,
[data-ui-mode="dark"] .market-theme-btn,
[data-bs-theme="dark"] .market-menu-btn,
[data-bs-theme="dark"] .market-theme-btn {
  background: #1b283a !important;
  border-color: #33465f !important;
  color: #d7e2f1 !important;
}

[data-ui-mode="dark"] .market-search .input-group,
[data-bs-theme="dark"] .market-search .input-group {
  background: #1b283a;
  border-color: #33465f;
}

html[data-ui-mode="dark"] body.theme-root .market-search .input-group,
html[data-bs-theme="dark"] body.theme-root .market-search .input-group {
  background: #1b283a !important;
  border-color: #33465f !important;
}

[data-ui-mode="dark"] .market-search .form-control,
[data-bs-theme="dark"] .market-search .form-control {
  background: #1b283a;
  color: #dce6f2;
}

html[data-ui-mode="dark"] body.theme-root .market-search .form-control,
html[data-bs-theme="dark"] body.theme-root .market-search .form-control {
  background: #1b283a !important;
  color: #dce6f2 !important;
}

[data-ui-mode="dark"] .market-search .form-control::placeholder,
[data-bs-theme="dark"] .market-search .form-control::placeholder {
  color: #8fa1b8;
}

[data-ui-mode="dark"] .market-search-cat,
[data-bs-theme="dark"] .market-search-cat {
  background: #223045;
  color: #d3deec;
  border-left-color: #33465f !important;
}

html[data-ui-mode="dark"] body.theme-root .market-search-cat,
html[data-bs-theme="dark"] body.theme-root .market-search-cat {
  background: #223045 !important;
  color: #d3deec !important;
  border-left-color: #33465f !important;
}

[data-ui-mode="dark"] .market-action,
[data-bs-theme="dark"] .market-action {
  color: #d3deec;
}

html[data-ui-mode="dark"] body.theme-root .market-action,
html[data-bs-theme="dark"] body.theme-root .market-action {
  color: #d3deec !important;
}

[data-ui-mode="dark"] .market-action:hover,
[data-bs-theme="dark"] .market-action:hover {
  background: #26364b;
  color: #f0f5fb;
}

[data-ui-mode="dark"] .market-mini-menu,
[data-ui-mode="dark"] .market-categories-menu,
[data-bs-theme="dark"] .market-mini-menu,
[data-bs-theme="dark"] .market-categories-menu {
  background: #1a2738;
  border-color: #33465f;
  box-shadow: 0 12px 24px rgba(2, 8, 20, 0.45);
}

[data-ui-mode="dark"] .market-account-link i,
[data-bs-theme="dark"] .market-account-link i {
  color: #9fc3ff;
}

[data-ui-mode="dark"] .market-account-avatar,
[data-bs-theme="dark"] .market-account-avatar {
  background: #1f3352;
  border-color: #35507a;
  color: #9fc3ff;
}

[data-ui-mode="dark"] .market-account-copy strong,
[data-bs-theme="dark"] .market-account-copy strong {
  color: #e5efff;
}

[data-ui-mode="dark"] .market-account-copy small,
[data-bs-theme="dark"] .market-account-copy small {
  color: #9eb2cf;
}

[data-ui-mode="dark"] .market-account-link,
[data-bs-theme="dark"] .market-account-link {
  color: #dbe7f7;
}

[data-ui-mode="dark"] .market-account-link:hover,
[data-bs-theme="dark"] .market-account-link:hover {
  background: #26364b;
  color: #ffffff;
}

html[data-ui-mode="dark"] body.theme-root .market-mini-menu,
html[data-ui-mode="dark"] body.theme-root .market-categories-menu,
html[data-bs-theme="dark"] body.theme-root .market-mini-menu,
html[data-bs-theme="dark"] body.theme-root .market-categories-menu {
  background: #1a2738 !important;
  border-color: #33465f !important;
}

[data-ui-mode="dark"] .market-mini-menu .dropdown-item,
[data-ui-mode="dark"] .market-root-item,
[data-ui-mode="dark"] .market-sub-list a,
[data-ui-mode="dark"] .market-root-link,
[data-bs-theme="dark"] .market-mini-menu .dropdown-item,
[data-bs-theme="dark"] .market-root-item,
[data-bs-theme="dark"] .market-sub-list a,
[data-bs-theme="dark"] .market-root-link {
  color: #d7e2f0;
}

[data-ui-mode="dark"] .market-mini-menu .dropdown-item:hover,
[data-ui-mode="dark"] .market-root-item:hover,
[data-ui-mode="dark"] .market-root-item.is-active,
[data-ui-mode="dark"] .market-sub-list a:hover,
[data-bs-theme="dark"] .market-mini-menu .dropdown-item:hover,
[data-bs-theme="dark"] .market-root-item:hover,
[data-bs-theme="dark"] .market-root-item.is-active,
[data-bs-theme="dark"] .market-sub-list a:hover {
  background: #26364b;
  color: #b9cbdf;
}

[data-ui-mode="dark"] .market-categories-left,
[data-bs-theme="dark"] .market-categories-left {
  border-right-color: #33465f;
}

[data-ui-mode="dark"] .market-categories-filter-wrap,
[data-bs-theme="dark"] .market-categories-filter-wrap {
  background: #1a2738;
}

[data-ui-mode="dark"] .market-categories-filter,
[data-bs-theme="dark"] .market-categories-filter {
  background: #223045;
  border-color: #33465f;
  color: #dce6f2;
}

[data-ui-mode="dark"] .market-categories-head,
[data-bs-theme="dark"] .market-categories-head {
  border-bottom-color: #33465f;
}

[data-ui-mode="dark"] .market-root-link,
[data-bs-theme="dark"] .market-root-link {
  color: #f1f6ff;
}

[data-ui-mode="dark"] .market-lang-flag,
[data-bs-theme="dark"] .market-lang-flag {
  background: #22385d;
  border-color: #3d557d;
  color: #d8e6fb;
}

[data-ui-mode="dark"] .market-root-item i,
[data-bs-theme="dark"] .market-root-item i {
  color: #95a8bf;
}

[data-ui-mode="dark"] .market-root-count,
[data-bs-theme="dark"] .market-root-count {
  color: #e7eef9;
  background: #2a3a52;
}

[data-ui-mode="dark"] .market-sub-empty,
[data-bs-theme="dark"] .market-sub-empty {
  color: #95a8bf;
}

[data-ui-mode="dark"] .market-category-preview img,
[data-bs-theme="dark"] .market-category-preview img {
  border-color: #33465f;
}

.market-drawer .offcanvas-header {
  background: #f8fafc;
}

.market-drawer-cats .accordion-button {
  box-shadow: none !important;
  background: transparent !important;
  font-weight: 600;
}

.market-drawer-cats .accordion-item {
  border: 0;
  border-bottom: 1px solid #edf1f8;
}

.app-main {
  padding-top: 14px !important;
}

html[data-bs-theme="light"] body.app-shell .app-main,
html[data-ui-mode="light"] body.app-shell .app-main {
  padding-top: 18px !important;
}

html[data-bs-theme="dark"] body.app-shell .app-main,
html[data-ui-mode="dark"] body.app-shell .app-main {
  padding-top: 18px !important;
}

html[data-bs-theme="dark"] body.app-shell,
html[data-ui-mode="dark"] body.app-shell {
  background: #0b1220 !important;
  background-image: none !important;
}

html[data-bs-theme="dark"] body.app-shell.theme-root,
html[data-ui-mode="dark"] body.app-shell.theme-root {
  color: #e7ecff;
}

html[data-bs-theme="dark"] body.app-shell .app-main,
html[data-ui-mode="dark"] body.app-shell .app-main,
html[data-bs-theme="dark"] body.app-shell .app-footer,
html[data-ui-mode="dark"] body.app-shell .app-footer {
  background: transparent !important;
}

@media (min-width: 1600px) {
  .market-header-row {
    grid-template-columns: auto 42px minmax(360px, 620px) auto;
  }
}

@media (max-width: 1199.98px) {
  .market-logo-link { margin-left: 0; }
  .market-actions { margin-right: 0; }

  .market-header-row {
    grid-template-columns: auto 40px minmax(250px, 1fr) auto;
    gap: 8px;
  }

  .market-search {
    max-width: 430px;
  }

  .market-search-cat {
    max-width: 130px;
  }
}

@media (max-width: 991.98px) {
  .market-header-row {
    min-height: 54px;
    grid-template-columns: 38px auto 1fr auto;
    gap: 8px;
  }

  .market-logo {
    height: 30px;
  }

  .market-search {
    max-width: none;
  }

  .market-search .form-control {
    min-height: 34px;
    font-size: 0.85rem;
  }

  .market-search-cat {
    display: none;
  }

  .market-search-btn {
    min-width: 40px;
  }
}

@media (max-width: 575.98px) {
  .market-header-row {
    grid-template-columns: 38px auto 1fr;
  }

  .market-actions {
    display: none;
  }
}
