:root {
  --ic-black: #070707;
  --ic-ink: #151515;
  --ic-muted: #6f6b63;
  --ic-line: rgba(199, 162, 87, 0.24);
  --ic-gold: #c7a257;
  --ic-gold-soft: #ead9b1;
  --ic-cream: #fbfaf7;
  --ic-white: #ffffff;
  --ic-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.ic-widget,
.ic-widget *,
.demo-page,
.demo-page * {
  box-sizing: border-box;
}

.ic-preview-page {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ic-white);
  background:
    linear-gradient(rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.6)),
    url("https://images.unsplash.com/photo-1523906834658-6e24ef2386f9?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
}

.demo-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.demo-hero {
  width: min(760px, 100%);
  text-align: center;
}

.demo-kicker {
  margin: 0 0 14px;
  color: var(--ic-gold-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.demo-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 8vw, 5.4rem);
  font-weight: 500;
  line-height: 0.98;
}

.demo-hero p:last-child {
  width: min(520px, 100%);
  margin: 20px auto 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  line-height: 1.6;
}

.ic-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  color: var(--ic-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ic-widget button,
.ic-widget input {
  font: inherit;
}

.ic-launcher {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(199, 162, 87, 0.55);
  border-radius: 999px;
  padding: 8px 16px 8px 8px;
  color: var(--ic-white);
  background: var(--ic-black);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.ic-launcher:hover,
.ic-launcher:focus-visible {
  transform: translateY(-2px);
  border-color: var(--ic-gold);
  background: #111;
}

.ic-launcher__mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--ic-black);
  background: linear-gradient(135deg, var(--ic-gold-soft), var(--ic-gold));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
  font-weight: 700;
}

.ic-launcher__text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ic-panel {
  position: absolute;
  right: 0;
  bottom: 76px;
  width: min(390px, calc(100vw - 36px));
  height: min(680px, calc(100vh - 112px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  border: 1px solid rgba(199, 162, 87, 0.28);
  border-radius: 22px;
  background: var(--ic-cream);
  box-shadow: var(--ic-shadow);
}

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

.ic-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 18px 15px;
  color: var(--ic-white);
  background:
    linear-gradient(135deg, rgba(199, 162, 87, 0.14), rgba(199, 162, 87, 0)),
    var(--ic-black);
}

.ic-eyebrow {
  margin: 0 0 5px;
  color: var(--ic-gold-soft);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ic-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: 0;
}

.ic-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--ic-white);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.ic-close span {
  transform: translateY(-1px);
  font-size: 1.6rem;
  line-height: 1;
}

.ic-progress {
  height: 3px;
  background: rgba(199, 162, 87, 0.16);
}

.ic-progress__bar {
  display: block;
  width: 7%;
  height: 100%;
  background: linear-gradient(90deg, var(--ic-gold), var(--ic-gold-soft));
  transition: width 240ms ease;
}

.ic-messages {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
  scroll-behavior: smooth;
}

.ic-message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.45;
  white-space: pre-line;
  animation: ic-rise 220ms ease both;
}

.ic-message--bot {
  color: var(--ic-ink);
  background: var(--ic-white);
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-bottom-left-radius: 5px;
}

.ic-message--user {
  margin-left: auto;
  color: var(--ic-white);
  background: var(--ic-black);
  border-bottom-right-radius: 5px;
}

.ic-message--soft {
  color: #4a4439;
  background: #f4ecdd;
  border-color: rgba(199, 162, 87, 0.22);
}

.ic-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 54px;
}

.ic-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ic-gold);
  animation: ic-pulse 900ms ease-in-out infinite;
}

.ic-typing span:nth-child(2) {
  animation-delay: 120ms;
}

.ic-typing span:nth-child(3) {
  animation-delay: 240ms;
}

.ic-input-area {
  padding: 12px;
  border-top: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(16px);
}

.ic-options {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}

.ic-options::-webkit-scrollbar {
  display: none;
}

.ic-option {
  min-height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(199, 162, 87, 0.45);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--ic-ink);
  background: var(--ic-white);
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.ic-option:hover,
.ic-option:focus-visible {
  transform: translateY(-1px);
  border-color: var(--ic-gold);
  background: #fff8e8;
}

.ic-input-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ic-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.ic-input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 999px;
  padding: 0 15px;
  color: var(--ic-ink);
  background: var(--ic-white);
  outline: none;
}

.ic-input:focus {
  border-color: var(--ic-gold);
  box-shadow: 0 0 0 4px rgba(199, 162, 87, 0.16);
}

.ic-send {
  min-width: 74px;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  color: var(--ic-white);
  background: var(--ic-black);
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.ic-send:hover,
.ic-send:focus-visible {
  transform: translateY(-1px);
  background: #1b1b1b;
}

.ic-send:disabled,
.ic-input:disabled {
  opacity: 0.56;
  cursor: not-allowed;
}

@keyframes ic-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ic-pulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (max-width: 640px) {
  .ic-widget {
    right: 12px;
    bottom: 12px;
  }

  .ic-panel {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: min(86dvh, 720px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 24px 24px 0 0;
  }

  .ic-launcher {
    min-height: 56px;
    padding-right: 14px;
  }

  .ic-messages {
    padding: 16px 14px;
  }

  .ic-message {
    max-width: 91%;
  }
}
