@font-face {
  font-family: "TikTok Sans";
  src: url("./assets/TikTokSans-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
}

:root {
  color-scheme: light;
  font-family: "TikTok Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #fafafa; }
button { font: inherit; }

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #fafafa;
}

.demo {
  position: absolute;
  width: 500px;
  height: 764px;
  transform-origin: top left;
}

.panel {
  position: absolute;
  left: 26px;
  top: 0;
  width: 448px;
  height: 700px;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .07);
  transform: translateY(0) scale(1);
  transform-origin: bottom right;
  opacity: 1;
  transition:
    left 360ms cubic-bezier(.22, 1, .36, 1),
    width 360ms cubic-bezier(.22, 1, .36, 1),
    opacity 260ms ease,
    transform 360ms cubic-bezier(.22, 1, .36, 1);
}

.demo:not([data-state="form"]) .panel { left: 0; width: 500px; }
.view { position: absolute; inset: 0; }

.form-view {
  width: 448px;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 180ms ease, transform 320ms cubic-bezier(.22, 1, .36, 1);
}

.demo:not([data-state="form"]) .form-view {
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
}

.form-header {
  height: 68px;
  margin: 0 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 20px;
}

h1, h2, p { margin: 0; }
.form-header h1 { font-size: 20px; font-weight: 500; line-height: 28px; letter-spacing: 0; }

.icon-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
}
.icon-button img { display: block; width: 13px; height: 13px; }

.form-content { width: 400px; margin: 0 24px; }
.field { width: 100%; }
.field label { display: block; height: 20px; font-size: 14px; font-weight: 400; line-height: 20px; color: #000; }
.field label em { color: #fe2c55; font-style: normal; }

.select-control, .input-control {
  width: 100%;
  height: 32px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  border-radius: 6px;
  background: rgba(0, 0, 0, .05);
  color: #000;
  font-size: 14px;
  line-height: 20px;
}
.select-control { justify-content: space-between; padding-left: 12px; }
.select-control img { width: 16px; height: 16px; margin: 0 8px 0 4px; }

.issue-field { margin-top: 20px; }
.textarea-control {
  position: relative;
  width: 400px;
  height: 194px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, .05);
}
.attachments { position: absolute; left: 8px; top: 8px; display: flex; gap: 8px; }
.attachment-preview, .upload-tile { display: block; width: 60px; height: 60px; object-fit: cover; }
.attachment-preview { border-radius: 10px; }
.upload-tile { border-radius: 6px; }
.issue-copy {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 76px;
  height: 80px;
  color: #000;
  font-size: 14px;
  line-height: 20px;
}
.counter { position: absolute; right: 10px; bottom: 8px; color: rgba(0, 0, 0, .48); font-size: 14px; line-height: 20px; }

.email-field { margin-top: 20px; }
.field-help { color: rgba(0, 0, 0, .65); font-size: 14px; line-height: 20px; }
.input-control { padding: 0 10px; }

.form-footer, .submitted-footer {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  background: #fff;
}

.button {
  min-width: 100px;
  height: 36px;
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: transform 120ms ease, filter 120ms ease;
}
.button img { width: 14px; height: 14px; object-fit: contain; }
.button-neutral { background: rgba(0, 0, 0, .05); color: #000; }
.button-primary { background: #fe2c55; color: #fff; }
.button-resolved { background: rgba(11, 224, 155, .12); color: #008568; }
.button-resolved.is-confirmed { background: rgba(11, 224, 155, .28); transform: scale(.985); }
.button:active, .button.is-pressed { transform: scale(.975); filter: brightness(.97); }

.submitted-view {
  width: 500px;
  opacity: 0;
  transform: translateX(14px);
  pointer-events: none;
  transition: opacity 220ms ease 80ms, transform 360ms cubic-bezier(.22, 1, .36, 1) 40ms;
}
.demo:not([data-state="form"]) .submitted-view { opacity: 1; transform: translateX(0); pointer-events: auto; }

.submitted-header { height: 56px; display: flex; justify-content: flex-end; align-items: flex-start; padding: 16px 24px 8px; }
.submitted-content {
  position: absolute;
  left: 24px;
  top: 56px;
  width: 452px;
  height: 560px;
  overflow: hidden;
}
.submitted-track {
  width: 452px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateY(0);
  transition: transform 1120ms cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}

.received-card {
  width: 452px;
  height: 98px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 12px;
}
.received-card h2 { color: #000; font-size: 20px; font-weight: 500; line-height: 28px; letter-spacing: 0; white-space: nowrap; }
.received-meta { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 20px; white-space: nowrap; }
.received-meta button { flex: 0 0 auto; padding: 0; border: 0; background: transparent; color: #0075db; font-size: 14px; font-weight: 500; line-height: 20px; }

.ai-card {
  position: absolute;
  left: 0;
  top: 0;
  width: 452px;
  overflow: hidden;
  border-radius: 12px;
  background: #f8f8f8;
}
.ai-slot { position: relative; width: 452px; height: 158px; flex: 0 0 auto; }
.demo[data-state^="answer"] .ai-slot { height: var(--answer-card-height, 648px); }
.loading-card {
  height: 158px;
  padding: 12px 24px 28px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms ease, transform 280ms cubic-bezier(.22, 1, .36, 1);
}
.ai-title-row { min-height: 28px; display: flex; align-items: center; gap: 8px; color: rgba(0, 0, 0, .48); font-size: 14px; line-height: 20px; }
.ai-title-row b { font-weight: 400; }
.sparkle { display: block; width: 14px; height: 14px; }
.skeleton { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.skeleton span {
  position: relative;
  width: 100%;
  height: 20px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0, 0, 0, .045);
}
.skeleton span::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -72%;
  width: 72%;
  background: linear-gradient(
    124deg,
    transparent 12%,
    rgba(255, 255, 255, .06) 28%,
    rgba(255, 255, 255, .3) 50%,
    rgba(255, 255, 255, .06) 72%,
    transparent 88%
  );
  animation: skeletonSweep 4.2s cubic-bezier(.4, 0, .2, 1) infinite;
}
.skeleton .short { width: 180px; }

.answer-card {
  height: auto;
  min-height: 648px;
  padding: 12px 20px 20px 24px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 260ms ease, transform 360ms cubic-bezier(.22, 1, .36, 1);
}
.copy-button { width: 32px; height: 32px; margin-left: auto; padding: 0; border: 0; background: transparent; }
.copy-button img { display: block; width: 14px; height: 14px; margin: auto; object-fit: contain; }
.answer-body { margin-top: 8px; padding: 0 4px; color: #000; font-size: 14px; line-height: 20px; }
.answer-body p + p { margin-top: 4px; }
.divider { height: 1px; margin: 12px 4px; background: rgba(0, 0, 0, .08); }
.sources { margin: 0; padding: 0 4px; list-style: none; color: rgba(0, 0, 0, .65); font-size: 12px; line-height: 16px; counter-reset: source; }
.sources li { position: relative; min-height: 16px; padding-left: 18px; counter-increment: source; white-space: nowrap; }
.sources li + li { margin-top: 4px; }
.sources li::before {
  content: counter(source);
  position: absolute;
  left: 0;
  top: 1px;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, .05);
  font-size: 8px;
  font-weight: 500;
  line-height: 12px;
}
.accuracy-note { margin-top: 12px; color: rgba(0, 0, 0, .48); font-size: 14px; line-height: 20px; }

.submitted-footer { height: 84px; padding: 24px; }
.loading-footer { opacity: 1; transition: opacity 160ms ease; }
.answer-footer { opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.demo[data-state^="answer"] .loading-card { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.demo[data-state^="answer"] .answer-card { opacity: 1; transform: translateY(0); }
.demo[data-state^="answer"] .loading-footer { opacity: 0; pointer-events: none; }
.demo[data-state^="answer"] .answer-footer { opacity: 1; pointer-events: auto; }
.demo.is-closing .panel,
.demo.is-closed .panel { opacity: 0; transform: translateY(14px) scale(.975); pointer-events: none; }
.demo.is-closing .customer-service-chevron { transform: rotate(180deg); }
.demo.is-closed .customer-service-chevron { opacity: 0; transform: rotate(180deg) scale(.72); }
.demo.is-closed .customer-service-icon { opacity: 1; transform: scale(1); }

.customer-service {
  box-sizing: border-box;
  position: absolute;
  left: 426px;
  top: 716px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  appearance: none;
  padding: 5px;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .07);
  cursor: pointer;
  transition: left 360ms cubic-bezier(.22, 1, .36, 1);
}
.demo:not([data-state="form"]) .customer-service { left: 452px; }
.customer-service-fill {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: url("./assets/customer-service-fill.png") center / cover no-repeat;
}
.customer-service-fill img {
  grid-area: 1 / 1;
  display: block;
  width: 16px;
  height: 16px;
  transition: opacity 220ms ease, transform 320ms cubic-bezier(.22, 1, .36, 1);
}
.customer-service-chevron { opacity: 1; transform: rotate(0) scale(1); }
.customer-service-icon { opacity: 0; transform: scale(.72); }

@keyframes skeletonSweep {
  0%, 7% { transform: translateX(0) skewX(-30deg); }
  88%, 100% { transform: translateX(245%) skewX(-30deg); }
}

@media (hover: hover) {
  .button:hover, .icon-button:hover, .received-meta button:hover, .copy-button:hover { filter: brightness(.96); }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .view, .customer-service, .loading-card, .answer-card, .submitted-track, .submitted-footer, .button { transition-duration: 1ms; }
  .skeleton span::after { animation: none; opacity: 0; }
}
