/* Ranking de Eficiencia Digital — EJEZ
   Estilos propios de la sección /ranking/. Reutiliza tokens de style.css. */

.ranking-shell {
  --rk-green: #0d6b30;
  --rk-amber: #7a5200;
  --rk-red: #b91c1c;
  --rk-muted: #6f6a63;
  --rk-border: rgba(15, 45, 36, 0.14);
  --rk-gold: #c9a34e;
}

/* ---------- Hero ---------- */
.ranking-hero {
  padding: 64px 0 48px;
  background: var(--color-primary);
  color: var(--color-ivory);
}

.ranking-hero-content {
  text-align: left;
}

.ranking-hero .section-kicker {
  color: #8fd8ad;
  margin: 0 0 12px;
}

.ranking-hero .section-title {
  color: var(--color-ivory);
  margin-bottom: 16px;
}

.ranking-hero .section-lead {
  color: rgba(245, 240, 230, 0.92);
  font-size: 1.2rem;
  line-height: 1.55;
  margin: 0 0 16px 0;
  max-width: 780px;
}

.ranking-hero-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 20px;
}

.rk-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(245, 240, 230, 0.09);
  border: 1px solid rgba(245, 240, 230, 0.18);
  font-size: 0.85rem;
  color: rgba(245, 240, 230, 0.9);
}

.rk-hero-pill strong {
  color: #8fd8ad;
  font-weight: 600;
}

.ranking-hero-note {
  max-width: 780px;
  color: rgba(245, 240, 230, 0.78);
  line-height: 1.65;
  margin-top: 16px;
}

.ranking-hero-note a {
  color: #8fd8ad;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ranking-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-top: 32px;
}

.rk-stat {
  background: rgba(245, 240, 230, 0.08);
  border: 1px solid rgba(245, 240, 230, 0.16);
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 140px;
}

.rk-stat strong {
  display: block;
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--color-ivory);
  font-family: "Cormorant SC", Georgia, serif;
}

.rk-stat span {
  font-size: 0.85rem;
  color: rgba(245, 240, 230, 0.7);
}

.ranking-hero-narrow .ranking-hero-content {
  max-width: 820px;
}

/* ---------- Podium ---------- */
.ranking-podium-section {
  padding: 56px 0 24px;
}

.ranking-section-title {
  font-family: "Cormorant SC", Georgia, serif;
  font-size: 1.7rem;
  color: var(--color-primary);
  margin-bottom: 24px;
}

.rk-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.rk-podium-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--rk-border);
  border-radius: 16px;
  padding: 32px 24px 24px;
  text-align: center;
  background: #fff;
  box-shadow: 0 6px 24px rgba(15, 45, 36, 0.07);
}

.rk-podium-item.is-1 {
  border-color: var(--color-primary);
  background: linear-gradient(180deg, #fff 0%, #f2f7f1 100%);
}

.rk-podium-medal {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--color-primary);
  font-family: "Cormorant SC", Georgia, serif;
}

.rk-podium-item.is-1 .rk-podium-medal {
  color: #0d6b30;
}

.rk-podium-item.is-2 .rk-podium-medal {
  color: #7a5200;
}

.rk-podium-item.is-3 .rk-podium-medal {
  color: var(--rk-muted);
}

.rk-podium-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.rk-podium-name a {
  color: var(--color-primary);
  text-decoration: none;
}

.rk-podium-name a:hover {
  text-decoration: underline;
}

.rk-podium-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--color-primary);
  font-family: "Cormorant SC", Georgia, serif;
  line-height: 1;
}

.rk-podium-score-unit {
  font-size: 1rem;
  color: var(--rk-muted);
  font-weight: 400;
}

.rk-podium-item .rk-band-pill {
  margin-top: 10px;
  position: static;
}

/* ---------- Table section ---------- */
.ranking-table-section {
  padding: 32px 0 64px;
}

.ranking-toolbar {
  margin-bottom: 20px;
}

.ranking-toolbar h2 {
  font-family: "Cormorant SC", Georgia, serif;
  font-size: 1.5rem;
  color: var(--color-primary);
}

.ranking-toolbar p {
  color: var(--rk-muted);
  max-width: 760px;
  line-height: 1.6;
  margin-top: 8px;
}

.rk-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 20px;
}

.rk-chip {
  border: 1px solid var(--rk-border);
  background: #fff;
  color: var(--color-primary);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rk-chip:hover {
  border-color: var(--color-primary);
}

.rk-chip.is-active {
  background: var(--color-primary);
  color: var(--color-ivory);
  border-color: var(--color-primary);
}

.rk-chip-count {
  opacity: 0.7;
  font-size: 0.8rem;
  margin-left: 4px;
}

.rk-search-wrap {
  margin-bottom: 16px;
}

.rk-search {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--rk-border);
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  background: #fff;
  color: var(--color-text);
}

.rk-search:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.rk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.rk-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--rk-border);
  border-radius: 14px;
  background: #fff;
}

.rk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 680px;
}

.rk-table thead th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rk-muted);
  padding: 14px 16px;
  border-bottom: 1px solid var(--rk-border);
  background: #faf8f2;
}

.rk-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(15, 45, 36, 0.07);
  vertical-align: top;
}

.rk-table tbody tr:last-child td {
  border-bottom: 0;
}

.rk-table tbody tr:hover {
  background: #f8fbf8;
}

.rk-col-rank {
  width: 44px;
  font-weight: 600;
  color: var(--rk-muted);
  font-variant-numeric: tabular-nums;
}

.rk-col-name {
  min-width: 220px;
}

.rk-name-link {
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
}

.rk-name-link:hover {
  text-decoration: underline;
}

.rk-name-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.rk-reviews {
  font-size: 0.8rem;
  color: var(--rk-muted);
}

.rk-col-pillars {
  min-width: 300px;
}

.rk-pillar-mini {
  display: grid;
  grid-template-columns: 1fr 56px 24px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.rk-pillar-mini-label {
  font-size: 0.78rem;
  color: var(--rk-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rk-pillar-mini-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 45, 36, 0.12);
  overflow: hidden;
}

.rk-pillar-mini-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--color-primary);
}

.rk-pillar-mini-val {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rk-col-score {
  width: 130px;
}

.rk-score-num {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  font-family: "Cormorant SC", Georgia, serif;
  line-height: 1.1;
}

.rk-scorebar {
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 45, 36, 0.12);
  overflow: hidden;
  margin: 6px 0 8px;
}

.rk-scorebar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), #1f6b3a);
}

/* ---------- Band pills & badges ---------- */
.rk-band-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.band-lider {
  background: #0f2d24;
  color: #f5f0e6;
}

.band-avanzado {
  /* Contraste verificado: #fff sobre #0d6b30 = 6.64 (axe exige >= 4.5). */
  background: #0d6b30;
  color: #fff;
}

.band-intermedio {
  /* Contraste verificado: #fff sobre #7a5200 = 6.92. */
  background: #7a5200;
  color: #fff;
}

.band-retrasado {
  background: #c2410c;
  color: #fff;
}

.band-critico {
  background: #b91c1c;
  color: #fff;
}

.rk-badge {
  display: inline-block;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
}

.rk-badge-ok {
  background: rgba(13, 107, 48, 0.14);
  /* Contraste verificado sobre el tint resultante: 5.56. */
  color: #0d6b30;
}

.rk-badge-warn {
  background: rgba(122, 82, 0, 0.14);
  /* Contraste verificado sobre el tint resultante: 5.96. */
  color: #7a5200;
}

.rk-badge-muted {
  background: rgba(111, 106, 99, 0.12);
  color: var(--rk-muted);
}

.rk-empty-state {
  margin-top: 20px;
  padding: 24px;
  text-align: center;
  color: var(--rk-muted);
  border: 1px dashed var(--rk-border);
  border-radius: 12px;
  background: #fff;
}

.ranking-toolbar-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
  padding: 28px;
  background: var(--color-primary);
  color: var(--color-ivory);
  border-radius: 14px;
}

.ranking-toolbar-cta p {
  color: rgba(245, 240, 230, 0.85);
  max-width: 640px;
  margin: 0;
}

.ranking-toolbar-cta strong {
  color: #fff;
}

/* ---------- Detail page ---------- */
.rk-breadcrumb {
  padding-top: 24px;
  font-size: 0.85rem;
  color: var(--rk-muted);
}

.rk-breadcrumb a {
  color: var(--rk-muted);
  text-decoration: none;
}

.rk-breadcrumb a:hover {
  color: var(--color-primary);
}

.rk-detail-hero {
  padding: 24px 0 40px;
}

.rk-detail-head {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
}

.rk-detail-titleblock .section-kicker {
  /* #0d6b30 sobre marfil da 7.27; el --rk-green anterior (#148d3e) quedaba 4.16. */
  color: #0d6b30;
}

.rk-detail-titleblock .section-title {
  color: var(--color-primary);
  margin: 8px 0 12px;
}

.rk-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rk-detail-scorecard {
  border: 1px solid var(--rk-border);
  border-radius: 14px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(15, 45, 36, 0.07);
  text-align: center;
}

.rk-detail-score {
  font-size: 3rem;
  font-weight: 700;
  color: var(--color-primary);
  font-family: "Cormorant SC", Georgia, serif;
  line-height: 1;
}

.rk-detail-score span {
  font-size: 1rem;
  color: var(--rk-muted);
}

.rk-detail-scorecard p {
  color: var(--rk-muted);
  font-size: 0.85rem;
  margin: 6px 0 10px;
}

.rk-detail-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.rk-detail-meta div {
  border-left: 3px solid var(--color-primary);
  padding-left: 12px;
}

.rk-detail-meta dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rk-muted);
}

.rk-detail-meta dd {
  margin: 4px 0 0;
  color: var(--color-text);
  line-height: 1.5;
}

.rk-detail-meta a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rk-detail-section {
  padding: 32px 0;
}

.rk-detail-section-alt {
  background: #faf8f2;
  border-top: 1px solid var(--rk-border);
  border-bottom: 1px solid var(--rk-border);
}

.rk-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.rk-pillar-block {
  border: 1px solid var(--rk-border);
  border-radius: 14px;
  padding: 20px;
  background: #fff;
}

.rk-pillar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.rk-pillar-head h3 {
  font-size: 0.95rem;
  color: var(--color-primary);
  margin: 0;
}

.rk-pillar-score {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  font-family: "Cormorant SC", Georgia, serif;
  white-space: nowrap;
}

.rk-pillar-score small {
  font-size: 0.75rem;
  color: var(--rk-muted);
  font-weight: 400;
}

.rk-signal-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.rk-signal {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(15, 45, 36, 0.1);
  font-size: 0.85rem;
}

.rk-signal:last-child {
  border-bottom: 0;
}

.rk-signal-icon {
  font-weight: 700;
  text-align: center;
}

.rk-signal.is-present .rk-signal-icon {
  color: #0d6b30;
}

.rk-signal.is-missing .rk-signal-icon {
  color: var(--rk-muted);
}

.rk-signal.is-missing .rk-signal-label {
  color: var(--rk-muted);
}

.rk-signal-state {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rk-muted);
}

.rk-signal.is-present .rk-signal-state {
  color: #0d6b30;
}

/* ---------- Detail grid (psi + gated) ---------- */
.rk-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.rk-psi-wrap,
.rk-gated-wrap {
  border: 1px solid var(--rk-border);
  border-radius: 14px;
  padding: 24px;
  background: #fff;
}

.rk-psi-wrap {
  display: flex;
  flex-direction: column;
}

.rk-psi {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.rk-psi-note {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rk-border);
  color: var(--rk-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.rk-psi h4,
.rk-gated-section h3,
.rk-unlock-card h3,
.rk-gated-teaser h3 {
  color: var(--color-primary);
  margin: 0 0 12px;
  font-family: "Cormorant SC", Georgia, serif;
  font-size: 1.25rem;
}

.rk-psi-overall {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.rk-psi-overall.fast {
  color: #0d6b30;
}

.rk-psi-overall.average {
  color: #7a5200;
}

.rk-psi-overall.slow {
  color: var(--rk-red);
}

.rk-psi-chart {
  display: flex;
  flex-direction: column;
  margin-top: 18px;
}

.rk-psi-chart-row {
  display: grid;
  grid-template-columns: 1fr 120px 30px;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.rk-psi-chart-label {
  font-size: 0.85rem;
  color: var(--rk-muted);
}

.rk-psi-chart-track {
  position: relative;
  height: 16px;
  border-radius: 999px;
  background: rgba(15, 45, 36, 0.1);
  overflow: hidden;
}

.rk-psi-chart-track::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(25% - 1px),
    rgba(15, 45, 36, 0.16) calc(25% - 1px),
    rgba(15, 45, 36, 0.16) 25%
  );
}

.rk-psi-chart-fill {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.5s ease;
}

.rk-psi-chart-fill.good {
  background: #0d6b30;
}

.rk-psi-chart-fill.mid {
  background: #7a5200;
}

.rk-psi-chart-fill.bad {
  background: var(--rk-red);
}

.rk-psi-chart-fill.na {
  background: rgba(15, 45, 36, 0.12);
}

.rk-psi-chart-val {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rk-psi-chart-axis {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  font-size: 0.72rem;
  color: var(--rk-muted);
  font-variant-numeric: tabular-nums;
}

.rk-psi-none {
  color: var(--rk-muted);
}

.rk-gated-teaser p,
.rk-unlock-card p {
  color: var(--rk-muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.rk-unlock-card {
  margin-top: 8px;
}

.rk-unlock-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.rk-unlock-form input {
  flex: 1 1 220px;
  border: 1px solid var(--rk-border);
  border-radius: 10px;
  padding: 10px 14px;
  font: inherit;
}

.rk-unlock-form input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

.rk-unlock-note {
  font-size: 0.8rem !important;
  margin-top: 12px;
}

.rk-unlock-error {
  color: var(--rk-red);
  font-size: 0.85rem;
  margin-top: 10px;
}

.rk-gated-section {
  border-top: 1px dashed var(--rk-border);
  padding-top: 20px;
}

.rk-recommendations {
  margin-top: 16px;
}

.rk-recommendations h4 {
  color: var(--color-primary);
  margin-bottom: 10px;
}

.rk-recommendations ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text);
  line-height: 1.6;
}

.rk-recommendations-none p {
  color: #0d6b30;
}

.ranking-cta {
  text-align: center;
}

.ranking-cta .ranking-section-title {
  margin-bottom: 12px;
}

.ranking-cta p {
  color: var(--rk-muted);
  max-width: 640px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* ---------- Methodology ---------- */
.ranking-prose {
  padding: 40px 0 64px;
}

.ranking-prose .container {
  max-width: 860px;
}

.ranking-prose h2 {
  font-family: "Cormorant SC", Georgia, serif;
  color: var(--color-primary);
  font-size: 1.5rem;
  margin: 36px 0 12px;
}

.ranking-prose h2:first-child {
  margin-top: 0;
}

.ranking-prose p,
.ranking-prose li {
  color: var(--color-text);
  line-height: 1.7;
}

.ranking-prose ul {
  padding-left: 20px;
}

.rk-table-methodology {
  min-width: 480px;
}

.rk-disclaimer {
  margin-top: 32px;
  padding: 16px 20px;
  background: #faf8f2;
  border-left: 3px solid var(--rk-muted);
  border-radius: 8px;
  font-size: 0.85rem !important;
  color: var(--rk-muted) !important;
}

/* ---------- Response cards ---------- */
.rk-response-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 16px 0 24px;
}

.rk-response-card {
  border: 1px solid var(--rk-border);
  border-radius: 12px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 45, 36, 0.04);
}

.rk-response-card.is-pending {
  border-style: dashed;
  background: #fdfcf9;
}

.rk-response-channel {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rk-muted);
  margin-bottom: 8px;
}

.rk-response-status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.rk-response-card.is-present .rk-response-status-pill {
  background: rgba(13, 107, 48, 0.1);
  color: #0d6b30;
}

.rk-response-card.is-missing .rk-response-status-pill {
  background: rgba(185, 28, 28, 0.1);
  color: var(--rk-red);
}

.rk-response-card.is-warning .rk-response-status-pill {
  background: rgba(122, 82, 0, 0.1);
  color: #7a5200;
}

.rk-response-card.is-muted .rk-response-status-pill {
  background: rgba(111, 106, 99, 0.1);
  color: var(--rk-muted);
}

.rk-response-card.is-pending .rk-response-status {
  font-size: 0.85rem;
  color: var(--rk-muted);
  font-weight: 500;
  margin-bottom: 8px;
}

.rk-response-time {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: "Cormorant SC", Georgia, serif;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: 4px;
}

.rk-response-card.is-pending .rk-response-time {
  color: var(--rk-border);
}

.rk-response-date {
  font-size: 0.78rem;
  color: var(--rk-muted);
}

@media (max-width: 600px) {
  .rk-response-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Hub y switch de verticales ---------- */
.ranking-hub-section {
  padding: 56px 0 64px;
}

.rk-hub-header {
  margin-bottom: 28px;
}

.rk-hub-header .section-kicker {
  color: var(--color-secondary);
  margin-bottom: 8px;
}

.rk-hub-header .ranking-section-title {
  margin-bottom: 8px;
}

.rk-hub-subtitle {
  color: var(--rk-muted);
  font-size: 1.05rem;
  margin: 0;
  max-width: 680px;
}

/* ---------- Hub Global Search ---------- */
.rk-global-search-container {
  position: relative;
  max-width: 680px;
  margin-top: 24px;
  width: 100%;
}

.rk-global-search-box {
  display: flex;
  align-items: center;
  position: relative;
  background: #FFFFFF;
  border: 1px solid rgba(15, 45, 36, 0.18);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  padding: 4px 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rk-global-search-box:focus-within {
  border-color: rgba(15, 45, 36, 0.4);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14), 0 0 0 3px rgba(15, 45, 36, 0.08);
}

.rk-search-icon {
  margin-left: 10px;
  color: var(--color-primary);
  flex-shrink: 0;
}

.rk-global-search-input {
  flex: 1;
  height: 46px;
  padding: 0 14px 0 10px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 1.02rem;
  color: var(--color-primary);
  outline: none;
}

.rk-global-search-input::placeholder {
  color: #78736a;
  opacity: 0.85;
}

.rk-global-search-clear {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  color: #8c857b;
  padding: 0 12px;
  transition: color 0.15s ease;
}

.rk-global-search-clear:hover {
  color: var(--color-primary);
}

.rk-global-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid rgba(15, 45, 36, 0.15);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  z-index: 250;
  max-height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rkDropdownIn 0.15s ease-out;
}

@keyframes rkDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rk-global-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--rk-muted);
  background: #FAF7F2;
  border-bottom: 1px solid rgba(15, 45, 36, 0.08);
}

.rk-global-hint kbd {
  background: #ECE6D8;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.72rem;
  color: var(--color-primary);
  font-family: inherit;
}

.rk-global-results-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  overflow-y: auto;
  max-height: 340px;
}

.rk-search-result-item {
  margin: 0;
}

.rk-search-result-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  margin: 2px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--color-primary);
  transition: background 0.15s ease, color 0.15s ease;
}

.rk-search-result-item:hover .rk-search-result-link,
.rk-search-result-item.is-selected .rk-search-result-link {
  background: rgba(15, 45, 36, 0.07);
}

.rk-search-result-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.rk-search-result-name {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--color-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-search-result-sector {
  font-size: 0.8rem;
  color: var(--rk-muted);
}

.rk-search-result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.rk-score-pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: "Cormorant SC", Georgia, serif;
  line-height: 1;
}

.rk-score-pill.band-avanzado {
  background: rgba(13, 107, 48, 0.14);
  /* Contraste verificado sobre el tint resultante: 5.56. */
  color: #0d6b30;
}

.rk-score-pill.band-intermedio {
  background: rgba(122, 82, 0, 0.14);
  /* Contraste verificado sobre el tint resultante: 5.96. */
  color: #7a5200;
}

.rk-score-pill.band-retrasado {
  background: rgba(194, 65, 12, 0.14);
  color: #c2410c;
}

.rk-score-pill.band-critico {
  background: rgba(185, 28, 28, 0.14);
  color: var(--rk-red);
}

.rk-search-result-arrow {
  font-size: 1.1rem;
  color: var(--rk-muted);
  transition: transform 0.15s ease, color 0.15s ease;
}

.rk-search-result-item:hover .rk-search-result-arrow,
.rk-search-result-item.is-selected .rk-search-result-arrow {
  color: var(--color-primary);
  transform: translateX(4px);
}

.rk-search-no-results {
  padding: 28px 20px;
  text-align: center;
  color: var(--rk-muted);
}

.rk-search-no-results p {
  margin: 0 0 6px;
  font-size: 0.98rem;
  color: var(--color-primary);
  font-weight: 500;
}

.rk-search-empty-hint {
  font-size: 0.85rem;
  color: #78736a;
}

.rk-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.rk-hub-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 24px;
  border: 1px solid var(--rk-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 45, 36, 0.04);
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.rk-hub-card:hover,
.rk-hub-card:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 8px 20px rgba(15, 45, 36, 0.08);
  transform: translateY(-2px);
}

.rk-hub-card-title {
  font-family: "Cormorant SC", Georgia, serif;
  font-size: 1.35rem;
  color: var(--color-primary);
  margin: 0 0 6px;
}

.rk-hub-card-count {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-primary);
  margin: 0 0 4px;
}

.rk-hub-card-note {
  font-size: 0.85rem;
  color: var(--rk-muted);
  margin: 0;
}

.rk-hub-card-top-score {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--rk-muted);
  background: rgba(15, 45, 36, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
}

.rk-hub-card-top-score strong {
  color: var(--color-primary);
}

.rk-hub-card-arrow {
  font-size: 1.4rem;
  color: var(--rk-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}

.rk-hub-card:hover .rk-hub-card-arrow,
.rk-hub-card:focus-visible .rk-hub-card-arrow {
  color: var(--color-primary);
  transform: translateX(4px);
}

.ranking-methodology-preview {
  padding: 16px 0 72px;
}

.rk-methodology-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #FAF7F2;
  border: 1px solid var(--rk-border);
  border-radius: 14px;
  padding: 36px 32px;
}

.rk-methodology-info {
  max-width: 680px;
}

.rk-methodology-info .section-kicker {
  color: var(--color-secondary);
  margin-bottom: 6px;
}

.rk-methodology-info h3 {
  font-family: "Cormorant SC", Georgia, serif;
  font-size: 1.6rem;
  color: var(--color-primary);
  margin: 0 0 12px;
}

.rk-methodology-info p {
  color: var(--color-text);
  line-height: 1.65;
  margin: 0;
  font-size: 0.96rem;
}

.rk-sector-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.85rem;
  margin: 8px 0 16px;
}

.ranking-hero .rk-sector-switch {
  /* El switch vive sobre el hero verde (#0F2D24): --rk-muted (#6f6a63) da
     ratio 2.76. El marfil pasa 13.01 y los links quedan 8.86. */
  color: rgba(245, 240, 230, 0.82);
}

.ranking-hero .rk-sector-switch span {
  color: rgba(245, 240, 230, 0.82);
}

.ranking-hero .rk-sector-switch a {
  color: #8fd8ad;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ranking-hero .rk-sector-switch a:hover,
.ranking-hero .rk-sector-switch a:focus-visible {
  color: #fff;
}

/* ---------- Sello descargable (podio) ---------- */
.rk-seal {
  margin: 36px auto 8px;
  max-width: 640px;
  text-align: center;
}

.rk-seal-rule {
  width: 64px;
  height: 2px;
  margin: 0 auto 22px;
  background: var(--rk-gold);
  border-radius: 2px;
}

.rk-seal-title {
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--color-primary);
  margin: 0 0 8px;
}

.rk-seal-note {
  margin: 0 auto 22px;
  max-width: 460px;
  font-size: 0.95rem;
  color: var(--rk-muted);
}

.rk-seal-btn {
  white-space: nowrap;
  padding: 14px 34px;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .rk-podium {
    grid-template-columns: 1fr;
  }

  .rk-detail-head {
    grid-template-columns: 1fr;
  }

  .rk-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ranking-hero {
    padding: 44px 0 36px;
  }

  .ranking-hero-stats {
    gap: 12px;
  }

  .rk-stat {
    flex: 1 1 40%;
    min-width: 0;
    padding: 12px 14px;
  }

  .rk-stat strong {
    font-size: 1.5rem;
  }

  .rk-detail-meta {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rk-detail-meta div {
    display: grid;
    grid-template-columns: minmax(0, 110px) minmax(0, 1fr);
    gap: 12px;
    align-items: baseline;
  }
}
.rk-global-search { width: 100%; max-width: 720px; min-height: 48px; padding: 12px 16px; font: inherit; color: #0F2D24; background: #F5F0E6; border: 1px solid #6F6A63; border-radius: 8px; }
.rk-global-results { display: grid; gap: 12px; margin: 24px 0; }
.rk-global-results a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(15,45,36,.2); }
