/* ─── Base ────────────────────────────────────────────────────────────────── */

.lx-score {
  height: 100%;
  min-height: 0;
  background: #ffffff;
}

.lx-score,
.lx-score * {
  box-sizing: border-box;
}

.lx-score__scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
}

/* ─── Empty State ─────────────────────────────────────────────────────────── */

.lx-score-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  min-height: 400px;
  opacity: 0;
  animation: lx-score-empty-fade-in 0.4s ease-out 0.1s forwards;
}

@keyframes lx-score-empty-fade-in {
  to {
    opacity: 1;
  }
}

.lx-score-empty__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--lx-rounded-full);
  background: var(--lx-color-slate-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.lx-score-empty__icon [data-lucide] {
  width: 24px;
  height: 24px;
  color: var(--lx-color-slate-500);
}

.lx-score-empty__text {
  font-size: var(--lx-text-base);
  font-weight: var(--lx-font-medium);
  color: var(--lx-color-slate-900);
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.lx-score-empty__hint {
  font-size: var(--lx-text-sm);
  line-height: 1.5;
  color: var(--lx-color-slate-500);
  margin: 0;
  max-width: 360px;
}

.lx-score-empty__demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  margin-top: 18px;
  padding: 9px 14px;
  color: #ffffff;
  background: var(--lx-color-slate-900);
  border: 1px solid var(--lx-color-slate-900);
  border-radius: var(--lx-rounded-md);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  line-height: 1.2;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.lx-score-empty__demo-btn:hover {
  background: var(--lx-color-slate-800);
  border-color: var(--lx-color-slate-800);
  transform: translateY(-1px);
}

.lx-score-empty__demo-btn:focus-visible {
  outline: 2px solid var(--lx-color-primary-500);
  outline-offset: 2px;
}

.lx-score-empty__demo-btn-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .lx-score-empty {
    padding: 60px 20px;
    min-height: 300px;
  }

  .lx-score-empty__icon {
    width: 40px;
    height: 40px;
    margin-bottom: 12px;
  }

  .lx-score-empty__icon [data-lucide] {
    width: 20px;
    height: 20px;
  }

  .lx-score-empty__demo-btn {
    width: 100%;
    max-width: 220px;
  }
}

/* ─── Loading & Skeleton States ──────────────────────────────────────────── */

.lx-score-card--loading {
  background: var(--lx-color-slate-50);
  border-color: var(--lx-color-slate-200);
  position: relative;
  overflow: hidden;
}

.lx-score-card--loading::before {
  background: var(--lx-color-slate-200);
}

.lx-score-loading-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  color: var(--lx-color-slate-600);
  background: var(--lx-color-slate-100);
  border: 1px solid var(--lx-color-slate-300);
  border-radius: var(--lx-rounded-full);
}

.lx-score-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.lx-score-skeleton--line {
  height: 12px;
  background: var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-sm);
  position: relative;
  overflow: hidden;
}

.lx-score-skeleton--line-short {
  width: 70%;
}

/* Desktop shimmer animation */
@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .lx-score-skeleton--line::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.6) 50%,
      transparent 100%
    );
    animation: lx-score-shimmer 1.5s ease-in-out infinite;
  }

  @keyframes lx-score-shimmer {
    to {
      left: 100%;
    }
  }
}

/* Mobile: no shimmer for performance */
@media (max-width: 768px) {
  .lx-score-skeleton--line {
    animation: lx-score-pulse 1.5s ease-in-out infinite;
  }

  @keyframes lx-score-pulse {
    0%, 100% {
      opacity: 1;
    }
    50% {
      opacity: 0.6;
    }
  }
}

/* ─── Error State ─────────────────────────────────────────────────────────── */

.lx-score-card--error {
  background: #fffbfb;
  border-color: var(--lx-color-red-300);
}

.lx-score-card--error::before {
  background: var(--lx-color-red-400);
}

.lx-score-card__text--error {
  color: var(--lx-color-red-700);
}

.lx-score-badge--error {
  background: var(--lx-color-red-100);
  color: var(--lx-color-red-700);
  border-color: var(--lx-color-red-300);
}

/* ─── Status Badges ───────────────────────────────────────────────────────── */

.lx-score-status--loading {
  background: var(--lx-color-primary-100);
  color: var(--lx-color-primary-700);
  border-color: var(--lx-color-primary-300);
}

.lx-score-status--warning {
  background: var(--lx-color-amber-100);
  color: var(--lx-color-amber-700);
  border-color: var(--lx-color-amber-300);
}

/* ─── Reveal Animations ───────────────────────────────────────────────────── */

@media (min-width: 769px) and (prefers-reduced-motion: no-preference) {
  .lx-score-view--partial .lx-score-card,
  .lx-score-view .lx-score-card {
    opacity: 0;
    transform: translateY(8px);
    animation: lx-score-reveal 220ms ease-out forwards;
  }

  .lx-score-view .lx-score-readiness-card {
    animation-delay: 0ms;
  }

  .lx-score-view .lx-score-overall-card {
    animation-delay: 80ms;
  }

  .lx-score-view .lx-score-criterion-group:nth-of-type(3) {
    animation-delay: 160ms;
  }

  .lx-score-view .lx-score-criterion-group:nth-of-type(4) {
    animation-delay: 160ms;
  }

  .lx-score-view .lx-score-criterion-group:nth-of-type(5) {
    animation-delay: 160ms;
  }

  @keyframes lx-score-reveal {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* Mobile: minimal fade only */
@media (max-width: 768px) {
  .lx-score-view--partial .lx-score-card,
  .lx-score-view .lx-score-card {
    opacity: 0;
    animation: lx-score-fade-in 160ms ease-out forwards;
  }

  @keyframes lx-score-fade-in {
    to {
      opacity: 1;
    }
  }
}

/* ─── Reduced Motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .lx-score,
  .lx-score *,
  .lx-score *::before,
  .lx-score *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .lx-score-skeleton--line::after {
    display: none;
  }
}

.lx-score__scroll::-webkit-scrollbar {
  width: 8px;
}

.lx-score__scroll::-webkit-scrollbar-track {
  background: transparent;
}

.lx-score__scroll::-webkit-scrollbar-thumb {
  background: var(--lx-color-slate-300);
  border-radius: var(--lx-rounded-full);
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lx-score__scroll::-webkit-scrollbar-thumb:hover {
  background: var(--lx-color-slate-500);
  background-clip: padding-box;
}

/* ─── Layout ──────────────────────────────────────────────────────────────── */

.lx-score-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.lx-score-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 0 4px;
}

.lx-score-header h2 {
  margin: 3px 0 4px;
  color: var(--lx-color-slate-950);
  font-size: var(--lx-text-xl);
  font-weight: var(--lx-font-bold);
  line-height: 1.2;
}

.lx-score-header p {
  margin: 0;
  color: var(--lx-color-slate-600);
  font-size: var(--lx-text-sm);
  line-height: 1.5;
}

.lx-score-kicker {
  color: var(--lx-color-primary-700);
  font-size: 11px;
  font-weight: var(--lx-font-bold);
  line-height: 1.2;
  text-transform: uppercase;
}

.lx-score-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: fit-content;
  padding: 6px 9px;
  color: var(--lx-color-slate-700);
  background: var(--lx-color-slate-100);
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-full);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  white-space: nowrap;
}

.lx-score-criterion-group {
  display: flex;
  flex-direction: column;
}

.lx-score-criterion-group + .lx-score-criterion-group {
  margin-top: 2px;
}

/* ─── Card base ───────────────────────────────────────────────────────────── */

.lx-score-card {
  padding: 16px;
  background: #ffffff;
  border: 1.5px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-lg);
  box-shadow: var(--lx-shadow-xs);
}

/* ─── Summary cards ──────────────────────────────────────────────────────── */

.lx-score-readiness-card {
  background: #fbfdff;
  border-color: var(--lx-color-slate-300);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.lx-score-readiness-card--failed {
  background: #fffbfb;
  border-color: var(--lx-color-red-300);
}

.lx-score-readiness-card--failed::before {
  background: var(--lx-color-red-400);
}

.lx-score-readiness-card__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.lx-score-readiness-card__chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 5px 8px;
  color: var(--lx-color-slate-600);
  background: var(--lx-color-slate-50);
  border: 1.5px solid var(--lx-color-slate-300);
  border-radius: var(--lx-rounded-md);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-bold);
  line-height: 1;
}

.lx-score-readiness-card__passed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #ffffff;
  background: var(--lx-color-primary-700);
  border-radius: var(--lx-rounded-full);
}

.lx-score-readiness-card__passed-icon {
  width: 19px;
  height: 19px;
  stroke-width: 3;
}

.lx-score-readiness-card__failed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: #ffffff;
  background: var(--lx-color-red-600);
  border-radius: var(--lx-rounded-full);
}

.lx-score-readiness-card__failed-icon {
  width: 19px;
  height: 19px;
  stroke-width: 2.5;
}

.lx-score-readiness-card::before {
  background: var(--lx-color-slate-300);
}

.lx-score-overall-card {
  background: linear-gradient(160deg, var(--lx-color-primary-50) 0%, #ffffff 60%);
  border-color: var(--lx-color-primary-500);
  border-width: 1.5px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.lx-score-overall-card:hover {
  border-color: var(--lx-color-primary-700);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.lx-score-overall-card__criteria {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
}

.lx-score-overall-card__criterion {
  max-width: 100%;
}

/* ─── Hero card ──────────────────────────────────────────────────────────── */

.lx-score-card--hero {
  background: linear-gradient(160deg, var(--lx-color-secondary-50) 0%, #ffffff 60%);
  border-color: var(--lx-color-secondary-500);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lx-score-card--hero:hover {
  border-color: var(--lx-color-secondary-700);
  box-shadow: 0 10px 24px rgba(43, 127, 255, 0.08);
  transform: translateY(-1px);
}

.lx-score-card--hero .lx-score-badge {
  background: white;
  border: 1px solid var(--lx-color-secondary-500);
}

.lx-score-overall-card .lx-score-badge {
  background: var(--lx-color-primary-700);
}

.lx-score-card--hero .lx-score-badge {
  color: var(--lx-color-secondary-700);
}

.lx-score-card--hero .lx-score-ghost-btn {
  color: var(--lx-color-secondary-700);
}

.lx-score-card--hero .lx-score-ghost-btn:hover {
  color: var(--lx-color-secondary-900);
}

/* ─── Card internals ──────────────────────────────────────────────────────── */

.lx-score-card__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.lx-score-card__title {
  margin: 0;
  color: var(--lx-color-slate-950);
  font-size: var(--lx-text-lg);
  font-weight: var(--lx-font-bold);
  line-height: 1.25;
}

/* Feedback text — smaller, lighter */
.lx-score-card__text {
  margin: 0;
  color: var(--lx-color-slate-500);
  font-size: 13px;
  line-height: 1.55;
}

/* Card footer — right-aligned ghost action */
.lx-score-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--lx-color-slate-100);
}

/* ─── Result Actions (Live) ──────────────────────────────────────────────── */

.lx-score-result-actions {
  background: var(--lx-color-slate-50);
  border-color: var(--lx-color-slate-300);
}

.lx-score-result-actions__controls {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-bottom: 12px;
}

.lx-score-result-actions__control-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.lx-score-result-actions__control-label {
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  color: var(--lx-color-slate-600);
}

.lx-score-result-actions__select {
  appearance: none;
  -webkit-appearance: none;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  border: 1px solid var(--lx-color-slate-300);
  border-radius: var(--lx-rounded-md);
  color: var(--lx-color-slate-800);
  cursor: pointer;
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-medium);
  line-height: 1.2;
  min-height: 32px;
  padding: 6px 28px 6px 10px;
  transition: border-color 0.15s ease;
  width: 100%;
}

.lx-score-result-actions__select:focus {
  border-color: var(--lx-color-primary-400);
  outline: none;
}

.lx-score-result-actions__select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.lx-score-result-actions__buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  flex: none;
  gap: 8px;
}

.lx-score-result-actions__tooltip {
  display: block;
}

.lx-score-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: var(--lx-rounded-md);
  border: 1px solid transparent;
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.lx-score-action-btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.lx-score-action-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.lx-score-action-btn--primary {
  color: #ffffff;
  background: var(--lx-color-slate-900);
  border-color: var(--lx-color-slate-900);
}

.lx-score-action-btn--primary:not(:disabled):hover {
  background: var(--lx-color-slate-800);
  border-color: var(--lx-color-slate-800);
}

.lx-score-action-btn--secondary {
  color: var(--lx-color-slate-700);
  background: #ffffff;
  border-color: var(--lx-color-slate-300);
}

.lx-score-action-btn--secondary:not(:disabled):hover {
  background: var(--lx-color-slate-50);
  border-color: var(--lx-color-slate-400);
}

.lx-score-action-btn__icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.lx-score-action-btn__icon--spin {
  animation: lx-score-spin 1s linear infinite;
}

@keyframes lx-score-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.lx-score-action-btn--sm {
  min-height: 32px;
  padding: 6px 10px;
}

/* ─── Overall score card feedback link ──────────────────────────────────── */

.lx-score-overall-card__feedback-link {
  display: inline;
  margin-left: 4px;
  color: var(--lx-color-primary-700);
  font-size: inherit;
  text-decoration: none;
}

.lx-score-overall-card__feedback-link:hover {
  color: var(--lx-color-primary-900);
  text-decoration: underline;
}

.lx-score-result-actions__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-top: 14px;
  color: var(--lx-color-primary-700);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  text-decoration: none;
}

.lx-score-result-actions__link:hover {
  color: var(--lx-color-primary-900);
  text-decoration: underline;
}

.lx-score-result-actions__link-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* ─── AI Feedback Section ────────────────────────────────────────────────── */

.lx-score-ai-feedback {
  background: #ffffff;
  border-color: var(--lx-color-slate-200);
}

.lx-score-ai-feedback__meta {
  margin: 8px 0 0 0;
  color: var(--lx-color-slate-600);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-medium);
}

.lx-score-ai-feedback__content {
  margin-top: 16px;
  color: var(--lx-color-slate-700);
  font-size: var(--lx-text-sm);
  line-height: 1.65;
}

.lx-score-ai-feedback__content h3 {
  margin: 24px 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lx-color-slate-200);
  color: var(--lx-color-slate-900);
  font-size: var(--lx-text-base);
  font-weight: var(--lx-font-bold);
  line-height: 1.3;
}

.lx-score-ai-feedback__content h3:first-child {
  margin-top: 0;
}

.lx-score-ai-feedback__content h4 {
  margin: 18px 0 10px 0;
  color: var(--lx-color-slate-900);
  font-size: var(--lx-text-sm);
  font-weight: var(--lx-font-bold);
  line-height: 1.35;
}

.lx-score-ai-feedback__content p {
  margin: 0 0 12px 0;
}

.lx-score-ai-feedback__content p:last-child {
  margin-bottom: 0;
}

.lx-score-ai-feedback__content ul {
  margin: 0 0 12px 0;
  padding-left: 24px;
  list-style-type: disc;
}

.lx-score-ai-feedback__content ol {
  margin: 0 0 12px 0;
  padding-left: 24px;
  list-style-type: decimal;
}

.lx-score-ai-feedback__content li {
  margin: 6px 0;
}

.lx-score-ai-feedback__content strong {
  font-weight: var(--lx-font-semibold);
  color: var(--lx-color-slate-900);
}

.lx-score-ai-feedback__content em {
  font-style: italic;
}

.lx-score-ai-feedback__qa {
  display: grid;
  gap: 10px;
  margin: 10px 0 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
  background: var(--lx-color-slate-50);
}

.lx-score-ai-feedback__qa-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.lx-score-ai-feedback__qa-row p {
  margin: 0;
}

.lx-score-ai-feedback__qa-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--lx-rounded-full);
  background: var(--lx-color-slate-200);
  color: var(--lx-color-slate-700);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-bold);
}

.lx-score-ai-feedback__answer-card,
.lx-score-ai-feedback__code-card {
  margin: 12px 0 20px 0;
  margin-inline: 0;
  padding: 12px 14px;
  border: 1px solid var(--lx-color-slate-200);
  border-left: 4px solid var(--lx-color-slate-600);
  border-radius: var(--lx-rounded-md);
  background: var(--lx-color-slate-50);
  quotes: none;
  font-style: normal;
}

.lx-score-ai-feedback__answer-card--original {
  border-left-color: var(--lx-color-slate-500);
}

.lx-score-ai-feedback__answer-card--improved {
  border-left-color: var(--lx-color-slate-500);
}

.lx-score-ai-feedback__code-card {
  margin-bottom: 18px;
}

.lx-score-ai-feedback__answer-label,
.lx-score-ai-feedback__answer-label-heading,
.lx-score-ai-feedback__code-label {
  display: block;
  margin-bottom: 6px;
  color: var(--lx-color-slate-500);
  font-size: 11px;
  font-weight: var(--lx-font-bold);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lx-score-ai-feedback__answer-label-heading {
  margin-top: 0;
}

.lx-score-ai-feedback__answer-label-heading u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lx-score-ai-feedback__question-heading {
  margin: 18px 0 10px;
}

.lx-score-ai-feedback__question-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 6px 10px;
  border-radius: var(--lx-rounded-md);
  background: var(--lx-color-slate-700);
  color: #ffffff;
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-bold);
  letter-spacing: 0.03em;
}

.lx-score-ai-feedback__code-card--improved .lx-score-ai-feedback__code-label {
  color: var(--lx-color-primary-700);
}

.lx-score-ai-feedback__answer-line,
.lx-score-ai-feedback__answer-text {
  margin: 0 0 8px 0;
  color: var(--lx-color-slate-700);
  font-size: var(--lx-text-sm);
  line-height: 1.65;
}

.lx-score-ai-feedback__answer-line:last-child,
.lx-score-ai-feedback__answer-text:last-child {
  margin-bottom: 0;
}

.lx-score-ai-feedback__answer-card pre,
.lx-score-ai-feedback__code-card pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.lx-score-ai-feedback__answer-card code,
.lx-score-ai-feedback__code-card code {
  display: block;
  color: var(--lx-color-slate-900);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--lx-text-sm);
  line-height: 1.65;
}

.lx-score-ai-feedback__request-link {
  display: inline-flex;
  align-items: center;
  color: var(--lx-color-slate-700);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  text-decoration: underline;
  text-decoration-color: var(--lx-color-slate-300);
  text-underline-offset: 3px;
}

.lx-score-ai-feedback__request-link:hover {
  color: var(--lx-color-slate-900);
  text-decoration-color: var(--lx-color-slate-600);
}

.lx-score-ai-feedback__table-wrap {
  margin: 12px 0 20px;
  overflow-x: auto;
}

.lx-score-ai-feedback__table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
  background: #ffffff;
  overflow: hidden;
}

.lx-score-ai-feedback__table th,
.lx-score-ai-feedback__table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--lx-color-slate-200);
  border-right: 1px solid var(--lx-color-slate-200);
  vertical-align: top;
  text-align: left;
  font-size: var(--lx-text-sm);
  line-height: 1.55;
}

.lx-score-ai-feedback__table th:last-child,
.lx-score-ai-feedback__table td:last-child {
  border-right: none;
}

.lx-score-ai-feedback__table tbody tr:last-child td {
  border-bottom: none;
}

.lx-score-ai-feedback__table th {
  background: var(--lx-color-slate-50);
  color: var(--lx-color-slate-700);
  font-weight: var(--lx-font-semibold);
}

.lx-score-ai-feedback__footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.lx-score-ai-feedback__footer .lx-score-action-btn {
  width: 100%;
}

.lx-score-ai-feedback__request-link {
  display: flex;
  justify-content: center;
  width: 100%;
}

.lx-score-ai-feedback--loading {
  background: var(--lx-color-slate-50);
  border-color: var(--lx-color-slate-300);
}

.lx-score-ai-feedback--error {
  background: #fef2f2;
  border-color: #fecaca;
}

/* ─── Future Actions (Legacy/Demo) ───────────────────────────────────────── */

.lx-score-future-actions {
  background: var(--lx-color-slate-50);
  border-color: var(--lx-color-slate-300);
}

.lx-score-future-actions__buttons {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  flex: none;
  gap: 8px;
}

.lx-score-future-actions__tooltip {
  display: block;
}

/* ─── Score badge: rounded square, no "Band" word ────────────────────────── */

.lx-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 38px;
  padding: 5px 8px;
  color: #ffffff;
  background: var(--lx-color-primary-700);
  border-radius: var(--lx-rounded-md);
  font-size: var(--lx-text-sm);
  font-weight: var(--lx-font-bold);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Soft variant for sub-detail cards — slate */
.lx-score-badge--soft {
  color: var(--lx-color-slate-700);
  background: var(--lx-color-slate-50);
  border: 1.5px solid var(--lx-color-slate-300);
}

/* ─── Ghost button shared (Show details / Show proof / Show more) ────────── */

.lx-score-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: none;
  border: none;
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

/* Primary teal — used in hero card footer */
.lx-score-ghost-btn {
  color: var(--lx-color-primary-700);
}
.lx-score-ghost-btn:hover {
  color: var(--lx-color-primary-900);
}

/* Slate variant — used inside sub-detail and proof cards */
.lx-score-ghost-btn--slate {
  color: var(--lx-color-slate-500);
}
.lx-score-ghost-btn--slate:hover {
  color: var(--lx-color-slate-800);
}

/* Show more: muted, sits below the list */
.lx-score-ghost-btn--more {
  margin-top: 16px;
  color: var(--lx-color-slate-400);
}
.lx-score-ghost-btn--more:hover {
  color: var(--lx-color-slate-700);
}

.lx-score-ghost-btn__icon {
  width: 13px;
  height: 13px;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.lx-score-ghost-btn.is-open .lx-score-ghost-btn__icon {
  transform: rotate(180deg);
}

/* ─── Inline sub-criteria pills ──────────────────────────────────────────── */

.lx-score-subcriteria-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
}

.lx-score-sub-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lx-score-sub-pill__label {
  color: var(--lx-color-slate-600);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  line-height: 1;
}

.lx-score-sub-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 5px;
  color: var(--lx-color-slate-700);
  background: #ffffff;
  border: 1.5px solid var(--lx-color-slate-300);
  border-radius: var(--lx-rounded-sm);
  font-size: 11px;
  font-weight: var(--lx-font-bold);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* ─── Details panel + sub-group connection timeline ─────────────────────── */

.lx-score-details-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  margin-top: 16px;
  padding-left: 24px;
}

/* Main vertical rail connecting all sub groups */
.lx-score-details-panel::before {
  content: "";
  position: absolute;
  top: 26px;
  bottom: 26px;
  left: 7px;
  width: 2px;
  background: var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-full);
}

.lx-score-details-panel[hidden] {
  display: none;
}

/* ─── Sub group: sub card + proof card with connector dot ────────────────── */

.lx-score-sub-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* Dot on the rail for each sub group */
.lx-score-sub-group::before {
  content: "";
  position: absolute;
  top: 20px;
  left: -21px;
  width: 8px;
  height: 8px;
  background: var(--lx-color-slate-300);
  border: 2px solid #ffffff;
  border-radius: var(--lx-rounded-full);
  box-shadow: 0 0 0 1px var(--lx-color-slate-300);
}

/* ─── Sub-detail card ─────────────────────────────────────────────────────── */

.lx-score-sub-detail {
  position: relative;
  background: #ffffff;
  border-color: var(--lx-color-slate-300);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lx-score-sub-detail::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--lx-color-slate-300);
}

.lx-score-sub-detail:hover {
  border-color: var(--lx-color-slate-500);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.lx-score-sub-title {
  margin: 0;
  color: var(--lx-color-slate-900);
  font-size: var(--lx-text-base);
  font-weight: var(--lx-font-bold);
  line-height: 1.25;
}

/* ─── Proof card: white bg, darker border, hover ─────────────────────────── */

.lx-score-proof-card {
  padding: 18px;
  background: #fbfdff;
  border: 1px solid var(--lx-color-slate-300);
  border-radius: var(--lx-rounded-lg);
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lx-score-proof-card:hover {
  border-color: var(--lx-color-slate-400);
  box-shadow: var(--lx-shadow-sm);
}

.lx-score-proof-card[hidden] {
  display: none;
}

/* ─── Proof filters: minimal text + circle count, more spacing ───────────── */

.lx-score-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.lx-score-filter-row {
  display: block;
}

.lx-score-filter-label {
  display: block;
  margin-bottom: 5px;
  color: var(--lx-color-slate-800);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-bold);
  line-height: 1.4;
  text-transform: none;
  letter-spacing: 0;
}

.lx-score-filter-items {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.lx-score-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  background: none;
  border: none;
  color: var(--lx-color-slate-400);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-normal);
  line-height: 1.9;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.1s ease;
}

.lx-score-filter-item:disabled {
  color: var(--lx-color-slate-300);
  cursor: not-allowed;
  text-decoration: none;
}

.lx-score-filter-item:hover {
  color: var(--lx-color-slate-900);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.lx-score-filter-item:disabled:hover {
  color: var(--lx-color-slate-300);
  text-decoration: none;
}

.lx-score-filter-item.is-active {
  color: var(--lx-color-slate-900);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.lx-score-filter-item.is-active:hover {
  color: var(--lx-color-slate-900);
}

.lx-score-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--lx-rounded-full);
  background: var(--lx-color-slate-100);
  color: var(--lx-color-slate-500);
  font-size: 10px;
  font-weight: var(--lx-font-bold);
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.1s ease, color 0.1s ease;
}

.lx-score-filter-item.is-active .lx-score-filter-count {
  background: var(--lx-color-slate-800);
  color: #ffffff;
}

.lx-score-filter-item:disabled .lx-score-filter-count {
  background: var(--lx-color-slate-50);
  color: var(--lx-color-slate-300);
}

/* ─── Proof list ─────────────────────────────────────────────────────────── */

.lx-score-proof-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lx-score-proof-empty {
  margin: 0;
  padding: 10px 12px;
  color: var(--lx-color-slate-500);
  background: var(--lx-color-slate-50);
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
  font-size: var(--lx-text-xs);
  line-height: 1.5;
}

.lx-score-proof-empty[hidden] {
  display: none;
}

.lx-score-proof-example,
.lx-score-correction {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.lx-score-proof-example:hover,
.lx-score-correction:hover {
  background: #ffffff;
  border-color: var(--lx-color-slate-300);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transform: translateY(-1px);
}

.lx-score-proof-example[hidden] {
  display: none;
}

.lx-score-proof-example__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.lx-score-proof-example__meta span {
  padding: 3px 7px;
  color: var(--lx-color-slate-700);
  background: var(--lx-color-slate-100);
  border-radius: var(--lx-rounded-full);
  font-size: 10px;
  font-weight: var(--lx-font-semibold);
  line-height: 1.1;
}

.lx-score-proof-example p {
  margin: 0;
  color: var(--lx-color-slate-700);
  font-size: 13px;
  line-height: 1.6;
}

.lx-score-proof-example--coherence {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lx-score-proof-qa {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.lx-score-proof-qa__line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  background: var(--lx-color-slate-50);
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
}

.lx-score-proof-qa__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0 5px;
  color: var(--lx-color-slate-600);
  background: #ffffff;
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-full);
  font-size: 10px;
  font-weight: var(--lx-font-bold);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lx-score-proof-qa__text {
  margin: 0;
  color: var(--lx-color-slate-700);
  font-size: 13px;
  line-height: 1.55;
}

.lx-score-proof-qa__line .lx-score-proof-qa__text {
  flex: 1;
  min-width: 0;
}

/* ─── Accuracy metric row ────────────────────────────────────────────────── */

.lx-score-metric {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
}

.lx-score-metric span {
  color: var(--lx-color-slate-600);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
}

.lx-score-metric strong {
  color: var(--lx-color-slate-800);
  font-size: var(--lx-text-sm);
  font-weight: var(--lx-font-bold);
}

/* ─── Lexical proof blocks ───────────────────────────────────────────────── */

.lx-score-proof-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 12px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
}

.lx-score-proof-stats div {
  min-width: 0;
  padding: 6px 8px;
  border-right: 1px solid var(--lx-color-slate-100);
}

.lx-score-proof-stats div:last-child {
  border-right: 0;
}

.lx-score-proof-stats--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.lx-score-proof-stats--2 div:last-child {
  border-right: 0;
}

.lx-score-proof-stats--2 div {
  border-right: 1px solid var(--lx-color-slate-100);
}

.lx-score-proof-stats span,
.lx-score-proof-block__label {
  display: block;
  color: var(--lx-color-slate-500);
  font-size: 10px;
  font-weight: var(--lx-font-bold);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.lx-score-proof-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--lx-color-slate-850, var(--lx-color-slate-800));
  font-size: 16px;
  font-weight: var(--lx-font-bold);
  line-height: 1.2;
}

.lx-score-proof-block {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-md);
}

.lx-score-proof-block + .lx-score-proof-note {
  margin-top: 10px;
}

.lx-score-proof-block__label {
  margin-bottom: 9px;
}

.lx-score-filters--compact {
  margin: 0 0 10px;
}

.lx-score-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lx-score-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  color: var(--lx-color-slate-700);
  background: var(--lx-color-slate-50);
  border: 1px solid var(--lx-color-slate-200);
  border-radius: var(--lx-rounded-full);
  font-size: var(--lx-text-xs);
  font-weight: var(--lx-font-semibold);
  line-height: 1.2;
  white-space: nowrap;
}

.lx-score-token-chip__phrase {
  display: block;
  min-width: 0;
  color: var(--lx-color-slate-900);
  overflow: hidden;
  text-overflow: ellipsis;
}

.lx-score-token-chip__meta {
  display: block;
  flex-shrink: 0;
  color: var(--lx-color-slate-500);
  font-size: 10px;
  font-weight: var(--lx-font-bold);
}

.lx-score-proof-note {
  margin: 0;
  color: var(--lx-color-slate-500);
  font-size: var(--lx-text-xs);
  line-height: 1.5;
}

/* ─── Correction diff ────────────────────────────────────────────────────── */

.lx-score-correction__label {
  display: block;
  margin-bottom: 8px;
  color: var(--lx-color-slate-500);
  font-size: 10px;
  font-weight: var(--lx-font-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lx-score-correction__diff {
  margin: 0;
  color: var(--lx-color-slate-700);
  font-size: 13px;
  line-height: 1.65;
}

.lx-score-diff {
  display: inline;
  border-radius: var(--lx-rounded-xs);
}

.lx-score-diff--delete {
  color: var(--lx-color-error-600);
  background: var(--lx-color-error-50);
  text-decoration: line-through;
}

.lx-score-diff--insert {
  color: var(--lx-color-highlight-correct-700);
  background: var(--lx-color-highlight-correct-100);
  text-decoration: none;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .lx-score__scroll {
    padding: 16px;
  }

  .lx-score-header {
    flex-direction: column;
    gap: 8px;
  }

  .lx-score-details-panel {
    padding-left: 18px;
  }

  .lx-score-proof-stats {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .lx-score-proof-stats div {
    border-right: 0;
    border-bottom: 1px solid var(--lx-color-slate-100);
  }

  .lx-score-proof-stats div:last-child {
    border-bottom: 0;
  }
}
