/* Navbar: rank menu, notifications, lab VPN. Theme tokens; status colours fixed. */

/* ---------- rank button + menu ---------- */
.rkx-btn { display: inline-flex; align-items: center; gap: 0.5rem; height: 38px; padding: 0 0.6rem 0 0.35rem; border: 1px solid var(--line); border-radius: 999px;
  background: var(--button-bg); color: var(--text); font: inherit; font-size: 0.82rem; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.rkx-btn:hover, .rkx-btn[aria-expanded="true"] { border-color: color-mix(in srgb, var(--primary) 55%, var(--line)); background: var(--button-bg-hover); }
.rkx-title { display: inline-flex; align-items: center; gap: 0.35rem; height: 28px; padding: 0 0.6rem; border-radius: 999px; font-weight: 700; font-size: 0.78rem;
  color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); white-space: nowrap; }
.rkx-rank { font-weight: 700; white-space: nowrap; }
.rkx-pts { color: var(--text-soft); font-weight: 600; }
.rkx-chev { font-size: 0.7rem; color: var(--text-soft); transition: transform 0.15s ease; }
.rkx-btn[aria-expanded="true"] .rkx-chev { transform: rotate(180deg); }
.rkx-menu { width: 330px; max-width: 92vw; padding: 0; display: block; overflow: hidden; }
.rkx-menu[hidden] { display: none; }
.rkx-hero { display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1rem 0.85rem;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 65%); }
.rkx-badge { flex: 0 0 auto; width: 3.1rem; height: 3.1rem; border-radius: 16px; display: grid; place-items: center; font-size: 1.45rem; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 45%, transparent); box-shadow: 0 10px 24px -14px var(--primary); }
.rkx-hero div { display: grid; min-width: 0; }
.rkx-hero small { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); }
.rkx-hero strong { font-size: 1.15rem; line-height: 1.2; color: var(--text); }
.rkx-hero .mono { font-size: 0.76rem; color: var(--text-soft); }
.rkx-next { display: grid; gap: 0.4rem; padding: 0 1rem 0.85rem; }
.rkx-next-row { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.8rem; color: var(--text-soft); }
.rkx-next-row b { color: var(--text); }
.rkx-bar { height: 8px; border-radius: 999px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.rkx-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--primary) 70%, transparent), var(--primary)); }
.rkx-next small { font-size: 0.74rem; color: var(--text-soft); }
.rkx-ladder { list-style: none; margin: 0; padding: 0.55rem 0.6rem; display: grid; gap: 1px; max-height: 230px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.rkx-ladder li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; padding: 0.32rem 0.45rem; border-radius: 8px; font-size: 0.8rem; color: var(--text-soft); }
.rkx-ladder li i { text-align: center; }
.rkx-ladder li b { font-size: 0.72rem; font-weight: 600; }
.rkx-ladder li.is-done i { color: var(--success-fg); }
.rkx-ladder li.is-current { background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--text); font-weight: 700; }
.rkx-ladder li.is-current i { color: var(--primary); }
.rkx-ladder li.is-locked { opacity: 0.55; }
.rkx-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rkx-links a { display: grid; justify-items: center; gap: 0.2rem; padding: 0.65rem 0.3rem; font-size: 0.74rem; font-weight: 600; color: var(--text-soft); text-decoration: none; }
.rkx-links a + a { border-left: 1px solid var(--line); }
.rkx-links a i { font-size: 1rem; color: var(--primary); }
.rkx-links a:hover { color: var(--text); background: var(--button-bg); text-decoration: none; }

/* ---------- notifications ---------- */
.nfx.notif-menu { width: 390px; max-height: min(520px, 76vh); display: flex; flex-direction: column; overflow: hidden; }
.nfx.notif-menu[hidden] { display: none; }
.nfx .notif-head { position: static; padding: 0.8rem 0.95rem; border-bottom: 1px solid var(--line); }
.nfx-title { display: inline-flex; align-items: center; gap: 0.45rem; font-weight: 800; font-size: 0.95rem; color: var(--text); }
.nfx-count { padding: 0.1rem 0.45rem; border-radius: 999px; font-size: 0.68rem; font-weight: 800; color: var(--on-primary, #111); background: var(--primary); }
.nfx .notif-markall { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.3rem 0.5rem; border-radius: 8px; color: var(--primary); }
.nfx .notif-markall:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 12%, transparent); text-decoration: none; }
.nfx .notif-markall:disabled { color: var(--text-soft); opacity: 0.6; cursor: default; }
.nfx-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.nfx .notif-item { display: grid; grid-template-columns: 2.3rem minmax(0, 1fr); gap: 0.7rem; align-items: start; padding: 0.75rem 2.4rem 0.75rem 0.95rem; border-bottom: 1px solid var(--line-soft, var(--line)); }
.nfx .notif-item:last-child { border-bottom: 0; }
.nfx .notif-item.unread { background: color-mix(in srgb, var(--primary) 7%, transparent); }
.nfx .notif-item.unread::before { content: ""; position: absolute; left: 0; top: 0.75rem; bottom: 0.75rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nfx .notif-item:hover { background: var(--button-bg); }
.nfx-icon { width: 2.3rem; height: 2.3rem; border-radius: 11px; display: grid; place-items: center; font-size: 1rem; --tone: var(--text-soft);
  color: var(--tone); background: color-mix(in srgb, var(--tone) 15%, transparent); }
.nfx-icon.tone-red { --tone: #F87171; }
.nfx-icon.tone-amber { --tone: var(--primary); }
.nfx-icon.tone-violet { --tone: #A78BFA; }
.nfx-icon.tone-green { --tone: #34D399; }
.nfx-icon.tone-teal { --tone: #2DD4BF; }
.nfx-icon.tone-blue { --tone: #60A5FA; }
.nfx-body { display: grid; gap: 0.15rem; min-width: 0; }
.nfx .notif-title { font-size: 0.86rem; line-height: 1.3; flex-wrap: wrap; gap: 0.35rem; }
.nfx .notif-item:not(.unread) .notif-title { font-weight: 600; color: var(--text-soft); }
.nfx .notif-msg { font-size: 0.78rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nfx .notif-time { font-size: 0.7rem; color: var(--text-soft); opacity: 0.85; }
.nfx .notif-done { top: 50%; right: 0.7rem; transform: translateY(-50%); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); color: var(--text-soft); background: var(--surface); opacity: 0; transition: opacity 0.15s ease; }
.nfx .notif-item:hover .notif-done, .nfx .notif-done:focus-visible { opacity: 1; }
.nfx .notif-done:hover { color: var(--success-fg); border-color: var(--success-fg); }
@media (hover: none) { .nfx .notif-done { opacity: 1; } }
.nfx-empty { display: grid; justify-items: center; gap: 0.3rem; padding: 2.2rem 1.2rem; text-align: center; }
.nfx-empty i { font-size: 1.8rem; color: var(--text-soft); opacity: 0.7; }
.nfx-empty strong { color: var(--text); font-size: 0.92rem; }
.nfx-empty span { font-size: 0.8rem; }
.nfx .notif-foot { position: static; display: flex; justify-content: center; padding: 0.6rem; border-top: 1px solid var(--line); }
.nfx .notif-foot a { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; font-size: 0.8rem; color: var(--primary); }

/* ---------- lab VPN ---------- */
.vpx-btn { position: relative; display: inline-flex; align-items: center; gap: 0.4rem; height: 38px; padding: 0 0.7rem 0 0.45rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--button-bg); color: var(--text-soft); font: inherit; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.05em; cursor: pointer; --vpx: var(--text-soft);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease; }
.vpx-btn:hover, .vpx-btn[aria-expanded="true"] { background: var(--button-bg-hover); border-color: color-mix(in srgb, var(--vpx) 55%, var(--line)); }
.vpx-btn.vpn-on { --vpx: #37D67A; color: #37D67A; border-color: color-mix(in srgb, #37D67A 45%, var(--line)); }
.vpx-btn.vpn-idle { --vpx: var(--warning); color: var(--warning); }
.vpx-shield { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; color: var(--vpx); background: color-mix(in srgb, var(--vpx) 16%, transparent); }
.vpx-btn .vpn-dot { position: static; width: 8px; height: 8px; border: 0; }
.vpx-menu { width: 320px; padding: 0; overflow: hidden; }
.vpx-menu[hidden] { display: none; }
.vpx-hero { --vpx: var(--text-soft); display: flex; align-items: center; gap: 0.8rem; padding: 1rem;
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--vpx) 22%, transparent), transparent 65%); }
.vpx-hero[data-state="on"] { --vpx: #37D67A; }
.vpx-hero[data-state="idle"] { --vpx: var(--warning); }
.vpx-hero-icon { position: relative; flex: 0 0 auto; width: 3rem; height: 3rem; border-radius: 15px; display: grid; place-items: center; font-size: 1.35rem; color: var(--vpx);
  background: color-mix(in srgb, var(--vpx) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--vpx) 40%, transparent); }
.vpx-hero-icon .vpn-state-dot { position: absolute; right: -3px; bottom: -3px; border: 2px solid var(--surface); width: 13px; height: 13px; }
.vpx-hero div { display: grid; min-width: 0; }
.vpx-hero small { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-soft); }
.vpx-hero strong { font-size: 1rem; line-height: 1.25; color: var(--text); }
.vpx-hero span:not(.vpn-state-dot) { font-size: 0.76rem; color: var(--text-soft); line-height: 1.4; }
.vpx-meta { margin: 0; padding: 0.7rem 1rem; display: grid; gap: 0.35rem; border-top: 1px solid var(--line); }
.vpx-meta[hidden], .vpx-steps[hidden], .vpx-dl[hidden] { display: none; }
.vpx-meta div { display: flex; justify-content: space-between; gap: 0.8rem; font-size: 0.8rem; }
.vpx-meta dt { color: var(--text-soft); }
.vpx-meta dd { margin: 0; color: var(--text); font-weight: 600; }
.vpx-steps { margin: 0; padding: 0.7rem 1rem 0.7rem 2.1rem; display: grid; gap: 0.3rem; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--text-soft); }
.vpx-steps .mono { color: var(--text); font-size: 0.74rem; word-break: break-all; }
.vpx-actions { display: flex; gap: 0.5rem; padding: 0.8rem 1rem 1rem; border-top: 1px solid var(--line); }
.vpx-actions .btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; }

/* ---------- phones ---------- */
@media (max-width: 760px) {
  .rkx-title span, .rkx-pts, .rkx-chev, .vpx-label { display: none; }
  .rkx-btn { gap: 0.35rem; padding: 0 0.55rem 0 0.25rem; }
  .rkx-title { padding: 0 0.45rem; }
  .vpx-btn { padding: 0 0.5rem 0 0.3rem; }
}
@media (max-width: 560px) {
  .nfx.notif-menu { max-height: 76vh; }
  .rkx-menu, .vpx-menu, .nfx.notif-menu { width: auto; }
}
@media (max-width: 380px) { .rkx-rank { display: none; } }

/* fixes */
.vpx-actions .btn[hidden] { display: none; }
.vpx-actions .btn { white-space: nowrap; font-size: 0.82rem; padding: 0.55rem 0.7rem; }
.vpx-hero-icon > i, .vpx-shield > i { color: var(--vpx); }
.vpx-steps .mono { word-break: normal; overflow-wrap: anywhere; }
.rkx-menu { max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; }
.rkx-ladder { max-height: none; overflow: visible; }
.nfx .notif-head { display: flex; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: nowrap; }
.nfx .notif-head form { flex: 0 0 auto; }
