:root {
  color-scheme: only light;
  --font-body: "DM Sans", sans-serif;
  --font-display: "Plus Jakarta Sans", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}
body { margin: 0; }
textarea[aria-label="Predefined survey prompt"] { field-sizing: content; min-height: 80px; }
.demo-receipt {
  position: fixed;
  z-index: 110;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--fg-1);
}

@media (max-width: 420px) {
  .demo-publish-dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
  .demo-share-header, .demo-share-body, .demo-share-footer { padding-inline: 16px !important; }
  .demo-share-tabs { padding-inline: 10px !important; }
  .demo-share-tabs button {
    flex: 1;
    min-width: 0;
    justify-content: center;
    gap: 4px !important;
    padding-inline: 4px !important;
  }
  .demo-share-tabs button svg { flex-shrink: 0; }
  .demo-share-qr { flex-direction: column; align-items: flex-start !important; gap: 12px !important; }
  .demo-share-email-history { gap: 7px !important; padding-inline: 8px !important; }
  .demo-share-footer { flex-direction: column; align-items: flex-start !important; }
}

.demo-watch-document { overflow:hidden; scrollbar-width:none; }
.demo-watch-scene {
  max-width: 790px;
  margin-inline: auto;
  padding: clamp(10px, 2.5vw, 24px);
  background: var(--bg);
}
.demo-watch-scene[data-still] *, .demo-watch-scene[data-still] *::after { animation: none !important; transition: none !important; }
.demo-watch-scene [data-watch-review-composer] { field-sizing: content; min-width: 0; }
.demo-watch-preview-comment { display: inline-grid; max-inline-size: 100%; vertical-align: top; }
.demo-watch-preview-comment > span { grid-area: 1 / 1; min-inline-size: 0; }
.demo-watch-preview-comment > [aria-hidden] { visibility: hidden; }
.demo-watch-scene[data-view="poster"] [data-watch-review-greeting] ~ ul button:not([aria-disabled])::before {
  content: "✓ ";
  visibility: hidden;
}
.demo-watch-preview-caret {
  display: inline-block;
  inline-size: 2px;
  block-size: 1em;
  margin-inline-start: 2px;
  vertical-align: -.12em;
  background: currentColor;
}
.demo-watch-scene[data-view="poster"] [data-watch-chat-footer],
.demo-watch-scene[data-view="poster"] header button,
.demo-watch-scene:is([data-view="answers"], [data-view="submit"]) [data-watch-chat-composer] { display: none; }
.demo-watch-scene:is([data-view="answers"], [data-view="submit"]) [data-watch-answers] .survey-scrollbar {
  max-height: none;
  overflow: visible;
}
.demo-watch-share { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--border); }
.demo-watch-share-backdrop { position: absolute; inset: 0; padding: 16px; background: var(--bg); }
.demo-watch-share [data-watch-modal-host] { position: relative; }
.demo-watch-share [data-watch-modal-host] > div { position: relative; inset: auto; min-height: 300px; padding: 12px; }
.demo-watch-share [aria-labelledby="share-modal-title"] { max-height: none !important; }
.demo-watch-scene[data-view="shared"] [data-watch-modal-host] > div,
.demo-watch-scene[data-view="shared"] [aria-labelledby="share-modal-title"] { animation: none !important; }
.demo-watch-share #share-modal-title { white-space: normal !important; }
.demo-watch-results-overview { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.demo-watch-scene[data-view^="track-"] { max-width: 960px; }
.demo-watch-response-list { min-width: 0; }
.demo-watch-scene [data-watch-summary] * { animation: none !important; transition: none !important; }
.demo-watch-scene [data-watch-summary="multiple-choice"] span[title] {
  white-space: normal !important;
  overflow-wrap: anywhere;
}
.demo-watch-scene [data-watch-summary="paragraph"] article > div:last-child {
  max-height: none !important;
  overflow: visible !important;
}
.demo-watch-scene [data-watch-summary="paragraph"] .survey-scrollbar-none { flex-wrap: wrap; overflow: visible !important; }
.demo-watch-scene [data-watch-summary="paragraph"] .survey-scrollbar-none > div {
  flex: 1 1 176px !important;
  min-width: 0;
  opacity: 1 !important;
  transform: none !important;
}
.demo-watch-response-list .survey-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--fg-3) var(--surface-2);
  scrollbar-gutter: stable;
}
.demo-watch-response-list .survey-scrollbar:focus-visible {
  outline: 2px solid var(--fg-3);
  outline-offset: -2px;
}
@supports selector(::-webkit-scrollbar) {
  .demo-watch-response-list .survey-scrollbar {
    scrollbar-width: auto;
    scrollbar-color: auto;
  }
  .demo-watch-response-list .survey-scrollbar::-webkit-scrollbar-track,
  .demo-watch-response-list .survey-scrollbar::-webkit-scrollbar-corner { background: var(--surface-2); }
  .demo-watch-response-list .survey-scrollbar::-webkit-scrollbar-thumb { background-color: var(--fg-3); }
}
.demo-watch-response-list tbody tr:hover { background: var(--surface); }
.demo-watch-response-list :is(td, th):last-child > * { display: none; }
@media (max-width: 480px) {
  .demo-watch-response-list col:first-child { width: 90px !important; }
  .demo-watch-results-overview h2 { white-space: normal; }
  .demo-watch-scene [data-watch-summary="star-rating"] article > div:last-child > div {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
}
.demo-watch-scene[data-view="track-arrival"] tbody tr:first-child { background: var(--success-subtle); }
.demo-watch-scene:is([data-view="ask"], [data-view="ask-click"], [data-view="insight"]) form { flex-wrap: wrap; }
.demo-watch-scene:is([data-view="ask"], [data-view="ask-click"], [data-view="insight"]) form kbd { display: none; }
.demo-watch-draft-question + .demo-watch-draft-question { margin-top: 10px; }
.demo-watch-draft-question [title="Drag to reorder"],
.demo-watch-draft-question article > div:first-child div:has(> button[aria-label^="Move question"]),
.demo-watch-draft-question article > div:last-child,
.demo-watch-draft-question[data-question-type="star-rating"] article > div:nth-child(2) > div:last-child > :not(:first-child),
.demo-watch-draft-question[data-question-type="multiple-choice"] [aria-label="Remove option"],
.demo-watch-draft-question[data-question-type="multiple-choice"] article > div:nth-child(2) > div > button { display: none; }
.demo-watch-scene[data-view="prompt"] textarea { min-height: 100px; }
.demo-watch-scene:is([data-view="prompt"], [data-view="generate"]) .ai-draft-border { margin-bottom: -16px; }
.demo-watch-scene[data-view="poster"] [data-watch-review-instruction],
.demo-watch-scene[data-view="insight"] form[hidden],
.demo-watch-scene [data-watch-answer-action] { display: none; }
.demo-watch-scene :is([data-watch-answer-label], [data-watch-answer-summary]) { white-space: normal; overflow-wrap: anywhere; }
.demo-watch-draft-page + .demo-watch-draft-page { margin-top: 22px; }
.demo-watch-draft-page > h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.demo-watch-draft [data-watch-option] { white-space: normal; overflow-wrap: anywhere; }
.demo-watch-draft label:has(> [data-watch-option]) { width: fit-content; max-width: 100%; }
.demo-watch-scene [data-watch-review-composer] { max-height: none; }
.demo-watch-scene[data-view="insight"] .ai-ask-border,
.demo-watch-scene[data-view="insight"] .ai-ask-border > div,
.demo-watch-scene[data-view="insight"] div:has(> div > button[aria-label="Collapse answer"]) { animation: none !important; }
.demo-watch-scene[data-view="review-intro"] div:has(> [data-watch-review-greeting]) ul {
  width: fit-content;
}
/* Point at the control that the demo is about to press. */
.demo-watch-scene:not([data-still]) :is(
  [data-view="generate"] [data-watch-action="generate"],
  [data-view="share-click"] [data-watch-tab],
  [data-view="send"] [data-watch-action="send"],
  [data-view="submit"] [data-watch-action="submit"],
  [data-view="ask-click"] [data-watch-action="ask"]
) {
  position: relative;
  animation: demo-watch-press 200ms 90ms ease-out both;

  &::before,
  &::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
  }

  &::before {
    inline-size: 16px;
    block-size: 16px;
    box-sizing: border-box;
    margin: -8px 0 0 -8px;
    border: 1.5px solid #637fae;
    border-radius: 50%;
    opacity: 0;
    animation: demo-watch-ring 290ms 105ms ease-out both;
  }

  &::after {
    z-index: 1;
    inline-size: 20px;
    block-size: 24px;
    /* Align the arrow tip at (3, 2) with the click. */
    margin: -2px 0 0 -3px;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 24'%3E%3Cpath d='M3 2v17l4.4-4.1 3.2 6.4 2.7-1.4-3.2-6.1H16Z' fill='%23131927' stroke='white' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E");
    filter: drop-shadow(0 1px 1px rgb(19 25 39 / 40%));
    animation: demo-watch-pointer 430ms ease-out both;
  }
}
@keyframes demo-watch-press { 40% { transform: scale(.97); } }
@keyframes demo-watch-ring {
  0% { opacity: 1; transform: scale(.5); }
  100% { opacity: 0; transform: scale(1.35); }
}
@keyframes demo-watch-pointer {
  0% { opacity: 0; transform: translate(6px, 6px); }
  22%, 78% { opacity: 1; transform: translate(0, 0); }
  100% { opacity: 0; transform: translate(0, 0); }
}
@media (max-width: 480px) {
  .demo-watch-scene:is([data-view="prompt"], [data-view="generate"]) { padding: 8px; }
  .demo-watch-scene:is([data-view="prompt"], [data-view="generate"]) .ai-draft-border > div { padding: 8px; }
  .demo-watch-scene:is([data-view="prompt"], [data-view="generate"]) textarea {
    min-height: 134px;
    max-height: 260px;
    padding-inline: 10px;
    line-height: 1.4;
    overflow-y: auto;
  }
  .demo-watch-scene:is([data-view="review-type"], [data-view="send"]) [role="log"],
  .demo-watch-scene:is([data-view="answers"], [data-view="submit"]) [role="log"] > div:not(:has(> [data-latest-reply])),
  .demo-watch-scene:is([data-view="answers"], [data-view="submit"]) [data-watch-review-instruction] { display: none; }
  .demo-watch-scene[data-view="review-intro"] [role="log"] { padding: 12px; }
  .demo-watch-scene[data-view="review-intro"] div:has(> [data-watch-review-greeting]) {
    font-size: 14px;
    gap: 7px;
    line-height: 1.45;
  }
  .demo-watch-scene[data-view="review-intro"] div:has(> [data-watch-review-greeting]) li > button {
    font-size: 12px;
    padding: 4px 9px;
  }
  .demo-watch-scene:is([data-view="answers"], [data-view="submit"]) [role="log"] { padding: 12px; }
  .demo-watch-scene[data-view="track-arrival"] > section { margin-bottom: 0 !important; }
  .demo-watch-scene[data-view="track-arrival"] > section > div:first-child,
  .demo-watch-scene[data-view="track-arrival"] > section + section,
  .demo-watch-scene[data-view="track-arrival"] .demo-watch-results-overview > :not(.demo-watch-response-list) { display: none; }
  .demo-watch-scene[data-view="review-intro"] div:has(> [data-watch-review-greeting]) ul {
    gap: 4px;
  }
  .demo-watch-share [data-watch-modal-host] > div { padding: 7px; }
  .demo-watch-share .demo-share-qr > div:first-child { padding: 8px !important; }
  .demo-watch-share .demo-share-qr svg { max-width: 100%; height: auto; }
  .demo-watch-scene:is([data-view="ask"], [data-view="ask-click"], [data-view="insight"]) form input { flex-basis: 68% !important; }
}

@media (max-width: 330px) {
  .demo-watch-scene header:has(+ [role="log"]) { gap: 8px; padding-inline: 12px; }
  .demo-watch-scene header:has(+ [role="log"]) > button { max-inline-size: 80px; text-align: right; }
}
