:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #171717;
  --muted: #475569;
  --line: #d7dee8;
  --accent: #2563eb;
  --accent-dark: #1e3a8a;
  --accent-soft: #eff6ff;
  --warn-bg: #fff5d6;
  --warn-border: #e7bd45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page-shell {
  width: min(100%, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 16px;
  display: grid;
  align-items: center;
}

.panel {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 44px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgb(15 23 42 / 7%);
}

.stack {
  display: grid;
  gap: 18px;
}

.center {
  text-align: center;
  justify-items: center;
}

.private-warning {
  width: min(100%, 680px);
  margin: 0 auto 18px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 700;
}

.brand-logo {
  display: block;
  width: 88px;
  height: auto;
  margin: 0 0 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.greeting,
.lead,
.hint,
.form-instruction {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lead {
  color: #334155;
  font-weight: 500;
}

.form-instruction {
  color: var(--accent-dark);
  font-weight: 700;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.answer-form {
  display: grid;
  gap: 14px;
}

.suggested-choices {
  display: grid;
  gap: 10px;
}

.choice-instruction {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
  line-height: 1.45;
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.suggested-choice-form {
  margin: 0;
}

.suggested-choice {
  min-height: 44px;
  max-width: 100%;
  padding: 8px 13px;
  border: 1px solid #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent-dark);
  text-align: left;
  gap: 2px;
  flex-direction: column;
  align-items: flex-start;
}

.suggested-choice small {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
}

textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
}

textarea:focus {
  border-color: var(--accent);
  outline: 3px solid rgb(37 99 235 / 18%);
}

.char-limit {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

button,
.button-link {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.button-link:hover {
  background: var(--accent-dark);
}

.suggested-choice {
  border: 1px solid #bfdbfe;
  background: var(--accent-soft);
  color: var(--accent-dark);
  align-items: flex-start;
  text-align: left;
}

.suggested-choice:hover {
  border-color: var(--accent);
  background: #dbeafe;
  color: var(--accent-dark);
}

.secondary-form {
  margin: 0;
}

button.secondary {
  background: var(--accent-soft);
  color: var(--text);
}

.security-notice {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #1e3a8a;
  line-height: 1.55;
}

.notice {
  padding: 12px 14px;
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  background: var(--warn-bg);
  color: #4f3c00;
  line-height: 1.45;
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.thinking-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  animation: thinking-pulse 1s ease-in-out infinite;
}

@keyframes thinking-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.field-errors {
  color: #8a1f17;
}

.summary {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  text-align: left;
  line-height: 1.55;
}

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

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 560px) {
  .page-shell {
    padding: 12px;
    align-items: start;
  }

  .panel {
    padding: 22px;
  }

  .header-row {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    max-width: 100%;
    font-size: 2.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thinking-dot {
    animation: none;
    opacity: 1;
    transform: none;
  }
}
