body.leaderboard-active {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: #03140b;
}
#leaderboard {
  flex: 1 0 auto;
  color-scheme: dark;
  color: #f1ffe9;
  background: radial-gradient(ellipse at top left, #103817, #03140b 55%);
}
.rank-dashboard { min-width: 0; padding: clamp(.85rem, 2vw, 1.6rem); }
.rank-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: center; gap: 1rem; }
.rank-heading h1 { margin: 0; font-size: clamp(1.45rem, 2.6vw, 2.25rem); line-height: 1.1; }
.rank-heading h1 i { color: #ffdc39; }
#rank-description { color: #bed2c0; margin: .5rem 0 0; line-height: 1.4; }
.rank-summary, .rank-layout, .rank-side { display: grid; gap: .8rem; }
.rank-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .55rem 1rem;
  margin: 1rem 0;
}
.rank-areas {
  flex: 1 1 430px;
  max-width: 670px;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: .3rem;
  padding: .25rem;
  border: 1px solid #49932d;
  border-radius: 1.1rem;
  background: linear-gradient(105deg, #082818, #041b10);
}
#rank-area-label { align-self: center; padding: .5rem clamp(.55rem, 1.5vw, 1.15rem); font-weight: 700; }
.rank-areas button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  padding: .6rem .4rem;
  border: 1px solid transparent;
  border-radius: .85rem;
  background: #082619;
  color: #f1ffe9;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.rank-areas button:hover { border-color: #83ed37; }
.rank-areas button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.rank-areas button[aria-pressed="true"] {
  color: #092002;
  background: linear-gradient(105deg, #c2ff4e, #75ef25);
  box-shadow: 0 0 .85rem #75ef2570;
}
.rank-areas i[data-icon] { width: 1.75rem; height: 1.75rem; }
.rank-areas button[aria-pressed="false"] i { color: #adff33; }
.rank-areas strong, .rank-areas small { display: block; }
.rank-areas small { font-size: .85rem; }
.rank-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .65rem;
  margin-inline-start: auto;
}
.rank-category-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .65rem;
  border: 1px solid #49932d;
  border-radius: 999px;
  background: #082619;
  font-size: .9rem;
  font-weight: 700;
}
.rank-category-pill select {
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}
.rank-category-pill:has(.ebfk-custom-select) {
  padding: 0;
}
.rank-category-pill:has(.ebfk-custom-select) > label {
  display: none;
}
.rank-category-pill .ebfk-custom-select > .ebfk-select-trigger {
  padding: .3rem .65rem;
}
.rank-category-pill option { background: #082619; }
.rank-category-pill:focus-within { outline: 2px solid #c2ff4e; outline-offset: 2px; }
.rank-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rank-summary div, .rank-panel {
  padding: .85rem;
  background: linear-gradient(150deg, #0a2d1b, #061e12);
  border: 1px solid #49932d;
  border-radius: .85rem;
  box-shadow: inset 0 0 1.2rem #56d62812;
}
.rank-summary div { font-size: .86rem; }
.rank-summary strong { display: block; font-size: 1.6rem; color: #aef653; }
.rank-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.rank-side { grid-template-columns: minmax(0, 1fr); }
.rank-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: .7rem;
}
.rank-panel-head h2 { margin: 0; }
.rank-panel-count {
  padding: .18rem .6rem;
  border-radius: 999px;
  border: 1px solid #49932d;
  background: #082619;
  color: #c6ff71;
  font-size: .82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.rank-resolved-panel h2 i { color: #4ade80; }
.rank-panel h2 { margin: 0 0 .7rem; color: #c6ff71; font-size: 1.15rem; }
.rank-panel-head h2 { margin: 0; }
.rank-panel h2 i { margin-right: .2rem; }
.rank-topics { margin-top: .8rem; }
.rank-topics h2 { color: #f1ffe9; }
.rank-topics h2 > span { color: #b9ff32; margin-right: .35rem; }
.rank-topics h2 small { font-size: .85em; font-weight: 400; }
.rank-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 108px), 1fr));
  gap: .45rem;
  padding: 0;
  margin: 0;
  list-style: none;
}
.rank-topic-grid li {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: .3rem;
  padding: .7rem .25rem;
  border: 1px solid #315f33;
  border-radius: .6rem;
  background: linear-gradient(155deg, #123e24, #051e12);
  text-align: center;
  font-size: .85rem;
}
.rank-topic-grid i[data-icon] { width: 1.65rem; height: 1.65rem; color: #ddffad; }
.rank-topic-grid i[data-icon="trash"], .rank-topic-grid i[data-icon="light"] { color: #ffd744; }
.rank-topic-grid i[data-icon="water"] { color: #31dfef; }
.rank-topic-grid i[data-icon="leaf"] { color: #9bf126; }
.rank-topic-count { color: #d8edcc; font-variant-numeric: tabular-nums; }
.rank-columns, .rank-results button {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) 7.25rem .75rem;
  column-gap: clamp(.35rem, 1vw, .6rem);
  padding-inline: .6rem;
  border: 1px solid transparent;
}
.rank-columns {
  padding-block: .5rem;
  margin-bottom: .35rem;
  color: #d8fbd6;
  background: #0d3a23;
  border-radius: .45rem;
  font-size: .85rem;
  font-weight: 700;
}
.rank-columns span:first-child { text-align: center; }
.rank-results { max-height: 62dvh; overflow: auto; scrollbar-width: none; }
.rank-results::-webkit-scrollbar { display: none; }
#ranking ol, #ranking-resolved ol { display: grid; list-style: none; margin: 0; padding: 0; gap: .35rem; }
#ranking li, #ranking-resolved li { padding: 0; background: transparent; }
.rank-results button {
  align-items: center;
  text-align: left;
  width: 100%;
  padding-block: .6rem;
  border-color: #31593a;
  border-radius: .45rem;
  background: #0a2b1b;
  color: inherit;
  cursor: pointer;
  font: inherit;
  overflow-wrap: anywhere;
}
.rank-results button:hover, .rank-results button[aria-pressed="true"] { border-color: #aef653; background: #143c22; }
.rank-results button:focus-visible, #rank-map a:focus-visible { outline: 2px solid #c6ff71; outline-offset: -2px; }
.rank-position { color: #aef653; font-weight: 700; text-align: center; }
.rank-results small { display: block; color: #bed2c0; margin-top: .2rem; }
.rank-results small + strong { display: block; margin-top: .3rem; }
.rank-reporter {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: #d8edcc;
  font-size: .85rem;
}
#rank-details-location { padding: 0; border: 0; background: transparent; color: #c6ff71; font-weight: 400; text-align: start; text-decoration: underline; text-underline-offset: .2em; }
.rank-areas button:disabled { opacity: .55; cursor: default; }
.rank-avatar {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  overflow: hidden;
  border: 1px solid #578b43;
  border-radius: 50%;
  color: #c6ff71;
  background: #174227;
  font-weight: 700;
}
.rank-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#rank-reporter .rank-reporter { margin: 0 0 .85rem; }
#rank-reporter .rank-avatar { width: 2.5rem; height: 2.5rem; }
.rank-risk { justify-self: start; border-radius: 1rem; padding: .2rem .5rem; background: #35433b; font-size: .8rem; white-space: nowrap; }
#rank-refresh {
  position: fixed;
  z-index: 10;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid #91cd70a8;
  border-radius: 50%;
  color: #c6ff71;
  background: #0b301bbb;
  backdrop-filter: blur(8px);
}
#rank-refresh:hover { border-color: #c6ff71; background: #18412cdd; }
#rank-refresh:disabled { opacity: .65; cursor: wait; }
.rank-risk[data-level="4"] { background: #a62327; }
.rank-risk[data-level="3"] { background: #ff9f38; color: #231500; }
.rank-risk[data-level="2"] { background: #f9d759; color: #231c00; }
.rank-risk[data-level="1"] { background: #225c39; }
.rank-row-arrow { color: #aef653; font-size: 1.25rem; }
#rank-details, #rank-map, #rank-evidence { min-width: 0; overflow-wrap: anywhere; }
#rank-details-heading { scroll-margin-top: 1rem; }
#rank-details-heading:focus-visible { outline: 2px solid #aef653; outline-offset: 3px; }
#rank-details-empty, #rank-details-description { margin: 0 0 .85rem; color: #bed2c0; }
#rank-details-description:empty { display: none; }
#rank-details-assessment { margin: 0 0 .85rem; }
#rank-details-content h3 { margin: 1.1rem 0 .55rem; color: #c6ff71; font-size: 1rem; }
.rank-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr)); gap: .65rem; }
.rank-gallery :is(img, video) {
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;
  max-height: 15rem;
  object-fit: contain;
  background: #03140b;
  border: 1px solid #3a683b;
  border-radius: .55rem;
}
.rank-map-place { margin: 0 0 .65rem; font-weight: 700; display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
#rank-details-dialog {
  width: min(94vw, 44rem);
  max-height: 88dvh;
  overflow-y: auto;
  padding: clamp(1.1rem, 2.5vw, 1.65rem);
  color-scheme: dark;
  color: #f1ffe9;
  background: radial-gradient(ellipse at top left, #0e321e, #05160c 80%), #05160c;
  border: 1px solid #49932d;
  border-radius: 1.15rem;
  box-shadow: 0 0 28px rgba(73, 147, 45, 0.28), 0 18px 50px rgba(0, 0, 0, 0.72);
}
#rank-details-dialog::backdrop {
  background: rgba(1, 10, 5, 0.78);
  backdrop-filter: blur(6px);
}
#rank-details-dialog .close {
  color: #bed2c0;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: color .2s;
}
#rank-details-dialog .close:hover {
  color: #aef653;
}
#rank-details-dialog .close:focus-visible {
  outline: 2px solid #aef653;
  outline-offset: 2px;
  border-radius: .35rem;
}
.rank-dialog-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding-right: 2.6rem;
  margin-bottom: .75rem;
}
.rank-dialog-top #rank-reporter .rank-reporter { margin: 0; }
.rank-dialog-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
}
.rank-dialog-status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  border-radius: 999px;
  padding: .2rem .6rem;
  font-size: .8rem;
  font-weight: 700;
  border: 1px solid #49932d;
  background: #0d2f1d;
  color: #c6ff71;
}
.rank-dialog-status.is-resolved {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
}
#rank-details-heading {
  margin: 0 0 .65rem;
  color: #c6ff71;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.25;
}
.rank-resolution-box {
  margin: .85rem 0 1rem;
  padding: .9rem 1rem;
  border: 1px solid #22c55e;
  border-radius: .85rem;
  background: rgba(16, 56, 28, 0.45);
}
.rank-resolution-box h3 {
  margin: 0 0 .45rem !important;
  color: #86efac !important;
  font-size: .95rem !important;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.rank-resolution-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1rem;
  margin-bottom: .65rem;
  font-size: .86rem;
  color: #d1e7d4;
}
.rank-resolution-duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: .65rem;
}
.rank-resolution-shot {
  position: relative;
  border-radius: .65rem;
  overflow: hidden;
  border: 1px solid #2e6b3f;
  background: #03140b;
  aspect-ratio: 4 / 3;
}
.rank-resolution-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rank-resolution-shot span {
  position: absolute;
  bottom: .45rem;
  left: .45rem;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: .18rem .55rem;
  border-radius: 999px;
}
.rank-resolution-shot .tag-before { background: #ef4444; color: #fff; }
.rank-resolution-shot .tag-after { background: #84cc16; color: #0c2b12; }
.rank-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: 1.15rem;
  padding-top: .85rem;
  border-top: 1px solid #285436;
}
.rank-dialog-actions a { text-decoration: none; }
#rank-map-dialog { width: min(94vw, 44rem); color-scheme: dark; color: #f1ffe9; background: #092419; border-color: #428253; }
#rank-map-dialog h2 { margin-bottom: .65rem; overflow-wrap: anywhere; }
#rank-map-dialog .close { color: #bed2c0; background: transparent; border: 0; }
#rank-map-dialog .close:hover { color: #aef653; }
#rank-map iframe { display: block; width: 100%; height: min(55dvh, 24rem); border: 1px solid #3a683b; border-radius: .55rem; margin-bottom: .5rem; }
#rank-map a { color: #c6ff71; }
.rank-photo-slider + .rank-gallery { margin-top: .75rem; }
.rank-photo-stage { position: relative; height: clamp(9rem, 45vw, 15rem); overflow: hidden; perspective: 42rem; touch-action: pan-y; }
.rank-photo-stage img { position: absolute; inset: 0 12%; width: 76%; height: 100%; object-fit: contain; border-radius: .65rem; background: #071a11; opacity: 0; transition: transform .45s ease, opacity .45s ease; transform: scale(.7); pointer-events: none; }
.rank-photo-stage img[data-position="active"] { z-index: 2; opacity: 1; transform: translateZ(0); }
.rank-photo-stage img[data-position="previous"] { opacity: .5; transform: translateX(-32%) rotateY(36deg) scale(.78); }
.rank-photo-stage img[data-position="next"] { opacity: .5; transform: translateX(32%) rotateY(-36deg) scale(.78); }
.rank-photo-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
.rank-photo-controls button { min-height: 2.5rem; min-width: 2.5rem; padding: .3rem .65rem; border: 1px solid #428253; border-radius: .55rem; background: #143a25; color: inherit; }
@media (prefers-reduced-motion: reduce) { .rank-photo-stage img { transition: none; } }
.rank-footer { padding: 0 clamp(.85rem, 2vw, 1.6rem) clamp(.85rem, 2vw, 1.6rem); color: #f1ffe9; }

@media (max-width: 1100px) {
  .rank-heading { grid-template-columns: 1fr; }
  .rank-filter-group { margin-inline-start: 0; }
}
@media (max-width: 800px) {
  .rank-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .rank-columns, .rank-results button { grid-template-columns: 1.75rem minmax(0, 1fr) 6.5rem .6rem; padding-inline: .4rem; }
  .rank-risk { font-size: .75rem; padding-inline: .4rem; }
  .rank-areas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #rank-area-label { grid-column: 1 / -1; padding-block: .25rem; }
  .rank-areas button { gap: .3rem; font-size: .9rem; }
  .rank-areas i[data-icon] { width: 1.15rem; height: 1.15rem; }
  .rank-areas small { font-size: .75rem; }
  .rank-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rank-regions { margin-bottom: .85rem; }
.rank-regions[hidden] { display: none; }
#rank-region-list { display: grid; gap: .35rem; max-height: 17rem; overflow-y: auto; margin: 0; padding-inline-start: 1.6rem; }
#rank-region-list li { padding: .35rem .5rem; }
#rank-region-list li span { display: block; color: var(--muted-dark-surface, #bed2c0); font-size: .85rem; }
