/**
 * FindEdition — platform-98.7-compare-ux.css
 * Compare module layout, contrast, and responsive styles.
 *
 * Copyright (c) FindEdition Developers. All rights reserved.
 */

/* ── MOBILES compare: force readable light theme ── */
.fe-mobiles .mc-page,
.fe-mobiles .mc-page.mobiles-theme {
  background: var(--fe-m-bg, #f4f7fb) !important;
  color: #0f172a !important;
  overflow-x: clip;
  max-width: 100%;
}

.fe-mobiles .mc-container,
.fe-mobiles .mc-sticky-inner,
.fe-mobiles .mc-floating-inner {
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
  padding-left: clamp(0.75rem, 3vw, 1.25rem);
  padding-right: clamp(0.75rem, 3vw, 1.25rem);
}

.fe-mobiles .mc-page .mf-breadcrumb,
.fe-mobiles .mc-page .mf-breadcrumb span[aria-current="page"] {
  color: #0f172a !important;
  font-weight: 600;
  opacity: 1 !important;
}

.fe-mobiles .mc-page .mf-breadcrumb a {
  color: #0e7490 !important;
  font-weight: 600;
}

.fe-mobiles .mc-page .mf-breadcrumb__sep {
  color: #64748b !important;
}

.fe-mobiles .mc-page h1,
.fe-mobiles .mc-page h2,
.fe-mobiles .mc-page h3,
.fe-mobiles .mc-page .mc-section-title,
.fe-mobiles .mc-page .mc-winners h2,
.fe-mobiles .mc-page .mc-ai-heading,
.fe-mobiles .mc-visual-compare__head h2 {
  color: #0f172a !important;
  opacity: 1 !important;
}

.fe-mobiles .mc-ai-summary {
  background: #eff6ff !important;
  border: 1px solid #93c5fd !important;
  color: #0f172a !important;
}

.fe-mobiles .mc-ai-summary h2 {
  color: #1e3a8a !important;
}

.fe-mobiles .mc-ai-summary p,
.fe-mobiles .mc-ai-summary li {
  color: #1e293b !important;
  opacity: 1 !important;
}

.fe-mobiles .mc-winner-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

.fe-mobiles .mc-winner-label {
  color: #475569 !important;
  font-weight: 700;
}

.fe-mobiles .mc-winner-card strong {
  color: #0f172a !important;
  opacity: 1 !important;
}

.fe-mobiles .mc-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
}

.fe-mobiles .mc-compare-table {
  min-width: 0;
  width: 100%;
}

.fe-mobiles .mc-compare-table th,
.fe-mobiles .mc-compare-table td,
.fe-mobiles .mc-label-col,
.fe-mobiles .mc-device-col,
.fe-mobiles .mc-device-col a,
.fe-mobiles .mc-group-toggle {
  color: #0f172a !important;
}

.fe-mobiles .mc-status-winner,
.fe-mobiles .mc-compare-table td.mc-status-winner {
  background: #dcfce7 !important;
  color: #14532d !important;
}

.fe-mobiles .mc-status-loser,
.fe-mobiles .mc-compare-table td.mc-status-loser {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
}

.fe-mobiles .mc-status-equal,
.fe-mobiles .mc-compare-table td.mc-status-equal {
  background: #fff !important;
  color: #1e293b !important;
}

.fe-mobiles .mc-diff-winner { color: #15803d !important; }
.fe-mobiles .mc-diff-loser { color: #b91c1c !important; }

.fe-mobiles .mc-sticky-header {
  background: #fff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.fe-mobiles .mc-sticky-device {
  background: #fff !important;
  border-color: #e2e8f0 !important;
  color: #0f172a !important;
}

.fe-mobiles .mc-sticky-device strong {
  color: #0f172a !important;
}

.fe-mobiles .mc-section-nav {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  max-width: 100%;
  overflow-x: auto;
}

.fe-mobiles .mc-section-nav-link {
  color: #334155 !important;
}

.fe-mobiles .mc-export-toolbar {
  background: #0f172a !important;
  color: #f8fafc !important;
  max-width: 100%;
  box-sizing: border-box;
}

.fe-mobiles .mc-export-toolbar .mc-diff-toggle {
  color: #e2e8f0 !important;
}

.fe-mobiles .mc-chart-panel h3 {
  color: #475569 !important;
}

.fe-mobiles .mc-visual-compare {
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  max-width: 100%;
  overflow-x: clip;
  overflow-y: visible;
}

.fe-mobiles .mc-visual-compare__grid {
  max-width: 100%;
  min-width: 0;
  width: 100%;
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .fe-mobiles .mc-visual-compare__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {
  .fe-mobiles .mc-visual-compare__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mc-visual-compare__grid,
.ac-visual-compare__grid,
.rc-visual-compare__grid {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

@media (min-width: 640px) {
  .mc-visual-compare__grid,
  .ac-visual-compare__grid,
  .rc-visual-compare__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.mc-chart-panel,
.ac-chart-panel,
.rc-chart-panel {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  height: 300px;
  overflow: hidden;
  box-sizing: border-box;
}

.mc-chart-panel h3,
.ac-chart-panel h3,
.rc-chart-panel h3 {
  margin: 0 0 0.5rem;
}

.mc-chart-panel canvas,
.ac-chart-panel canvas,
.rc-chart-panel canvas {
  display: block !important;
  max-width: 100% !important;
  width: 100% !important;
  height: calc(100% - 1.75rem) !important;
}

.fe-mobiles .mc-popular-vs-card {
  max-width: 100%;
}

.fe-mobiles .mc-floating-bar {
  background: #fff !important;
  border-top: 2px solid #0891b2 !important;
  color: #0f172a !important;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
}

.fe-mobiles .mc-floating-count {
  color: #475569 !important;
}

.fe-mobiles .mc-btn-primary {
  background: #0891b2 !important;
  color: #fff !important;
}

/* Prefer light theme tokens over OS dark-mode overrides */
@media (prefers-color-scheme: dark) {
  .fe-mobiles .mc-page.mobiles-theme,
  .fe-mobiles .mc-page {
    background: #f4f7fb !important;
    color: #0f172a !important;
  }
  .fe-mobiles .mc-ai-summary p,
  .fe-mobiles .mc-winner-card strong,
  .fe-mobiles .mc-sticky-device strong,
  .fe-mobiles .mc-compare-table th,
  .fe-mobiles .mc-compare-table td {
    color: #0f172a !important;
  }
  .fe-mobiles .mc-status-winner,
  .fe-mobiles .mc-compare-table td.mc-status-winner {
    background: #dcfce7 !important;
    color: #14532d !important;
  }
  .fe-mobiles .mc-status-loser,
  .fe-mobiles .mc-compare-table td.mc-status-loser {
    background: #fee2e2 !important;
    color: #7f1d1d !important;
  }
  .fe-mobiles .mc-floating-bar,
  .fe-mobiles .mc-sticky-header,
  .fe-mobiles .mc-table-wrap,
  .fe-mobiles .mc-winner-card,
  .fe-mobiles .mc-ai-summary {
    background: #fff !important;
    border-color: #e2e8f0 !important;
  }
}

/* ── AUTOS compare: overflow + contrast + floating bar ── */
.ac-page,
.ac-page.autos-theme {
  overflow-x: clip;
  max-width: 100%;
  color: #0f172a;
}

.ac-container,
.ac-sticky-inner {
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.ac-breadcrumb,
.ac-breadcrumb li,
.ac-breadcrumb span,
.ac-breadcrumb [aria-current="page"] {
  color: #0f172a !important;
  font-weight: 600;
}

.ac-breadcrumb ol {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ac-breadcrumb a {
  color: #059669 !important;
}

.ac-ai-summary,
.ac-ai-summary p,
.ac-ai-summary h2 {
  color: #0f172a !important;
}

.ac-winner-card,
.ac-winner-card strong {
  color: #0f172a !important;
}

.ac-winner-label {
  color: #475569 !important;
}

.ac-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.ac-status-winner {
  background: #d1fae5 !important;
  color: #065f46 !important;
}

.ac-status-loser {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
}

.ac-export-toolbar,
.ac-visual-compare,
.ac-popular-vs-grid {
  max-width: 100%;
  box-sizing: border-box;
}

.ac-floating-bar {
  background: #ffffff !important;
  border-top: 3px solid #059669 !important;
  color: #0f172a !important;
  display: block !important;
  padding: 0.75rem clamp(0.75rem, 3vw, 1.25rem);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  left: 0;
  right: 0;
}

.ac-floating-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.ac-floating-devices {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
}

.ac-floating-device {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

.ac-floating-device img,
.ac-floating-device-fallback {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid #059669;
  display: block;
  background: #ecfdf5;
}

.ac-floating-device .ac-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-size: 0.65rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.ac-floating-slot {
  width: 52px;
  height: 52px;
  border: 2px dashed #a7f3d0;
  border-radius: 0.5rem;
  flex: 0 0 auto;
}

.ac-floating-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.ac-floating-bar .ac-btn-primary {
  background: #059669 !important;
  color: #fff !important;
}

.ac-floating-bar .ac-btn-outline {
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

/* ── RECIPES compare: overflow + contrast + floating bar ── */
.rc-page {
  overflow-x: clip;
  max-width: 100%;
  color: #0f172a;
}

.rc-container,
.rc-sticky-inner {
  max-width: 1280px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}

.rc-breadcrumb,
.rc-breadcrumb li,
.rc-breadcrumb span,
.rc-breadcrumb [aria-current="page"] {
  color: #0f172a !important;
  font-weight: 600;
}

.rc-breadcrumb ol {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rc-breadcrumb a {
  color: #ea580c !important;
}

.rc-ai-summary,
.rc-ai-summary p,
.rc-ai-summary h2,
.rc-winner-card,
.rc-winner-card strong {
  color: #0f172a !important;
}

.rc-winner-label {
  color: #78716c !important;
}

.rc-table-wrap {
  overflow-x: auto;
  max-width: 100%;
}

.rc-status-winner {
  background: #ffedd5 !important;
  color: #9a3412 !important;
}

.rc-status-loser {
  background: #fee2e2 !important;
  color: #7f1d1d !important;
}

.rc-export-toolbar,
.rc-visual-compare,
.rc-popular-vs-grid {
  max-width: 100%;
  box-sizing: border-box;
}

.rc-floating-bar {
  background: #ffffff !important;
  border-top: 3px solid #ea580c !important;
  color: #0f172a !important;
  display: block !important;
  padding: 0.75rem clamp(0.75rem, 3vw, 1.25rem);
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  left: 0;
  right: 0;
}

.rc-floating-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}

.rc-floating-devices {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
}

.rc-floating-device {
  position: relative;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
}

.rc-floating-device img,
.rc-floating-device-fallback {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 2px solid #ea580c;
  display: block;
  background: #fff7ed;
}

.rc-floating-device .rc-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: #0f172a;
  color: #fff;
  font-size: 0.65rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.rc-floating-slot {
  width: 52px;
  height: 52px;
  border: 2px dashed #fdba74;
  border-radius: 0.5rem;
  flex: 0 0 auto;
}

.rc-floating-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.rc-floating-bar .rc-btn-primary {
  background: #ea580c !important;
  color: #fff !important;
}

.rc-floating-bar .rc-btn-outline {
  background: #fff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

/* ── Autos / Recipes cards: icon-only Compare (like Mobiles) ── */
.fe983-auto .fe983-compare__text,
.fe983-recipe .fe983-compare__text {
  display: none !important;
}

.fe983-auto .fe983-compare,
.fe983-auto .fe983-compare--auto,
.fe983-recipe .fe983-compare,
.fe983-recipe .fe983-compare--recipe {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px;
  min-height: 36px;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 999px !important;
}

.fe983-auto .fe983-compare i,
.fe983-recipe .fe983-compare i {
  margin: 0;
  font-size: 14px;
}

.fe983-auto .fe983-compare--auto {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
}

.fe983-auto .fe983-compare--auto:hover {
  background: #059669 !important;
  color: #fff !important;
  border-color: #059669 !important;
}

.fe983-auto .fe983-compare--auto.is-added {
  background: #047857 !important;
  color: #fff !important;
  border-color: #047857 !important;
}

.fe983-recipe .fe983-compare--recipe {
  background: rgba(255, 255, 255, 0.96) !important;
  color: #0f172a !important;
  border: 1px solid #fdba74 !important;
}

.fe983-recipe .fe983-compare--recipe:hover {
  background: #ea580c !important;
  color: #fff !important;
  border-color: #ea580c !important;
}

.fe983-recipe .fe983-compare--recipe.is-added {
  background: #c2410c !important;
  color: #fff !important;
  border-color: #c2410c !important;
}

/* ── Movies compare overflow / toolbar ── */
.mfc-compare,
.mfc-compare-body,
.mfc-wrap-wide {
  max-width: 100%;
  overflow-x: clip;
  box-sizing: border-box;
}

.mfc-compare-toolbar {
  max-width: 100%;
  box-sizing: border-box;
}

.mfc-compare .ac-table-wrap,
.mfc-compare-charts-grid,
.mfc-compare-widget-grid,
.mfc-compare-vs-row {
  max-width: 100%;
  overflow-x: auto;
}

.mfc-compare .mc-sticky-inner {
  max-width: 100%;
  box-sizing: border-box;
}

/* ── Series compare overflow / toolbar ── */
.sfx-root .sfx-page-stage,
.sfx-compare-header,
.sfx-compare-toolbar,
.sfx-chart-grid,
.sfx-table-scroll {
  max-width: 100%;
  box-sizing: border-box;
}

.sfx-table-scroll,
.sfx-chart-grid {
  overflow-x: auto;
}

.sfx-compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.85rem;
}

.sfx-compare-search {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  min-width: 160px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
}

.sfx-compare-search input {
  border: 0;
  background: transparent;
  color: #f8fafc;
  outline: none;
  width: 100%;
}

.sfx-page-title,
.sfx-section-title {
  overflow-wrap: anywhere;
}

/* ── Anime compare overflow ── */
.anx-page,
.anx-compare-table-wrap,
.anx-compare-toolbar,
.anx-compare-add,
.anx-compare-popular-grid,
.anx-compare-visual-grid {
  max-width: 100%;
  box-sizing: border-box;
}

.anx-compare-table-wrap {
  overflow-x: auto;
}

.anx-compare-page { overflow-x: clip; max-width: 100%; }
.anx-compare-sticky {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex; gap: 0.75rem; overflow-x: auto; margin: 0 0 1rem;
  padding: 0.75rem; background: #111827; border-radius: 0.85rem; border: 1px solid #1f2937;
}
.anx-compare-sticky__devices { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 0.65rem; }
.anx-compare-sticky__device {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.65rem;
  background: #1f2937; border-radius: 0.65rem; flex: 0 0 auto; color: #f9fafb;
}
.anx-compare-sticky__device img { width: 40px; height: 56px; object-fit: cover; border-radius: 0.35rem; }
.anx-compare-sticky__device strong { font-size: 0.8rem; max-width: 120px; }
.anx-compare-sticky__device button {
  border: 0; background: #374151; color: #fff; width: 28px; height: 28px; border-radius: 999px; cursor: pointer;
}
.anx-compare-add, .anx-compare-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center;
  margin: 1rem 0; padding: 0.85rem 1rem; background: #111827; border-radius: 0.85rem; color: #e5e7eb;
}
.anx-compare-search {
  display: inline-flex; align-items: center; gap: 0.45rem; background: #1f2937;
  border: 1px solid #374151; border-radius: 999px; padding: 0.4rem 0.85rem; flex: 1; min-width: 160px;
}
.anx-compare-search input { border: 0; background: transparent; color: #f9fafb; outline: none; width: 100%; min-width: 0; }
.anx-compare-diff { font-size: 0.875rem; }
.anx-compare-suggest-results { width: 100%; background: #1f2937; border-radius: 0.75rem; padding: 0.5rem; }
.anx-compare-suggest-item {
  display: block; width: 100%; text-align: left; background: transparent; border: 0;
  color: #f9fafb; padding: 0.55rem 0.65rem; border-radius: 0.5rem; cursor: pointer;
}
.anx-compare-suggest-item:hover { background: #374151; }
.anx-chart-grid {
  display: grid !important; grid-template-columns: 1fr; gap: 0.85rem; margin: 1rem 0 1.5rem;
}
@media (min-width: 640px) {
  .anx-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.anx-chart-panel {
  background: #111827; color: #f9fafb; border-radius: 1rem; padding: 0.85rem;
  border: 1px solid #1f2937; min-width: 0; height: 300px; overflow: hidden;
}
.anx-chart-panel h3 { margin: 0 0 0.5rem; font-size: 0.75rem; text-transform: uppercase; color: #9ca3af; }
.anx-chart-panel canvas { display: block; max-width: 100% !important; height: calc(100% - 1.5rem) !important; }
.anx-compare-popular-grid {
  display: grid; grid-template-columns: 1fr; gap: 0.85rem;
}
@media (min-width: 640px) {
  .anx-compare-popular-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .anx-compare-popular-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.anx-compare-popular-card {
  background: #111827; color: #f9fafb; border-radius: 1rem; padding: 1rem; border: 1px solid #1f2937;
}
.anx-compare-popular-pair {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem; align-items: center; text-align: center;
}
.anx-compare-popular-pair img {
  width: 48px; height: 68px; object-fit: cover; border-radius: 0.4rem; margin: 0 auto 0.35rem; display: block;
}
.anx-compare-vs {
  width: 2rem; height: 2rem; border-radius: 999px; background: #fbbf24; color: #111;
  display: grid; place-items: center; font-size: 0.65rem; font-weight: 800;
}
.anx-compare-score {
  display: inline-block; margin-top: 0.25rem; background: #fbbf24; color: #111;
  border-radius: 999px; padding: 0.1rem 0.45rem; font-size: 0.7rem; font-weight: 700;
}
.anx-compare-popular-actions { margin-top: 0.75rem; }
.anx-compare-table-wrap { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
.anx-compare-table { min-width: 480px; width: 100%; }
.sfx-chart-grid {
  display: grid !important; grid-template-columns: 1fr; gap: 0.85rem;
}
@media (min-width: 640px) {
  .sfx-chart-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.sfx-chart-wrap {
  min-width: 0; height: 280px; overflow: hidden; position: relative;
}
.sfx-chart-wrap canvas {
  display: block; max-width: 100% !important; height: calc(100% - 1.5rem) !important;
}
@media print {
  .anx-compare-toolbar, .anx-compare-add, .anx-compare-popular, .anx-compare-sticky { display: none !important; }
}

.ac-page h1,
.ac-page h2,
.ac-page .ac-section-title,
.ac-visual-compare__head h2 {
  color: #0f172a !important;
}

.ac-sticky-header {
  max-width: 100%;
  overflow-x: auto;
}

.rc-page h1,
.rc-page h2,
.rc-page .rc-section-title,
.rc-visual-compare__head h2 {
  color: #0f172a !important;
}

.rc-sticky-header {
  max-width: 100%;
  overflow-x: auto;
}

/* ── Global compare responsiveness (all 6 modules) ── */
.mc-page,
.ac-page,
.rc-page,
.mfc-compare,
.sfx-root,
.anx-compare-page {
  overflow-x: clip;
  max-width: 100%;
}

.mc-export-toolbar,
.ac-export-toolbar,
.rc-export-toolbar,
.sfx-compare-toolbar,
.anx-compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  max-width: 100%;
  box-sizing: border-box;
}

.mc-table-wrap,
.ac-table-wrap,
.rc-table-wrap,
.sfx-table-scroll,
.anx-compare-table-wrap,
.mfc-compare .ac-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

.sfx-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  max-width: 100%;
}

.sfx-compare-card {
  min-width: 0;
  max-width: 100%;
}

.sfx-compare-card img {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

@media (max-width: 639px) {
  .mc-sticky-device strong,
  .ac-sticky-device strong,
  .rc-sticky-device strong,
  .mfc-compare .mc-sticky-device strong,
  .anx-compare-sticky__device strong {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
  }

  .mc-export-actions,
  .ac-export-actions,
  .rc-export-actions {
    margin-left: 0;
    width: 100%;
  }

  .mc-page h1,
  .ac-page h1,
  .rc-page h1,
  .mfc-compare h1,
  .sfx-page-title {
    font-size: clamp(1.15rem, 5vw, 1.65rem);
    line-height: 1.25;
    word-break: break-word;
  }

  .mc-floating-inner,
  .ac-floating-inner,
  .rc-floating-inner,
  .mc-floating-bar .mc-floating-inner {
    flex-wrap: wrap;
  }
}

/* ── Shared VS row (below Category Winners) ── */
.fe-compare-vs { margin: 1.25rem 0 1.75rem; max-width: 100%; }
.fe-compare-vs__row {
  display: flex; flex-wrap: wrap; align-items: stretch; justify-content: center;
  gap: 0.75rem 1rem; max-width: 100%;
}
.fe-compare-vs__badge {
  font-size: clamp(1.25rem, 3vw, 2rem); font-weight: 800; letter-spacing: 0.06em;
  color: #ef4444; align-self: center; flex: 0 0 auto;
}
.fe-compare-vs__badge--teal { color: #059669; }
.fe-compare-vs__badge--orange { color: #ea580c; }
.fe-compare-vs__card {
  position: relative; flex: 1 1 140px; max-width: 200px; min-width: 120px;
  text-align: center; padding: 0.85rem 0.75rem 1rem;
  border-radius: 0.85rem; box-sizing: border-box;
}
.fe-compare-vs__card--light {
  background: #fff; border: 1px solid #e2e8f0; color: #0f172a;
}
.fe-compare-vs__card--dark {
  background: #111827; border: 1px solid #1f2937; color: #f9fafb;
}
.fe-compare-vs__card.is-winner {
  border-color: #f0c040; box-shadow: 0 0 0 1px #f0c040, 0 0 20px rgba(240,192,64,0.25);
}
.fe-compare-vs__card.is-winner--teal { border-color: #059669; box-shadow: 0 0 0 1px #059669, 0 0 16px rgba(5,150,105,0.2); }
.fe-compare-vs__card.is-winner--orange { border-color: #ea580c; box-shadow: 0 0 0 1px #ea580c, 0 0 16px rgba(234,88,12,0.2); }
.fe-compare-vs__card img {
  width: 100%; max-width: 120px; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 0.5rem; margin: 0 auto 0.65rem; display: block;
}
.fe-compare-vs__fallback {
  width: 100%; max-width: 120px; aspect-ratio: 2/3; margin: 0 auto 0.65rem;
  display: grid; place-items: center; border-radius: 0.5rem;
  background: #1f2937; color: #9ca3af; font-size: 1.5rem;
}
.fe-compare-vs__card--light .fe-compare-vs__fallback { background: #f1f5f9; color: #64748b; }
.fe-compare-vs__card h3 { margin: 0 0 0.35rem; font-size: 0.875rem; line-height: 1.3; }
.fe-compare-vs__card h3 a { color: inherit; text-decoration: none; }
.fe-compare-vs__meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 0.55rem;
  font-size: 0.7rem; color: #94a3b8; margin-bottom: 0.35rem;
}
.fe-compare-vs__card--light .fe-compare-vs__meta { color: #64748b; }
.fe-compare-vs__score {
  display: inline-block; margin-top: 0.15rem; padding: 0.15rem 0.55rem;
  border-radius: 999px; border: 1px solid #f0c040; color: #f0c040;
  font-size: 0.75rem; font-weight: 700;
}
.fe-compare-vs__score--teal { border-color: #059669; color: #059669; }
.fe-compare-vs__score--orange { border-color: #ea580c; color: #ea580c; }
.fe-compare-vs__genres { margin: 0.4rem 0 0; font-size: 0.7rem; color: #94a3b8; }
.fe-compare-vs__winner {
  position: absolute; top: 0.45rem; left: 0.45rem; z-index: 2;
  padding: 0.2rem 0.5rem; border-radius: 999px; font-size: 0.625rem; font-weight: 800;
  background: #f0c040; color: #111;
}
.fe-compare-vs__winner--teal { background: #059669; color: #fff; }
.fe-compare-vs__winner--orange { background: #ea580c; color: #fff; }

@media (max-width: 639px) {
  .fe-compare-vs__row { flex-direction: column; align-items: center; }
  .fe-compare-vs__badge { transform: rotate(90deg); margin: 0.15rem 0; }
  .fe-compare-vs__card { max-width: 260px; width: 100%; }
}

/* Anime / Series compare top */
.anx-breadcrumb, .sfx-breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  font-size: 0.875rem; margin: 0 0 0.75rem; font-weight: 600;
}
.anx-breadcrumb a, .sfx-breadcrumb a { color: #fbbf24; text-decoration: none; }
.anx-breadcrumb [aria-current="page"], .sfx-breadcrumb [aria-current="page"] { color: #e5e7eb; }
.anx-compare-intro { margin: 0 0 1rem; }
.anx-compare-kicker, .sfx-kicker {
  margin: 0 0 0.35rem; font-size: 0.75rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: #fbbf24; font-weight: 700;
}
.anx-compare-title, .sfx-compare-stage .sfx-page-title {
  margin: 0 0 0.35rem; font-size: clamp(1.2rem, 3vw, 1.75rem);
  line-height: 1.25; word-break: break-word;
}
.anx-compare-add__head {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; margin-bottom: 0.55rem;
}
.sfx-compare-stage { padding-top: 1.25rem !important; }
.sfx-compare-header { margin-bottom: 0.85rem; gap: 0.75rem; }
.sfx-compare-add-panel { margin-bottom: 1rem; }

.rc-page.rc-compare-show { padding-top: 1.25rem; }
.ac-page.ac-compare-show { padding-top: 1.25rem; }
.rc-container, .ac-container { padding-top: 0; }
