:root {
  --msai-ink: #080808;
  --msai-surface: #141414;
  --msai-surface-raised: #191919;
  --msai-line: rgba(232, 221, 204, 0.15);
  --msai-gold: #c9a35f;
  --msai-gold-soft: #e0c17d;
  --msai-copy: #d8d1c7;
  --msai-muted: #978f84;
}

html body #mscra-root {
  right: 24px;
  bottom: 24px;
  z-index: 99998;
  color: var(--msai-copy);
  font-family: "Helvetica Neue", "Avenir Next", "Segoe UI", sans-serif;
}

html body #mscra-button {
  position: relative;
  width: 68px;
  height: 68px;
  border: 1px solid rgba(201, 163, 95, 0.7);
  border-radius: 50%;
  background: #0a0a0a;
  color: var(--msai-gold-soft);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.52), inset 0 0 0 5px rgba(201, 163, 95, 0.035);
  font: 700 10px/1 "Helvetica Neue", sans-serif;
  letter-spacing: 0.15em;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

html body #mscra-button::before {
  content: "";
  display: block;
  width: 18px;
  height: 14px;
  margin: 0 auto 5px;
  border: 1.5px solid currentColor;
  border-radius: 9px 9px 9px 3px;
}

html body #mscra-button:hover,
html body #mscra-button:focus-visible {
  transform: translateY(-3px);
  border-color: var(--msai-gold-soft);
  background: #111;
  outline: none;
}

html body #mscra-panel {
  overflow: hidden;
  right: 0;
  bottom: 84px;
  width: min(430px, calc(100vw - 36px));
  max-height: min(720px, calc(100vh - 130px));
  border: 1px solid rgba(201, 163, 95, 0.4);
  border-radius: 2px;
  background: var(--msai-surface);
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.72);
  transform-origin: right bottom;
}

html body #mscra-panel.mscra-open {
  display: flex;
  flex-direction: column;
  animation: msai-panel-in 240ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

@keyframes msai-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

html body #mscra-panel .mscra-head {
  position: relative;
  padding: 27px 64px 22px 26px;
  border-bottom: 1px solid var(--msai-line);
  background:
    radial-gradient(circle at 88% 8%, rgba(201, 163, 95, 0.11), transparent 34%),
    linear-gradient(145deg, #181818, #0c0c0c);
}

html body #mscra-panel .mscra-head::after {
  content: "";
  position: absolute;
  left: 26px;
  bottom: -1px;
  width: 58px;
  height: 1px;
  background: var(--msai-gold);
}

html body #mscra-panel .mscra-eyebrow {
  margin: 0 0 11px;
  color: var(--msai-gold-soft);
  font: 700 10px/1.2 "Helvetica Neue", sans-serif;
  letter-spacing: 0.25em;
}

html body #mscra-panel .mscra-title {
  max-width: 310px;
  margin: 0;
  color: #eee8de;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.msai-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--msai-line);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: #c7bfb4;
  cursor: pointer;
  font: 300 21px/30px "Helvetica Neue", sans-serif;
}

.msai-service-state {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  color: #aaa297;
  font-size: 11px;
  letter-spacing: 0.035em;
}

.msai-service-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8fa36b;
  box-shadow: 0 0 0 4px rgba(143, 163, 107, 0.09);
}

html body #mscra-panel .mscra-body {
  overflow: auto;
  padding: 22px 26px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 163, 95, 0.35) transparent;
}

.msai-suggestions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 0 0 15px;
  padding: 0 0 3px;
  scrollbar-width: none;
}

.msai-suggestions::-webkit-scrollbar { display: none; }
.msai-suggestion {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--msai-line);
  border-radius: 999px;
  background: #101010;
  color: #bdb4a9;
  cursor: pointer;
  font: 600 10px/1.2 "Helvetica Neue", sans-serif;
  letter-spacing: 0.04em;
}
.msai-suggestion:hover { border-color: rgba(201, 163, 95, 0.62); color: var(--msai-gold-soft); }

html body #mscra-input {
  min-height: 118px;
  max-height: 220px;
  border: 1px solid var(--msai-line);
  border-radius: 0;
  background: #090909;
  color: #ddd6cc;
  padding: 15px 16px;
  font: 400 14px/1.55 "Helvetica Neue", sans-serif;
  caret-color: var(--msai-gold-soft);
}

html body #mscra-input::placeholder { color: #777067; opacity: 1; }
html body #mscra-input:focus {
  border-color: rgba(201, 163, 95, 0.7);
  box-shadow: 0 0 0 3px rgba(201, 163, 95, 0.08);
}

html body #mscra-panel .mscra-row { gap: 8px; margin-top: 9px; }
html body #mscra-panel .mscra-row button {
  min-height: 44px;
  border-radius: 0;
  padding: 12px;
  font: 700 10px/1 "Helvetica Neue", sans-serif;
  letter-spacing: 0.17em;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
html body #mscra-ask {
  border-color: var(--msai-gold);
  background: var(--msai-gold);
  color: #0a0907;
}
html body #mscra-ask:hover { background: var(--msai-gold-soft); }
html body #mscra-clear {
  flex: 0 0 104px;
  border-color: var(--msai-line);
  background: transparent;
  color: #aba399;
}
html body #mscra-clear:hover { border-color: rgba(232, 221, 204, 0.35); color: #e0d9cf; }

html body #mscra-answer {
  position: relative;
  margin-top: 18px;
  padding: 34px 17px 17px;
  border: 1px solid var(--msai-line);
  border-left: 2px solid rgba(201, 163, 95, 0.8);
  background: #101010;
  color: #cbc4ba;
  font: 400 14px/1.65 "Helvetica Neue", sans-serif;
}
html body #mscra-answer::before {
  content: "MENSSKULL CLIENT CARE";
  position: absolute;
  top: 13px;
  left: 17px;
  color: var(--msai-gold-soft);
  font: 700 9px/1 "Helvetica Neue", sans-serif;
  letter-spacing: 0.18em;
}

html body #mscra-panel .mscra-meta { display: none; }
html body #mscra-panel .mscra-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--msai-line);
  color: #d2cabe;
  font: 700 10px/1.2 "Helvetica Neue", sans-serif;
  letter-spacing: 0.14em;
  text-decoration: none;
}
html body #mscra-panel .mscra-link::after { content: "→"; color: var(--msai-gold-soft); font-size: 17px; }

html body #msai-feedback {
  margin-top: 0 !important;
  padding: 12px 15px;
  border: 1px solid var(--msai-line);
  border-top: 0;
  color: var(--msai-muted) !important;
  font-family: "Helvetica Neue", sans-serif !important;
}
html body #msai-feedback button {
  border-radius: 999px;
  background: transparent !important;
  padding: 5px 10px !important;
}

.msai-product-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 12px;
}
.msai-product-card {
  overflow: hidden;
  border: 1px solid var(--msai-line);
  background: #0b0b0b;
  color: #cfc7bc;
  text-decoration: none;
}
.msai-product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #050505;
}
.msai-product-card span {
  display: block;
  padding: 9px;
  font-size: 10px;
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  html body #mscra-panel.mscra-open { animation: none; }
  html body #mscra-button { transition: none; }
}

@media (max-width: 640px) {
  html body #mscra-root { right: 14px; bottom: 82px; }
  html body #mscra-button { position: fixed; right: 14px; bottom: 82px; width: 60px; height: 60px; }
  html body #mscra-panel {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-width: none;
    max-height: min(86dvh, 760px);
    border-width: 1px 0 0;
    border-radius: 0;
    padding-bottom: env(safe-area-inset-bottom);
    transform-origin: center bottom;
  }
  html body #mscra-panel .mscra-head { padding: 23px 58px 19px 20px; }
  html body #mscra-panel .mscra-head::after { left: 20px; }
  html body #mscra-panel .mscra-title { max-width: 290px; font-size: 25px; }
  html body #mscra-panel .mscra-body { padding: 18px 20px 22px; }
  html body #mscra-input { min-height: 104px; }
  html body #mscra-clear { flex-basis: 92px; }
  .msai-product-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.msai-panel-open { overflow: hidden; }
}
