@layer components {
  .rating-summary {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
  }

  .rating-summary__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .rating-summary__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
  }

  .rating-summary__select {
    width: auto;
    height: auto;
    min-width: 140px;
    padding: 0.4rem 2.25rem 0.4rem 0.75rem;
    font-size: 0.85rem;
  }

  .rating-summary__empty {
    color: #9ca3af;
    font-size: 0.9rem;
    margin: 0;
  }

  .rating-summary__body {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
  }

  .rating-summary__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
    min-width: 96px;
  }

  .rating-summary__average {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    color: #111827;
  }

  .rating-summary__stars {
    display: flex;
    gap: 0.1rem;
  }

  .rating-summary__star {
    font-size: 1rem;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.3px #d1d5db;
  }

  .rating-summary__star--full {
    color: #facc15;
    -webkit-text-stroke: 0;
  }

  .rating-summary__count {
    font-size: 0.78rem;
    color: #6b7280;
    white-space: nowrap;
  }

  .rating-summary__bars {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
    min-width: 200px;
  }

  .rating-summary__bar-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .rating-summary__bar-label {
    width: 1.8rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
  }

  .rating-summary__bar-track {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 999px;
    overflow: hidden;
  }

  .rating-summary__bar-fill {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: #facc15;
    transition: width 0.3s ease;
  }

  .rating-summary__bar-value {
    width: 1.6rem;
    flex-shrink: 0;
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: right;
  }

  [data-theme="dark"] .rating-summary {
    background: #1e293b;
    border-color: #334155;
  }

  [data-theme="dark"] .rating-summary__title,
  [data-theme="dark"] .rating-summary__average {
    color: #f1f5f9;
  }

  [data-theme="dark"] .rating-summary__count,
  [data-theme="dark"] .rating-summary__bar-label {
    color: #94a3b8;
  }

  [data-theme="dark"] .rating-summary__bar-value {
    color: #64748b;
  }

  [data-theme="dark"] .rating-summary__bar-track {
    background: #334155;
  }

  [data-theme="dark"] .rating-summary__star {
    -webkit-text-stroke-color: #475569;
  }

  @media (max-width: 480px) {
    .rating-summary__header {
      flex-direction: column;
      align-items: stretch;
    }

    .rating-summary__body {
      flex-direction: column;
      align-items: stretch;
      gap: 1rem;
    }

    .rating-summary__score {
      flex-direction: row;
      justify-content: center;
    }
  }
}
