:root {
  --sq-page: #f5f7fa;
  --sq-card: #ffffff;
  --sq-text: #172033;
  --sq-muted: #667085;
  --sq-accent: #355dde;
  --sq-accent-dark: #2949b7;
  --sq-accent-pale: #eef3ff;
  --sq-border: #e4e7ec;
  --sq-border-strong: #d0d5dd;
  --sq-success: #18864b;
  --sq-success-pale: #ecf8f1;
  --sq-danger: #b42318;
  --sq-shadow: 0 18px 48px rgba(23, 32, 51, 0.08);
  --sq-radius-lg: 16px;
  --sq-radius-md: 14px;
  --sq-radius-sm: 12px;
  --sq-ease: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.sq-page {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--sq-page);
  color: var(--sq-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.sq-page button,
.sq-page input {
  font: inherit;
}

.sq-page button {
  -webkit-tap-highlight-color: transparent;
}

.sq-app {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: start center;
  padding: clamp(0.75rem, 2.5vw, 2rem);
}

.sq-shell {
  width: min(100%, 980px);
  min-height: calc(100svh - clamp(1.5rem, 5vw, 4rem));
  overflow: hidden;
  border: 1px solid var(--sq-border);
  border-radius: var(--sq-radius-lg);
  background: var(--sq-card);
  box-shadow: var(--sq-shadow);
}

.sq-brand {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--sq-border);
}

.sq-brand__identity,
.sq-brand__labels,
.sq-demo-panel__header,
.sq-progress-panel__row,
.sq-question-heading,
.sq-result__topline {
  display: flex;
  align-items: center;
}

.sq-brand__identity {
  gap: 0.7rem;
}

.sq-brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--sq-text);
  color: #ffffff;
}

.sq-brand__mark svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sq-brand__name {
  font-size: 1.02rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.sq-brand__labels {
  justify-content: flex-end;
  gap: 0.5rem;
}

.sq-badge,
.sq-connectivity {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.25rem 0.65rem;
  border: 1px solid var(--sq-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--sq-muted);
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.sq-badge--accent {
  border-color: #cbd7ff;
  background: var(--sq-accent-pale);
  color: var(--sq-accent-dark);
}

.sq-screen {
  width: 100%;
  padding: clamp(1.35rem, 4vw, 3.25rem);
}

.sq-screen[hidden] {
  display: none;
}

.sq-welcome {
  min-height: min(650px, calc(100svh - 6rem));
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(290px, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 6vw, 4.5rem);
}

.sq-welcome__copy {
  max-width: 560px;
}

.sq-kicker,
.sq-demo-panel__eyebrow,
.sq-instruction {
  margin: 0;
  color: var(--sq-accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.sq-welcome h1,
.sq-result h1,
.sq-preparing h1 {
  margin: 0;
  color: var(--sq-text);
  font-size: clamp(2.35rem, 5vw, 4rem);
  font-weight: 750;
  line-height: 1.03;
  letter-spacing: -0.052em;
}

.sq-welcome h1 {
  max-width: 12ch;
  margin-top: 0.8rem;
}

.sq-welcome__intro {
  max-width: 54ch;
  margin: 1.15rem 0 0;
  color: var(--sq-muted);
  font-size: clamp(0.98rem, 2vw, 1.08rem);
}

.sq-welcome__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0 0;
  color: var(--sq-text);
  font-size: 0.85rem;
  font-weight: 700;
}

.sq-privacy-note {
  margin: 0.85rem 0 0;
  color: var(--sq-muted);
  font-size: 0.78rem;
}

.sq-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--sq-border-strong);
  border-radius: var(--sq-radius-sm);
  background: var(--sq-card);
  color: var(--sq-text);
  cursor: pointer;
  font-weight: 720;
  transition:
    transform var(--sq-ease),
    background-color var(--sq-ease),
    border-color var(--sq-ease),
    box-shadow var(--sq-ease);
}

.sq-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sq-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.sq-button:focus-visible,
.sq-option:has(input:focus-visible) {
  outline: 3px solid rgba(53, 93, 222, 0.25);
  outline-offset: 3px;
}

.sq-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.sq-button--primary {
  border-color: var(--sq-accent);
  background: var(--sq-accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(53, 93, 222, 0.2);
}

.sq-button--primary:hover:not(:disabled) {
  border-color: var(--sq-accent-dark);
  background: var(--sq-accent-dark);
  box-shadow: 0 10px 24px rgba(53, 93, 222, 0.24);
}

.sq-button--secondary:hover:not(:disabled) {
  border-color: #aab9ee;
  background: var(--sq-accent-pale);
}

.sq-button--start {
  min-width: 190px;
  margin-top: 1.5rem;
}

.sq-button--small {
  min-height: 44px;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
}

.sq-demo-panel {
  overflow: hidden;
  border: 1px solid var(--sq-border);
  border-radius: var(--sq-radius-lg);
  background: #fafbfc;
  box-shadow: 0 12px 30px rgba(23, 32, 51, 0.06);
}

.sq-demo-panel__header {
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.25rem;
  border-bottom: 1px solid var(--sq-border);
}

.sq-demo-panel__eyebrow {
  color: var(--sq-muted);
  font-size: 0.66rem;
}

.sq-demo-panel h2 {
  margin: 0.18rem 0 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.sq-connectivity {
  position: relative;
  padding-left: 1.4rem;
  color: var(--sq-success);
}

.sq-connectivity::before {
  content: "";
  position: absolute;
  left: 0.65rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.sq-connectivity.sq-is-offline {
  color: var(--sq-muted);
}

.sq-init-state {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 0.8rem;
  align-items: center;
  margin: 1rem;
  padding: 0.9rem;
  border: 1px solid #cbd7ff;
  border-radius: var(--sq-radius-sm);
  background: var(--sq-accent-pale);
}

.sq-init-state__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #ffffff;
  color: var(--sq-accent);
}

.sq-init-state__icon svg {
  width: 22px;
  height: 22px;
  display: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sq-init-state p {
  margin: 0;
  color: var(--sq-text);
  font-size: 0.85rem;
  font-weight: 750;
}

.sq-init-state div > span {
  display: block;
  margin-top: 0.2rem;
  color: var(--sq-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.sq-init-state.sq-is-success {
  border-color: #b7e1c8;
  background: var(--sq-success-pale);
}

.sq-init-state.sq-is-success .sq-init-state__icon {
  color: var(--sq-success);
}

.sq-init-state.sq-is-success .sq-spinner {
  display: none;
}

.sq-init-state.sq-is-success svg {
  display: block;
}

.sq-spinner {
  width: 20px;
  height: 20px;
  display: block;
  border: 2px solid #cbd7ff;
  border-top-color: var(--sq-accent);
  border-radius: 50%;
  animation: sq-spin 760ms linear infinite;
}

.sq-status-list {
  margin: 0;
  padding: 0 1rem 1rem;
  list-style: none;
}

.sq-status-list li {
  min-height: 40px;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 0.65rem;
  border-top: 1px solid var(--sq-border);
  color: var(--sq-muted);
  font-size: 0.76rem;
}

.sq-status-list__icon {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sq-success);
}

.sq-status-list strong {
  color: var(--sq-text);
  font-weight: 700;
  text-align: right;
}

.sq-quiz {
  max-width: 820px;
  margin: 0 auto;
}

.sq-progress-panel {
  margin-bottom: 1.2rem;
}

.sq-progress-panel__row,
.sq-question-heading,
.sq-result__topline {
  justify-content: space-between;
  gap: 1rem;
}

.sq-question-count,
.sq-completion-copy,
.sq-result__topline {
  margin: 0;
  color: var(--sq-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.sq-completion-copy {
  display: flex;
  gap: 0.75rem;
}

.sq-completion-copy strong {
  color: var(--sq-accent);
}

.sq-progress {
  height: 7px;
  margin-top: 0.6rem;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f4;
}

.sq-progress__fill {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--sq-accent);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sq-question-card {
  animation: sq-card-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sq-question-card.sq-is-leaving {
  animation: sq-card-out 130ms ease forwards;
}

.sq-question-heading {
  align-items: flex-end;
}

.sq-question-title {
  max-width: 620px;
  margin: 0.3rem 0 0;
  font-size: clamp(1.45rem, 3.3vw, 2.15rem);
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.sq-question-title:focus {
  outline: none;
}

.sq-position-key {
  flex: 0 0 auto;
  padding-bottom: 0.18rem;
  color: #98a2b3;
  font-size: 0.72rem;
  font-weight: 700;
}

.sq-viewing-helper {
  margin: 0.8rem 0 0;
  color: var(--sq-muted);
  font-size: 0.8rem;
}

.sq-viewing-cue {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.45rem 0 0.9rem;
  color: var(--sq-accent-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.sq-viewing-cue__count {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #cbd7ff;
  border-radius: 9px;
  background: var(--sq-accent-pale);
  color: var(--sq-accent);
  font-size: 0.78rem;
  font-weight: 800;
  animation: sq-pulse 1.4s ease-out infinite;
}

.sq-viewing-cue.sq-is-ready {
  color: var(--sq-success);
}

.sq-viewing-cue.sq-is-ready .sq-viewing-cue__count {
  border-color: #b7e1c8;
  background: var(--sq-success-pale);
  color: var(--sq-success);
  animation: none;
}

.sq-image-stage {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--sq-border);
  border-radius: var(--sq-radius-md);
  background: #f8fafc;
}

.sq-collage {
  width: 100%;
  max-height: min(53vh, 530px);
  display: block;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--sq-ease);
}

.sq-image-stage.sq-is-ready .sq-collage {
  opacity: 1;
}

.sq-image-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.sq-image-stage.sq-is-ready .sq-image-loading,
.sq-image-stage.sq-has-error .sq-image-loading {
  display: none;
}

.sq-image-error {
  max-width: 340px;
  padding: 2rem 1.25rem;
  text-align: center;
}

.sq-image-error__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0 auto 0.6rem;
  border: 1px solid #f0b7b1;
  border-radius: 50%;
  color: var(--sq-danger);
  font-weight: 800;
}

.sq-image-error p {
  margin: 0.35rem 0 1rem;
  color: var(--sq-muted);
  font-size: 0.88rem;
}

.sq-options {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0.85rem 0 0;
  padding: 0;
  border: 0;
}

.sq-options:disabled {
  opacity: 0.52;
}

.sq-option {
  position: relative;
  min-height: 62px;
  display: grid;
  grid-template-columns: 38px 1fr 22px;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--sq-border);
  border-radius: var(--sq-radius-sm);
  background: var(--sq-card);
  cursor: pointer;
  transition:
    transform var(--sq-ease),
    border-color var(--sq-ease),
    background-color var(--sq-ease),
    box-shadow var(--sq-ease);
}

.sq-option:hover {
  transform: translateY(-1px);
  border-color: #aab9ee;
  box-shadow: 0 6px 16px rgba(23, 32, 51, 0.06);
}

.sq-option:has(input:checked) {
  border-color: var(--sq-accent);
  background: var(--sq-accent-pale);
  box-shadow: 0 0 0 1px var(--sq-accent);
}

.sq-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.sq-option__number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sq-border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--sq-text);
  font-size: 0.95rem;
  font-weight: 800;
}

.sq-option:has(input:checked) .sq-option__number {
  border-color: #c3d0fa;
  background: #ffffff;
  color: var(--sq-accent);
}

.sq-option__label {
  color: var(--sq-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.sq-option__check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--sq-border-strong);
  border-radius: 50%;
  color: transparent;
  font-size: 0.7rem;
  font-weight: 900;
}

.sq-option:has(input:checked) .sq-option__check {
  border-color: var(--sq-accent);
  background: var(--sq-accent);
  color: #ffffff;
}

.sq-status {
  min-height: 1.3em;
  margin: 0.65rem 0 0;
  color: var(--sq-danger);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.sq-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 0.7rem;
  margin-top: 0.45rem;
}

.sq-actions .sq-button {
  width: 100%;
}

.sq-actions .sq-button[hidden] {
  visibility: hidden;
  display: inline-flex;
}

.sq-preparing,
.sq-result {
  min-height: min(650px, calc(100svh - 6rem));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sq-preparing__indicator {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 1.2rem;
  border: 1px solid var(--sq-border);
  border-radius: 14px;
  background: #f8fafc;
}

.sq-preparing h1 {
  margin-top: 0.6rem;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.sq-preparing > p:last-child {
  margin: 0.75rem 0 0;
  color: var(--sq-muted);
  font-size: 0.9rem;
}

.sq-result {
  max-width: 760px;
  margin: 0 auto;
}

.sq-result__topline {
  width: min(100%, 650px);
}

.sq-progress--complete {
  width: min(100%, 650px);
  margin: 0.75rem 0 2rem;
}

.sq-progress--complete .sq-progress__fill {
  width: 100%;
  background: var(--sq-success);
}

.sq-result h1 {
  max-width: 15ch;
  margin-top: 0.55rem;
  font-size: clamp(2rem, 5vw, 3.35rem);
}

.sq-result-card {
  position: relative;
  width: min(100%, 650px);
  margin-top: 1.35rem;
  overflow: hidden;
  padding: clamp(1.35rem, 4vw, 2rem);
  border: 1px solid var(--sq-border);
  border-radius: var(--sq-radius-lg);
  background: var(--sq-card);
  box-shadow: 0 12px 32px rgba(23, 32, 51, 0.08);
  text-align: left;
  animation: sq-card-in 420ms 80ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sq-result-card__accent {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--sq-accent);
}

#sq-result-message {
  margin: 0;
  color: var(--sq-text);
  font-size: clamp(1rem, 2.35vw, 1.2rem);
  line-height: 1.65;
}

.sq-share-note {
  margin: 1.2rem 0 1rem;
  color: var(--sq-muted);
  font-size: 0.9rem;
}

.sq-noscript {
  margin: 1.5rem;
  padding: 1rem;
  border: 1px solid var(--sq-border);
  border-radius: var(--sq-radius-sm);
  background: var(--sq-page);
  color: var(--sq-text);
  text-align: center;
}

.sq-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@keyframes sq-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sq-pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(53, 93, 222, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(53, 93, 222, 0);
  }
}

@keyframes sq-card-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }

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

@keyframes sq-card-out {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@media (max-width: 760px) {
  .sq-welcome {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .sq-welcome__copy {
    max-width: none;
  }

  .sq-welcome h1 {
    max-width: 14ch;
  }

  .sq-demo-panel {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .sq-app {
    padding: 0;
  }

  .sq-shell {
    min-height: 100svh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sq-brand {
    min-height: 58px;
    padding: 0.65rem 1rem;
  }

  .sq-brand__mark {
    width: 32px;
    height: 32px;
  }

  .sq-brand__labels .sq-badge:last-child {
    display: none;
  }

  .sq-screen {
    padding: 1.25rem 1rem 1.5rem;
  }

  .sq-welcome h1 {
    font-size: clamp(2.15rem, 10vw, 3rem);
  }

  .sq-question-heading {
    align-items: flex-start;
  }

  .sq-position-key {
    display: none;
  }

  .sq-image-stage {
    min-height: 190px;
  }

  .sq-collage {
    max-height: min(48vh, 460px);
  }

  .sq-option {
    min-height: 58px;
    grid-template-columns: 34px 1fr 20px;
    gap: 0.55rem;
    padding: 0.55rem 0.6rem;
  }

  .sq-option__number {
    width: 34px;
    height: 34px;
  }

  .sq-option__check {
    width: 20px;
    height: 20px;
  }

  .sq-result,
  .sq-preparing {
    min-height: calc(100svh - 58px);
    justify-content: flex-start;
    padding-top: 2rem;
  }

  .sq-progress--complete {
    margin-bottom: 1.5rem;
  }

  .sq-result-card {
    margin-top: 1.1rem;
  }
}

@media (max-width: 390px) {
  .sq-brand__labels .sq-badge--accent {
    font-size: 0.68rem;
  }

  .sq-progress-panel__row {
    align-items: flex-start;
  }

  .sq-completion-copy {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }

  .sq-viewing-helper {
    font-size: 0.75rem;
  }

  .sq-option {
    grid-template-columns: 32px 1fr;
  }

  .sq-option__check {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
  }

  .sq-option__number {
    width: 32px;
    height: 32px;
  }

  .sq-option__label {
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
