/*
 * rankings.html: the year-end Top 100 lists, live during a countdown, and the
 * compare view. Built on css/app.css and css/ui.css; the colours come from
 * their tokens, in light and dark.
 */

/* ---------- list tabs and the search ---------- */
.rk-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.rk-tab .pill { margin-left: 0; }
.rk-tab[aria-pressed="true"] .pill { background: color-mix(in srgb, var(--app) 18%, transparent); color: inherit; }
.rk-tab-compare { border-style: dashed; }
.rk-tab-compare[aria-pressed="true"] { border-style: solid; }

.rk-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; margin: 0; }
.rk-search { flex: 1 1 260px; max-width: 520px; }
.rk-yearfield { flex: 0 0 auto; }
.rk-input { position: relative; display: block; }
.rk-input input { padding-right: 44px; }
.rk-input input::-webkit-search-cancel-button { display: none; }
.rk-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 10px; color: var(--muted); font-size: 22px; line-height: 1;
}
.rk-clear:hover { background: var(--chip); color: var(--ink); }
.rk-summary { min-height: 1.45em; margin: 10px 0 12px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rk-summary[data-tone="error"] { padding: 9px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); }
.rk-source { margin: 18px 0 0; max-width: 64ch; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.rk-muted { color: var(--muted); }

/* ---------- layout of a list ----------
 * Small screens: list name (+ "Just revealed"), the ranking, then the boxes.
 * From 1100px the name and the boxes move into a column on the right, and
 * the boxes stay in view while the ranking scrolls. */
.rk-layout { display: grid; gap: 16px; grid-template-areas: "top" "main" "extra"; }
.rk-side-top { grid-area: top; min-width: 0; }
.rk-main { grid-area: main; min-width: 0; }
.rk-side-extra { grid-area: extra; display: grid; gap: 12px; align-content: start; min-width: 0; }
.rk-side-extra:empty { display: none; }
.rk-side-top > :last-child { margin-bottom: 0; }

@media (min-width: 1100px) {
  .rk-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    grid-template-rows: auto 1fr;
    grid-template-areas: "main top" "main extra";
    column-gap: 24px; row-gap: 14px; align-items: start;
  }
  .rk-side-extra { position: sticky; top: 16px; }
  /* The sidebar is narrow: the "Just revealed" row gets smaller columns. */
  .rk-side-top .rk-entry.is-big { grid-template-columns: 44px 56px minmax(0, 1fr) auto; gap: 10px; }
  .rk-side-top .rk-entry.is-big .rk-rank { font-size: 32px; }
  .rk-side-top .rk-entry.is-big .rk-cover { width: 56px; height: 56px; }
  .rk-side-top .rk-entry.is-big .rk-title { font-size: 17px; }
}

/* Artist names link to their page when there is one. */
.rk-artist-page { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
.rk-artist-page:hover { color: var(--ink); text-decoration-color: currentColor; }

/* The official stream, and "Go to rank", under the list name. */
.rk-stream { margin: 12px 0 0; }
.rk-stream-link { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.rk-stream-link svg, .rk-share-btn svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rk-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 12px 0 0; font-size: 13px; font-weight: 600; }
.rk-jump input {
  width: 5.5rem; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums;
}
.rk-jump .button { min-height: 38px; padding: 0 14px; }
.rk-jump-note { flex: 1 1 100%; color: var(--muted); font-weight: 400; }
.rk-jump-note:empty { display: none; }

/* Share as image: Top 10 / Phone wallpaper / Full list. */
.rk-share { margin: 12px 0 0; }
.rk-share-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.rk-share-row { display: flex; flex-wrap: wrap; gap: 6px; }
.rk-share-btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.rk-share-note { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.rk-share-note:empty { display: none; }

/* Tracks per artist against last year: ▲2 / ▼1 / = / New. The arrow and the
 * word carry the meaning; the colour only adds to it. */
.rk-box-sub { margin: -4px 0 6px; color: var(--muted); font-size: 12px; }
.rk-move { display: inline-block; min-width: 2.4em; margin-left: 8px; padding: 1px 6px; border-radius: 6px; background: var(--chip); color: var(--ink); font-size: 11.5px; font-weight: 800; text-align: center; }
.rk-move.is-up { color: var(--accent); }
.rk-move.is-down { color: var(--warn); }
.rk-move.is-new { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }

/* The boxes: most tracks per artist, and every list's progress. */
.rk-box { padding: 14px; border-radius: 14px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.rk-box-h { margin: 0 0 8px; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.rk-box-list { margin: 0; padding: 0; list-style: none; }
.rk-box-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 0; }
.rk-box-list li + li { border-top: 1px solid var(--line-strong); }
.rk-box-list .rk-artist-link { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.rk-box-count { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rk-box-lists { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rk-box-listbtn {
  display: grid; gap: 6px; width: 100%; padding: 10px 12px; border-radius: 10px;
  background: var(--chip); color: var(--ink); text-align: left;
}
.rk-box-listbtn:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.rk-box-listbtn[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.rk-box-listrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rk-box-listrow b { min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.rk-box .rk-status { padding: 2px 7px; font-size: 10.5px; }
.rk-progress { display: block; height: 6px; border-radius: 999px; background: var(--line-strong); overflow: hidden; }
.rk-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* ---------- a list ---------- */
.rk-listhead { margin: 0 0 12px; }
.rk-listhead-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.rk-listname {
  margin: 0; min-width: 0; overflow-wrap: anywhere;
  font-family: var(--display); font-weight: 800; font-size: clamp(24px, 5vw, 32px); line-height: 1; text-transform: uppercase;
}
.rk-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

/* "Notify me of new tracks" under the list name. */
.rk-notifybox { margin: 12px 0 0; }
.rk-notify { min-height: 38px; padding: 0 14px; font-size: 13.5px; }
.rk-notify svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rk-notify[aria-busy="true"] { opacity: .7; cursor: progress; }
.rk-notify-note { margin: 6px 0 0; max-width: 60ch; color: var(--muted); font-size: 13px; }

.rk-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  background: var(--chip); color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.rk-status.is-live { background: var(--warn-soft); color: var(--warn); }
.rk-status.is-final { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.rk-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: none; animation: rk-pulse 1.6s ease-in-out infinite; }
@keyframes rk-pulse { 50% { opacity: .35; } }

.rk-empty { max-width: 60ch; }

/* The track revealed last, during a countdown. */
.rk-latest {
  margin: 0 0 14px; padding: 12px 0 2px; border-radius: 14px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong), inset 4px 0 0 var(--warn);
}
.rk-latest-label { margin: 0 14px; color: var(--warn); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.rk-entries {
  margin: 0; padding: 0; list-style: none; border-radius: 14px; overflow: hidden;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.rk-entry {
  display: grid; grid-template-columns: 40px 48px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px 14px; scroll-margin: 120px;
  transition: background-color .6s ease;
}
.rk-entries > .rk-entry + .rk-entry { border-top: 1px solid var(--line-strong); }
.rk-rank {
  font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; text-align: right;
  font-variant-numeric: tabular-nums;
}
.rk-cover { width: 48px; height: 48px; border-radius: 8px; background: var(--chip); object-fit: cover; display: block; }
.rk-entry-text { min-width: 0; }
.rk-title { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.rk-artists { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; overflow-wrap: anywhere; }
.rk-elsewhere { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 0; color: var(--muted); font-size: 11.5px; }
.rk-other, .rk-rank-link {
  padding: 1px 7px; border-radius: 6px; background: var(--chip); color: var(--ink);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rk-other:hover, .rk-rank-link:hover { background: var(--accent); color: var(--accent-ink); }
.rk-spotify { color: var(--muted); }
.rk-spotify:hover { color: var(--ink); }

.rk-entry.is-big { grid-template-columns: 66px 64px minmax(0, 1fr) auto; }
.rk-entry.is-big .rk-rank { font-size: 40px; }
.rk-entry.is-big .rk-cover { width: 64px; height: 64px; }
.rk-entry.is-big .rk-title { font-size: 19px; }
.rk-entry.is-big .rk-artists { font-size: 14px; }

.rk-entry.is-next { color: var(--muted); }
.rk-entry.is-next .rk-cover { background: repeating-linear-gradient(135deg, var(--chip) 0 6px, transparent 6px 12px); }
.rk-entry.is-next .rk-title { font-weight: 600; }

/* #4–#10: a step up from the rest of the list. */
.rk-entry.is-top10 { grid-template-columns: 48px 56px minmax(0, 1fr) auto; padding-block: 12px; }
.rk-entry.is-top10 .rk-rank { font-size: 30px; }
.rk-entry.is-top10 .rk-cover { width: 56px; height: 56px; }
.rk-entry.is-top10 .rk-title { font-size: 16px; }
.rk-entries > .rk-entry.is-top10 + .rk-entry:not(.is-top10) { border-top-width: 3px; }

/* ---------- the podium (#1–#3) ----------
 * The medal colours sit behind dark text, so they keep their contrast in
 * light and dark mode. The rank number is always shown, so the colour is
 * never the only cue. DOM order is 1, 2, 3; wide screens show 2 · 1 · 3. */
.rk-podium {
  --rk-gold: #e3b341; --rk-silver: #b8c1cc; --rk-bronze: #c98a52; --rk-medal-ink: #1c1606;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end;
  max-width: 900px; margin: 0 auto 14px; padding: 0; list-style: none;
}
.rk-podium-item {
  --medal: var(--rk-gold);
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 14px 16px; border-radius: 14px; text-align: center; scroll-margin: 120px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 4px 0 var(--medal);
  transition: background-color .6s ease;
}
.rk-podium-item.is-rank-1 { order: 2; padding-top: 26px; padding-bottom: 22px; }
.rk-podium-item.is-rank-2 { order: 1; --medal: var(--rk-silver); }
.rk-podium-item.is-rank-3 { order: 3; --medal: var(--rk-bronze); }
.rk-medal {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--medal); color: var(--rk-medal-ink);
  font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums;
}
.rk-podium-item.is-rank-1 .rk-medal { width: 50px; height: 50px; font-size: 30px; }
.rk-podium-cover {
  display: block; width: 100%; max-width: 120px; aspect-ratio: 1; height: auto;
  border-radius: 10px; background: var(--chip); object-fit: cover;
}
.rk-podium-item.is-rank-1 .rk-podium-cover { max-width: 160px; }
.rk-podium-text { min-width: 0; width: 100%; }
.rk-podium-text .rk-title { font-size: 16px; }
.rk-podium-item.is-rank-1 .rk-title { font-size: 19px; }
.rk-podium-text .rk-elsewhere { justify-content: center; }
.rk-podium-item .rk-spotify { position: absolute; top: 8px; right: 8px; }
.rk-podium-item.is-empty { color: var(--muted); }
.rk-podium-item.is-empty .rk-podium-cover { background: repeating-linear-gradient(135deg, var(--chip) 0 6px, transparent 6px 12px); }
.rk-podium-item.is-empty .rk-title { font-weight: 600; }
.rk-podium-item.is-empty.is-next { box-shadow: inset 0 0 0 1px var(--warn), inset 0 4px 0 var(--medal); }
.rk-podium-item.is-new { background: color-mix(in srgb, var(--warn) 10%, var(--panel-2)); }
.rk-podium-item.is-target { background: color-mix(in srgb, var(--accent) 16%, var(--panel-2)); }

/* Phones: #1 across the full width, #2 and #3 side by side under it. */
@media (max-width: 520px) {
  .rk-podium { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rk-podium-item { order: 0; padding: 14px 10px 12px; }
  .rk-podium-item.is-rank-1 { order: 0; grid-column: 1 / -1; padding: 18px 12px 16px; }
  .rk-podium-cover { max-width: 96px; }
  .rk-podium-item.is-rank-1 .rk-podium-cover { max-width: 140px; }
  .rk-podium-text .rk-title { font-size: 14.5px; }
  .rk-podium-item.is-rank-1 .rk-title { font-size: 18px; }
  .rk-entry.is-top10 { grid-template-columns: 40px 48px minmax(0, 1fr) auto; }
  .rk-entry.is-top10 .rk-rank { font-size: 25px; }
  .rk-entry.is-top10 .rk-cover { width: 48px; height: 48px; }
}

/* New since the page was opened: a short glow that fades. */
.rk-entry.is-new { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.rk-entry.is-new .rk-rank { color: var(--warn); }
.rk-entry.is-target { background: color-mix(in srgb, var(--accent) 16%, transparent); }

@media (max-width: 520px) {
  .rk-entry { grid-template-columns: 34px 40px minmax(0, 1fr) auto; gap: 10px; padding: 10px 10px; }
  .rk-cover { width: 40px; height: 40px; }
  .rk-rank { font-size: 21px; }
  .rk-entry.is-big { grid-template-columns: 52px 52px minmax(0, 1fr) auto; }
  .rk-entry.is-big .rk-rank { font-size: 32px; }
  .rk-entry.is-big .rk-cover { width: 52px; height: 52px; }
  .rk-entry.is-big .rk-title { font-size: 17px; }
}

/* ---------- compare ---------- */
.rk-compare-controls { display: grid; gap: 10px; margin: 0 0 12px; }
.rk-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.rk-picks .pill { margin-left: 0; }
.rk-picks .chip[aria-pressed="true"] .pill { background: color-mix(in srgb, var(--app) 18%, transparent); color: inherit; }
.rk-compare-row { display: flex; flex-wrap: wrap; gap: 8px; }
.rk-compare-row .seg { max-width: 100%; overflow-x: auto; }
.rk-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.rk-sort select {
  height: 34px; max-width: 100%; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--panel); color: var(--ink); padding: 0 8px; font: inherit; font-weight: 500;
}

.rk-table-wrap { max-height: min(75vh, 900px); overflow: auto; }
.rk-table th { position: sticky; top: 0; z-index: 1; background: var(--panel-2); box-shadow: inset 0 -1px 0 var(--line-strong); }
.rk-table td { vertical-align: middle; }
.rk-table td:first-child { white-space: normal; }
.rk-table th, .rk-table td { padding: 8px 10px; }
.rk-table .rk-num { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rk-track-cell { min-width: 12rem; }
.rk-track-cell .rk-title, .rk-track-cell .rk-artists { display: block; }
.rk-track-cell .rk-title { font-size: 14px; }
.rk-gap b { display: block; font-size: 15px; }
.rk-gap small { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; }
.rk-artist-link { color: var(--accent); font-weight: 700; text-align: left; }
.rk-artist-link:hover { text-decoration: underline; }
.rk-more { margin: 0; font-size: 13px; }

@media (max-width: 520px) {
  .rk-table th, .rk-table td { padding: 8px 6px; }
  .rk-track-cell { min-width: 9rem; }
}

/* ---------- the editor (only for the "top-lists" admin feature) ---------- */
.rk-editor {
  padding: 10px 14px; border-radius: 14px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-strong), inset 0 3px 0 var(--accent);
}
/* Header row: title, list picker, a short hint, hide/show. */
.rk-ed-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.rk-ed-title { margin: 0; font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1; text-transform: uppercase; }
.rk-ed-listfield { flex: 0 1 320px; min-width: 0; }
.rk-ed-listfield select {
  width: 100%; height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel-2); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
}
.rk-ed-hint { flex: 1 1 16rem; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.rk-ed-fold { margin-left: auto; }
.rk-ed-body { display: grid; gap: 10px; margin-top: 10px; }
.rk-ed-body[hidden] { display: none; }
.rk-ed-status { margin: 0; font-size: 13px; }
.rk-ed-status:empty { display: none; }
.rk-ed-status[data-tone="ok"] { color: var(--accent); font-weight: 600; }
.rk-ed-status[data-tone="warn"] { padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); font-weight: 600; }
.rk-ed-status[data-tone="error"] { padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); }
.rk-ed-form { display: grid; gap: 12px; }
/* Add a track: one row from 900px; two fields per row from 600px; on
 * phones rank + find, then title, artists and save on rows of their own. */
.rk-ed-entry {
  display: grid; gap: 8px 10px; align-items: end;
  grid-template-columns: 5rem minmax(0, 1fr);
  grid-template-areas: "rank find" "title title" "artists artists" "spotify spotify" "save save" "note note" "link link";
}
@media (min-width: 600px) {
  .rk-ed-entry {
    grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "rank find find" "title title artists" "spotify spotify spotify" "save save save" "note note note" "link link link";
  }
}
.rk-ed-rankfield { grid-area: rank; }
.rk-ed-searchfield { grid-area: find; }
.rk-ed-titlefield { grid-area: title; }
.rk-ed-artistsfield { grid-area: artists; }
.rk-ed-save { grid-area: save; }
.rk-ed-spotifyfield { grid-area: spotify; }
/* The cover of the linked song next to the link field. */
.rk-ed-spotifyrow { display: flex; gap: 8px; align-items: center; }
.rk-ed-spotifyrow input { flex: 1 1 auto; min-width: 0; }
.rk-ed-spotifycover { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; background: var(--chip); }
.rk-ed-spotifycover[hidden] { display: none; }
.rk-ed-entry > .rk-ed-note { grid-area: note; }
.rk-ed-entry > .rk-ed-link { grid-area: link; }
.rk-ed-save .button { width: 100%; min-height: 40px; }
.rk-editor .field { gap: 3px; font-size: 12px; }
.rk-editor .field input, .rk-editor .field select { min-height: 40px; border-radius: 10px; }
.rk-ed-rankfield input { font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
  .rk-ed-entry {
    grid-template-columns: 5rem minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    grid-template-areas: "rank find title artists save" "spotify spotify spotify spotify spotify" "note note note note note" "link link link link link";
  }
}
.rk-ed-combo { position: relative; display: block; }
.rk-ed-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20;
  margin: 0; padding: 4px; list-style: none; border-radius: 12px; max-height: 360px; overflow-y: auto;
  background: var(--panel-2); box-shadow: var(--shadow), inset 0 0 0 1px var(--line-strong);
}
.rk-ed-suggest li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-weight: 400; }
.rk-ed-suggest li[aria-selected="true"], .rk-ed-suggest li:hover { background: var(--chip); }
.rk-ed-suggest img, .rk-ed-nocover { width: 32px; height: 32px; border-radius: 6px; background: var(--chip); display: block; object-fit: cover; }
.rk-ed-suggest b { display: block; font-size: 14px; overflow-wrap: anywhere; }
.rk-ed-suggest small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.rk-ed-note { margin: 0; color: var(--muted); font-size: 12.5px; }
.rk-ed-note:empty { display: none; }
.rk-ed-note[data-tone="warn"] { padding: 7px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--ink); }
.rk-ed-link { color: var(--accent); font-size: 12px; }
.rk-ed-link:empty { display: none; }
.rk-ed-link[data-tone="warn"], .rk-ed-link[data-tone="error"] { padding: 7px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--ink); }
/* The other tools: a row of small buttons; the open one's panel goes below. */
.rk-ed-more { display: flex; flex-wrap: wrap; gap: 6px; }
.rk-ed-tool::after { content: "+"; margin-left: 6px; color: var(--muted); }
.rk-ed-tool[aria-expanded="true"] { background: var(--ink); color: var(--app); border-color: var(--ink); }
.rk-ed-tool[aria-expanded="true"]::after { content: "−"; color: inherit; }
.rk-ed-panel {
  min-width: 0; padding: 12px 14px 14px; border-radius: 12px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.rk-ed-panel[hidden] { display: none; }
.rk-ed-entries { margin: 0; padding: 0; list-style: none; max-height: 420px; overflow-y: auto; }
.rk-ed-entries li { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; font-size: 13px; }
.rk-ed-entries li + li { border-top: 1px solid var(--line-strong); }
.rk-ed-rank { flex: 0 0 3.5ch; font-weight: 800; font-variant-numeric: tabular-nums; }
.rk-ed-track { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.rk-ed-preview .rk-ed-entries { max-height: none; margin-top: 6px; }

@media (max-width: 520px) {
  .rk-editor { padding: 10px 12px; }
  .rk-ed-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-dot { animation: none; }
  .rk-entry, .rk-podium-item { transition: none; }
}

/* ---------- a final list's own page (rankings/<slug>.html) ---------- */
.rk-crumbs { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.rk-static-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.rk-static-links .button { flex: 0 0 auto; width: auto; }
.rk-static .rk-podium { margin-top: 4px; }
