.cqa-shell {
  --cqa-primary: #0f172a;
  --cqa-accent: #25D366;
  --cqa-surface: #dcf8c6;
  --cqa-muted: #64748b;
  --cqa-border: rgba(15, 23, 42, 0.09);
  --cqa-shadow: 0 18px 55px rgba(15, 23, 42, 0.12);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--cqa-primary);
}

.cqa-shell * {
  box-sizing: border-box;
}

.cqa-card {
  position: relative;
  overflow: hidden;
  max-width: 940px;
  margin: 0 auto;
  padding: 28px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(37, 211, 102, 0.32), transparent 30%),
    radial-gradient(circle at bottom left, rgba(18, 140, 126, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(220, 248, 198, 0.98), rgba(235, 255, 239, 0.98));
  border: 1px solid var(--cqa-border);
  box-shadow: var(--cqa-shadow);
}

.cqa-card::before,
.cqa-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(8px);
}

.cqa-card::before {
  width: 280px;
  height: 280px;
  top: -100px;
  right: -90px;
  background: rgba(37, 211, 102, 0.12);
}

.cqa-card::after {
  width: 220px;
  height: 220px;
  bottom: -120px;
  left: -80px;
  background: rgba(15, 23, 42, 0.05);
}

.cqa-header,
.cqa-form,
.cqa-loading,
.cqa-result {
  position: relative;
  z-index: 1;
}

.cqa-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--cqa-primary);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.cqa-title {
  margin: 16px 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.cqa-subtitle {
  margin: 0;
  max-width: 720px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--cqa-muted);
}

.cqa-form {
  margin-top: 26px;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.cqa-form.is-hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  position: absolute;
  inset: auto 28px auto 28px;
}

.cqa-label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.cqa-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.cqa-input {
  width: 100%;
  min-height: 58px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.62);
  font-size: 1rem;
  color: var(--cqa-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.cqa-input:focus {
  outline: none;
  border-color: rgba(37, 211, 102, 0.65);
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.12);
  transform: translateY(-1px);
}

.cqa-input-error {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.cqa-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 58px;
  padding: 0 22px;
  border-radius: 18px;
  border: 0;
  font-size: 0.98rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

.cqa-btn:hover {
  transform: translateY(-2px);
}

.cqa-btn-primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cqa-primary), var(--cqa-accent));
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.22);
}

.cqa-btn-secondary {
  color: var(--cqa-primary);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.cqa-disclaimer {
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--cqa-muted);
}

.cqa-disclaimer-top {
  margin: 14px 4px 0;
}

.cqa-loading,
.cqa-result {
  margin-top: 26px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.cqa-loading {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.cqa-loading.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cqa-loading-head,
.cqa-result-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.cqa-loading-kicker,
.cqa-result-label,
.cqa-summary-title,
.cqa-score-title {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cqa-muted);
}

.cqa-loading-title,
.cqa-result-profile {
  margin: 0;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.cqa-loading-percent,
.cqa-score-value {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 92px;
  min-height: 58px;
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--cqa-primary);
  background: linear-gradient(180deg, rgba(37, 211, 102, 0.12), rgba(37, 211, 102, 0.02));
  border: 1px solid rgba(37, 211, 102, 0.18);
}

.cqa-progress {
  width: 100%;
  height: 14px;
  margin-top: 20px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.cqa-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cqa-accent), var(--cqa-primary));
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.25);
  transition: width 0.22s ease;
}

.cqa-loading-message {
  min-height: 28px;
  margin: 18px 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--cqa-primary);
  opacity: 0.92;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.cqa-loading-message.is-active {
  opacity: 1;
  transform: translateY(0);
}

.cqa-summary-box,
.cqa-footer-box {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.3));
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.cqa-summary-body,
.cqa-footer-note,
.cqa-share-text {
  margin: 0;
  line-height: 1.7;
  color: var(--cqa-primary);
}

.cqa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.cqa-item-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.cqa-item-title {
  margin: 0 0 10px;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.cqa-item-text {
  margin: 0;
  color: var(--cqa-muted);
  line-height: 1.7;
}

.cqa-actions {
  margin-top: 18px;
}

.cqa-result {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.cqa-result.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 780px) {
  .cqa-card {
    padding: 20px;
    border-radius: 24px;
  }

  .cqa-input-wrap,
  .cqa-grid {
    grid-template-columns: 1fr;
  }

  .cqa-loading-head,
  .cqa-result-top {
    flex-direction: column;
  }

  .cqa-loading-percent,
  .cqa-score-value {
    min-width: 0;
  }

  .cqa-form.is-hidden {
    inset: auto 20px auto 20px;
  }
}

.cqa-is-busy .cqa-analyze-btn {
  opacity: 0.8;
  pointer-events: none;
}

.cqa-history {
  position: relative;
  z-index: 1;
  margin-top: 26px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.cqa-history-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.cqa-history-kicker,
.cqa-history-country {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--cqa-muted);
}

.cqa-history-title {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.cqa-history-subtitle {
  margin: 0;
  max-width: 360px;
  line-height: 1.7;
  color: var(--cqa-muted);
}

.cqa-history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.cqa-history-item,
.cqa-history-empty {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.cqa-history-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.cqa-history-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 1.6rem;
  background: linear-gradient(180deg, rgba(37, 211, 102, 0.12), rgba(37, 211, 102, 0.03));
  border: 1px solid rgba(37, 211, 102, 0.18);
}

.cqa-history-meta {
  min-width: 0;
}

.cqa-history-country,
.cqa-history-number {
  word-break: break-word;
}

.cqa-history-number {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--cqa-primary);
}

.cqa-history-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--cqa-muted);
}

@media (max-width: 780px) {
  .cqa-history-head {
    flex-direction: column;
  }

  .cqa-history-subtitle {
    max-width: none;
  }

  .cqa-history-list {
    grid-template-columns: 1fr;
  }
}
