/* css/audit.css — SEO Audit report and form styles */

/* ============ AUDIT FORM ============ */
.audit-form {
  max-width: 640px;
  margin-inline: auto;
}

.audit-form__row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.audit-form__url-input {
  flex: 1;
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-family: var(--font-mono);
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-fast) var(--ease-out);
}

.audit-form__url-input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.audit-form__url-input::placeholder {
  color: var(--text-muted);
}

/* ============ CAPTCHA ============ */
.audit-captcha {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.audit-captcha__question {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  color: var(--accent-green);
  white-space: nowrap;
  min-width: 8ch;
}

.audit-captcha__input {
  width: 80px;
  padding: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-family: var(--font-mono);
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease-out);
}

.audit-captcha__input:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.audit-captcha__refresh {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  padding: var(--space-md);
  cursor: pointer;
  transition: color var(--duration-fast), border-color var(--duration-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.audit-captcha__refresh:hover {
  color: var(--accent-green);
  border-color: var(--accent-green);
}

.audit-form__submit {
  width: 100%;
  justify-content: center;
  text-align: center;
  transform: none !important;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.audit-form__submit:hover {
  transform: none !important;
  box-shadow: 0 0 20px rgba(45, 212, 168, 0.4), 0 0 40px rgba(45, 212, 168, 0.15);
  background: #24b893;
}

.audit-form__note {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-md);
  width: 100%;
  place-self: center;
}

.audit-progress {
  margin-top: var(--space-md);
}

.audit-form__error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  color: #ef4444;
  padding: var(--space-md) var(--space-lg);
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
  display: none;
}

.audit-form__error--visible {
  display: block;
}

/* ============ PROGRESS ============ */
.audit-progress {
  display: none;
  text-align: center;
  padding: var(--space-2xl) 0;
}

.audit-progress--active {
  display: block;
}

.audit-progress__bar {
  width: 100%;
  max-width: 400px;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  margin: var(--space-lg) auto;
  overflow: hidden;
}

.audit-progress__bar-fill {
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-terra));
  border-radius: var(--radius-full);
  animation: audit-progress-slide 1.5s ease-in-out infinite;
}

@keyframes audit-progress-slide {
  0% { transform: translateX(-100%); width: 30%; }
  50% { transform: translateX(100%); width: 60%; }
  100% { transform: translateX(300%); width: 30%; }
}

.audit-progress__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-md);
}

/* ============ SCORE CIRCLE ============ */
.audit-score-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.audit-score-circle {
  width: 160px;
  height: 160px;
}

.audit-score-circle__bg {
  fill: none;
  stroke: var(--bg-elevated);
  stroke-width: 8;
}

.audit-score-circle__value {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: score-arc-in 1.4s var(--ease-out) 0.3s both;
}

/* 1. Score arc draws itself on load */
@keyframes score-arc-in {
  from { stroke-dashoffset: 339.29; /* full circumference = 2*PI*54 */ }
}

.audit-score-circle__value--green { stroke: var(--accent-green); }
.audit-score-circle__value--amber { stroke: #f59e0b; }
.audit-score-circle__value--warning { stroke: #f59e0b; }
.audit-score-circle__value--error { stroke: #ef4444; }

.audit-score-circle__text {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: var(--weight-bold);
  fill: var(--text-primary);
  dominant-baseline: central;
}

.audit-score-circle__label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  fill: var(--text-muted);
  dominant-baseline: central;
}

/* ============ GRADE BADGE ============ */
.audit-grade {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  border: 2px solid;
}

.audit-grade--green {
  color: var(--accent-green);
  border-color: var(--accent-green);
  background: var(--accent-green-glow);
}

.audit-grade--amber {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.audit-grade--warning {
  color: #f59e0b;
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.audit-grade--error {
  color: #ef4444;
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ============ RADAR CHART ============ */
.audit-radar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.audit-radar {
  width: 300px;
  height: 300px;
}

.audit-radar__grid {
  fill: none;
  stroke: var(--border);
  stroke-width: 0.5;
}

.audit-radar__axis {
  stroke: var(--border);
  stroke-width: 0.5;
}

.audit-radar__area {
  fill: rgba(45, 212, 168, 0.15);
  stroke: var(--accent-green);
  stroke-width: 2;
  transition: all 0.6s var(--ease-out);
}

.audit-radar__area--warning {
  fill: rgba(245, 158, 11, 0.15);
  stroke: #f59e0b;
}

.audit-radar__area--error {
  fill: rgba(239, 68, 68, 0.15);
  stroke: #ef4444;
}

.audit-radar__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  fill: var(--text-secondary);
  text-anchor: middle;
}

.audit-radar__dot {
  r: 6;
  stroke: var(--bg-primary);
  stroke-width: 2;
  transition: r 0.2s;
}

.audit-radar__dot:hover {
  r: 9;
}

.audit-radar__tooltip {
  font-family: var(--font-body);
  font-size: 0.75rem;
  fill: var(--text-primary);
  text-anchor: middle;
  opacity: 0;
  transition: opacity 0.2s;
}

.audit-radar__dot:hover + .audit-radar__tooltip {
  opacity: 1;
}

/* ============ SCORE HERO ============ */
.audit-score-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2xl);
  align-items: center;
  margin: var(--space-2xl) 0;
  padding: var(--space-xl);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}
/* 2. Slow-breathing glow behind score */
.audit-score-hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -20%;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-green-glow) 0%, transparent 70%);
  filter: blur(60px);
  opacity: 0.4;
  pointer-events: none;
  animation: glow-breathe 4s ease-in-out infinite alternate;
}
@keyframes glow-breathe {
  from { opacity: 0.3; transform: scale(0.95); }
  to   { opacity: 0.6; transform: scale(1.05); }
}
.audit-score-hero__circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}
.audit-score-circle--xl {
  width: 200px;
  height: 200px;
}
.audit-grade--xl {
  width: 56px;
  height: 56px;
  font-size: var(--text-2xl);
}
.audit-score-hero__info {
  position: relative;
  z-index: 1;
}
.audit-score-hero__verdict {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 50ch;
  margin-bottom: var(--space-xl);
  line-height: var(--leading-relaxed);
}

@media (max-width: 768px) {
  .audit-score-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .audit-score-hero__circle {
    flex-direction: row;
    justify-content: center;
  }
  .audit-score-circle--xl {
    width: 140px;
    height: 140px;
  }
  .audit-grade--xl {
    width: 48px;
    height: 48px;
    font-size: var(--text-xl);
  }
}

/* ============ SUMMARY GRID (legacy) ============ */
.audit-summary-grid {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-2xl);
  align-items: start;
  margin: var(--space-2xl) 0;
}

/* ============ QUICK WINS HERO BAR ============ */
.audit-qw-hero {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-xl);
}
.audit-qw-hero__count {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}
.audit-qw-hero__number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: 1;
}
.audit-qw-hero__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}
.audit-qw-hero__bar-wrap {
  flex: 1;
  min-width: 0;
}
.audit-qw-stackbar {
  display: flex;
  height: 12px;
  border-radius: var(--radius-full);
  overflow: hidden;
  gap: 2px;
}
/* 5. Stacked bar segments animate in */
.audit-qw-stackbar__seg {
  border-radius: var(--radius-full);
  animation: stackbar-in 0.8s var(--ease-out) 0.2s both;
}
/* ============ BENCHMARK BAR ============ */
.audit-benchmark {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.audit-benchmark__bar {
  position: relative;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: visible;
  display: flex;
}
.audit-benchmark__zone {
  height: 100%;
}
.audit-benchmark__zone--low {
  background: rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-full) 0 0 var(--radius-full);
}
.audit-benchmark__zone--mid {
  background: rgba(245, 158, 11, 0.2);
}
.audit-benchmark__zone--high {
  background: rgba(45, 212, 168, 0.2);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}
.audit-benchmark__avg,
.audit-benchmark__you {
  position: absolute;
  top: -4px;
  width: 3px;
  height: 16px;
  border-radius: 2px;
  transform: translateX(-50%);
}
.audit-benchmark__avg {
  background: var(--text-muted);
}
.audit-benchmark__you {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green-glow);
}
.audit-benchmark__labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-xs);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.audit-benchmark__avg-label {
  color: var(--text-secondary);
  font-size: 0.7rem;
}

/* ============ QW PROGRESS BAR ============ */
.audit-qw-progress {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
.audit-qw-progress__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  white-space: nowrap;
  font-family: var(--font-mono);
}
.audit-qw-progress__bar {
  flex: 1;
  height: 6px;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.audit-qw-progress__fill {
  height: 100%;
  background: var(--accent-green);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease-out);
}

/* ============ QW CHECKBOX ============ */
.audit-qw-check {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.audit-qw-check__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.audit-qw-check__box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-out);
  flex-shrink: 0;
}
.audit-qw-check__input:checked + .audit-qw-check__box {
  background: var(--accent-green);
  border-color: var(--accent-green);
}
.audit-qw-check__input:checked + .audit-qw-check__box::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid var(--bg-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.audit-qw-check__input:focus-visible + .audit-qw-check__box {
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}
/* Done state — dim the card */
.audit-quickwin--done {
  opacity: 0.5;
  transform: scale(0.98);
  transition: opacity 0.3s, transform 0.3s;
}
.audit-quickwin--done .audit-quickwin__title {
  text-decoration: line-through;
  text-decoration-color: var(--accent-green);
}

/* ============ SHARE BUTTON ============ */
.audit-share-btn span {
  transition: color 0.2s;
}

@keyframes stackbar-in {
  from { width: 0 !important; opacity: 0; }
  to { opacity: 1; }
}

/* ============ PREMIUM EFFECTS ============ */

/* 1. Score number counter-style reveal — typewriter fade */
.audit-score-circle__text {
  animation: score-num-reveal 0.6s var(--ease-out) 0.8s both;
}
@keyframes score-num-reveal {
  from { opacity: 0; transform: scale(1.4); filter: blur(4px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

/* 2. Grade badge bounce-in */
.audit-grade {
  animation: grade-bounce 0.5s var(--ease-out) 1.2s both;
}
@keyframes grade-bounce {
  0% { opacity: 0; transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

/* 3. Verdict pills stagger pop-in */
.audit-verdicts > * {
  animation: pill-pop 0.4s var(--ease-out) both;
}
.audit-verdicts > *:nth-child(1) { animation-delay: 0.3s; }
.audit-verdicts > *:nth-child(2) { animation-delay: 0.4s; }
.audit-verdicts > *:nth-child(3) { animation-delay: 0.5s; }
.audit-verdicts > *:nth-child(4) { animation-delay: 0.55s; }
.audit-verdicts > *:nth-child(5) { animation-delay: 0.6s; }
.audit-verdicts > *:nth-child(6) { animation-delay: 0.65s; }
@keyframes pill-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 4. Table rows subtle cascade entrance */
.audit-section--visible .audit-table tbody tr {
  animation: row-slide 0.3s var(--ease-out) both;
}
.audit-section--visible .audit-table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.audit-section--visible .audit-table tbody tr:nth-child(2) { animation-delay: 0.08s; }
.audit-section--visible .audit-table tbody tr:nth-child(3) { animation-delay: 0.11s; }
.audit-section--visible .audit-table tbody tr:nth-child(4) { animation-delay: 0.14s; }
.audit-section--visible .audit-table tbody tr:nth-child(5) { animation-delay: 0.17s; }
.audit-section--visible .audit-table tbody tr:nth-child(6) { animation-delay: 0.20s; }
.audit-section--visible .audit-table tbody tr:nth-child(n+7) { animation-delay: 0.23s; }
@keyframes row-slide {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 5. Section heading accent line grow */
.audit-section__title {
  position: relative;
  padding-bottom: var(--space-sm);
}
.audit-section--visible .audit-section__title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-green), transparent);
  animation: line-grow 0.8s var(--ease-out) 0.2s both;
}
@keyframes line-grow {
  from { width: 0; }
  to { width: 120px; }
}

/* 6. Quick win cards — severity stripe pulse on hover */
.audit-quickwin:hover::before {
  animation: stripe-pulse 0.6s ease;
}
@keyframes stripe-pulse {
  0%, 100% { width: 4px; }
  50% { width: 6px; }
}

/* 7. Score hero — floating particles via pseudo-elements (pure CSS) */
.audit-score-hero__circle::before,
.audit-score-hero__circle::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
}
.audit-score-hero__circle::before {
  width: 6px; height: 6px;
  background: var(--accent-green);
  top: 10%; left: 15%;
  animation: particle-float 4s ease-in-out 1.5s infinite alternate;
}
.audit-score-hero__circle::after {
  width: 4px; height: 4px;
  background: var(--accent-terra);
  bottom: 20%; right: 10%;
  animation: particle-float 5s ease-in-out 2s infinite alternate-reverse;
}
@keyframes particle-float {
  from { opacity: 0; transform: translateY(0) scale(0.5); }
  50% { opacity: 0.6; }
  to { opacity: 0; transform: translateY(-30px) scale(1); }
}

/* 8. Gauge bar marker — pulse on load */
.audit-gauge__marker {
  animation: marker-pulse 0.4s ease 1s both;
}
@keyframes marker-pulse {
  0% { transform: translateX(-50%) scale(0); }
  70% { transform: translateX(-50%) scale(1.5); }
  100% { transform: translateX(-50%) scale(1); }
}

/* 9. Nav link active — glow ring */
.audit-nav__link--active {
  box-shadow: 0 0 12px var(--accent-green-glow), inset 0 0 8px var(--accent-green-glow);
}

/* 10. CTA hero card — shimmer border effect */
.audit-path--hero {
  position: relative;
  overflow: hidden;
}
.audit-path--hero::after {
  content: '';
  position: absolute;
  top: -1px; left: -100%;
  width: 60%;
  height: calc(100% + 2px);
  background: linear-gradient(90deg, transparent, rgba(45,212,168,0.15), transparent);
  animation: shimmer-border 4s ease-in-out 2s infinite;
  pointer-events: none;
}
@keyframes shimmer-border {
  0% { left: -60%; }
  40%, 100% { left: 160%; }
}

/* 11. Radar dots — sequential pulse */
.audit-radar__dot {
  animation: radar-dot-in 0.5s var(--ease-out) both;
}
.audit-radar__dot:nth-child(8n+1) { animation-delay: 0.6s; }
.audit-radar__dot:nth-child(8n+2) { animation-delay: 0.75s; }
.audit-radar__dot:nth-child(8n+3) { animation-delay: 0.9s; }
.audit-radar__dot:nth-child(8n+4) { animation-delay: 1.05s; }
.audit-radar__dot:nth-child(8n+5) { animation-delay: 1.2s; }
.audit-radar__dot:nth-child(8n+6) { animation-delay: 1.35s; }
.audit-radar__dot:nth-child(8n+7) { animation-delay: 1.5s; }
.audit-radar__dot:nth-child(8n+8) { animation-delay: 1.65s; }
@keyframes radar-dot-in {
  0% { r: 0; opacity: 0; }
  60% { r: 9; opacity: 1; }
  100% { r: 6; opacity: 1; }
}

/* 12. Table row — left accent glow on hover */
.audit-table tbody tr {
  position: relative;
}
.audit-table tbody tr::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--accent-green);
  transition: width 0.2s var(--ease-out);
  pointer-events: none;
}
.audit-table tbody tr:hover::after {
  width: 3px;
}

/* 13. Collapsible — smooth arrow rotation */
.audit-collapsible__title {
  position: relative;
  padding-left: 1.2em;
}
.audit-collapsible__title::before {
  content: '>';
  position: absolute;
  left: 0;
  display: inline-block;
  transition: transform 0.25s var(--ease-out);
  font-family: var(--font-mono);
}
.audit-collapsible[open] > .audit-collapsible__title::before {
  transform: rotate(90deg);
}
/* Hide native marker */
.audit-collapsible summary { list-style: none; }
.audit-collapsible summary::-webkit-details-marker { display: none; }

/* 14. Section title — underline draw on reveal */
.audit-section__title {
  position: relative;
  display: inline-block;
}
.audit-section--visible .audit-section__title::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-terra), transparent);
  animation: title-underline 0.8s var(--ease-out) 0.2s both;
}
@keyframes title-underline {
  from { width: 0; }
  to { width: 100%; }
}

/* 15. Quick win cards — staggered entrance */
.audit-section--visible .audit-quickwin:nth-child(1) { animation: qw-enter 0.4s var(--ease-out) 0.1s both; }
.audit-section--visible .audit-quickwin:nth-child(2) { animation: qw-enter 0.4s var(--ease-out) 0.2s both; }
.audit-section--visible .audit-quickwin:nth-child(3) { animation: qw-enter 0.4s var(--ease-out) 0.3s both; }
.audit-section--visible .audit-quickwin:nth-child(4) { animation: qw-enter 0.4s var(--ease-out) 0.4s both; }
.audit-section--visible .audit-quickwin:nth-child(5) { animation: qw-enter 0.4s var(--ease-out) 0.5s both; }
.audit-section--visible .audit-quickwin:nth-child(n+6) { animation: qw-enter 0.4s var(--ease-out) 0.6s both; }
@keyframes qw-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 16. Verdict pills — pop-in with scale bounce */
.audit-verdicts .audit-verdict-mini {
  animation: mini-pop 0.3s var(--ease-out) both;
}
.audit-verdicts .audit-verdict-mini:nth-child(4) { animation-delay: 0.5s; }
.audit-verdicts .audit-verdict-mini:nth-child(5) { animation-delay: 0.6s; }
.audit-verdicts .audit-verdict-mini:nth-child(6) { animation-delay: 0.7s; }
@keyframes mini-pop {
  0% { opacity: 0; transform: scale(0.6); }
  70% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

/* 17. Histogram bars — grow up from bottom */
.audit-histogram__bar {
  animation: hist-grow 0.5s var(--ease-out) both;
}
.audit-histogram__bar-group:nth-child(1) .audit-histogram__bar { animation-delay: 0.1s; }
.audit-histogram__bar-group:nth-child(2) .audit-histogram__bar { animation-delay: 0.15s; }
.audit-histogram__bar-group:nth-child(3) .audit-histogram__bar { animation-delay: 0.2s; }
.audit-histogram__bar-group:nth-child(4) .audit-histogram__bar { animation-delay: 0.25s; }
.audit-histogram__bar-group:nth-child(5) .audit-histogram__bar { animation-delay: 0.3s; }
.audit-histogram__bar-group:nth-child(6) .audit-histogram__bar { animation-delay: 0.35s; }
.audit-histogram__bar-group:nth-child(7) .audit-histogram__bar { animation-delay: 0.4s; }
@keyframes hist-grow {
  from { transform: scaleY(0); transform-origin: bottom; }
  to { transform: scaleY(1); transform-origin: bottom; }
}

/* 18. Word cloud words — fade in with random-ish delays */
.audit-wordcloud__word {
  animation: word-appear 0.4s var(--ease-out) both;
}
.audit-wordcloud__word:nth-child(odd) { animation-delay: 0.1s; }
.audit-wordcloud__word:nth-child(even) { animation-delay: 0.25s; }
.audit-wordcloud__word:nth-child(3n) { animation-delay: 0.35s; }
.audit-wordcloud__word:nth-child(5n) { animation-delay: 0.15s; }
@keyframes word-appear {
  from { opacity: 0; transform: scale(0.7) translateY(8px); }
  to { opacity: var(--word-opacity, 1); transform: scale(1) translateY(0); }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .audit-score-circle__value,
  .audit-score-circle__text,
  .audit-cat-bar__fill,
  .audit-qw-stackbar__seg,
  .audit-grade,
  .audit-verdicts > *,
  .audit-section--visible .audit-table tbody tr,
  .audit-section--visible .audit-section__title::after,
  .audit-gauge__marker,
  .audit-path--hero::after,
  .audit-score-hero__circle::before,
  .audit-score-hero__circle::after,
  .audit-radar__dot,
  .audit-section--visible .audit-section__title::after,
  .audit-section--visible .audit-quickwin,
  .audit-verdicts .audit-verdict-mini,
  .audit-histogram__bar,
  .audit-wordcloud__word {
    animation: none !important;
  }
  .audit-table tbody tr::after {
    display: none;
  }
  .audit-score-hero::before {
    animation: none !important;
    opacity: 0.4;
  }
  .audit-quickwin {
    transition: none !important;
  }
}
.audit-qw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-sm);
}
.audit-qw-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.audit-qw-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .audit-qw-hero {
    flex-direction: column;
    text-align: center;
  }
  .audit-qw-legend {
    justify-content: center;
  }
}

.audit-url-display {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-green);
  word-break: break-all;
  margin-bottom: var(--space-xs);
}

.mini-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============ CATEGORY BARS ============ */
.audit-categories {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  width: 100%;
}

.audit-cat-row {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  gap: var(--space-md);
  align-items: center;
}

.audit-cat-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.audit-cat-bar {
  height: 8px;
  background: var(--bg-elevated);
  border-radius: var(--radius-full);
  overflow: hidden;
}

/* 3. Category bars animate on appear */
.audit-cat-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  animation: bar-fill-in 0.8s var(--ease-out) both;
}
.audit-cat-row:nth-child(1) .audit-cat-bar__fill { animation-delay: 0.5s; }
.audit-cat-row:nth-child(2) .audit-cat-bar__fill { animation-delay: 0.6s; }
.audit-cat-row:nth-child(3) .audit-cat-bar__fill { animation-delay: 0.7s; }
.audit-cat-row:nth-child(4) .audit-cat-bar__fill { animation-delay: 0.75s; }
.audit-cat-row:nth-child(5) .audit-cat-bar__fill { animation-delay: 0.8s; }
.audit-cat-row:nth-child(6) .audit-cat-bar__fill { animation-delay: 0.85s; }
.audit-cat-row:nth-child(7) .audit-cat-bar__fill { animation-delay: 0.9s; }
.audit-cat-row:nth-child(8) .audit-cat-bar__fill { animation-delay: 0.95s; }

@keyframes bar-fill-in {
  from { width: 0 !important; }
}

.audit-cat-bar__fill--green { background: var(--accent-green); }
.audit-cat-bar__fill--amber { background: #f59e0b; }
.audit-cat-bar__fill--warning { background: #f59e0b; }
.audit-cat-bar__fill--error { background: #ef4444; }

.audit-cat-score {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-primary);
  text-align: right;
}

/* ============ VERDICTS ============ */
.audit-verdicts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.audit-verdict {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  border: 1px solid;
}

.audit-verdict--good {
  color: var(--accent-green);
  border-color: var(--accent-green-dim);
  background: var(--accent-green-glow);
}

.audit-verdict--bad {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
}

.audit-verdict--warn {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
}

.audit-verdict__icon {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
}

.audit-verdict-pill {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  border: 1px solid var(--border-accent);
  background: var(--bg-elevated);
}
.audit-verdict-pill__icon {
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
}
.audit-verdict-pill__label {
  color: var(--text-secondary);
}

/* Verdict hero variant — larger, more prominent */
.audit-verdict--hero {
  padding: var(--space-sm) var(--space-xl);
  font-size: var(--text-base);
}
.audit-verdict--hero .audit-verdict__icon {
  font-size: var(--text-base);
}

/* Verdict mini — small inline checks */
.audit-verdict-mini {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
}
.audit-verdict-mini--good {
  color: var(--accent-green);
  background: var(--accent-green-glow);
}
.audit-verdict-mini--bad {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

/* ============ CONTENT HERO STATS ============ */
.audit-content-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.audit-content-stat--hero {
  padding: var(--space-xl);
}
.audit-content-stat--hero .audit-content-stat__value {
  font-size: var(--text-2xl);
  color: var(--accent-green);
}

/* Content boolean checks — inline row */
.audit-content-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.audit-content-check {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}
.audit-content-check__icon {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
}
.audit-content-check__icon--yes { color: var(--accent-green); }
.audit-content-check__icon--no { color: #ef4444; }

/* N-grams side-by-side grid */
.audit-ngrams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

@media (max-width: 768px) {
  .audit-content-hero-stats {
    grid-template-columns: 1fr 1fr;
  }
  .audit-ngrams-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .audit-content-hero-stats {
    grid-template-columns: 1fr;
  }
}

/* ============ SECTION ============ */
.audit-section {
  padding-block: var(--space-2xl);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.audit-section--visible {
  opacity: 1;
  transform: translateY(0);
}

.audit-section__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
}

.audit-subsection-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

/* ============ TABLE WRAPPER (mobile scroll) ============ */
.audit-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-inline: calc(-1 * var(--space-md));
  padding-inline: var(--space-md);
  place-self: center;
  max-width: 100%;
  width: 100%;
}

/* ============ TABLE ============ */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.audit-table thead th {
  text-align: left;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--weight-semibold);
  border-bottom: 1px solid var(--border);
}

.audit-table tbody td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.audit-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.audit-table code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Redirect table column widths (4-col: # | Scenario | Status | Recommendation) */
.audit-table--redirects th:nth-child(1),
.audit-table--redirects td:nth-child(1) {
  width: 28px;
  min-width: 28px;
  text-align: center;
  padding-inline: var(--space-xs);
  color: var(--text-muted);
}
.audit-table--redirects th:nth-child(3),
.audit-table--redirects td:nth-child(3) {
  width: 68px;
  min-width: 68px;
  text-align: center;
  padding-inline: var(--space-sm);
}
.audit-table--redirects td:nth-child(4) {
  width: auto;
}

.audit-table__text {
  max-width: 400px;
  word-break: break-word;
}

.audit-table__url {
  max-width: 300px;
  word-break: break-all;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.audit-table__detail {
  max-width: 300px;
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

/* ============ BADGES ============ */
.audit-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  min-width: 28px;
  text-align: center;
}

.audit-badge--passed {
  background: rgba(45, 212, 168, 0.15);
  color: var(--accent-green);
}

.audit-badge--warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.audit-badge--error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.audit-badge--na {
  background: var(--bg-elevated);
  color: var(--text-muted);
}

/* ============ SCROLLABLE TABLE (blog-style) ============ */
.audit-scroll-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.audit-scroll-table .audit-table {
  width: max-content;
  min-width: 100%;
  border: none;
}
.audit-scroll-table .audit-table thead th:first-child {
  border-radius: var(--radius-lg) 0 0 0;
}
.audit-scroll-table .audit-table thead th:last-child {
  border-radius: 0 var(--radius-lg) 0 0;
}
.audit-scroll-table .audit-table th,
.audit-scroll-table .audit-table td {
  white-space: nowrap;
}
.audit-scroll-table .audit-table td.audit-table__detail {
  white-space: normal;
  min-width: 220px;
}
.audit-scroll-table .audit-table--redirects td:nth-child(2) {
  min-width: 180px;
}

/* ============ REDIRECT SUMMARY ============ */
.audit-redirect-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
}

/* ============ CONTENT STATS ============ */
.audit-content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.audit-content-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.audit-content-stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.audit-content-stat__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.audit-trust-signals {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ============ QUICK WINS ============ */
.audit-quickwins {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* 4. Quick win cards — hover lift + glow stripe */
.audit-quickwin {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}
.audit-quickwin:hover {
  transform: translateY(-2px);
  border-color: var(--border-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Left severity stripe */
.audit-quickwin::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.audit-quickwin--critical::before { background: #ef4444; }
.audit-quickwin--high::before { background: #f59e0b; }
.audit-quickwin--medium::before { background: #fbbf24; }
.audit-quickwin--low::before { background: var(--text-muted); }

.audit-quickwin__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.audit-quickwin__num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.audit-quickwin__effort {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.audit-quickwin__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.audit-quickwin__impact {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
}

.audit-quickwin__action,
.audit-quickwin__evidence,
.audit-quickwin__effect {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
  border-left: 2px solid var(--border);
}

.audit-quickwin__action strong,
.audit-quickwin__evidence strong,
.audit-quickwin__effect strong {
  color: var(--text-primary);
}

.audit-quickwin__evidence {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  border-left-color: var(--accent-terra-dim);
}

/* ============ CTA BLOCK ============ */
.audit-cta-block {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.audit-cta-block h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-lg);
}

.audit-cta-form {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.audit-cta-form input[type="url"] {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
}

.audit-cta-form input[type="url"]:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}

.audit-captcha-inline {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.audit-captcha-inline .audit-captcha-q {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent-green);
  white-space: nowrap;
}

.audit-captcha-inline input[type="text"] {
  width: 60px;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  text-align: center;
}

.audit-captcha-inline input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}

/* ============ HOW IT WORKS ============ */
.audit-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-xl);
  counter-reset: step;
}

.audit-step {
  text-align: center;
  counter-increment: step;
}

.audit-step__num {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--accent-green);
  opacity: 0.3;
  margin-bottom: var(--space-md);
}

.audit-step__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-sm);
}

.audit-step__text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ============ SCORE CIRCLE (simple) ============ */
.audit-score {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  border: 4px solid;
  margin-bottom: var(--space-lg);
}
.audit-score__number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: 1;
}
.audit-score__grade {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  margin-top: var(--space-xs);
}
.audit-score--green { border-color: var(--accent-green); color: var(--accent-green); }
.audit-score--amber { border-color: #f59e0b; color: #f59e0b; }
.audit-score--red { border-color: #ef4444; color: #ef4444; }

/* ============ STAT CARDS (generic) ============ */
.audit-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: var(--space-md);
}
.audit-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}
.audit-stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--accent-green);
}
.audit-stat__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ============ CATEGORY SCORE BARS ============ */
.audit-category-bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 4px;
}
.audit-category-bar__fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

/* ============ ADDITIONAL BADGES ============ */
.audit-badge--ok { background: rgba(45, 212, 168, 0.15); color: #2dd4a8; }
.audit-badge--critical { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.audit-badge--inconclusive { background: var(--bg-elevated); color: var(--text-muted); }
.audit-badge--high { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.audit-badge--medium { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.audit-badge--low { background: rgba(45, 212, 168, 0.15); color: #2dd4a8; }

/* ============ BACK LINK ============ */
.audit-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
  margin-bottom: var(--space-lg);
  transition: color 0.2s, transform 0.2s;
}

.audit-back-link__icon {
  font-size: var(--text-lg);
  line-height: 1;
}

.audit-back-link:hover {
  color: var(--accent-green) !important;
  transform: translateX(-2px);
}

.audit-page-title {
  margin-bottom: var(--space-sm);
  text-wrap: balance;
}

.audit-page-title__prefix {
  white-space: nowrap;
}

.audit-page-title__domain {
  display: inline-block;
  margin-left: 0.25ch;
  overflow-wrap: anywhere;
  word-break: normal;
}

.audit-section[id] {
  scroll-margin-top: var(--audit-sticky-offset, 180px);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .audit-summary-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .audit-radar {
    width: 240px;
    height: 240px;
  }

  .audit-score-wrapper {
    flex-direction: row;
    justify-content: center;
  }

  .audit-content-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .audit-cat-row {
    grid-template-columns: 100px 1fr 36px;
    gap: var(--space-sm);
  }

  .audit-cat-label {
    font-size: var(--text-xs);
  }

  .audit-form__row {
    flex-direction: column;
  }

  .audit-captcha {
    flex-wrap: wrap;
  }

  .audit-table {
    font-size: var(--text-xs);
  }

  .audit-table thead th,
  .audit-table tbody td {
    padding: var(--space-sm) var(--space-md);
  }

  .audit-table__text {
    max-width: 200px;
  }

  .audit-cta-form {
    flex-direction: column;
  }

  .audit-cta-form input[type="url"] {
    max-width: 100%;
    width: 100%;
  }

  .audit-redirect-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .audit-quickwin__header {
    flex-wrap: wrap;
  }

  .audit-quickwin__effort {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .audit-score-circle {
    width: 120px;
    height: 120px;
  }

  .audit-grade {
    width: 48px;
    height: 48px;
    font-size: var(--text-2xl);
  }

  .audit-verdicts {
    flex-direction: column;
  }
}

/* ============ TRUST BADGE ============ */
.audit-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--text-muted);
  flex-wrap: wrap;
}
.audit-trust__highlight {
  color: var(--accent-green);
  font-weight: var(--weight-semibold);
}

/* ============ FEATURE CARDS FOR LANDING ============ */
.audit-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

@media (max-width: 960px) {
  .audit-features {
    grid-template-columns: repeat(2, 1fr);
  }
}
.audit-feature {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.audit-feature:hover {
  border-color: var(--accent-green-dim);
  transform: translateY(-2px);
}
.audit-feature__icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-green-glow);
  border-radius: var(--radius-md);
  margin: 0 auto var(--space-md);
  color: var(--accent-green);
}

.audit-feature__icon svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.audit-feature__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-xs);
}
.audit-feature__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ============ PATHS V2 (CTA hierarchy) ============ */
.audit-paths-v2 {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.audit-path--hero {
  border-color: var(--accent-green-dim);
  padding: var(--space-2xl);
}
.audit-path--hero .audit-path__title {
  font-size: var(--text-2xl);
  color: var(--accent-green);
}
.audit-path--hero .audit-path__desc {
  max-width: 50ch;
  margin-inline: auto;
}

.audit-path--secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.audit-path--secondary {
  padding: var(--space-lg);
}
.audit-path--secondary .audit-path__title {
  font-size: var(--text-lg);
}

@media (max-width: 640px) {
  .audit-path--secondary-row {
    grid-template-columns: 1fr;
  }
  .audit-path--hero {
    padding: var(--space-xl);
  }
}

/* ============ PATHS AFTER REPORT (legacy) ============ */
.audit-paths {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: var(--space-md);
  margin-top: var(--space-xl);
}
.audit-path {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease-out);
}
.audit-path:hover {
  border-color: var(--accent-green-dim);
}
.audit-path__title {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-sm);
}
.audit-path__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

/* ============ QUICKWIN SEVERITY LABEL ============ */
.audit-quickwin__severity {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============ VERDICT SUMMARY TEXT ============ */
.audit-verdict-text {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 60ch;
  margin: var(--space-md) auto;
  line-height: var(--leading-relaxed);
}
.audit-verdict-text strong {
  color: var(--text-primary);
}

/* ============ ANCHOR NAV FOR REPORT ============ */
.audit-nav {
  position: sticky;
  top: 64px;
  z-index: var(--z-sticky);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
  margin-bottom: var(--space-xl);
}
.audit-nav__list {
  display: flex;
  align-items: stretch;
  gap: var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  list-style: none;
  padding: 0;
  margin: 0;
}
.audit-nav__list::-webkit-scrollbar { display: none; }
.audit-nav__item {
  min-width: 0;
}
.audit-nav__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.audit-nav__link:hover {
  color: var(--accent-green);
  background: var(--accent-green-glow);
}
.audit-nav__link--active {
  color: var(--accent-green);
  background: var(--accent-green-glow);
  border-color: var(--accent-green-dim);
}

/* ============ BUSINESS IMPACT BLOCK ============ */
.audit-business {
  background: var(--bg-surface);
  border: 1px solid var(--accent-terra-dim);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  margin-top: var(--space-2xl);
}
.audit-business__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--accent-terra);
  margin-bottom: var(--space-md);
}

/* ============ RESPONSIVE — NEW SECTIONS ============ */
@media (max-width: 640px) {
  .audit-trust {
    flex-direction: column;
    text-align: center;
    gap: var(--space-xs);
  }

  .audit-paths {
    grid-template-columns: 1fr;
  }

  .audit-features {
    gap: var(--space-sm);
  }

  .audit-feature {
    padding: var(--space-md);
  }

  .audit-feature__icon {
    width: 44px;
    height: 44px;
    margin-bottom: var(--space-sm);
  }

  .audit-feature__icon svg {
    width: 22px;
    height: 22px;
  }

  .audit-feature__title {
    font-size: var(--text-sm);
  }

  .audit-feature__desc {
    font-size: var(--text-xs);
  }
}

@media (max-width: 480px) {
  .audit-features {
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  .audit-feature {
    display: grid;
    grid-template-columns: 40px 1fr;
    grid-template-rows: auto auto;
    gap: 0 var(--space-sm);
    text-align: left;
    padding: var(--space-sm) var(--space-md);
  }

  .audit-feature__icon {
    grid-row: 1 / 3;
    margin: 0;
    width: 36px;
    height: 36px;
    align-self: center;
  }

  .audit-feature__icon svg {
    width: 18px;
    height: 18px;
  }

  .audit-feature__title {
    font-size: var(--text-sm);
    align-self: end;
  }

  .audit-feature__desc {
    font-size: var(--text-xs);
    align-self: start;
  }
}

/* ── CTA Variants ── */
.audit-cta--pill {
  text-align: center;
  padding: var(--space-sm) 0;
}
.audit-cta-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-decoration: none;
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: border-color 0.3s, color 0.3s;
}
.audit-cta-pill:hover {
  border-color: var(--accent-green-dim);
  color: var(--accent-green);
}
.audit-cta-pill strong {
  color: var(--accent-green);
}

.audit-cta--inline {
  padding: var(--space-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.audit-cta__title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-md);
  text-align: center;
}
.audit-cta__desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-align: center;
  margin-bottom: var(--space-lg);
  max-width: 50ch;
  margin-inline: auto;
}
.audit-cta__heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.audit-cta--full {
  padding: var(--space-xl);
  background: var(--bg-surface);
  border: 1px solid var(--accent-green-dim);
  border-radius: var(--radius-lg);
}

.audit-cta-form__row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}
.audit-cta-form__url {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
  padding: var(--space-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
}
.audit-cta-form__url:focus {
  outline: none;
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}
.audit-cta-form__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Captcha refresh button */
.audit-captcha-refresh {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  font-size: var(--text-base);
  transition: color 0.2s, border-color 0.2s;
}
.audit-captcha-refresh:hover {
  color: var(--accent-green);
  border-color: var(--accent-green-dim);
}

/* ── Form error states polish ── */
.audit-form__error {
  display: none;
  padding: var(--space-md);
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-md);
  color: #ef4444;
  font-size: var(--text-sm);
  margin-bottom: var(--space-lg);
  text-align: center;
}
.audit-form__error--visible {
  display: block;
  animation: audit-error-appear 0.3s ease;
}
@keyframes audit-error-appear {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Status badge polish ── */
.audit-badge--info {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
}

/* ── Mobile polish ── */
@media (max-width: 640px) {
  .audit-cta-form__row {
    flex-direction: column;
    align-items: stretch;
  }
  .audit-cta-form__url {
    max-width: none;
    min-width: auto;
  }
  .audit-nav__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-sm);
    overflow: visible;
  }
  .audit-nav__link {
    min-height: 44px;
    white-space: normal;
    text-wrap: balance;
    font-size: 11px;
    padding: var(--space-sm);
  }
  .audit-cta--full {
    padding: var(--space-lg);
  }
  .audit-cta__heading {
    font-size: var(--text-lg);
  }
}

/* ============ LINKS GRID (two-column) ============ */
.audit-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
}

@media (max-width: 768px) {
  .audit-links-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ============ COLLAPSIBLE (details/summary) ============ */
.audit-collapsible {
  margin-bottom: var(--space-md);
}

.audit-collapsible__title {
  font-size: var(--text-sm);
  color: var(--accent-green);
  cursor: pointer;
  padding: var(--space-sm) 0;
  font-family: var(--font-mono);
}

.audit-collapsible__title:hover {
  color: var(--text-primary);
}

/* ============ EXPORT BUTTONS ============ */
.audit-export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.audit-action-button {
  min-height: 44px;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--accent-green);
}

.audit-action-button::after {
  content: none;
}

.audit-action-button:hover {
  border-color: var(--accent-green-dim);
  color: var(--text-primary);
}

.audit-action-button svg {
  flex-shrink: 0;
}

/* ============ TOAST ============ */
.audit-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: #fff;
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}
.audit-toast--visible { opacity: 1; transform: translateY(0); }
.audit-toast--info { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-primary); }
.audit-toast--error { background: #ef4444; }
.audit-toast--success { background: var(--accent-green); color: #000; }

/* ============ PDF EXPORT MODE (light theme for html2pdf) ============ */
body.pdf-export-mode,
body.pdf-export-mode * {
  color-scheme: light !important;
}
body.pdf-export-mode {
  background: #fff !important;
  color: #222 !important;
}
body.pdf-export-mode header,
body.pdf-export-mode footer,
body.pdf-export-mode nav,
body.pdf-export-mode .audit-nav,
body.pdf-export-mode .audit-export-buttons,
body.pdf-export-mode .audit-back-link,
body.pdf-export-mode .cta-section,
body.pdf-export-mode #audit-business,
body.pdf-export-mode .scroll-progress,
body.pdf-export-mode .cookie-banner,
body.pdf-export-mode .audit-toast,
body.pdf-export-mode #pdf-template {
  display: none !important;
}
body.pdf-export-mode main,
body.pdf-export-mode .container,
body.pdf-export-mode .audit-section {
  background: #fff !important;
  color: #222 !important;
  opacity: 1 !important;
  transform: none !important;
  border-color: #e0e0e0 !important;
}
body.pdf-export-mode .audit-content-stat {
  background: #f0f4f8 !important;
  border: 1px solid #d0d5dd !important;
  color: #222 !important;
}
body.pdf-export-mode .audit-content-stat__value { color: #111 !important; }
body.pdf-export-mode .audit-content-stat__label { color: #555 !important; }
body.pdf-export-mode .audit-quickwin {
  background: #fafafa !important;
  border: 1px solid #ddd !important;
  color: #333 !important;
}
body.pdf-export-mode .audit-quickwin__title,
body.pdf-export-mode .audit-quickwin__impact,
body.pdf-export-mode .audit-quickwin__action,
body.pdf-export-mode .audit-quickwin__evidence,
body.pdf-export-mode .audit-quickwin__effect,
body.pdf-export-mode .audit-quickwin__header,
body.pdf-export-mode .audit-quickwin__effort { color: #333 !important; }
body.pdf-export-mode .audit-quickwin__num { color: #666 !important; }
body.pdf-export-mode .audit-table th {
  background: #2DD4A8 !important;
  color: #fff !important;
}
body.pdf-export-mode .audit-table td {
  color: #333 !important;
  border-color: #e0e0e0 !important;
  background: #fff !important;
}
body.pdf-export-mode .audit-table tr:nth-child(even) td { background: #f8f8f8 !important; }
body.pdf-export-mode .audit-section__title,
body.pdf-export-mode .audit-subsection-title { color: #2DD4A8 !important; }
body.pdf-export-mode .audit-cat-label,
body.pdf-export-mode .audit-cat-score { color: #333 !important; }
body.pdf-export-mode .audit-cat-bar { background: #e0e0e0 !important; }
body.pdf-export-mode .audit-score-circle__text { fill: #222 !important; }
body.pdf-export-mode .audit-score-circle__label { fill: #666 !important; }
body.pdf-export-mode .audit-score-circle__bg { stroke: #e0e0e0 !important; }
body.pdf-export-mode .audit-radar__label { fill: #555 !important; }
body.pdf-export-mode .audit-radar__grid { stroke: #ccc !important; }
body.pdf-export-mode .page-header__title { color: #222 !important; }
body.pdf-export-mode .audit-url-display { color: #2DD4A8 !important; }
body.pdf-export-mode .mini-meta { color: #999 !important; }
body.pdf-export-mode .audit-verdict-text { color: #444 !important; }
body.pdf-export-mode .audit-verdict--good {
  background: #d4edda !important; color: #155724 !important; border-color: #c3e6cb !important;
}
body.pdf-export-mode .audit-verdict--bad {
  background: #f8d7da !important; color: #721c24 !important; border-color: #f5c6cb !important;
}
body.pdf-export-mode .audit-badge--passed { background: #d4edda !important; color: #155724 !important; }
body.pdf-export-mode .audit-badge--warning { background: #fff3cd !important; color: #856404 !important; }
body.pdf-export-mode .audit-badge--error { background: #f8d7da !important; color: #721c24 !important; }
body.pdf-export-mode .audit-badge--na { background: #e9ecef !important; color: #495057 !important; }
body.pdf-export-mode .audit-collapsible__title { color: #2DD4A8 !important; }
body.pdf-export-mode .section-header__label { color: #2DD4A8 !important; }
body.pdf-export-mode .audit-links-col { color: #222 !important; }
body.pdf-export-mode p,
body.pdf-export-mode span,
body.pdf-export-mode td,
body.pdf-export-mode th,
body.pdf-export-mode li,
body.pdf-export-mode div { color: inherit !important; }

/* ============ PRINT STYLES (dark theme preserved as-is) ============ */
@media print {
  /* Hide non-essential elements */
  header, footer, nav, .audit-nav, .audit-export-buttons,
  .scroll-progress, .cookie-banner, .audit-back-link,
  .cta-section, #audit-business, .audit-toast, script {
    display: none !important;
  }

  /* Force browser to print background colors/images */
  * {
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }

  body, main, .container {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Keep dark theme — only structural overrides */
  .audit-section {
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
  }

  .audit-quickwin {
    page-break-inside: avoid;
  }

  .audit-section__title {
    page-break-after: avoid;
  }

  /* Force page breaks between major sections */
  #audit-redirects, #audit-onpage, #audit-content,
  #audit-render, #audit-text, #audit-links,
  #audit-aibots, #audit-quickwins {
    page-break-before: always;
  }

  /* Footer for print */
  main::after {
    content: "Отчёт подготовлен: sk-seo.ru | Кириченко Станислав | " attr(data-audit-uuid);
    display: block;
    text-align: center;
    font-size: 9pt;
    color: #999;
    padding-top: 20pt;
    border-top: 1px solid #ddd;
    margin-top: 20pt;
  }
}

/* ============ MOBILE OVERFLOW FIX (result page) ============ */
html, body {
  overflow-x: hidden;
}

.audit-table-wrapper {
  max-width: 100%;
}

.audit-table {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.audit-table td,
.audit-table th {
  overflow-wrap: break-word;
  word-break: break-word;
}

.audit-table code {
  word-break: break-all;
}

/* ============ DONUT CHART (Quick Wins) ============ */
.audit-quickwins-summary {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.audit-donut-wrapper {
  flex-shrink: 0;
}

.audit-donut {
  width: 120px;
  height: 120px;
}

.audit-donut-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.audit-donut-legend__item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-sm);
}

.audit-donut-legend__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.audit-donut-legend__label {
  color: var(--text-secondary);
  flex: 1;
}

.audit-donut-legend__count {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

/* ============ TEXT ANALYSIS HERO ============ */
.audit-text-hero {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.audit-text-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.audit-text-score__label {
  margin-top: var(--space-xs);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.audit-text-hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: var(--space-md);
  flex: 1;
}

.audit-text-hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.audit-text-hero__stat-value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.audit-text-hero__stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ============ GAUGE BARS ============ */
.audit-gauges {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.audit-gauge {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.audit-gauge__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.audit-gauge__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.audit-gauge__value {
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-mono);
}

.audit-gauge__track {
  position: relative;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  overflow: visible;
}

.audit-gauge__zone {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 4px;
}

.audit-gauge__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.audit-gauge__marker {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--bg-primary);
  border: 2px solid;
  transform: translateX(-50%);
}

.audit-gauge__zones-labels {
  display: flex;
  justify-content: space-between;
  padding-top: 2px;
}

/* ============ HISTOGRAM ============ */
.audit-histogram {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  height: 120px;
  padding: var(--space-sm) 0;
}

.audit-histogram__bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.audit-histogram__count {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.audit-histogram__bar {
  width: 100%;
  max-width: 40px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.4s ease;
}

.audit-histogram__label {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
}

/* ============ WORD CLOUD ============ */
.audit-wordcloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm) var(--space-md);
  padding: var(--space-lg);
  min-height: 80px;
}

.audit-wordcloud__word {
  display: inline-block;
  font-weight: 600;
  cursor: default;
  transition: transform 0.2s;
  line-height: 1.2;
}

.audit-wordcloud__word:hover {
  transform: scale(1.15);
}

/* ============ REDIRECT CHECKER HERO ============ */
.audit-redirect-hero {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.audit-redirect-score {
  flex-shrink: 0;
}

.audit-redirect-badges {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.audit-redirect-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.audit-redirect-conninfo {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.audit-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
}

.audit-pill--green {
  background: rgba(45, 212, 168, 0.12);
  color: #2DD4A8;
  border: 1px solid rgba(45, 212, 168, 0.25);
}

.audit-pill--red {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.audit-pill--gray {
  background: rgba(107, 114, 128, 0.1);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.25);
}

/* ============ REDIRECT CHAIN VISUALIZATION ============ */
.audit-chain {
  margin-bottom: var(--space-xl);
}

.audit-chain__flow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow-x: auto;
}

.audit-chain__hop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 100px;
  max-width: 200px;
}

.audit-chain__code {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  border: 1px solid;
  white-space: nowrap;
}

.audit-chain__url {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  word-break: break-all;
  line-height: 1.3;
}

.audit-chain__time {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  opacity: 0.7;
}

.audit-chain__arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.4;
}

.audit-chain__total {
  margin-top: var(--space-sm);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: right;
}

/* ============ SERP PREVIEW ============ */
.audit-serp-preview {
  max-width: 600px;
  padding: var(--space-md);
  background: #1a1a2e;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-family: Arial, sans-serif;
}

.audit-serp-preview__url {
  font-size: 0.75rem;
  color: #bdc1c6;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-serp-preview__title {
  font-size: 1.15rem;
  color: #8ab4f8;
  line-height: 1.3;
  margin-bottom: 4px;
  cursor: pointer;
}

.audit-serp-preview__title:hover {
  text-decoration: underline;
}

.audit-serp-preview__desc {
  font-size: 0.85rem;
  color: #bdc1c6;
  line-height: 1.5;
}

/* ============ SOCIAL PREVIEW ============ */
.audit-social-preview {
  max-width: 500px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg-elevated);
}

.audit-social-preview__image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-surface);
}

.audit-social-preview__image--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border);
}

.audit-social-preview__body {
  padding: var(--space-sm) var(--space-md);
}

.audit-social-preview__site {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.audit-social-preview__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 4px 0;
}

.audit-social-preview__desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ============ HEADING TREE ============ */
.audit-heading-tree {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) 0;
}

.audit-heading-tree__item {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  padding: 4px var(--space-sm);
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.audit-heading-tree__item:hover {
  background: var(--bg-elevated);
}

.audit-heading-tree__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  width: 24px;
}

.audit-heading-tree__text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.4;
}

@media (max-width: 640px) {
  .audit-table-wrapper--stack-mobile {
    margin-inline: 0;
    padding-inline: 0;
    overflow: visible;
  }

  .audit-table--stack-mobile {
    display: block;
    font-size: 12px;
  }

  .audit-table--stack-mobile thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
  }

  .audit-table--stack-mobile tbody {
    display: grid;
    gap: var(--space-md);
  }

  .audit-table--stack-mobile tr {
    display: grid;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
  }

  .audit-table--stack-mobile tbody td {
    display: grid;
    grid-template-columns: minmax(92px, 36%) minmax(0, 1fr);
    gap: var(--space-sm);
    padding: 0;
    border: 0;
    background: transparent;
    align-items: start;
  }

  .audit-table--stack-mobile tbody td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .audit-table--stack-mobile tbody tr:hover td {
    background: transparent;
  }

  /* Status-based card left border */
  .audit-table--stack-mobile tr[data-status="passed"] {
    border-left: 3px solid var(--accent-green, #2DD4A8);
  }
  .audit-table--stack-mobile tr[data-status="warning"] {
    border-left: 3px solid #f59e0b;
  }
  .audit-table--stack-mobile tr[data-status="error"] {
    border-left: 3px solid #ef4444;
  }
  .audit-table--stack-mobile tr[data-status="na"],
  .audit-table--stack-mobile tr[data-status="not_applicable"] {
    border-left: 3px solid var(--text-muted, #666);
  }

  .audit-table--stack-mobile.audit-table--redirects td[data-label="#"] {
    display: none;
  }

  /* Hide empty recommendation cells on mobile cards */
  .audit-table--stack-mobile .audit-table__detail--empty {
    display: none;
  }

  /* Compact passed rows: scenario + status inline */
  .audit-table--stack-mobile tr[data-status="passed"] {
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
  }
  .audit-table--stack-mobile tr[data-status="na"],
  .audit-table--stack-mobile tr[data-status="not_applicable"] {
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
  }

  .audit-table--stack-mobile .audit-badge {
    justify-self: start;
  }

  .audit-table--stack-mobile .audit-table__url,
  .audit-table--stack-mobile .audit-table__text,
  .audit-table--stack-mobile .audit-table__detail {
    max-width: none;
  }

  /* Fix: override scroll-table styles when stack-mobile is active */
  .audit-scroll-table:has(.audit-table--stack-mobile) {
    overflow: visible;
    border: none;
    border-radius: 0;
  }
  .audit-scroll-table .audit-table--stack-mobile {
    width: 100%;
    min-width: unset;
  }
  .audit-scroll-table .audit-table--stack-mobile td,
  .audit-scroll-table .audit-table--stack-mobile th {
    white-space: normal;
  }
  .audit-scroll-table .audit-table--stack-mobile td:nth-child(2) {
    min-width: unset;
  }

  .audit-table {
    font-size: 12px;
  }
  .audit-table td,
  .audit-table th {
    padding: 6px 5px;
  }
  /* Redirect table on mobile */
  .audit-table--redirects { font-size: 12px; }
  .audit-table--redirects th:first-child,
  .audit-table--redirects td:first-child { display: none; }
  /* Reset status column — no fixed width, hug content */
  .audit-table--redirects th:nth-child(3),
  .audit-table--redirects td:nth-child(3) {
    width: auto;
    min-width: auto;
    padding-inline: var(--space-xs);
  }
  .audit-badge { white-space: nowrap; }
  .audit-table:not(.audit-table--stack-mobile) th {
    white-space: nowrap;
  }
  .audit-score-header {
    flex-direction: column;
    gap: var(--space-md);
  }
  .audit-radar-wrapper {
    max-width: 100%;
    overflow: hidden;
  }
  .audit-radar-wrapper svg {
    max-width: 100%;
    height: auto;
  }
  .audit-quick-stats {
    flex-wrap: wrap;
  }
  .audit-links-grid {
    grid-template-columns: 1fr;
  }
  .audit-content-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }
  .audit-content-stat {
    padding: var(--space-md) var(--space-sm);
    min-height: 60px;
  }
  .audit-content-stat__value {
    font-size: var(--text-base);
  }
  .audit-nav {
    padding-inline: var(--space-sm);
  }

  .audit-page-title__prefix,
  .audit-page-title__domain {
    display: block;
  }

  .audit-page-title__domain {
    margin-left: 0;
    margin-top: var(--space-xs);
  }

  .audit-back-link,
  .audit-cta-form__btn,
  .audit-captcha-refresh,
  .audit-collapsible__title {
    min-height: 44px;
  }
  .audit-quickwins-summary {
    flex-direction: column;
    text-align: center;
  }
  .audit-text-hero {
    flex-direction: column;
    text-align: center;
  }
  .audit-text-hero__stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }
  .audit-text-hero__stat {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
  }
  /* Donut chart — limit size on mobile */
  .audit-donut-wrapper {
    max-width: 160px;
    margin-inline: auto;
  }
  .audit-donut {
    width: 100%;
    height: auto;
  }
  /* AI Bots table — hide 4th column (Статус) on mobile */
  #audit-aibots .audit-table th:nth-child(4),
  #audit-aibots .audit-table td:nth-child(4) {
    display: none;
  }
  #audit-aibots .audit-table th:first-child,
  #audit-aibots .audit-table td:first-child {
    min-width: 70px;
    word-break: normal;
  }
  /* Links grid — reduce gap on mobile */
  .audit-links-grid {
    gap: var(--space-md);
  }
  .audit-links-col .audit-content-grid {
    gap: var(--space-sm);
  }
  /* Verdict pill consistency */
  .audit-verdict-pill {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    border: 1px solid;
    width: 100%;
    justify-content: center;
  }
  /* Gauge — ensure bars visible */
  .audit-gauge__track {
    height: 10px;
  }
  .audit-histogram {
    height: 100px;
    gap: 1px;
    margin-inline: calc(-1 * var(--space-xs));
    padding-inline: var(--space-xs);
  }
  .audit-histogram__bar-group {
    min-width: 0;
  }
  .audit-histogram__bar {
    max-width: 28px;
  }
  .audit-histogram__label {
    font-size: 0.5rem;
  }
  .audit-histogram__count {
    font-size: 0.55rem;
  }
  .audit-redirect-hero {
    flex-direction: column;
    text-align: center;
  }
  .audit-redirect-badges {
    align-items: center;
  }
  .audit-chain__flow {
    flex-direction: column;
  }
  .audit-chain__arrow {
    transform: rotate(90deg);
  }
  .audit-chain__hop {
    max-width: 100%;
  }
  /* SERP & Social Preview — enforce card styling on mobile */
  .audit-serp-preview {
    max-width: 100%;
    padding: var(--space-md);
    background: #1a1a2e;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }
  .audit-social-preview {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
  }
  .audit-social-preview__image {
    height: 140px;
  }
  /* (redirect table now uses card layout from 768px block above) */
  /* Content stat — shrink font for long text like "Главная страница" */
  .audit-content-stat__value {
    font-size: var(--text-sm);
    word-break: break-word;
    white-space: normal;
    line-height: 1.3;
  }
}
