:root {
  --bg: #ffffff;
  --text: #111111;
  --muted: #6f6f73;
  --line: #dfdfe3;
  --line-strong: #c4c4cc;
  --blue: #0445af;
  --blue-deep: #02368f;
  --blue-soft: rgba(4, 69, 175, 0.08);
  --shadow: 0 20px 60px rgba(17, 17, 17, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, rgba(4, 69, 175, 0.04), transparent 34%), var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top-bar {
  display: grid;
  gap: 14px;
  padding: 16px 18px 0;
}

.time-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 14px;
  margin-top: 14px;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #ececf1;
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width 220ms ease;
}

.screen-wrap {
  display: grid;
  place-items: center;
  padding: 28px 18px 96px;
}

.screen {
  width: min(100%, 760px);
}

.screen-card {
  animation: rise 220ms ease;
}

.screen-card--centered {
  max-width: 760px;
}

.hero-mark,
.hero-mark--done {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(4, 69, 175, 0.12), rgba(4, 69, 175, 0.02));
  margin-bottom: 30px;
}

.hero-mark--done {
  background: linear-gradient(135deg, rgba(4, 69, 175, 0.16), rgba(4, 69, 175, 0.03));
}

.quote-mark {
  color: var(--blue);
  font-size: clamp(64px, 10vw, 84px);
  line-height: 0.8;
  margin-bottom: 10px;
}

.question-kicker {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 10px;
}

.screen-title {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.hero-title {
  max-width: 12ch;
}

.screen-copy,
.statement-copy,
.screen-description,
.group-prompt,
.group-label,
.textarea-hint,
.inline-message {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  line-height: 1.65;
}

.screen-copy,
.statement-copy,
.screen-description,
.group-prompt {
  max-width: 60ch;
}

.statement-copy {
  font-size: clamp(1.45rem, 3.2vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
  max-width: 24ch;
}

.screen-description {
  color: var(--muted);
  margin-bottom: 24px;
}

.field-wrap {
  display: block;
  margin: 0 0 20px;
}

.text-input,
.text-area {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  border-radius: 0;
  outline: none;
  background: transparent;
  color: var(--blue);
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.25;
  padding: 10px 0 12px;
  transition: border-color 180ms ease;
}

.text-area {
  resize: none;
  min-height: calc(1.25em + 22px);
  overflow: hidden;
}

.text-input::placeholder,
.text-area::placeholder {
  color: rgba(4, 69, 175, 0.52);
}

.text-input:focus,
.text-area:focus {
  border-color: var(--blue);
}

.primary-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.primary-action-row--welcome {
  margin: 28px 0 0;
}

.primary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: var(--blue);
  color: #fff;
  border-radius: 8px;
  padding: 12px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--blue-deep);
  transform: translateY(-1px);
}

.primary-action:disabled {
  background: #7f9acf;
  cursor: wait;
  transform: none;
}

.button-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.hint-chip {
  color: var(--muted);
  font-size: 14px;
}

.inline-message {
  color: #b42318;
  margin: 14px 0 0;
}

.inline-group {
  display: grid;
  gap: 26px;
}

.voice-panel {
  display: grid;
  gap: 16px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f7f9fd);
}

.voice-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.98rem;
}

.voice-status--recording {
  color: var(--text);
}

.voice-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d92d20;
  box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.4);
  animation: pulse 1.2s ease-in-out infinite;
}

.voice-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.voice-preview {
  width: 100%;
}

.voice-link,
.voice-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.captcha-wrap {
  margin: 12px 0 20px;
}

.captcha-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.scale-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.group-label {
  display: inline-block;
  color: var(--text);
  margin-bottom: 14px;
}

.scale-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;
  max-width: 680px;
}

.scale-option {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.scale-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scale-option span {
  color: var(--blue);
  font-weight: 600;
  font-size: 1.1rem;
}

.scale-option:has(input:checked) {
  background: var(--blue);
  border-color: var(--blue);
}

.scale-option:has(input:checked) span {
  color: #fff;
}

.textarea-hint {
  display: inline-block;
  color: var(--muted);
  margin-top: 10px;
  font-size: 0.95rem;
}

.group-block {
  display: grid;
  gap: 18px;
}

.completion-meta {
  margin-top: 20px;
}

.secondary-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}

.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 18px;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.96) 28%, rgba(255, 255, 255, 0.96));
}

.nav-cluster {
  display: flex;
  gap: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.icon-button[hidden] {
  visibility: hidden;
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

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

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.4);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(217, 45, 32, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(217, 45, 32, 0);
  }
}

@media (max-width: 760px) {
  .top-bar {
    padding: 12px 12px 0;
  }

  .screen-wrap {
    align-items: start;
    padding: 20px 12px;
  }

  .screen {
    width: 100%;
  }

  .scale-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .voice-actions {
    flex-direction: column;
  }

  .bottom-bar {
    position: sticky;
    bottom: 0;
    left: auto;
    right: auto;
    z-index: auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(17, 17, 17, 0.06);
  }

}

@media (max-width: 520px) {
  .screen-title {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .statement-copy {
    font-size: clamp(1.3rem, 7vw, 2rem);
  }

  .text-input,
  .text-area {
    font-size: 1.35rem;
  }

  .bottom-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-cluster {
    order: 2;
  }
}
