/* Звания за приглашённых коллег, друзья, помощники (club/). Медали — static/img/medals/<звание>.svg */
.medal { display: inline-flex; align-items: center; gap: 6px; vertical-align: -4px; line-height: 1; text-decoration: none; }
.medal img { display: block; }
.medal-s { margin-left: 4px; }
.medal-m { font-size: 14px; font-weight: 600; color: var(--ink2); }
a.medal:hover .medal-name { color: var(--green-d); }
.medal-locked { filter: grayscale(1); opacity: .35; }
.team-plaque { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px 0 6px; margin-left: 6px;
  border-radius: 11px; background: var(--green-t); color: var(--green-word); border: 1px solid #B9DEC7; font-size: 12px;
  font-weight: 700; white-space: nowrap; vertical-align: 2px; }
.team-plaque img { display: block; }

/* крупный блок на визитке */
.medal-card { display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px 8px 10px; border-radius: 14px;
  background: linear-gradient(100deg, #FFF8EC, #FFFFFF); border: 1px solid #EEDDBF; }
.medal-card .mc-img { flex-shrink: 0; display: block; }
.medal-card .mc-img img { display: block; }
.medal-card .mc-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.medal-card b { font-family: var(--display); font-size: 16px; }
.mc-titles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.mc-title, .mc-helper { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.mc-title { background: #FFF1C9; color: #7A5300; }
.mc-helper { background: var(--green-t); color: var(--green-word); }
.medal-card.lv10 { background: linear-gradient(100deg, #EFFBFF, #FFFFFF 60%, #F4F0FF); border-color: #BFE6F4; }

/* рамка цвета медали вокруг фото со 2-го звания */
.medal-ring { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ring, #C9D3CC); }
.ring-2 { --ring: #C4683A; } .ring-3 { --ring: #A86B2D; } .ring-4 { --ring: #9AA6B0; } .ring-5 { --ring: #D9A520; }
.ring-6 { --ring: #8EA6BE; } .ring-7 { --ring: #2B55C7; } .ring-8 { --ring: #C21F3E; } .ring-9 { --ring: #10A060; }
.ring-10 { --ring: #7FD3EE; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #7FD3EE, 0 0 10px 2px rgba(127, 211, 238, .55); }

/* бриллиантовая медаль переливается; «уменьшить движение» — замирает */
.medal-10 { animation: club-shine 4s ease-in-out infinite; }
@keyframes club-shine { 0%, 100% { filter: drop-shadow(0 0 0 rgba(127, 211, 238, 0)); } 50% { filter: drop-shadow(0 0 4px rgba(127, 211, 238, .9)) brightness(1.08); } }
@media (prefers-reduced-motion: reduce) { .medal-10 { animation: none; } }

/* вкладка «Пригласить коллег»: лестница званий */
.rank-now { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.rank-now .rn-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1 1 260px; }
.rank-bar { height: 10px; border-radius: 5px; background: var(--grey-t); overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--green-brand), #3FBF79); }
.rank-ladder { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.rank-ladder li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rank-ladder li.got { background: #FBFEFC; border-color: #BFE3CD; }
.rank-ladder li.next { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; }
.rank-ladder .ld-img { flex-shrink: 0; position: relative; }
/* с Сапфирового: лента «Высылаем по почте» наискосок через правый верхний угол, цвета камня медали (Тим, 11.11.2026).
   Лента выходит за край карточки на 6px и «загибается» за неё (тёмные треугольники). Чтобы она не задевала название,
   при ленте медаль стоит над названием (как на телефоне), а правый верхний угол карточки свободен. */
.rank-ladder.rl-col li { flex-direction: column; gap: 6px; }
.rank-ladder li.has-ribbon { position: relative; }
.ld-ribbon { position: absolute; top: -6px; right: -6px; width: 96px; height: 96px; overflow: hidden; z-index: 1; pointer-events: none; }
.ld-ribbon::before, .ld-ribbon::after { content: ""; position: absolute; border: 3px solid var(--rb-fold); border-top-color: transparent; border-right-color: transparent; }
.ld-ribbon::before { top: 0; left: 0; }
.ld-ribbon::after { bottom: 0; right: 0; }
/* полоса 30px: внешний край проходит через углы обёртки, центр — на диагонали (96 − 30/√2) */
.ld-band { position: absolute; left: -11.4px; top: 22.4px; width: 140px; height: 30px; transform: rotate(45deg); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; letter-spacing: .07em; line-height: 11px; text-transform: uppercase; white-space: nowrap;
  color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); background: var(--rb);
  box-shadow: 0 2px 6px rgba(15, 31, 23, .25), inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 -1px 0 rgba(0, 0, 0, .18); }
.ld-band > span { display: inline-flex; align-items: center; gap: 3px; position: relative; z-index: 1; }
.ld-band svg { flex-shrink: 0; width: 11px; height: 11px; }
.ld-band::before { content: ""; position: absolute; top: 0; bottom: 0; left: 18%; width: 36%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .3), rgba(255, 255, 255, 0)); }
.rb-7 { --rb: linear-gradient(90deg, #17389E, #2B55C7 45%, #4C7BEA); --rb-fold: #0C1F5E; }    /* сапфир */
.rb-8 { --rb: linear-gradient(90deg, #8E0F28, #C21F3E 45%, #E2475F); --rb-fold: #5E0718; }    /* рубин */
.rb-9 { --rb: linear-gradient(90deg, #08714A, #10A060 45%, #2FC07E); --rb-fold: #034A30; }    /* изумруд */
.rb-10 { --rb: linear-gradient(90deg, #4FB6D8, #8FDDF2 40%, #E6F8FF 55%, #B7A9F0); --rb-fold: #3A7E9C; }  /* бриллиант */
.rb-10 .ld-band { color: #0F2A3A; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
@media (prefers-reduced-motion: no-preference) {
  .rb-10 .ld-band::before { animation: club-ribbon 4s ease-in-out infinite; }
}
@keyframes club-ribbon { 0%, 100% { left: -40%; } 50% { left: 100%; } }
.rank-ladder .ld-lock { position: absolute; right: -4px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.rank-ladder .ld-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; color: var(--ink2); }
.rank-ladder .ld-text b { font-size: 15px; color: var(--ink); }
.invite-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.invite-stats > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.invite-stats b { display: block; font-family: var(--display); font-size: 26px; line-height: 1.1; }
.invite-stats span { display: block; overflow-wrap: anywhere; hyphens: auto; }
.invite-qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.invite-qr img { width: 148px; height: 148px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.rank-congrats { display: flex; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 14px;
  background: linear-gradient(100deg, #FFF6E0, #FFFFFF); border: 1px solid #F0D9A8; }
.rank-congrats .grow { display: flex; flex-direction: column; gap: 2px; }
.helper-offer { padding: 16px 18px; border-radius: 14px; background: var(--green-t); border: 1px solid #B9DEC7; }
.helper-offer ol { margin: 8px 0 12px; padding-left: 20px; font-size: 14px; color: var(--ink2); }

/* настоящая медаль по почте (club/real.py): метка в лестнице, блок во вкладке, напоминание в шапке кабинета */
.real-tag { display: inline-flex; align-items: center; gap: 4px; width: fit-content; align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 10px;
  background: #EAF0FF; color: #1E3F9A; font-size: 12px; font-weight: 700; }
.real-tag svg { flex-shrink: 0; }
.real-medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.real-medal { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.real-medal img { flex-shrink: 0; }
.real-medal.sent { background: #FBFEFC; border-color: #BFE3CD; }
.real-medal.off { opacity: .7; }
.real-medal .small svg { vertical-align: -2px; color: var(--green-d); }
.real-need { color: var(--orange-d); }
.real-ask { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 12px; background: #FFF6E0;
  border: 1px solid #F0D9A8; font-size: 14px; line-height: 1.45; }
.real-ask svg { flex-shrink: 0; margin-top: 1px; color: #7A5300; }
.real-addr { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 12px; background: var(--grey-t);
  font-size: 14px; overflow-wrap: anywhere; }
.real-form { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.real-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 160px); gap: 12px; }
.real-consent { align-items: flex-start; font-size: 14px; line-height: 1.45; }
.real-consent input { margin-top: 2px; flex-shrink: 0; }
.real-edit { flex: 1 1 100%; }
.real-edit > summary { list-style: none; width: fit-content; }
.real-edit > summary::-webkit-details-marker { display: none; }
.real-edit[open] > summary { margin-bottom: 8px; }
.real-progress { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.real-progress > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); }
.real-points { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.real-points li { display: flex; gap: 10px; align-items: baseline; }
.real-points b { min-width: 28px; text-align: right; font-family: var(--display); color: #1E3F9A; }
.real-wait { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(100deg, #FFF6E0, #FFFFFF); border: 1px solid #F0D9A8; }
.real-wait .grow { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }

.real-send { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }

/* страница по ссылке-приглашению */
.join-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.join-who { display: flex; gap: 14px; align-items: center; }
.join-who .avatar { width: 64px; height: 64px; font-size: 22px; flex-shrink: 0; }
.join-who .avatar img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.join-list { display: flex; flex-direction: column; gap: 12px; }
.join-list > div { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.join-list .jl-ico { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; background: var(--green-t); color: var(--green-d);
  display: inline-flex; align-items: center; justify-content: center; }
.join-list b { display: block; font-size: 15px; }
.join-list span { font-size: 14px; color: var(--ink2); }
.join-card { padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px; position: sticky; top: 90px; }
.join-free { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 700; color: var(--green-d); }
.join-free svg { flex-shrink: 0; margin-top: 2px; }
.join-friend { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--green-t); font-size: 14px; }
.join-friend input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }

/* друзья */
.friend-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.friend { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); align-items: flex-start; }
.friend .avatar { width: 48px; height: 48px; flex-shrink: 0; font-size: 17px; }
.friend .avatar img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.friend .fr-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.friend .fr-name { font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.friend .fr-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.friend .fr-acts form { display: inline; }
.fr-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--green-word); background: var(--green-t); border-radius: 10px; padding: 1px 8px; width: fit-content; }
.friend-btn-note { font-size: 13px; color: var(--muted); }

/* «Клуб помощников» */
.club-post { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 6px; }
.club-post.staff { border-color: #B9DEC7; background: #FBFEFC; }

/* благодарность и «Благодарим» */
.thanks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.thanks-grid > div { display: flex; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }

@media (max-width: 760px) {
  .join-hero { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .join-hero > .stack { display: contents; }   /* на телефоне кнопка регистрации — сразу после заголовка */
  .join-card { position: static; order: 3; }
  .join-list { order: 4; }
  .medal-card { padding: 8px 12px 8px 8px; }
  .rank-ladder { grid-template-columns: 1fr 1fr; }
  .rank-ladder li { flex-direction: column; gap: 6px; }
  .ld-ribbon { width: 80px; height: 80px; }
  .ld-band { left: -9.45px; top: 16.95px; width: 118px; height: 27px; font-size: 8.5px; line-height: 9.5px; letter-spacing: .06em; }
  .ld-band svg { width: 10px; height: 10px; }
  .real-row { grid-template-columns: minmax(0, 1fr); }
  .real-wait { flex-wrap: wrap; }
}
