:root {
  --ai-ms-bg: #ffffff;
  --ai-ms-text: #0b0b0d;
  --ai-ms-sub: rgba(11, 11, 13, 0.62);
  --ai-ms-border: rgba(11, 11, 13, 0.10);
  --ai-ms-shadow: 0 18px 60px rgba(0, 0, 0, 0.12);
  --ai-ms-radius: 18px;
  --ai-ms-focus: rgba(0, 122, 255, 0.35);
  --ai-ms-accent: #0a84ff;
}

html.ai-ms-open,
html.ai-ms-open body {
  overflow: hidden;
}

.ai-ms-icon {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999999;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ai-ms-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.ai-ms-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.12);
}
.ai-ms-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ai-ms-focus), 0 14px 38px rgba(0, 0, 0, 0.12);
}
.ai-ms-icon__glass {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
}
.ai-ms-icon__glass:before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(11, 11, 13, 0.70);
  border-radius: 999px;
}
.ai-ms-icon__glass:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  background: rgba(11, 11, 13, 0.70);
  right: -5px;
  bottom: -1px;
  transform: rotate(45deg);
  border-radius: 99px;
}

.ai-ms {
  position: fixed;
  inset: 0;
  z-index: 999998;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--ai-ms-text);
  top: 105px;
  height: auto;
}

.ai-ms__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.20);
  animation: ai-ms-fade 140ms ease-out both;
}

.ai-ms__panel {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  animation: ai-ms-slide 180ms cubic-bezier(.2,.8,.2,1) both;
  width: 100%;
}

.ai-ms__top {
  border-bottom: 1px solid var(--ai-ms-border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.ai-ms__top-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 18px 18px;
}

.ai-ms__nav {
  display: grid;
  grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) minmax(120px, 320px);
  gap: 14px;
  align-items: center;
}

.ai-ms__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ai-ms-text);
  font-weight: 650;
  letter-spacing: 0.2px;
}
.ai-ms__brand img {
  max-height: 26px;
  width: auto;
  display: block;
}

.ai-ms__nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
}

.ai-ms__menu-list {
  list-style: none;
  display: flex;
  gap: 14px;
  padding: 0;
  margin: 0;
  align-items: center;
  white-space: nowrap;
}
.ai-ms__menu-list a {
  text-decoration: none;
  color: rgba(11, 11, 13, 0.72);
  font-size: 13px;
  padding: 8px 8px;
  border-radius: 10px;
  transition: background 160ms ease, color 160ms ease;
}
.ai-ms__menu-list a:hover {
  background: rgba(11, 11, 13, 0.04);
  color: rgba(11, 11, 13, 0.90);
}

.ai-ms__search {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 14px;
  border: 1px solid var(--ai-ms-border);
  border-radius: var(--ai-ms-radius);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.ai-ms__search:focus-within {
  box-shadow: 0 0 0 4px var(--ai-ms-focus);
  border-color: rgba(10, 132, 255, 0.25);
}

.ai-ms__search-icon {
  width: 18px;
  height: 18px;
  position: relative;
  opacity: 0.65;
}
.ai-ms__search-icon:before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(11, 11, 13, 0.70);
  border-radius: 999px;
}
.ai-ms__search-icon:after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  background: rgba(11, 11, 13, 0.70);
  right: -5px;
  bottom: -1px;
  transform: rotate(45deg);
  border-radius: 99px;
}

.ai-ms__input {
  width: 100%;
  border: 0;
  outline: none;
  font-size: 22px;
  line-height: 1.25;
  background: transparent;
  color: var(--ai-ms-text);
}
.ai-ms__input::placeholder {
  color: rgba(11, 11, 13, 0.42);
}

.ai-ms__close {
  border: 1px solid var(--ai-ms-border);
  background: rgba(11, 11, 13, 0.04);
  color: rgba(11, 11, 13, 0.72);
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.ai-ms__close:hover {
  background: rgba(11, 11, 13, 0.06);
  transform: translateY(-1px);
}
.ai-ms__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ai-ms-focus);
}

.ai-ms__hint {
  margin-top: 10px;
  color: var(--ai-ms-sub);
  font-size: 12px;
  letter-spacing: 0.2px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ai-ms__hint span {
  border: 1px solid var(--ai-ms-border);
  background: rgba(11, 11, 13, 0.03);
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 12px;
  color: rgba(11, 11, 13, 0.72);
}

.ai-ms__body {
  position: relative;
  flex: 1;
  overflow: auto;
}

.ai-ms__grid {
  margin: 0 auto;
  padding: 22px 18px 34px;
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  gap: 22px;
  align-items: start;
}

.ai-ms__col {
  min-width: 0;
}

.ai-ms__section {
  margin-bottom: 18px;
}

.ai-ms__section-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(11, 11, 13, 0.55);
  margin-bottom: 10px;
}
.ai-ms__section-title.is-dim {
  opacity: 0.32;
}

.ai-ms__list {
  display: grid;
  gap: 8px;
}

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

.ai-ms-product {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--ai-ms-border);
  border-radius: 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
  background: #fff;
}

.ai-ms-product:hover,
.ai-ms-product.is-active {
  transform: translateY(-1px);
  box-shadow: var(--ai-ms-shadow);
  border-color: rgba(10, 132, 255, 0.18);
  background: rgba(10, 132, 255, 0.02);
}
.ai-ms-product:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ai-ms-focus), var(--ai-ms-shadow);
}

.ai-ms-product__thumb {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(11, 11, 13, 0.03);
  display: grid;
  place-items: center;
}
.ai-ms-product__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-ms-product__thumb-ph {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(11, 11, 13, 0.06);
}

.ai-ms-product__title {
  font-size: 15px;
  line-height: 1.25;
  font-weight: 600;
  margin-bottom: 6px;
}
.ai-ms-product__excerpt {
  font-size: 13px;
  line-height: 1.35;
  color: rgba(11, 11, 13, 0.72);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-ms-product__price {
  font-size: 13px;
  color: rgba(11, 11, 13, 0.62);
}

.ai-ms-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  background: transparent;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}
.ai-ms-row:hover,
.ai-ms-row.is-active {
  background: rgba(11, 11, 13, 0.03);
  border-color: rgba(11, 11, 13, 0.06);
  transform: translateY(-1px);
}
.ai-ms-row__media {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(11, 11, 13, 0.03);
  display: grid;
  place-items: center;
}
.ai-ms-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-ms-row__ph {
  width: 18px;
  height: 18px;
  border-radius: 8px;
  background: rgba(11, 11, 13, 0.08);
}
.ai-ms-row__bullet {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(10, 132, 255, 0.45);
  margin-left: 12px;
}
.ai-ms-row__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.ai-ms-row__meta {
  font-size: 12px;
  color: rgba(11, 11, 13, 0.55);
}
.ai-ms-row--plain {
  grid-template-columns: 14px 1fr auto;
}

.ai-ms__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ai-ms-chip {
  border: 1px solid var(--ai-ms-border);
  background: rgba(11, 11, 13, 0.03);
  color: rgba(11, 11, 13, 0.72);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.ai-ms-chip:hover {
  background: rgba(11, 11, 13, 0.05);
  transform: translateY(-1px);
}
.ai-ms-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--ai-ms-focus);
}

.ai-ms__empty {
  max-width: 720px;
  margin: 0 auto;
  padding: 42px 18px;
  text-align: center;
}
.ai-ms__empty-title {
  font-size: 18px;
  font-weight: 650;
}
.ai-ms__empty-sub {
  margin-top: 8px;
  color: var(--ai-ms-sub);
}

.ai-ms__spinner {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 6px;
  align-items: center;
}
.ai-ms__spinner-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(11, 11, 13, 0.25);
  animation: ai-ms-bounce 750ms ease-in-out infinite;
}
.ai-ms__spinner-dot:nth-child(2) { animation-delay: 120ms; }
.ai-ms__spinner-dot:nth-child(3) { animation-delay: 240ms; }

.ai-ms__mark {
  background: rgba(10, 132, 255, 0.18);
  color: inherit;
  padding: 0 2px;
  border-radius: 6px;
}

.ai-ms__preview {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 999999;
  width: min(380px, calc(100vw - 40px));
  border: 1px solid var(--ai-ms-border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  box-shadow: var(--ai-ms-shadow);
  overflow: hidden;
  pointer-events: none;
}
.ai-ms__preview-inner {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 14px;
}
.ai-ms__preview-img {
  width: 120px;
  height: 120px;
  border-radius: 18px;
  background: rgba(11, 11, 13, 0.04);
  background-size: cover;
  background-position: center;
}
.ai-ms__preview-title {
  font-weight: 650;
  line-height: 1.25;
  margin-top: 6px;
}
.ai-ms__preview-price {
  margin-top: 8px;
  color: var(--ai-ms-sub);
}
.ai-ms__preview-cta {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(10, 132, 255, 0.92);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@keyframes ai-ms-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ai-ms-slide {
  from { transform: translateY(-8px); opacity: 0.98; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes ai-ms-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-4px); opacity: 0.9; }
}

@media (max-width: 1024px) {
  .ai-ms__grid {
    grid-template-columns: 260px 1fr;
  }
  .ai-ms__col--right {
    display: none;
  }
}

@media (max-width: 720px) {
  .ai-ms__top-inner {
    padding: 20px 14px 14px;
  }
  .ai-ms__nav {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ai-ms__nav-right {
    justify-content: space-between;
  }
  .ai-ms__menu {
    display: none;
  }
  .ai-ms__grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .ai-ms__col--left {
    order: 2;
  }
  .ai-ms__col--center {
    order: 1;
  }
  .ai-ms__products {
    grid-template-columns: 1fr;
  }
  .ai-ms__preview {
    display: none;
  }
}

