.fq-shell {
  max-width: min(92vw, 660px);
  margin: 0 auto;
  padding: 0 4px 24px;
  color: var(--cg-ink);
  font-family: Inter, Arial, sans-serif;
}

.fq-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.fq-stats {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
}

.fq-stat {
  flex: 1 1 0;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  box-shadow: 0 8px 18px rgba(33, 43, 40, 0.07);
  text-align: center;
}

.fq-stat span {
  display: block;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fq-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
  line-height: 1;
}

.fq-urgent { color: var(--cg-red); }

.fq-actions { display: flex; flex: 0 0 auto; gap: 6px; }

.fq-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.fq-btn:focus-visible,
.fq-chip:focus-visible,
.fq-choice:focus-visible,
.fq-input:focus-visible {
  outline: 3px solid rgba(49, 95, 157, 0.42);
  outline-offset: 2px;
}

.fq-icon { padding: 0; font-size: 18px; }

.fq-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #315f9d, #127a89);
  color: #fff;
}

.fq-board {
  position: relative;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 18px 16px;
  border: 1px solid var(--cg-line);
  border-radius: 18px;
  background: radial-gradient(circle at 50% -10%, #ffffff, #eef1ec 62%);
  box-shadow: var(--cg-shadow);
}

.fq-flag {
  width: min(100%, 330px);
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(30, 37, 40, 0.24), 0 0 0 1px rgba(30, 37, 40, 0.18);
}

.fq-flag svg { display: block; width: 100%; height: 100%; }

.fq-prompt {
  min-height: 22px;
  margin: 0;
  color: var(--cg-muted);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.fq-right { color: var(--cg-green); font-size: 17px; }
.fq-wrong { color: var(--cg-red); font-size: 17px; }

.fq-panel {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 10px;
  width: min(88%, 330px);
  padding: 20px;
  border: 1px solid var(--cg-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 26px 60px rgba(30, 37, 40, 0.26);
  text-align: center;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(8px);
}

.fq-panel strong { font-size: 22px; }
.fq-panel p { margin: 0; color: var(--cg-muted); font-size: 13px; line-height: 1.45; }
.fq-panel .fq-btn { justify-self: center; min-width: 140px; }
.fq-hide { display: none !important; }

.fq-result-actions { display: flex; gap: 8px; justify-content: center; }
.fq-result-actions .fq-btn { min-width: 0; padding: 0 14px; }

.fq-answer { margin-top: 12px; }

.fq-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.fq-choices[hidden] { display: none; }

.fq-choice {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 12px;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: var(--cg-panel);
  color: var(--cg-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(33, 43, 40, 0.06);
}

.fq-choice i {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: #eef1ec;
  color: var(--cg-muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.fq-choice span { flex: 1 1 auto; min-width: 0; }
.fq-choice:hover { border-color: var(--cg-blue); }
.fq-ok { border-color: transparent; background: #e2f6ec; color: #14563f; }
.fq-ok i { background: var(--cg-green); color: #fff; }
.fq-no { border-color: transparent; background: #fdeceb; color: #8d2e2a; }
.fq-no i { background: var(--cg-red); color: #fff; }

.fq-typed { display: flex; gap: 8px; }
.fq-typed[hidden] { display: none; }
.fq-field { position: relative; flex: 1 1 auto; min-width: 0; }

.fq-input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: #fff;
  color: var(--cg-ink);
  font: inherit;
  font-size: 15px;
}

.fq-shake { animation: fq-shake 320ms ease; }

.fq-suggest {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 6px);
  right: 0;
  left: 0;
  overflow: hidden;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(20, 30, 34, 0.2);
}

.fq-suggest[hidden] { display: none; }

.fq-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--cg-line);
  background: #fff;
  color: var(--cg-ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.fq-option:last-child { border-bottom: 0; }
.fq-option.fq-active,
.fq-option:hover { background: #eef4fb; }

.fq-below {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.fq-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--cg-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.fq-label {
  flex: 0 0 58px;
  color: var(--cg-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fq-chips { display: flex; flex: 1 1 auto; flex-wrap: wrap; gap: 6px; }

.fq-chip {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--cg-line);
  border-radius: 999px;
  background: #fff;
  color: var(--cg-ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}

.fq-chip-on {
  border-color: transparent;
  background: linear-gradient(135deg, #315f9d, #127a89);
  color: #fff;
}

.fq-modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(30, 37, 40, 0.45);
}

.fq-modal[hidden] { display: none; }

.fq-modal-card {
  position: relative;
  width: min(100%, 460px);
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(30, 37, 40, 0.3);
}

.fq-modal-card h2 { margin: 0 48px 12px 0; }
.fq-modal-card p { color: var(--cg-muted); line-height: 1.5; }

.fq-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--cg-line);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 22px;
  cursor: pointer;
}

@keyframes fq-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (max-width: 640px) {
  .fq-shell { max-width: 100%; padding: 0 2px 20px; }
  .fq-board { padding: 14px 10px; border-radius: 14px; }
  .fq-flag { width: min(100%, 260px); }
  .fq-stat { padding: 6px 4px; }
  .fq-stat strong { font-size: 15px; }
  .fq-choices { grid-template-columns: minmax(0, 1fr); }
  .fq-choice { min-height: 48px; font-size: 14px; }
  .fq-typed { flex-wrap: wrap; }
  .fq-field { flex: 1 1 100%; }
  .fq-typed .fq-btn { flex: 1 1 0; }
  .fq-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .fq-label { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .fq-shake { animation: none; }
}
