.page-ai .site-header-cta {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.page-ai main {
  position: relative;
  z-index: 1;
}

.ai-hero {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 1024px) {
  .ai-hero {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 2rem;
  }
}

.ai-hero-text .plaza-subtitle {
  max-width: 36rem;
}

.ai-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #5b21b6;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(124, 106, 239, 0.25);
  border-radius: 9999px;
}

.ai-privacy-badge i {
  font-size: 0.7rem;
}

.ai-dashboard {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .ai-dashboard {
    grid-template-columns: minmax(0, 280px) 1fr;
    align-items: stretch;
  }
}

.ai-score-panel {
  background: linear-gradient(145deg, #6d5ce7 0%, #8b5cf6 52%, #a78bfa 100%);
  border-radius: 1.5rem;
  padding: 1.5rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 16px 48px rgba(109, 92, 231, 0.35);
  position: relative;
  overflow: hidden;
}

.ai-score-panel::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  top: -60px;
  right: -40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.ai-score-panel::after {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  bottom: -30px;
  left: -20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.ai-score-ring-wrap {
  position: relative;
  width: 148px;
  height: 148px;
  margin-bottom: 1rem;
}

.ai-score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ai-score-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 10;
}

.ai-score-ring-fill {
  fill: none;
  stroke: #fff;
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ai-score-num {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.ai-score-label {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-top: 0.25rem;
}

.ai-score-grade {
  font-size: 0.875rem;
  font-weight: 600;
  opacity: 0.95;
}

.ai-score-hint {
  font-size: 0.75rem;
  opacity: 0.8;
  line-height: 1.5;
  max-width: 14rem;
}

.ai-dimensions {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.5rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ai-dimensions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.ai-dimensions-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #111827;
}

.ai-dimensions-updated {
  font-size: 0.7rem;
  color: #9ca3af;
}

.ai-dim-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
}

.ai-dim-icon {
  width: 2rem;
  height: 2rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.ai-dim-icon--keywords {
  background: #fef3c7;
  color: #d97706;
}

.ai-dim-icon--layout {
  background: #d1fae5;
  color: #059669;
}

.ai-dim-icon--metrics {
  background: #dbeafe;
  color: #2563eb;
}

.ai-dim-icon--ats {
  background: #ede9fe;
  color: #7c3aed;
}

.ai-dim-body {
  min-width: 0;
}

.ai-dim-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.35rem;
}

.ai-dim-bar {
  height: 6px;
  background: #f3f4f6;
  border-radius: 9999px;
  overflow: hidden;
}

.ai-dim-bar-fill {
  height: 100%;
  border-radius: 9999px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-dim-bar-fill--warn {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.ai-dim-bar-fill--good {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.ai-dim-bar-fill--info {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.ai-dim-bar-fill--brand {
  background: linear-gradient(90deg, #7c6aef, #a78bfa);
}

.ai-dim-pct {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111827;
  min-width: 2.5rem;
  text-align: right;
}

.ai-insights {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .ai-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ai-insight-card {
  background: #fff;
  border-radius: 1.25rem;
  border: 1px solid #e5e7eb;
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}

.ai-insight-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.ai-insight-card--warn::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.ai-insight-card--good::before {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.ai-insight-card--info::before {
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.ai-insight-card:hover {
  border-color: #c4b5fd;
  box-shadow: 0 8px 28px rgba(124, 106, 239, 0.1);
  transform: translateY(-2px);
}

.ai-insight-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ai-insight-icon {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.ai-insight-card--warn .ai-insight-icon {
  background: #fef3c7;
  color: #d97706;
}

.ai-insight-card--good .ai-insight-icon {
  background: #d1fae5;
  color: #059669;
}

.ai-insight-card--info .ai-insight-icon {
  background: #dbeafe;
  color: #2563eb;
}

.ai-insight-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: #111827;
}

.ai-insight-text {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.65;
  margin: 0;
}

.ai-insight-action {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 0.35rem 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.ai-insight-action:hover {
  background: #fef3c7;
  border-color: #fcd34d;
}

.ai-keywords-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.5rem;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.ai-keywords-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.ai-keywords-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
}

.ai-keywords-desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.ai-keywords-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #7c6aef, #8b5cf6);
  padding: 0.5rem 1rem;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  flex-shrink: 0;
}

.ai-keywords-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.ai-keywords-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

.ai-keywords-groups {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .ai-keywords-groups {
    grid-template-columns: 1fr 1fr;
  }
}

.ai-kw-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.ai-kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-kw-chip {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.ai-kw-chip--missing {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.ai-kw-chip--found {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.ai-kw-chip.is-filled {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
  animation: ai-chip-pop 0.35s ease;
}

@keyframes ai-chip-pop {
  0% { transform: scale(0.92); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.ai-actions {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .ai-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.ai-action-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}

.ai-action-card--highlight {
  background: linear-gradient(160deg, #faf5ff 0%, #fff 45%);
  border-color: #ddd6fe;
}

.ai-action-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.ai-action-icon--scan {
  background: #ede9fe;
  color: #7c3aed;
}

.ai-action-icon--mic {
  background: #dbeafe;
  color: #2563eb;
}

.ai-action-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #111827;
}

.ai-action-desc {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.35rem;
  line-height: 1.6;
  flex: 1;
}

.ai-action-btn {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  align-self: flex-start;
}

.ai-action-btn--primary {
  color: #fff;
  background: #7c6aef;
}

.ai-action-btn--primary:hover {
  background: #6d5ce7;
}

.ai-action-btn--secondary {
  color: #7c6aef;
  background: #f5f3ff;
  border: 1px solid #ddd6fe;
}

.ai-action-btn--secondary:hover {
  background: #ede9fe;
}

.ai-action-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

.ai-action-btn.is-loading i {
  animation: ai-spin 0.8s linear infinite;
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

.ai-intro-output {
  margin-top: 1rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  position: relative;
}

.ai-intro-output.is-visible {
  animation: ai-fade-in 0.35s ease;
}

@keyframes ai-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-intro-text {
  font-size: 0.8125rem;
  color: #475569;
  line-height: 1.75;
  margin: 0;
}

.ai-intro-copy {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: #7c6aef;
  background: #fff;
  border: 1px solid #ddd6fe;
  padding: 0.25rem 0.6rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background 0.15s;
}

.ai-intro-copy:hover {
  background: #f5f3ff;
}

.ai-intro-copy.is-copied {
  color: #059669;
  border-color: #a7f3d0;
  background: #ecfdf5;
}

.ai-bottom-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding-top: 0.5rem;
}

.ai-bottom-cta a {
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 0.625rem;
  transition: background 0.15s, border-color 0.15s;
}

.ai-bottom-cta .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.ai-bottom-cta .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
