:root {
  --incore-black: #000000;
  --incore-black-soft: #111111;
  --incore-black-muted: #1a1a1a;
  --incore-user-bubble: #454545;
  --incore-user-bubble-border: #5c5c5c;
  --incore-orange: #e67e22;
  --incore-orange-hover: #d35400;
  --incore-white: #ffffff;
  --incore-gray: #a3a3a3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background: #f3f5f8;
  color: #0f172a;
}

.demo-page {
  max-width: 900px;
  margin: 32px auto;
  padding: 0 16px 96px;
}

.incore-widget-shell {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  transition: bottom 0.2s ease;
}

/* Po zamknięciu czatu — launcher wyżej, żeby nie nachodził na „do góry” sklepu */
.incore-widget-shell--chat-closed {
  bottom: calc(20px + var(--incore-launcher-offset-closed, 2cm));
}

.incore-widget-launcher {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--incore-orange);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.incore-widget-launcher img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.incore-widget-launcher:hover {
  background: var(--incore-orange-hover);
  transform: scale(1.05);
}

.incore-widget-launcher--hidden {
  display: none;
}

.incore-widget {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--incore-black);
  border: 1px solid #2a2a2a;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: none;
  flex-direction: column;
  overflow: hidden;
  color: var(--incore-white);
}

.incore-widget--open {
  display: flex;
}

.incore-widget__header {
  background: var(--incore-black);
  color: var(--incore-white);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2a2a2a;
  gap: 10px;
}

.incore-widget__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.incore-widget__logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}

.incore-widget__title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.incore-widget__title strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.incore-widget__title span {
  font-size: 0.68rem;
  color: var(--incore-gray);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.incore-widget__status {
  font-size: 12px;
  color: var(--incore-orange);
  white-space: nowrap;
}

.incore-widget__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.incore-widget__close {
  border: 0;
  background: transparent;
  color: var(--incore-gray);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.incore-widget__close:hover {
  color: var(--incore-white);
}

.incore-widget__messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--incore-black);
}

.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 100%;
}

.msg-row--assistant {
  align-self: flex-start;
}

.msg-row--user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg__avatar {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}

.msg {
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  max-width: calc(100% - 40px);
  word-break: break-word;
}

.msg--user {
  background: var(--incore-user-bubble);
  color: var(--incore-white);
  border: 1px solid var(--incore-user-bubble-border);
}

.msg--assistant {
  background: var(--incore-black-soft);
  color: var(--incore-white);
  border: 1px solid #2a2a2a;
}

.msg--assistant a,
.msg__link {
  color: var(--incore-orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg--assistant a:hover,
.msg__link:hover {
  color: var(--incore-orange-hover);
}

.msg__product-links,
.msg__info-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.msg__product-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.msg__product-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(230, 126, 34, 0.08);
  border: 1px solid rgba(230, 126, 34, 0.28);
}

.msg__product-card__main {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.msg__product-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--incore-white);
  line-height: 1.35;
}

.msg__product-card__price {
  font-size: 13px;
  color: var(--incore-orange);
  font-weight: 600;
}

.msg__product-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.msg__product-card__link {
  font-size: 12px;
  color: var(--incore-gray);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.msg__product-card__link:hover {
  color: var(--incore-white);
}

.msg__product-card__add {
  border: 0;
  border-radius: 8px;
  background: var(--incore-orange);
  color: var(--incore-white);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.msg__product-card__add:hover:not(:disabled) {
  background: var(--incore-orange-hover);
}

.msg__product-card__add:disabled {
  opacity: 0.75;
  cursor: default;
}

.msg__product-card__add--success {
  background: #2d6a4f;
}

.msg__product-card__add--error {
  background: #8b2e2e;
}

.msg__product-links__item,
.msg__info-links__item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(230, 126, 34, 0.12);
  border: 1px solid rgba(230, 126, 34, 0.35);
  color: var(--incore-orange);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.msg__product-links__item:hover,
.msg__info-links__item:hover {
  background: rgba(230, 126, 34, 0.2);
  border-color: var(--incore-orange);
  color: var(--incore-orange-hover);
}

.msg__coupon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(230, 126, 34, 0.14);
  border: 1px dashed rgba(230, 126, 34, 0.55);
}

.msg__coupon-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--incore-gray);
  width: 100%;
}

.msg__coupon-code {
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--incore-orange);
}

.msg__coupon-meta {
  font-size: 13px;
  color: var(--incore-white);
}

.msg__feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2a2a2a;
}

.msg__feedback-label {
  font-size: 12px;
  color: var(--incore-gray);
  margin-right: 4px;
}

.msg__feedback-actions {
  display: flex;
  gap: 6px;
}

.msg__feedback-btn {
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: var(--incore-black-muted);
  color: var(--incore-white);
  font-size: 12px;
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.msg__feedback-btn:hover:not(:disabled) {
  border-color: var(--incore-orange);
  background: rgba(230, 126, 34, 0.12);
}

.msg__feedback-btn--selected {
  border-color: var(--incore-orange);
  background: rgba(230, 126, 34, 0.2);
  color: var(--incore-orange);
}

.msg__feedback-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.msg__feedback-thanks {
  font-size: 12px;
  color: var(--incore-gray);
}

.incore-widget__composer {
  border-top: 1px solid #2a2a2a;
  padding: 10px;
  display: flex;
  gap: 8px;
  background: var(--incore-black);
}

.incore-widget__composer input {
  flex: 1;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--incore-black-soft);
  color: var(--incore-white);
}

.incore-widget__composer input::placeholder {
  color: #666;
}

.incore-widget__composer input:focus {
  outline: 2px solid var(--incore-orange);
  outline-offset: 0;
  border-color: var(--incore-orange);
}

.incore-widget__composer button {
  border: 0;
  border-radius: 10px;
  background: var(--incore-orange);
  color: var(--incore-white);
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s ease;
}

.incore-widget__composer button:hover {
  background: var(--incore-orange-hover);
}

.incore-widget__composer button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.incore-widget__messages::-webkit-scrollbar {
  width: 6px;
}

.incore-widget__messages::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 999px;
}
