*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  display: grid;
  min-height: 100%;
  line-height: 1.2;
  overflow-x: clip;
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-main-background);
  color: var(--color-main-font);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Global link styles (fix WebKit UA a:-webkit-any-link + visited) */
:where(a, a:visited) {
  color: var(--color-link);
  text-decoration: none;
  text-decoration-color: currentColor;
}

:where(a:hover, a:focus-visible) {
  color: var(--color-link-hover);
}

img {
  max-width: 100%;
  display: block;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-heading);
  margin: 0;
}

h1 {
  margin-bottom: var(--spacing-lg);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

input,
textarea {
  font-family: inherit;
  font-size: 100%;
}

hr {
  height: 1px;
  background-color: gray;
  border: none;
}

/* =============================================
   Star rating system (CSS-based)
   ============================================= */
:root {
  counter-reset: rating;
}

.stars {
  position: relative;
  display: inline-block;
  font-size: var(--star-size);
  color: var(--color-main-font, #ccc);
  overflow: hidden;
}

.stars::before {
  content: "\2605\2605\2605\2605\2605";
}

.stars__fill {
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  overflow: hidden;
  width: 0%;
  color: var(--color-alt-highlighter, gold);
}

.stars__fill::before {
  content: "\2605\2605\2605\2605\2605";
}

/* =============================================
   Pill metrics (0-100 bar)
   ============================================= */
.metric.pill {
  --h: 3px;
  height: var(--h);
  background: var(--color-unactive-background);
  border-radius: var(--h);
  overflow: hidden;
}

.metric.pill .pill__fill {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--color-alt-highlighter);
  border-radius: inherit;
}

/* =============================================
   Radial metrics (circular progress)
   ============================================= */
.metric.radial {
  --size: 48px;
  --thickness: 6px;
  --value: 0;
  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: conic-gradient(
    var(--color-alt-highlighter) calc(var(--value) * 1%),
    var(--color-unactive-background) 0
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--size) * 0.4);
  font-weight: 500;
  color: var(--color-main-font);
  transition: background 1s ease-out;
}

.metric.radial::before {
  content: attr(aria-valuenow) "%";
  position: absolute;
  z-index: 1;
}

.metric.radial::after {
  content: "";
  position: absolute;
  inset: var(--thickness);
  border-radius: 50%;
  background: var(--color-main-background);
  z-index: 0;
}

.metric.radial.overall {
  --fill: var(--color-brand);
}

.metrics-row .metric.radial:first-child {
  --fill: var(--color-brand);
}

/* =============================================
   Dots metrics
   ============================================= */
.metrics-dots {
  display: flex;
  gap: 4px;
}

.metrics-dots .dot {
  --d-min: 6px;
  --d-max: 12px;
  width: var(--d-min);
  height: var(--d-min);
  background: var(--color-unactive-background);
  border-radius: 50%;
  transition:
    width 0.5s ease,
    height 0.5s ease;
}

/* =============================================
   Auto-numbering for rating cards
   ============================================= */
.number::before {
  counter-increment: rating;
  content: counter(rating);
}

/* =============================================
   Details / Summary — intro & conclusion context
   ============================================= */
.introduction details,
.conclusion details {
  margin-top: 0.5rem;
  padding: 0;
  border-bottom: 1px solid var(--color-unactive-background);
}

.introduction summary,
.conclusion summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  padding: var(--spacing-sm) 0;
  color: var(--color-brand);
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.introduction summary::-webkit-details-marker,
.conclusion summary::-webkit-details-marker {
  display: none;
}

.introduction summary::after,
.conclusion summary::after {
  content: "";
  margin-left: auto;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.5;
  transition: transform 0.2s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

.introduction summary:hover::after,
.conclusion summary:hover::after {
  opacity: 0.8;
}

.introduction details[open] summary::after,
.conclusion details[open] summary::after {
  transform: rotate(180deg);
  opacity: 0.9;
}

.introduction details[open] summary,
.conclusion details[open] summary {
  margin-bottom: var(--spacing-sm);
}

.introduction details > :not(summary),
.conclusion details > :not(summary) {
  padding-bottom: var(--spacing-md);
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.85;
}

/* =============================================
   Introduction / Conclusion content links
   ============================================= */
.introduction a,
.conclusion a {
  color: var(--color-link) !important;
  text-decoration: none !important;
  font-weight: inherit;
}

.introduction a:hover {
  color: var(--color-link-hover) !important;
  text-decoration: underline !important;
}

.introduction details[open] a {
  color: var(--color-link) !important;
}

/* =============================================
   Tab panels (SEO-friendly, always in DOM)
   ============================================= */
.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* =============================================
   Button tokens (standardized from original)
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xs);
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-small);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s ease;
  line-height: 1.4;
}

.btn:hover {
  opacity: 0.85;
}

/* Primary: brand color (filled) */
.btn-brand {
  background-color: var(--color-brand);
  color: var(--color-btn-brand-text);
}

.btn-brand:hover {
  color: var(--color-btn-brand-text);
}

/* Contrast: outline style (transparent bg + colored border) */
.btn-contrast {
  background: transparent;
  border: 1.5px solid var(--color-highlighter, #8e7cff);
  color: var(--color-heading);
}

.btn-contrast:hover {
  color: var(--color-heading);
  border-color: var(--color-link-hover);
}

/* Paired left (rounded left only) */
.btn-left {
  border-radius: var(--radius-small) 0 0 var(--radius-small);
}

/* Paired right (rounded right only) */
.btn-right {
  border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

/* Pill shape (fully rounded) */
.btn-pill {
  border-radius: 2rem;
}

/* =============================================
   Content typography (CMS HTML inside main-content)
   Restores margins/styles stripped by reset.
   No custom class names — pure element selectors.
   ============================================= */
/* Scoped to text content areas only (not banners/cards/sidebar) */
.tab-panel p,
.introduction p,
.conclusion p,
.verdict p {
  margin-bottom: var(--spacing-md);
  line-height: 1.6;
}

.tab-panel h2, .introduction h2, .conclusion h2, .verdict h2 {
  font-size: 1.4rem;
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
  line-height: 1.3;
}

.tab-panel h3, .introduction h3, .conclusion h3, .verdict h3 {
  font-size: 1.15rem;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-sm);
  line-height: 1.3;
}

.tab-panel h4, .introduction h4, .conclusion h4, .verdict h4 {
  font-size: 1rem;
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-sm);
}

.tab-panel ul, .tab-panel ol,
.introduction ul, .introduction ol,
.conclusion ul, .conclusion ol,
.verdict ul, .verdict ol {
  padding-left: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.tab-panel ul, .introduction ul, .conclusion ul, .verdict ul { list-style: disc; }
.tab-panel ol, .introduction ol, .conclusion ol, .verdict ol { list-style: decimal; }

.tab-panel li, .introduction li, .conclusion li, .verdict li {
  margin-bottom: var(--spacing-xs);
  line-height: 1.6;
}

/* Links — only inside text content areas, not in buttons/banners/cards */
.tab-panel a,
.introduction a,
.conclusion a,
.verdict a {
  color: var(--color-link);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.tab-panel a:hover,
.introduction a:hover,
.conclusion a:hover,
.verdict a:hover {
  color: var(--color-link-hover);
}

.tab-panel img, .introduction img, .conclusion img, .verdict img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-small);
  margin: var(--spacing-md) 0;
}

.tab-panel table, .introduction table, .conclusion table, .verdict table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--spacing-md) 0;
  font-size: 0.9rem;
}

.tab-panel th, .tab-panel td,
.introduction th, .introduction td,
.conclusion th, .conclusion td,
.verdict th, .verdict td {
  padding: var(--spacing-sm);
  border: 1px solid var(--color-unactive-background);
  text-align: left;
}

.tab-panel th, .introduction th, .conclusion th, .verdict th {
  background-color: var(--color-secondary-background);
  font-weight: 600;
}

.tab-panel blockquote, .introduction blockquote, .conclusion blockquote, .verdict blockquote {
  border-left: 3px solid var(--color-highlighter);
  padding-left: var(--spacing-md);
  margin: var(--spacing-md) 0;
  opacity: 0.9;
}

/* Smooth theme transition */
@media (prefers-reduced-motion: no-preference) {
  html {
    transition:
      background-color 180ms ease,
      color 180ms ease;
  }
}
