/* Shared controls explicitly outrank dashboard button rules on every entry point. */
.answer-welcome, [data-panel=answer] {
  --setup-ink: #405137;
  --setup-muted: #687461;
  --setup-green: #236324;
  --setup-line: #e0e8e2;
  color: var(--setup-ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: normal;
  word-spacing: normal;
}
.answer-welcome, .answer-welcome * { box-sizing: border-box; }
.answer-welcome {
  width: min(480px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid #e7ede7;
  border-radius: 24px;
  background: #fffefa;
  box-shadow: 0 24px 80px #24491826;
  overflow: hidden;
  animation: setup-open .28s ease-out both;
}
.answer-welcome::backdrop { background: #17341166; backdrop-filter: blur(5px); }
.setup-frame { display: block; min-height: 0; }
.setup-content {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 26px);
  min-width: 0;
  padding: 20px 26px;
  background: radial-gradient(ellipse at 100% 0, #eff7e9 0, transparent 210px);
}
.setup-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.setup-counter { color: var(--setup-muted); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums; }
.answer-welcome button { font-family: inherit; font-weight: 400; cursor: pointer; touch-action: manipulation; letter-spacing: normal; }
.answer-welcome .setup-skip { border: 0; background: none; color: var(--setup-muted); min-height: 40px; padding: 7px 0 7px 12px; font-size: 12px; }
.setup-progress { position: relative; display: flex; justify-content: space-between; margin: 8px 0 24px; flex-shrink: 0; isolation: isolate; }
.setup-progress::before, .setup-progress::after { content: ''; position: absolute; inset-inline-start: 22px; top: 21px; height: 3px; width: calc(100% - 44px); background: #e5edda; z-index: -1; border-radius: 8px; }
.setup-progress::after { background: #88c540; transform: scaleX(var(--setup-progress, 0)); transform-origin: left; transition: transform .4s ease; }
[dir=rtl] .setup-progress::after { transform-origin: right; }
.setup-progress button { display: grid; place-items: center; border: 1px solid #dce6d4; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: #fffefa; transition: background .25s, border-color .25s, transform .25s; }
.setup-progress button[aria-current=step] { background: #eaf6dc; border-color: #88c540; box-shadow: 0 0 0 5px #88c54014; transform: scale(1.08); }
.setup-progress button.is-done { background: #236324; border-color: #236324; }
.setup-progress button.is-done .setup-icon { color: #fff; }
.setup-progress button:disabled { opacity: 1; }
.setup-progress button:disabled .setup-icon { color: #b2bfa7; }
.setup-progress .setup-icon svg { width: 22px; height: 22px; }
.setup-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; color: #537e36; }
.setup-icon svg { width: 24px; height: 24px; }
.setup-content h2 { font-family: inherit; font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -.45px; margin: 0 0 8px; color: #365f2b; outline: none; flex-shrink: 0; }
.setup-hint { font-size: 13px; line-height: 1.55; font-weight: 400; color: var(--setup-muted); margin: 0 0 18px; flex-shrink: 0; }
.setup-body { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 5px; margin: -5px; scrollbar-width: thin; scrollbar-color: #cfdbd0 transparent; }
.setup-body > * { animation: setup-arrive .26s ease-out both; }
.setup-body > :nth-child(2) { animation-delay: .035s; }
.setup-body > :nth-child(3) { animation-delay: .07s; }
.setup-body > :nth-child(4) { animation-delay: .105s; }
.setup-choices { border: 0; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; min-width: 0; }
.setup-choices legend { font-size: 12px; font-weight: 500; color: var(--setup-muted); padding: 0 0 8px; }
.answer-welcome .setup-choice { border: 1px solid var(--setup-line); border-radius: 13px; min-height: 58px; background: #fff; display: flex; align-items: center; gap: 9px; text-align: start; padding: 11px 12px; color: #405137; font-size: 13px; font-weight: 400; line-height: 1.45; transition: background .18s, border-color .18s, transform .18s; }
.answer-welcome .setup-choice:hover { background: #f7faf4; border-color: #abc696; }
.answer-welcome .setup-choice:active { transform: scale(.98); }
.answer-welcome .setup-choice[aria-pressed=true] { border-color: #88b75b; background: #f0f7eb; box-shadow: inset 0 0 0 1px #88b75b30; }
.setup-choice .setup-icon svg { width: 23px; height: 23px; stroke-width: 1.8; }
.setup-field { display: block; margin: 0 0 12px; font-size: 12px; font-weight: 500; color: var(--setup-muted); }
.setup-field:focus-within { position: relative; z-index: 5; }
.setup-field .setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding-top: 10px; flex-shrink: 0; }
.setup-flow-hint { color: #687461; font-size: 11px; line-height: 1.6; }
.answer-welcome .setup-finish { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: #236324; color: #fff; border-radius: 999px; min-height: 46px; padding: 11px 20px; margin-inline-start: auto; font-weight: 500; font-size: 14px; white-space: nowrap; transition: background .18s, transform .18s; }
.answer-welcome .setup-finish .setup-icon { color: #fff; }.setup-finish svg { width: 19px; height: 19px; }
.answer-welcome .setup-finish:hover { background: #3e672b; transform: translateY(-1px); }
.answer-welcome button:disabled { cursor: default; }.setup-finish:disabled { opacity: .6; }
.answer-welcome.is-advancing .setup-choice[aria-pressed=true] { animation: setup-choice-bloom .26s ease-out both; }
@keyframes setup-choice-bloom { 50% { box-shadow: 0 0 0 6px #88c54022; transform: scale(1.025); } 100% { box-shadow: 0 0 0 9px #88c54000; transform: scale(1); } }
.setup-note { font-size: 12px; line-height: 1.65; font-weight: 400; color: var(--setup-muted); margin: 8px 0 14px; }
.setup-recap { background: #f3f7ee; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 1.6; }
.setup-error { color: #a33932; font-size: 13px; line-height: 1.5; margin: 8px 0; flex-shrink: 0; }.setup-error:empty { display: none; }
[data-panel=answer] #answerTitle { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-family: inherit; font-weight: 600; color: #405137; font-size: 23px; }
[data-panel=answer] .answer-intro { color: #687461; font-size: 13px; font-weight: 400; margin: 0 0 18px; }
[data-panel=answer] #resolvedAnswer { background: #f0f6eb; border: 0; padding: 14px 16px; border-radius: 13px; font-size: 13px; font-weight: 400; line-height: 1.8; color: #536c48; }
[data-panel=answer] .language-settings { background: #fafcf7; border: 1px solid #e1e8dc; border-radius: 16px; padding: 16px 20px; }
[data-panel=answer] .language-settings h4 { font-family: inherit; font-weight: 500; color: #405137; }
[data-panel=answer] .language-settings p { font-weight: 400; font-size: 12px; color: #687461; }
[data-panel=answer] #answerForm { padding: 20px; border: 1px solid #e1e8dc; border-radius: 18px; background: #fff; box-shadow: none; }
#answerForm > label:not(.dashboard-check), #answerForm .dashboard-fields > label { background: #fafbf8; border-radius: 13px; padding: 14px; font-size: 13px; font-weight: 400; color: #687461; min-width: 0; margin-bottom: 14px; }
#answerForm .answer-field-heading { display: flex; align-items: center; gap: 9px; min-height: 26px; font-weight: 500; line-height: 1.65; }
#answerForm .answer-field-heading .setup-icon svg { width: 21px; height: 21px; }
#answerForm .answer-select { margin-top: 4px; }#answerForm .dashboard-fields { gap: 14px; }
#answerForm small { font-weight: 400; font-size: 12px; line-height: 1.8; color: #687461; }
#answerForm .dashboard-check { padding: 14px; border-radius: 12px; background: #f0f6eb; align-items: center; font-size: 13px; font-weight: 400; color: #405137; }
#answerForm input[role=switch] { appearance: none; width: 40px; height: 24px; border-radius: 24px; background: #bcc9b8; border: 0; position: relative; flex-shrink: 0; cursor: pointer; transition: background .18s; }
#answerForm input[role=switch]:before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; top: 3px; inset-inline-start: 3px; box-shadow: 0 1px 3px #0002; transition: inset-inline-start .18s; }
#answerForm input[role=switch]:checked { background: #537e36; }#answerForm input[role=switch]:checked:before { inset-inline-start: 19px; }
#answerForm .dashboard-actions { padding-top: 14px; border-top: 1px solid #edf0e8; margin-bottom: 0; }
@keyframes setup-open { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes setup-arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media(max-width:520px) {
  .answer-welcome { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 20px; }
  .setup-content { max-height: calc(100dvh - 22px); padding: 14px 18px 18px; }
  .setup-content h2 { font-size: 21px; line-height: 1.3; }
  .setup-hint { margin-bottom: 14px; font-size: 12px; }
  .setup-progress { margin-bottom: 20px; }
  .answer-welcome .setup-choice { min-height: 54px; padding: 10px; font-size: 12px; gap: 7px; }
  .setup-choice .setup-icon svg { width: 20px; height: 20px; }
  .setup-footer { margin-top: 12px; padding-top: 12px; }
  [data-panel=answer] #answerForm { padding: 12px; }
  #answerForm .dashboard-fields { grid-template-columns: 1fr; gap: 0; }
}
@media(max-height:620px) {.setup-content { padding-top: 8px; }.setup-hint { margin-bottom: 10px; }.setup-footer { margin-top: 10px; padding-top: 10px; } }
@media(prefers-reduced-motion:reduce) { .answer-welcome, .answer-welcome *, .answer-welcome *::before, .answer-welcome *::after, .answer-select * { animation: none !important; transition: none !important; } }

.answer-welcome .setup-content h2 { margin-bottom: 16px; }
.setup-flow-hint:empty { display: none; }

/* Homepage header, answer-title highlight, livelier progress. */
.answer-welcome {
  background: linear-gradient(180deg, #fcfef9, #f3f8ec);
  border: 0;
  box-shadow: 0 24px 60px rgba(12, 36, 14, 0.28);
}
.answer-welcome .setup-content {
  padding: 0 0 18px;
  background: linear-gradient(180deg, #fcfef9, #f3f8ec);
}
.answer-welcome .setup-top {
  margin: 0;
  padding: 14px 22px;
  background: rgba(12, 36, 14, 0.92);
}
.answer-welcome .setup-counter { color: #d7e8c8; }
.answer-welcome .setup-skip { color: #f3fbe8; }
.answer-welcome .setup-skip:hover { color: #fff; }
.answer-welcome .setup-progress { margin: 18px 22px 16px; }
.answer-welcome .setup-progress::after {
  height: 4px;
  top: 20px;
  background: linear-gradient(90deg, #9ad24a, #5d9a2c);
  box-shadow: 0 0 10px rgba(136, 197, 64, 0.65);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.answer-welcome .setup-progress button[aria-current=step] {
  animation: setup-step-live 1.6s ease-in-out infinite;
}
@keyframes setup-step-live {
  0%, 100% { box-shadow: 0 0 0 0 rgba(136, 197, 64, 0.45); }
  70% { box-shadow: 0 0 0 9px rgba(136, 197, 64, 0); }
}
.answer-welcome .setup-content h2 {
  margin: 0 22px 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(100deg, #eaf6dc 0%, #f7fbf2 72%, #fff 100%);
  color: #236324;
  font-weight: 800;
}
.answer-welcome .setup-body,
.answer-welcome .setup-error { margin-inline: 17px; }
.answer-welcome .setup-footer { margin: 12px 22px 0; padding-top: 12px; }
.answer-welcome .setup-finish {
  background: linear-gradient(145deg, #4cae3a 0%, #2f8a2c 42%, #1f6b24 100%);
  box-shadow: 0 8px 18px rgba(31, 107, 36, 0.28);
  font-weight: 800;
}
.answer-welcome .setup-finish:hover { background: linear-gradient(145deg, #5abd48, #3e9a32 42%, #26782c); filter: brightness(1.04); }

/* Native touch pickers keep long language lists usable inside scrolling panels. */
.setup-field select:not([hidden]) { display:block;width:100%;min-height:44px;margin-top:6px;padding:10px 12px;border:1px solid var(--setup-line);border-radius:10px;background:#fff;color:var(--setup-ink);font:inherit; }
