/* =====================================================
   SCHOOL RANKINGS – DEDICATED STYLESHEET
   ===================================================== */

/* ── Hero ─────────────────────────────────────────── */
.rank-hero {
  position: relative;
  background: linear-gradient(135deg, #001433 0%, #003087 50%, #001F5B 100%);
  padding: 7rem 0 4rem;
  overflow: hidden;
}
.rank-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255,205,0,.12) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(0,166,81,.1) 0%, transparent 50%);
}
.rank-hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 60px 60px;
}
.rank-hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
}
.rank-hero-text { flex: 1; }
.rank-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,205,0,.15);
  border: 1px solid rgba(255,205,0,.3);
  color: var(--gold);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .4rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.rank-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 800;
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 1rem;
}
.rank-hero h1 span { color: var(--gold); }
.rank-hero p {
  color: rgba(255,255,255,.75);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 560px;
}
.rank-hero-stats {
  display: flex;
  gap: 2rem;
  flex-shrink: 0;
}
.rhs-item {
  text-align: center;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.75rem;
  backdrop-filter: blur(8px);
}
.rhs-num {
  display: block;
  font-family: var(--font-head);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
}
.rhs-label { font-size: .75rem; color: rgba(255,255,255,.6); margin-top: .35rem; display: block; text-transform: uppercase; letter-spacing: .06em; }

/* ── State Tabs ───────────────────────────────────── */
.rank-state-bar {
  background: var(--navy-dark);
  border-bottom: 2px solid rgba(255,205,0,.2);
  position: sticky;
  top: 56px;   /* matches .navbar.scrolled height (8px+40px+8px) */
  z-index: 100;
}
.rank-state-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rank-state-tabs::-webkit-scrollbar { display: none; }
.rst-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .9rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: rgba(255,255,255,.6);
  font-family: var(--font-main);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s;
  letter-spacing: .02em;
}
.rst-btn img { width: 22px; height: 22px; object-fit: contain; border-radius: 2px; opacity: .7; transition: opacity .2s; }
.rst-btn:hover { color: var(--white); background: rgba(255,255,255,.05); }
.rst-btn:hover img { opacity: 1; }
.rst-btn.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  background: rgba(255,205,0,.06);
}
.rst-btn.active img { opacity: 1; }
.rst-icsea-badge {
  font-size: .6rem;
  background: var(--gold);
  color: var(--navy-dark);
  font-weight: 800;
  padding: .1rem .35rem;
  border-radius: 4px;
  letter-spacing: .04em;
}

/* ── ICSEA info banner ────────────────────────────── */
.icsea-info-bar {
  background: linear-gradient(90deg, rgba(0,48,135,.06), rgba(255,205,0,.06));
  border: 1px solid rgba(0,48,135,.12);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  animation: fadeSlideDown .5s ease both;
}
.icsea-info-bar.no-icsea {
  background: rgba(100,116,139,.06);
  border-color: rgba(100,116,139,.2);
}
.icsea-info-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.icsea-info-bar.no-icsea .icsea-info-icon { background: var(--gray-200); color: var(--gray-500); }
.icsea-info-bar p { margin: 0; font-size: .875rem; color: var(--gray-700); line-height: 1.5; }
.icsea-info-bar a { color: var(--navy); font-weight: 600; text-decoration: underline; }

/* ── Layout ───────────────────────────────────────── */
.rank-page-body { padding: 2.5rem 0 5rem; }
.rank-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ── Sidebar Filters ──────────────────────────────── */
.rank-sidebar {
  position: sticky;
  top: 120px;
}
.rank-filter-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.rfc-header {
  background: var(--navy);
  color: var(--white);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rfc-header h3 { font-size: .9rem; font-weight: 700; display: flex; align-items: center; gap: .5rem; }
.rfc-reset-btn {
  background: rgba(255,255,255,.15);
  border: none;
  color: rgba(255,255,255,.8);
  font-size: .72rem;
  font-weight: 600;
  padding: .3rem .7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .2s;
}
.rfc-reset-btn:hover { background: rgba(255,255,255,.25); }
.rfc-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1.25rem; }

.rfc-group label {
  display: block;
  font-size: .75rem;
  font-weight: 700;
  color: var(--gray-700);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: .6rem;
}
.rfc-search-wrap {
  position: relative;
}
.rfc-search-wrap i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gray-500); font-size: .8rem; pointer-events: none; }
.rfc-input {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem .6rem 2.2rem;
  font-family: var(--font-main);
  font-size: .85rem;
  color: var(--gray-900);
  transition: border-color .2s;
  outline: none;
}
.rfc-input:focus { border-color: var(--navy); }

.rfc-select {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .6rem .75rem;
  font-family: var(--font-main);
  font-size: .85rem;
  color: var(--gray-900);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: 12px;
}
.rfc-select:focus { border-color: var(--navy); }

/* ICSEA Range Slider */
.icsea-range-wrap { display: flex; flex-direction: column; gap: .5rem; }
.icsea-range-labels { display: flex; justify-content: space-between; font-size: .72rem; color: var(--gray-500); }
.icsea-range-display {
  text-align: center;
  font-weight: 700;
  color: var(--navy);
  font-size: .9rem;
  background: rgba(0,48,135,.06);
  border-radius: 6px;
  padding: .25rem .5rem;
}
.range-slider-dual { position: relative; height: 4px; background: var(--gray-200); border-radius: 2px; margin: .5rem 0; }
.range-slider-dual input[type=range] {
  position: absolute;
  width: 100%;
  height: 4px;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  top: 0; left: 0;
}
.range-slider-dual input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--white);
  box-shadow: var(--shadow-sm);
  pointer-events: all;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.range-slider-dual input[type=range]::-webkit-slider-thumb:hover { background: var(--navy-light); transform: scale(1.15); }
.range-track-fill {
  position: absolute;
  height: 4px;
  background: var(--navy);
  border-radius: 2px;
  top: 0;
}

/* Chips for type/sector */
.rfc-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.rfc-chip {
  padding: .3rem .7rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: var(--gray-700);
  background: var(--white);
  user-select: none;
}
.rfc-chip:hover { border-color: var(--navy); color: var(--navy); }
.rfc-chip.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.rfc-chip.chip-gov.active  { background: #003087; border-color: #003087; }
.rfc-chip.chip-cath.active { background: #8B0000; border-color: #8B0000; }
.rfc-chip.chip-ind.active  { background: #B8860B; border-color: #B8860B; }

/* ── Main Content ─────────────────────────────────── */
.rank-main {}
.rank-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.rank-results-count {
  font-size: .875rem;
  color: var(--gray-500);
}
.rank-results-count strong { color: var(--gray-900); font-weight: 700; }
.rank-sort-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.rank-sort-wrap label { font-size: .8rem; color: var(--gray-500); font-weight: 600; }
.rank-sort-select {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .5rem .85rem;
  font-family: var(--font-main);
  font-size: .8rem;
  color: var(--gray-900);
  background: var(--white);
  cursor: pointer;
  outline: none;
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  background-size: 11px;
  padding-right: 2rem;
}
.rank-sort-select:focus { border-color: var(--navy); }

/* ── Chart ────────────────────────────────────────── */
.rank-chart-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideDown .5s ease both;
}
.rank-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.rank-chart-header h3 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.rank-chart-header h3 i { color: var(--navy); }
.rank-chart-sub { font-size: .75rem; color: var(--gray-500); }
.rank-chart-wrap { height: 180px; position: relative; }

/* ── Ranking Table ────────────────────────────────── */
.rank-table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.rank-table-head {
  display: grid;
  padding: .75rem 1.25rem;
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
  font-size: .7rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* NSW grid: rank | name | type | icsea bar | foei | enrollment | indigenous */
.rank-table-head.has-icsea {
  grid-template-columns: 56px 1fr 90px 200px 70px 90px 90px;
  gap: .5rem;
}
.rank-table-head.no-icsea {
  grid-template-columns: 56px 1fr 110px 90px 110px;
  gap: .5rem;
}

/* Loading skeleton */
.rank-skeleton { padding: 1rem 1.25rem; }
.skel-row {
  display: flex;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--gray-100);
  animation: pulse 1.5s ease infinite;
}
.skel-box {
  background: var(--gray-100);
  border-radius: 6px;
  height: 20px;
  flex-shrink: 0;
}

/* School rows */
.rank-row {
  display: grid;
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  align-items: center;
  gap: .5rem;
  transition: background .15s;
  opacity: 0;
  transform: translateY(12px);
  animation: rowReveal .35s ease forwards;
}
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: var(--gray-50); }
.rank-row.has-icsea {
  grid-template-columns: 56px 1fr 90px 200px 70px 90px 90px;
}
.rank-row.no-icsea {
  grid-template-columns: 56px 1fr 110px 90px 110px;
}

/* Rank badge */
.rr-rank {
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank-badge {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: .75rem;
  flex-shrink: 0;
}
.rank-badge.gold   { background: linear-gradient(135deg,#FFD700,#FFA500); color: #7B4A00; box-shadow: 0 2px 8px rgba(255,165,0,.4); }
.rank-badge.silver { background: linear-gradient(135deg,#C0C0C0,#999);     color: #444; box-shadow: 0 2px 8px rgba(150,150,150,.3); }
.rank-badge.bronze { background: linear-gradient(135deg,#CD7F32,#A0522D);   color: var(--white); box-shadow: 0 2px 8px rgba(160,82,45,.4); }
.rank-badge.default { background: var(--gray-100); color: var(--gray-500); }

/* Name cell */
.rr-name a {
  font-weight: 700;
  color: var(--gray-900);
  font-size: .9rem;
  transition: color .15s;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rr-name a:hover { color: var(--navy); }
.rr-location {
  font-size: .72rem;
  color: var(--gray-500);
  margin-top: .15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Type cell */
.rr-type {
  font-size: .72rem;
  color: var(--gray-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ICSEA bar cell */
.rr-icsea {}
.icsea-bar-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.icsea-bar-outer {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.icsea-bar-inner {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}
.icsea-val {
  font-weight: 700;
  font-size: .82rem;
  color: var(--gray-900);
  min-width: 36px;
  text-align: right;
  flex-shrink: 0;
}
/* ICSEA color scale */
.icsea-very-low  { background: linear-gradient(90deg,#E8112D,#FF4444); }
.icsea-low       { background: linear-gradient(90deg,#FF8C00,#FFA500); }
.icsea-average   { background: linear-gradient(90deg,#FFCD00,#FFE044); }
.icsea-above     { background: linear-gradient(90deg,#4CAF50,#66BB6A); }
.icsea-high      { background: linear-gradient(90deg,#00A651,#007A3D); }

/* Other metric cells */
.rr-number {
  font-size: .82rem;
  font-weight: 600;
  color: var(--gray-700);
  text-align: right;
}
.rr-pct {
  font-size: .82rem;
  font-weight: 600;
  text-align: right;
}

/* Sector badge */
.sector-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: .3rem;
  flex-shrink: 0;
}
.sector-gov  .sector-dot { background: var(--navy); }
.sector-cath .sector-dot { background: #8B0000; }
.sector-ind  .sector-dot { background: #B8860B; }

/* Empty / error state */
.rank-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--gray-500);
}
.rank-empty i { font-size: 3rem; color: var(--gray-300); margin-bottom: 1rem; display: block; }
.rank-empty h3 { font-size: 1.1rem; color: var(--gray-700); margin-bottom: .5rem; }

/* ── Pagination ───────────────────────────────────── */
.rank-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1.5rem 0 .5rem;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px; height: 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-700);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  padding: 0 .6rem;
  font-family: var(--font-main);
}
.page-btn:hover:not(:disabled) { border-color: var(--navy); color: var(--navy); background: rgba(0,48,135,.04); }
.page-btn.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── ICSEA Legend ─────────────────────────────────── */
.icsea-legend {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: .75rem 1rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  align-items: center;
}
.icsea-legend-title {
  font-size: .7rem;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-right: .25rem;
}
.icsea-litem {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .7rem;
  color: var(--gray-700);
}
.icsea-lswatch {
  width: 24px; height: 8px;
  border-radius: 4px;
}

/* ── No-ICSEA state message ───────────────────────── */
.rank-no-icsea-note {
  background: linear-gradient(135deg,rgba(100,116,139,.08),rgba(100,116,139,.03));
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.rank-no-icsea-note i { font-size: 1.5rem; color: var(--gray-400); flex-shrink: 0; }
.rank-no-icsea-note p { margin: 0; font-size: .85rem; color: var(--gray-500); line-height: 1.5; }
.rank-no-icsea-note strong { color: var(--gray-700); }

/* ── Animations ───────────────────────────────────── */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rowReveal {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .5; }
}
@keyframes countUp {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── FAQ Accordion ────────────────────────────────── */
.rank-faq {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--gray-200);
}
.rank-faq > h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: .5rem;
}
.rank-faq-subtitle {
  text-align: center;
  color: var(--gray-500);
  font-size: .95rem;
  margin-bottom: 2.5rem;
}
.rank-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .85rem;
}
.rank-faq-item {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: box-shadow .25s, border-color .25s;
}
.rank-faq-item:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.rank-faq-item.faq-open { border-color: rgba(0,48,135,.25); box-shadow: 0 4px 20px rgba(0,48,135,.08); }
.rank-faq-q {
  padding: 1rem 1.25rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  user-select: none;
  transition: background .15s;
}
.rank-faq-q:hover { background: rgba(0,48,135,.03); }
.rank-faq-item.faq-open .rank-faq-q { background: rgba(0,48,135,.04); }
.rank-faq-q i {
  flex-shrink: 0;
  font-size: .75rem;
  color: var(--navy);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.rank-faq-item.faq-open .rank-faq-q i { transform: rotate(180deg); }
.rank-faq-a {
  padding: 0 1.25rem;
  font-size: .875rem;
  color: var(--gray-500);
  line-height: 1.75;
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease, padding .25s ease;
}
.rank-faq-item.faq-open .rank-faq-a {
  max-height: 400px;
  padding: 0 1.25rem 1.25rem;
}
.rank-faq-a strong { color: var(--gray-700); }

@media (max-width: 768px) {
  .rank-faq-grid { grid-template-columns: 1fr; }
}

/* ── Suburb filter extras ─────────────────────────── */
.suburb-clear-btn {
  background: none;
  border: none;
  color: #888;
  cursor: pointer;
  padding: 0 .3rem;
  display: flex;
  align-items: center;
  transition: color .2s;
}
.suburb-clear-btn:hover { color: #c0392b; }
.suburb-hint {
  font-size: .75rem;
  color: #1a56db;
  margin-top: .4rem;
  display: flex;
  align-items: center;
  gap: .3rem;
}
.suburb-hint i { font-size: .7rem; }

/* ── Suburb Insights Card ─────────────────────────── */
.suburb-insights-card {
  background: linear-gradient(135deg, #0e2a5a 0%, #1a3f7e 100%);
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  color: #fff;
  animation: sicSlideIn .35s cubic-bezier(.22,1,.36,1);
  position: relative;
  overflow: hidden;
}
.suburb-insights-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% -10%, rgba(255,205,0,.15) 0%, transparent 55%);
  pointer-events: none;
}
@keyframes sicSlideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sic-header {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  margin-bottom: 1.25rem;
}
.sic-icon {
  width: 40px;
  height: 40px;
  background: rgba(255,205,0,.2);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #FFCD00;
  flex-shrink: 0;
}
.sic-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 .2rem;
  color: #fff;
}
.sic-sub {
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  margin: 0;
}
.sic-close {
  margin-left: auto;
  background: rgba(255,255,255,.1);
  border: none;
  color: rgba(255,255,255,.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, color .2s;
}
.sic-close:hover { background: rgba(255,255,255,.2); color: #fff; }

.sic-metrics {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}
.sic-metric { flex: 1; text-align: center; }
.sic-metric-label {
  display: block;
  font-size: .7rem;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .25rem;
}
.sic-metric-val {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #FFCD00;
  font-family: 'Poppins', sans-serif;
  line-height: 1;
  transition: all .4s;
}
.sic-state-val { color: rgba(255,255,255,.8); font-size: 1.6rem; }
.sic-metric-vs {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  font-weight: 600;
}

.sic-bar-wrap { margin-bottom: 1rem; }
.sic-bar-track {
  height: 8px;
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  margin-bottom: .4rem;
  position: relative;
  overflow: visible;
}
.sic-bar-suburb,
.sic-bar-state {
  position: absolute;
  top: 0;
  height: 8px;
  border-radius: 99px;
  transition: width .6s cubic-bezier(.22,1,.36,1);
}
.sic-bar-suburb {
  background: linear-gradient(90deg, #FFCD00, #FFA500);
  top: 0;
}
.sic-bar-state {
  background: rgba(255,255,255,.35);
  top: 12px;
}
.sic-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: .65rem;
  color: rgba(255,255,255,.4);
  margin-top: 22px;
}

.sic-diff-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .75rem;
  border-radius: 99px;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: .6rem;
}
.sic-diff-badge.above {
  background: rgba(0,166,81,.2);
  color: #4ade80;
  border: 1px solid rgba(0,166,81,.3);
}
.sic-diff-badge.below {
  background: rgba(220,38,38,.2);
  color: #f87171;
  border: 1px solid rgba(220,38,38,.3);
}
.sic-diff-badge.equal {
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
}
.sic-school-count {
  font-size: .78rem;
  color: rgba(255,255,255,.55);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 1100px) {
  .rank-layout { grid-template-columns: 240px 1fr; }
  .rank-row.has-icsea,
  .rank-table-head.has-icsea { grid-template-columns: 50px 1fr 80px 180px 60px 80px; }
}

@media (max-width: 900px) {
  /* Layout: sidebar arriba, contenido abajo — sin desbordamiento */
  .rank-layout {
    display: block;
  }
  .rank-sidebar { position: static; margin-bottom: 1.5rem; }
  .rank-filter-card { display: grid; grid-template-columns: 1fr 1fr; }
  .rfc-header { grid-column: 1 / -1; }
  .rfc-body { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .rank-hero-stats { display: none; }
  /* Tabla: scroll horizontal para columnas que no caben */
  .rank-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rank-row.has-icsea,
  .rank-table-head.has-icsea { grid-template-columns: 46px 1fr 160px 60px; min-width: 500px; }
  .rank-row.no-icsea,
  .rank-table-head.no-icsea { min-width: 360px; }
  .rank-row .rr-pct,
  .rank-table-head .th-ind { display: none; }
  .rank-row.has-icsea .rr-number:last-child,
  .rank-table-head.has-icsea .th-enroll:last-child { display: none; }
}

@media (max-width: 640px) {
  .rank-hero { padding: 5.5rem 0 3rem; }
  .rank-hero-inner { flex-direction: column; gap: 1.5rem; }
  .rank-row.has-icsea,
  .rank-table-head.has-icsea {
    grid-template-columns: 36px 1fr 140px;
    min-width: 360px;
  }
  .rank-row .rr-type,
  .rank-table-head .th-type { display: none; }
  .rank-row.no-icsea,
  .rank-table-head.no-icsea {
    grid-template-columns: 36px 1fr 90px;
    min-width: 280px;
  }
  /* Filtros: una columna */
  .rank-filter-card { grid-template-columns: 1fr !important; }
  .rfc-body { grid-template-columns: 1fr !important; }
  .rfc-chips { flex-wrap: wrap; }
  .rfc-chip { font-size: .78rem; padding: .3rem .75rem; }
  /* Toolbar */
  .rank-toolbar { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .rank-sort-wrap { width: 100%; justify-content: space-between; }
  .rank-sort-select { flex: 1; }
}
