.rank-progress {
  margin: 0 0 18px;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid #3d3432;
  border-radius: 12px;
  background: linear-gradient(120deg, #261e1b 0%, #1c1a1b 58%);
  min-width: 0;
  font-variant-numeric: tabular-nums;
}
.rank-progress [hidden] { display: none !important; }
.rp-head, .rp-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.rp-reference { color: #f1ae83; font-size: .8125rem; font-weight: 650; }
.rp-readout { display: grid; gap: 3px; margin: 14px 0 16px; }
.rp-readout strong { color: #f8f2ef; font-size: .9375rem; }
.rp-readout span, .rank-progress p { color: #c2b9b6; font-size: .875rem; line-height: 1.5; }
.rp-bands, .rp-track { display: grid; grid-template-columns: var(--down) calc(var(--up) - var(--down)) calc(100% - var(--up)); text-align: center; }
.rp-bands span { display: grid; gap: 2px; }
.rp-bands strong { color: #eee7e3; font-size: .875rem; }
.rp-bands small { color: #c9bdba; font-size: .8125rem; }
.rp-track { height: 9px; position: relative; margin-top: 8px; }
.rp-track span:first-child { border-radius: 20px 0 0 20px; background: #6c373f; }
.rp-track span:nth-child(2) { background: #65584e; border-inline: 2px solid #211b1b; }
.rp-track span:last-child { border-radius: 0 20px 20px 0; background: #32644c; }
.rp-track[data-sim]::after, .rp-track[data-estimate]::before { content: ""; position: absolute; left: clamp(6px,var(--ratio),calc(100% - 6px)); top: 50%; transform: translate(-50%,-50%); width: 12px; height: 12px; background: #fff3df; border: 2px solid #392924; border-radius: 50%; }
.rank-progress p { margin: 12px 0 8px; }
.rp-actions a, .rp-actions button { color: #ffb489; font: inherit; font-weight: 650; font-size: .875rem; text-decoration: underline; text-underline-offset: 3px; }
.rp-actions button { border: 0; padding: 5px 0; background: none; cursor: pointer; }
.rp-sim { border-top: 1px solid #513b33; margin-top: 6px; }
.rp-sim label, .rp-sim output { color: #f9f1ec; display: block; font-size: .875rem; font-weight: 650; }
.rp-sim input { width: 100%; margin: 8px 0; accent-color: #ff9a62; }

.rp-readout b { color: #ffab72; font-size: 1.6rem; line-height: 1.15; }
.rp-readout small { display: inline-block; font-size: .75rem; margin-left: 4px; color: #eab290; font-weight: 650; }
.rp-track[data-sim]::after { background: #fff; box-shadow: 0 0 0 2px #ff9a62; }
.rp-notes { margin: 5px 0 8px; font-size: .875rem; }
.rp-notes summary, .rp-notes a { color: #ffd0b4; cursor: pointer; }

.rp-track[data-estimate]::before { left: clamp(6px,var(--estimate-ratio),calc(100% - 6px)); background: #ffab72; }
.rp-track[data-sim][data-estimate]::before { opacity: .25; }

.rp-rank-group { display: inline-grid; max-width: 100%; vertical-align: top; }
.rp-hero-trigger {
  --rp-value-tone: #b7b4bb;
  display: grid; gap: 5px; width: 100%; min-height: 44px; margin-top: 3px;
  padding: 6px 4px 5px; border: 0; border-radius: 5px; text-align: left;
  background: none; color: #d8d4d9; cursor: pointer; font: 650 .8125rem/1.25 system-ui, sans-serif;
}
.rp-hero-trigger:hover { color: #f5f3f5; }
.rp-hero-trigger:focus-visible { outline: 2px solid var(--rp-value-tone); outline-offset: 3px; }
.rp-close:focus-visible { outline: 2px solid #ffab81; outline-offset: 3px; }
.rp-hero-row { display: flex; justify-content: space-between; gap: 10px; }
.rp-hero-target { color: var(--rank-tone, #f5f3f5); }
.rp-hero-row strong { color: var(--rp-value-tone); font-variant-numeric: tabular-nums; }
.rp-hero-trigger[data-rp-tone="very-low"] { --rp-value-tone: var(--stat-negative, #ff5265); }
.rp-hero-trigger[data-rp-tone="low"] { --rp-value-tone: #f88c98; }
.rp-hero-trigger[data-rp-tone="high"] { --rp-value-tone: #9bddad; }
.rp-hero-trigger[data-rp-tone="very-high"] { --rp-value-tone: var(--stat-positive, #35e77b); }
.rp-hero-track { display: block; height: 5px; background: #37353a; border-radius: 9px; overflow: hidden; }
.rp-hero-track i { display: block; height: 100%; width: var(--rp-fill); border-radius: inherit; background: var(--rp-value-tone); }
.rp-hero-trigger:hover .rp-hero-track i { background: color-mix(in srgb, var(--rp-value-tone) 82%, white); }
.rp-dialog {
  color-scheme: dark; padding: 0; border: 1px solid #5c4238; border-radius: 14px;
  width: min(670px, calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 28px);
  color: #f8f2ef; background: #201a19; box-shadow: 0 24px 90px #0009; overflow-y: auto;
}
.rp-dialog::backdrop { background: #0c090bd9; }
.rp-dialog .rank-progress { padding: clamp(16px, 4vw, 28px); border: 0; border-radius: 0; margin: 0; }
.rp-dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.rp-dialog-head .rp-head { display: grid; gap: 4px; }
.rp-dialog-head h2 { font-size: clamp(1.27rem, 4.5vw, 1.85rem); color: #f8f2ef; line-height: 1.16; margin: 0; }
.rp-close { display: grid; place-items: center; flex: 0 0 44px; height: 44px; border: 1px solid #5f4b45; border-radius: 6px; color: #ffcfb7; background: #2c2322; cursor: pointer; }
.rp-close:hover { background: #4b3028; }
@media (max-width: 760px) { .rp-rank-group { display: grid; width: 100%; } }

html:has(.rp-dialog[open]) { overflow: hidden; }
