/* Tennison Rating Page — p8 (scoped, mainV2 shell) */
.p8-rating-page {
  --lime: #B7E000;
  --lime-dark: #6B8E00;
  --lime-light: #E8F5A3;
  --bg: #F4F5F6;
  --card: #FFFFFF;
  --text: #1F1F1F;
  --secondary: #6F6F6F;
  --muted: #A0A0A0;
  --up: #2D8A1F;
  --down: #C0392B;
  --border: #E8E8E8;
  --radius: 12px;
}
.p8-rating-page *,
.p8-rating-page *::before,
.p8-rating-page *::after { box-sizing: border-box; }

.p8-rating-page.mainV2__page--inner {
  padding-left: 0;
  padding-right: 0;
  max-width: none;
}

body.v2-page .p8-rating-page.mainV2__page--inner {
  padding-top: 4px;
}

@media (min-width: 991px) {
  body.v2-page .p8-rating-page.mainV2__page--inner {
    padding-top: 64px;
  }
}

.p8-rating-form-hidden,
.p8-rating-filter-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}
body.v2-page .p8-rating-page .p8-rating-form-hidden,
body.v2-page .p8-rating-page .p8-rating-form-hidden *,
body.v2-page .p8-rating-page .p8-rating-filter-hidden,
body.v2-page .p8-rating-page .p8-rating-filter-hidden * {
  visibility: hidden !important;
}

/* Фильтры — одна строка */
body.v2-page .p8-rating-page .mainV2__page-title.p8-rating-page-title {
  margin: 0 0 6px !important;
  font-size: 20px;
  line-height: 1.15;
}

@media (min-width: 991px) {
  body.v2-page .p8-rating-page .mainV2__page-title.p8-rating-page-title {
    font-size: 24px;
    margin-bottom: 8px !important;
  }
}

.p8-rating-page .p8-rating-filter-form {
  margin-bottom: 6px;
  overflow: visible;
}

body.v2-page .p8-rating-page form.mainV2__filter-form[name="rating_filter"] .p8-rating-filters-row {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 6px;
  margin-bottom: 8px;
  overflow: visible !important;
  padding-bottom: 0;
}

body.v2-page .p8-rating-page .p8-rating-filters-row::-webkit-scrollbar {
  display: none;
}

body.v2-page .p8-rating-page form.mainV2__filter-form .p8-rating-filters-row .mainV2__filter-field {
  display: flex !important;
  align-items: center;
  flex: 0 0 auto !important;
  width: auto !important;
  position: relative;
  min-width: 0;
}

.p8-rating-page .p8-rating-filters-row .mainV2__filter-group--sex,
.p8-rating-page .p8-rating-filters-row .p8-rating-filter-field--sex {
  flex-shrink: 0;
}

@media (min-width: 991px) {
  body.v2-page .p8-rating-page form.mainV2__filter-form[name="rating_filter"] .p8-rating-filters-row {
    gap: 8px;
    overflow: visible !important;
  }

  body.v2-page .p8-rating-page form.mainV2__filter-form .p8-rating-filters-row .mainV2__filter-field--search {
    flex: 0 1 150px !important;
    min-width: 110px;
    max-width: 170px;
  }

  body.v2-page .p8-rating-page form.mainV2__filter-form[name="rating_filter"] input.ratingSearch__input {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 auto !important;
  }

  .p8-rating-page .p8-rating-filters-row .p8-filter-dd {
    max-width: none;
    min-width: 92px;
  }

  .p8-rating-page .p8-rating-filters-row .p8-filter-dd--city {
    min-width: 100px;
    max-width: none;
  }
}

body.v2-page .p8-rating-page #rating_filter_sex label {
  padding: 4px 10px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
}

.p8-rating-page .p8-rating-filters-row .p8-rating-filter-search {
  flex: 1 1 88px;
  min-width: 72px;
  max-width: 150px;
  margin-left: 0;
}

body.v2-page .p8-rating-page form.mainV2__filter-form input.ratingSearch__input,
body.v2-page .p8-rating-page .p8-rating-filter-search .ratingSearch__input {
  width: 100% !important;
  max-width: none !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

.p8-rating-page .p8-filter-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  pointer-events: none !important;
}

.p8-rating-page .p8-filter-dd {
  position: relative;
  z-index: 1;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 128px;
}

.p8-rating-page .p8-filter-dd--city {
  max-width: 112px;
}

.p8-rating-page .p8-filter-dd:has(.p8-filter-dd-btn.is-open) {
  z-index: 130;
}

.p8-rating-page .p8-filter-dd-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 0.5px solid rgba(31, 31, 31, 0.12);
  background: var(--card, #fff);
  color: var(--secondary, #6F6F6F);
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.p8-rating-page .p8-filter-dd-btn.is-set {
  color: var(--text, #1F1F1F);
  font-weight: 600;
  border-color: rgba(31, 31, 31, 0.2);
}

.p8-rating-page .p8-filter-dd-btn.is-open {
  background: var(--bg, #F4F5F6);
  border-color: rgba(31, 31, 31, 0.2);
}

.p8-rating-page .p8-filter-dd-btn .ti-map-pin {
  font-size: 13px;
  flex-shrink: 0;
}

.p8-rating-page .p8-filter-dd-btn-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.p8-rating-page .p8-filter-dd-btn .ti-chevron-down {
  font-size: 13px;
  color: var(--muted, #A0A0A0);
  flex-shrink: 0;
  transition: transform 0.15s;
}

.p8-rating-page .p8-filter-dd-btn.is-open .ti-chevron-down {
  transform: rotate(180deg);
}

.p8-rating-page .p8-filter-dd-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(280px, 92vw);
  background: var(--card, #fff);
  border: 0.5px solid rgba(31, 31, 31, 0.1);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(31, 31, 31, 0.12);
  padding: 4px;
  z-index: 200;
}

.p8-rating-page .p8-filter-dd-menu[hidden] {
  display: none !important;
}

body.v2-page .p8-rating-page .p8-filter-dd-menu.is-ported.is-fixed {
  position: fixed !important;
  z-index: 10050 !important;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.p8-rating-page .p8-filter-dd-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text, #1F1F1F);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.p8-rating-page .p8-filter-dd-item:hover,
.p8-rating-page .p8-filter-dd-item.is-active {
  background: var(--bg, #F4F5F6);
}

.p8-rating-page .p8-filter-dd-item.is-active {
  font-weight: 600;
}

.p8-rating-page .p8-filter-dd-menu--sort-grouped {
  min-width: 200px;
}

.p8-rating-page .p8-filter-dd-section {
  padding: 8px 10px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted, #6F6F6F);
  text-transform: uppercase;
  letter-spacing: 0.35px;
  line-height: 1.2;
  pointer-events: none;
}

.p8-rating-page .p8-filter-dd-section:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid var(--border, #E8E8E8);
  padding-top: 10px;
}

.p8-rating-page .p8-filter-dd-menu--city {
  min-width: 220px;
}

.p8-rating-page .p8-filter-dd-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 0.5px solid rgba(31, 31, 31, 0.08);
}

.p8-rating-page .p8-filter-dd-search .ti-search {
  font-size: 14px;
  color: var(--muted, #A0A0A0);
}

.p8-rating-page .p8-filter-dd-search input {
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: var(--text, #1F1F1F);
  width: 100%;
  font-family: inherit;
}

.p8-rating-page .p8-filter-dd-list {
  max-height: min(240px, 40vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.p8-rating-page .p8-rating-filter-field--cat.is-my-category .p8-filter-dd-btn.is-set {
  border-color: var(--text) !important;
  font-weight: 600;
}

.p8-rating-page .fdrop-wrap {
  position: relative;
  display: inline-block;
}
.p8-rating-page .fdrop-wrap--cat {
  min-width: 118px;
}
.p8-rating-page .fdrop-wrap--cat .fdrop {
  min-width: 118px;
}
.p8-rating-page .fdrop-wrap select.p8-native-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 13px;
}

.p8-rating-page .p8-pagination {
  display: none;
}

.p8-rating-page .mbn-meta-item .down {
  color: var(--down);
}

.p8-rating-page .mover-ph--photo {
  overflow: hidden;
  padding: 0;
}

.p8-rating-page .mover-ph--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p8-rating-page .mover-row {
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
  padding: 5px 6px;
  margin-left: -6px;
  margin-right: -6px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.p8-rating-page .mover-row:hover {
  opacity: 1;
  background: var(--lime-light);
  border-radius: 8px;
}

.p8-rating-page .mover-row:last-child {
  margin-bottom: 0;
}


*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.p8-rating-page {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  padding-bottom: 80px;
}

/* ── PAGE ── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px 0; }

/* ── FILTERS ── */
.filters-header {
  background: var(--card); border-radius: var(--radius);
  padding: 16px 20px 14px; margin-bottom: 16px;
}
.filters-header--compact {
  padding: 4px 12px;
  margin-bottom: 6px;
  border-radius: 10px;
}
.frow-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.filters-header--compact .frow-main {
  min-height: 0;
}
.frow1 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.page-title {
  font-size: 18px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--text); flex-shrink: 0; margin-right: 0;
  line-height: 1.15;
}
.filters-header--compact .page-title {
  font-size: 15px;
  line-height: 1.1;
}
.fpills { display: flex; gap: 4px; flex-shrink: 0; }
.fdrop-wrap--city { flex-shrink: 0; }
.fdrop-wrap--cat-primary { flex-shrink: 0; max-width: 168px; }
.fdrop-wrap--cat-primary .fdrop {
  max-width: 100%;
}
.fdrop-wrap--cat-primary #p8CatLabel {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}
.fdrop--my-cat {
  border-color: var(--text);
  color: var(--text);
  font-weight: 600;
}
.fpill {
  padding: 5px 12px; border-radius: 20px; border: 1.5px solid var(--border);
  background: transparent; font-size: 12px; font-weight: 500; color: var(--secondary);
  cursor: pointer; font-family: inherit; white-space: nowrap; transition: all 0.15s;
  display: flex; align-items: center; gap: 5px;
  line-height: 1.2;
}
.filters-header--compact .fpill {
  padding: 3px 9px;
  font-size: 11px;
  border-width: 1px;
  border-radius: 16px;
}
.fpill:hover { border-color: #bbb; color: var(--text); }
.fpill.active { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.fpills-hint {
  font-size: 11px;
  color: var(--muted);
  margin: -2px 0 10px;
  line-height: 1.35;
}
.fsearch-top { position: relative; margin-left: auto; flex-shrink: 0; }
.fsearch-top input {
  background: var(--bg); border: 1.5px solid var(--border); border-radius: 20px;
  padding: 6px 12px 6px 28px; font-size: 12px; font-family: inherit;
  width: 160px; outline: none; color: var(--text);
  line-height: 1.2;
}
.filters-header--compact .fsearch-top input {
  width: 136px;
  padding: 3px 10px 3px 24px;
  font-size: 11px;
  border-width: 1px;
  border-radius: 16px;
}
.filters-header--compact .fsearch-top svg {
  width: 12px;
  height: 12px;
  left: 8px;
}
.fsearch-top input:focus { border-color: var(--lime); }
.fsearch-top input::placeholder { color: var(--muted); }
.fsearch-top svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.frow2 { display: flex; gap: 8px; }
.frow2--inline { gap: 4px; flex: 1 1 auto; min-width: 0; }
.fdrop {
  display: flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 20px; border: 1.5px solid var(--border); background: transparent;
  font-size: 12px; font-family: inherit; color: var(--text);
  cursor: pointer; white-space: nowrap; transition: border-color 0.15s; font-weight: 500;
  line-height: 1.2;
}
.filters-header--compact .fdrop {
  padding: 3px 8px;
  font-size: 11px;
  border-width: 1px;
  border-radius: 16px;
  gap: 3px;
}
.filters-header--compact .fdrop svg {
  width: 10px;
  height: 10px;
}
.fdrop:hover { border-color: #aaa; }
.fdrop:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.fdrop svg { color: var(--muted); flex-shrink: 0; }

/* ── LAYOUT ── */
.p8-rating-page .page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
}

.p8-rating-page .main-col {
  min-width: 0;
}

.p8-rating-page .side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 72px;
  align-self: start;
}

.p8-rating-page .side-empty {
  font-size: 13px;
  color: var(--secondary);
  line-height: 1.4;
  padding: 2px 0 4px;
}

.p8-rating-page .p8-empty-action {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.p8-rating-page .p8-empty-action:hover {
  border-color: var(--lime-dark);
  background: var(--lime-light);
}

.p8-rating-page .p8-movers-mobile {
  display: none;
}

.p8-rating-page .p8-movers-desktop {
  display: block;
}

.p8-rating-page .p8-movers-card {
  padding: 12px 14px;
}

.p8-rating-page .p8-movers-card-title {
  margin-bottom: 8px;
}

.p8-rating-page .p8-movers-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.p8-rating-page .p8-movers-block + .p8-movers-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.p8-rating-page .p8-movers-block-lbl {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.p8-rating-page .p8-movers-block-lbl--up {
  color: var(--up);
}

.p8-rating-page .p8-movers-block-lbl--down {
  color: var(--down);
}

.p8-rating-page .p8-movers-stable {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  padding: 2px 0;
}

.p8-rating-page .p8-movers-block .mover-row {
  margin-bottom: 6px;
}

.p8-rating-page .p8-movers-block .mover-row:last-child {
  margin-bottom: 0;
}

.p8-rating-page .player-mobile-meta {
  display: none;
}

.p8-rating-page .p8-search-banner {
  font-size: 11px;
  color: var(--secondary);
  margin: -4px 0 12px;
  line-height: 1.2;
}

/* ── TABLE TOPBAR ── */
.table-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.table-topbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.2;
  min-width: 0;
}
.p8-rating-page .p8-rating-share-bar {
  margin-bottom: 8px;
}

/* P8: закреплённая строка «я» — та же tgrid, что у таблицы */
.p8-rating-page .p8-my-pin {
  border-left: 3px solid var(--lime);
  background: #FAFFF0;
  border-bottom: 1px solid var(--border);
}

.p8-rating-page .p8-my-pin .player-row.me {
  outline: none;
  border-bottom: none;
  background: transparent;
  position: static;
  z-index: auto;
}

.p8-rating-page .p8-my-pin .player-row.me:hover {
  background: #F4FCE3;
}

.p8-rating-page .p8-my-pin .p8-my-pin-steps {
  padding: 8px 16px 10px;
  border-top: 1px solid var(--border);
  background: transparent;
}

.p8-rating-page .p8-my-banner-block {
  width: 100%;
}

.p8-rating-page .p8-my-banner-block--has-banner {
  position: relative;
  background: var(--card);
  border-left: 3px solid var(--lime);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
}

.p8-rating-page .p8-my-banner-block--has-banner .my-banner--p8 {
  margin-bottom: 0;
  border-left: none;
  border-radius: 0;
  background: transparent;
}

.p8-rating-page .p8-my-banner-block--has-banner .p8-rating-share-bar {
  margin-bottom: 0;
  padding: 8px 16px 10px;
  border-top: 1px solid var(--border);
}

.p8-rating-page .p8-my-banner-block--has-banner .p8-rating-share-bar .btn-share {
  padding: 6px 12px;
  font-size: 12px;
}

@media (min-width: 901px) {
  .p8-rating-page .p8-my-banner-block--has-banner .p8-rating-share-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .p8-rating-page .p8-my-banner-block--has-banner .p8-rating-share-bar .table-topbar-label {
    display: block;
  }
}

.p8-rating-page .p8-my-banner-block:not(.p8-my-banner-block--has-banner) .p8-rating-share-bar {
  margin-bottom: 8px;
}

.btn-share {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: var(--card); font-size: 13px; font-weight: 500; color: var(--secondary);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.btn-share--compact {
  padding: 6px 12px;
  font-size: 12px;
}
.btn-share:hover { border-color: var(--lime-dark); color: var(--lime-dark); }
.btn-share.copied { border-color: var(--up); color: var(--up); }

.p8-rating-page .p8-rating-filter-field--sort .p8-filter-dd {
  min-width: 72px;
  max-width: 88px;
}

.p8-rating-page .p8-rating-filter-field--sort .p8-filter-dd-btn-text {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── MY BANNER ── */
.my-banner {
  background: var(--card); border-radius: 10px;
  border-left: 3px solid var(--lime);
  padding: 10px 14px; margin-bottom: 8px;
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(0, max-content) 1fr;
  grid-template-rows: auto auto;
  gap: 4px 14px; align-items: center;
}
.my-banner--has-overall {
  grid-template-rows: auto auto auto;
}
.my-banner--has-overall .mbn-rank {
  grid-row: 1;
}
.my-banner--has-overall .mbn-steps-wrap {
  grid-row: 3;
}
.mbn-rank {
  grid-column: 1; grid-row: 1;
  font-size: 24px; font-weight: 700; color: var(--text);
  line-height: 1; padding-right: 12px;
  border-right: 1px solid var(--border); align-self: center;
}
.mbn-name {
  grid-column: 2; grid-row: 1;
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.25;
  min-width: 0;
}
.mbn-meta {
  grid-column: 3; grid-row: 1;
  display: flex; align-items: center; flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px 14px;
  text-align: left;
  justify-self: start;
}
.mbn-meta-item { font-size: 11px; color: var(--secondary); }
.mbn-meta-item strong { color: var(--text); font-weight: 600; }
.mbn-meta-item .up { color: var(--up); }
.mbn-meta-item .down { color: var(--down); }

/* P8: баннер «я» — та же tgrid, что у строк таблицы */
.p8-rating-page .my-banner--p8 {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  background: var(--card);
  border-radius: 10px;
  border-left: 3px solid var(--lime);
  overflow: hidden;
}

.p8-rating-page .p8-my-banner-block--has-banner .my-banner--p8 {
  margin-bottom: 0;
}

.p8-rating-page .my-banner--p8 .my-banner-row {
  border: none;
  outline: none;
  cursor: default;
  background: transparent;
}

.p8-rating-page .my-banner--p8 .my-banner-row:hover,
.p8-rating-page .my-banner--p8 .player-row.me,
.p8-rating-page .my-banner--p8 .player-row.me:hover {
  background: transparent;
  outline: none;
}

.p8-rating-page .my-banner--p8 .col-player--banner {
  gap: 0;
}

.p8-rating-page .my-banner--p8 .col-rank {
  font-size: 24px;
  font-weight: 700;
}

.p8-rating-page .my-banner--p8 .col-rank .rank-num {
  font-size: inherit;
  display: inline;
}

.p8-rating-page .my-banner--p8 .mbn-steps-wrap {
  grid-column: auto;
  grid-row: auto;
  margin-top: 0;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--border);
}

.p8-rating-page .my-banner--cat-place .tgrid {
  grid-template-columns: 72px 1fr 90px 96px 72px;
}

.mbn-overall {
  grid-column: 2 / 4;
  grid-row: 2;
  padding-top: 2px;
}
.mbn-overall-bridge {
  font-size: 11px;
  color: var(--secondary);
  line-height: 1.3;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px;
}
.mbn-overall-cat {
  font-weight: 600;
  color: var(--text);
}
.mbn-overall-arrow {
  color: var(--muted);
  font-weight: 400;
}
.mbn-overall-bridge strong {
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
}
.mbn-overall-of {
  color: var(--secondary);
}
.mbn-overall-city strong {
  color: var(--text);
  font-weight: 700;
}
.mbn-overall-weighted {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.mbn-goals-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #2d8a4e);
  text-decoration: none;
}
.mbn-goals-link:hover {
  text-decoration: underline;
}
.mbn-goals-link--inline {
  margin-top: 0;
  margin-left: 4px;
}

/* ── «Среди любителей» — горизонтальная шкала под таблицей ── */
.p8-amateur-ladder {
  max-width: 1200px;
  margin: 16px auto 12px;
  padding: 16px 16px 14px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(31, 31, 31, 0.07);
}
.p8-al-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.p8-al-top-text {
  flex: 1;
  min-width: 0;
}
.p8-al-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.p8-al-summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--secondary);
}
.p8-al-rank {
  flex-shrink: 0;
  text-align: right;
  line-height: 1.1;
}
.p8-al-rank-num {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.p8-al-rank-of {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.p8-al-track-block {
  margin-bottom: 14px;
  padding: 0 2px 22px;
}
.p8-al-track-ends {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.p8-al-end {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.p8-al-end--high {
  color: #4A6600;
}
.p8-al-track {
  position: relative;
  height: 10px;
  background: #E8E8E8;
  border-radius: 5px;
  overflow: visible;
}
.p8-al-track-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, #C5E026 0%, var(--lime) 100%);
  border-radius: 5px;
  transition: width 0.3s ease;
}
.p8-al-tick {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  border-radius: 1px;
  transform: translateX(-50%);
  z-index: 1;
}
.p8-al-tick--passed {
  background: #bbb;
}
.p8-al-tick--goal {
  background: var(--lime-dark);
  box-shadow: 0 0 0 2px rgba(184, 233, 46, 0.35);
}
.p8-al-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 0;
}
.p8-al-pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lime);
  border: 3px solid var(--text);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.p8-al-pin-bubble {
  margin-top: 6px;
  padding: 3px 8px;
  background: var(--text);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  white-space: nowrap;
  line-height: 1.2;
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
}

.p8-al-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.p8-al-card {
  flex: 1 1 120px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.p8-al-card-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.p8-al-card-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.3;
}
.p8-al-card--behind {
  background: #F5F5F5;
}
.p8-al-card--done {
  background: #F0F7D4;
  border-color: rgba(184, 233, 46, 0.45);
}
.p8-al-card--done .p8-al-card-val {
  color: #4A6600;
}
.p8-al-card--next {
  background: #FAFFF0;
  border-color: var(--lime-dark);
}
.p8-al-card--next .p8-al-card-val {
  color: #4A6600;
}

.p8-al-details {
  margin-top: 12px;
  font-size: 11px;
  color: var(--muted);
}
.p8-al-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--secondary);
  user-select: none;
}
.p8-al-details-body {
  margin: 8px 0 0;
  line-height: 1.45;
}

/* ── «Мои цели» — два блока внизу рейтинга ── */
.p8-goals-section {
  margin: 20px 0 8px;
  padding-bottom: 4px;
}
.p8-goals-heading {
  margin: 0 0 12px;
  padding: 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.2px;
}
.p8-goals-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 4px;
}
.p8-goals-heading-row .p8-goals-heading {
  margin: 0;
  padding: 0;
}
.p8-goals-page-link {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--lime-dark);
  text-decoration: none;
}
.p8-goals-page-link:hover {
  color: var(--text);
}
.p8-goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.p8-goal-card {
  padding: 16px 16px 14px;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(31, 31, 31, 0.07);
}
.p8-goal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.p8-goal-head-text {
  flex: 1;
  min-width: 0;
}
.p8-goal-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.p8-goal-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--secondary);
}
.p8-goal-rank {
  flex-shrink: 0;
  text-align: right;
  line-height: 1.1;
}
.p8-goal-rank-num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
}
.p8-goal-rank-of {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.p8-goal-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.p8-goal-picker-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.p8-goal-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.p8-goal-chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.p8-goal-chip:hover {
  border-color: #bbb;
}
.p8-goal-chip.is-active {
  border-color: #4A6600;
  background: #F4FBE0;
  color: #3D5500;
}
.p8-goal-motivation {
  margin: 0 0 12px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
}
.p8-goal-motivation--far {
  background: #FFF0EE;
  color: #9E3B2E;
}
.p8-goal-motivation--mid,
.p8-goal-motivation--behind {
  background: #FFF8E6;
  color: #8A6200;
}
.p8-goal-motivation--warm,
.p8-goal-motivation--on_track {
  background: #F6FCE8;
  color: #4A6600;
}
.p8-goal-motivation--close,
.p8-goal-motivation--ahead,
.p8-goal-motivation--elite {
  background: #EEF8E4;
  color: #3A5800;
}
.p8-goal-motivation--done {
  background: #E4F5D4;
  color: #2E5E00;
  font-weight: 600;
}
.p8-goal-track-block {
  margin-bottom: 12px;
  padding: 0 2px 20px;
}
.p8-goal-track-ends {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}
.p8-goal-end {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.p8-goal-end--high {
  color: #4A6600;
}
.p8-goal-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  overflow: visible;
}
.p8-goal-track-base {
  position: absolute;
  inset: 0;
  background: #E8E8E8;
  border-radius: 5px;
}
.p8-goal-track-segment {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 5px;
  opacity: 0.22;
  z-index: 1;
}
.p8-goal-track-segment.p8-goal-motivation--far { background: #E85D4A; }
.p8-goal-track-segment.p8-goal-motivation--mid { background: #F0B429; }
.p8-goal-track-segment.p8-goal-motivation--warm { background: #C5E026; }
.p8-goal-track-segment.p8-goal-motivation--close,
.p8-goal-track-segment.p8-goal-motivation--elite { background: #7CB342; }
.p8-goal-track-segment.p8-goal-motivation--done { background: #4CAF00; }
.p8-goal-track-fill {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 5px;
  z-index: 2;
  transition: width 0.3s ease, left 0.3s ease, background 0.25s ease;
}
.p8-goal-track-fill.p8-goal-motivation--far { background: linear-gradient(90deg, #F09585, #E85D4A); }
.p8-goal-track-fill.p8-goal-motivation--mid { background: linear-gradient(90deg, #FFD56A, #F0B429); }
.p8-goal-track-fill.p8-goal-motivation--warm { background: linear-gradient(90deg, #D8EA6A, #C5E026); }
.p8-goal-track-fill.p8-goal-motivation--close,
.p8-goal-track-fill.p8-goal-motivation--on_track,
.p8-goal-track-fill.p8-goal-motivation--ahead,
.p8-goal-track-fill.p8-goal-motivation--elite { background: linear-gradient(90deg, #9CCC65, #7CB342); }
.p8-goal-track-fill.p8-goal-motivation--done { background: linear-gradient(90deg, #66BB6A, #43A047); }
.p8-goal-track-fill--games.p8-goal-motivation--behind { background: linear-gradient(90deg, #FFD56A, #F0B429); }
.p8-goal-track-fill--games.p8-goal-motivation--far { background: linear-gradient(90deg, #F09585, #E85D4A); }
.p8-goal-tick {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  border-radius: 1px;
  transform: translateX(-50%);
  z-index: 3;
  background: #bbb;
}
.p8-goal-tick--passed { background: #ccc; }
.p8-goal-tick--goal {
  width: 3px;
  background: #4A6600;
  box-shadow: 0 0 0 2px rgba(197, 224, 38, 0.35);
}
.p8-goal-tick--pace {
  background: transparent;
  height: 14px;
  top: -2px;
  border-left: 2px dashed #888;
  width: 0;
}
.p8-goal-tick--future { background: #d5d5d5; }
.p8-goal-pin {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.p8-goal-pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1F1F1F;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.p8-goal-pin-bubble {
  position: absolute;
  top: 16px;
  white-space: nowrap;
  background: #1F1F1F;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
}
.p8-goal-track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}
.p8-goal-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.p8-goal-mini {
  flex: 1 1 calc(33% - 8px);
  min-width: 88px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #F5F5F5;
  border: 1px solid var(--border);
}
.p8-goal-mini-val {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.p8-goal-mini-lbl {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
}
.p8-goal-mini--behind { background: #F5F5F5; }
.p8-goal-mini--passed {
  background: #FAFAFA;
  border-color: #E0E0E0;
}
.p8-goal-mini--passed .p8-goal-mini-val { color: var(--muted); }
.p8-goal-mini--goal {
  background: #F4FBE0;
  border-color: #C5E026;
}
.p8-goal-mini--goal .p8-goal-mini-val { color: #4A6600; }
.p8-goal-track-segment--context {
  position: absolute;
  top: 0;
  height: 100%;
  border-radius: 5px;
  background: rgba(197, 224, 38, 0.18);
  border: 1px solid rgba(74, 102, 0, 0.2);
  z-index: 1;
  pointer-events: none;
}
.p8-goal-track--context {
  margin-bottom: 10px;
}
.p8-goal-segment-rail {
  margin-top: 2px;
  padding-top: 2px;
}
.p8-goal-segment-rail-ends {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--secondary);
}
.p8-goal-segment-rail-track {
  position: relative;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}
.p8-goal-segment-rail-base {
  position: absolute;
  inset: 0;
  background: #ECECEC;
  border-radius: 6px;
}
.p8-goal-segment-rail-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  border-radius: 6px;
  transition: width 0.35s ease, background 0.25s ease;
  min-width: 4px;
}
.p8-goal-segment-rail-fill.p8-goal-motivation--far { background: linear-gradient(90deg, #F09585, #E85D4A); }
.p8-goal-segment-rail-fill.p8-goal-motivation--mid { background: linear-gradient(90deg, #FFD56A, #F0B429); }
.p8-goal-segment-rail-fill.p8-goal-motivation--warm { background: linear-gradient(90deg, #D8EA6A, #C5E026); }
.p8-goal-segment-rail-fill.p8-goal-motivation--close,
.p8-goal-segment-rail-fill.p8-goal-motivation--on_track,
.p8-goal-segment-rail-fill.p8-goal-motivation--ahead,
.p8-goal-segment-rail-fill.p8-goal-motivation--elite { background: linear-gradient(90deg, #9CCC65, #7CB342); }
.p8-goal-segment-rail-fill.p8-goal-motivation--done { background: linear-gradient(90deg, #66BB6A, #43A047); }
.p8-goal-segment-rail-pct {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}
.p8-goal-cards--rank .p8-goal-mini {
  flex: 1 1 calc(20% - 8px);
  min-width: 72px;
}

/* ── Соперники (дуэли): setup / tracking ── */
.p8-my-goals-page,
#p8RivalsPicker {
  --tm-lime: #B7E000;
  --tm-lime-dark: #6B8E00;
  --tm-bg: #F4F5F6;
  --tm-card: #FFFFFF;
  --tm-text: #1F1F1F;
  --tm-secondary: #6F6F6F;
  --tm-up: #2D8A1F;
  --tm-down: #C0392B;
  --tm-border: #E8E8E8;
  --tm-radius: 12px;
}

.p8-goal-card--rivals {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.p8-rivals-setup,
.p8-rivals-tracking {
  margin: 0;
}
.p8-rivals-setup[hidden],
.p8-rivals-tracking[hidden] {
  display: none !important;
}
.p8-rivals-draft-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}
.p8-rivals-draft-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
}
.p8-rivals-draft-progress {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.p8-rivals-slot-list {
  margin: 0 0 10px !important;
}
.p8-rivals-slot-list .tm-slot.is-next {
  border-color: #e8d44a;
  background: #fffef5;
}
.p8-rivals-setup-hint {
  margin: 0 0 10px !important;
}
.p8-rivals-setup-done {
  margin-top: 4px;
}
.p8-rivals-edit-roster {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
  font-family: inherit;
}
.p8-rivals-edit-roster:hover {
  background: #F5F5F5;
}
.p8-rivals-progress {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}
.p8-rivals-progress[hidden] {
  display: none !important;
}
.p8-rivals-progress__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.p8-rivals-progress__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.p8-rivals-progress__pct {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
}
.p8-rivals-progress__track {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: #ececec;
  overflow: hidden;
}
.p8-rivals-progress__track-wrap {
  position: relative;
  margin-top: 2px;
  padding-top: 6px;
  padding-bottom: 2px;
}
.p8-rivals-progress__runner {
  position: absolute;
  top: 0;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #c5de8e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: left .25s ease, background .25s ease;
}
.p8-rivals-progress__runner--far { background: #E85D4A; }
.p8-rivals-progress__runner--behind,
.p8-rivals-progress__runner--mid { background: #F0B429; }
.p8-rivals-progress__runner--warm,
.p8-rivals-progress__runner--on_track,
.p8-rivals-progress__runner--ahead { background: #C5E026; }
.p8-rivals-progress__runner--done { background: #43A047; }
.p8-rivals-progress__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width .25s ease;
}
.p8-rivals-progress__hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--secondary);
}
.p8-rivals-track-list {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.p8-rivals-track-empty {
  padding: 10px 8px;
  font-size: 12px;
  color: var(--secondary);
  text-align: center;
}
.p8-rivals-track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}
.p8-rivals-track-item--h2h-ahead {
  background: #f3faf0;
  border-color: #d7ebc9;
}
.p8-rivals-track-item--h2h-behind {
  background: #fdf3f3;
  border-color: #f0d0d0;
}
.p8-rivals-track-item--h2h-even {
  background: #faf9f3;
  border-color: #ebe4cf;
}
.p8-rivals-track-item--beaten {
  border-color: #c5de8e;
  box-shadow: inset 0 0 0 1px rgba(107, 143, 0, 0.08);
}
.p8-rivals-track-item__avatar {
  flex-shrink: 0;
  text-decoration: none;
  color: inherit;
}
.p8-rivals-track-item__avatar .tm-avatar {
  border-radius: 50%;
  background: var(--bg, #f0f0f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--secondary, #6f6f6f);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.p8-rivals-track-item__avatar .tm-avatar.has-photo {
  color: transparent;
}
.p8-rivals-avatar--track,
.p8-rivals-track-item__avatar .tm-avatar.p8-rivals-avatar--track {
  width: 42px;
  height: 42px;
  font-size: 13px;
  border-radius: 50%;
}
.p8-rivals-track-item__body {
  flex: 1;
  min-width: 0;
}
.p8-rivals-track-item__sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--secondary);
}
.p8-rivals-track-item--h2h-ahead .p8-rivals-h2h,
.p8-rivals-track-item--h2h-ahead .p8-rivals-h2h--link {
  color: #4a7a28;
}
.p8-rivals-track-item--h2h-behind .p8-rivals-h2h,
.p8-rivals-track-item--h2h-behind .p8-rivals-h2h--link {
  color: #b44a4a;
}
.p8-rivals-h2h {
  font-weight: 600;
  color: var(--secondary);
}
.p8-rivals-h2h--link {
  color: inherit;
  text-decoration: none;
}
.p8-rivals-h2h--link:hover {
  text-decoration: underline;
}
.p8-rivals-h2h--none {
  color: var(--muted);
  font-weight: 500;
}
.p8-rivals-track-item__name {
  display: block;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  line-height: 1.25;
}
.p8-rivals-track-item__lastname {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p8-rivals-track-item__firstname {
  display: block;
  margin-top: 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.p8-rivals-track-item--beaten .p8-rivals-track-item__lastname {
  color: #4a6600;
}
.p8-rivals-track-item__goal {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  order: -1;
}
.p8-rivals-track-item__goal-ring {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid #d4d4d4;
  border-radius: 50%;
  background: #fff;
  box-sizing: border-box;
}
.p8-rivals-track-item__goal.is-pending .p8-rivals-track-item__goal-ring {
  border-color: #cfcfcf;
  background: #fff;
}
.p8-rivals-track-item__goal.is-done .p8-rivals-track-item__goal-ring {
  border-color: #7cb342;
  background: #7cb342;
}
.p8-rivals-track-item__goal-check {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}
.p8-rivals-track-item__remove {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.p8-rivals-track-item__remove:hover {
  background: #f5f5f5;
  color: #b44a4a;
}
.p8-rivals-add-player {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px dashed #c5de8e;
  border-radius: 8px;
  background: #fbfef5;
  color: #4a6600;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.p8-rivals-add-player:hover {
  background: #f4fbe0;
}
.p8-rivals-add-player[hidden] {
  display: none !important;
}
.p8-rivals-edit-roster[hidden] {
  display: none !important;
}

.p8-rivals-remove-confirm__sheet {
  max-width: 360px;
  margin: 0 auto;
  padding: 20px 16px 16px;
  text-align: center;
}

.p8-rivals-remove-confirm__title {
  margin: 0 0 8px;
  font-size: 18px;
}

.p8-rivals-remove-confirm__text {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--secondary);
}

.p8-rivals-remove-confirm__actions {
  display: flex;
  gap: 10px;
}

.p8-rivals-remove-confirm__actions .tm-btn {
  flex: 1 1 0;
}

.p8-rivals-roster-meta {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--secondary, #6f6f6f);
}

.p8-rivals-roster-meta--warn {
  color: #8a6200;
}

.p8-rivals-roster-meta[hidden] {
  display: none !important;
}

.p8-rivals-roster-hint {
  margin: 0 0 10px !important;
}

.p8-rivals-roster-hint[hidden] {
  display: none !important;
}

.p8-mg-lite-card:not(.is-collapsed) .p8-mg-lite-card-config[data-p8-lite-config="rivals"] {
  display: none;
}

.p8-rivals-roster {
  margin-top: 4px;
}
.p8-rivals-picker-footer {
  flex-shrink: 0;
  padding: 10px 0 4px;
  border-top: 1px solid var(--tm-border, #e8e8e8);
  margin-top: 4px;
}
.p8-rivals-picker-footer[hidden] {
  display: none !important;
}
.p8-mg-lite-card--rivals-draft .p8-mg-lite-card-badge,
.p8-mg-lite-card--rivals-setup .p8-mg-lite-card-badge {
  color: #6B5B00;
}
#p8RivalsPicker.tm-picker {
  z-index: 1300;
}
#p8RivalsRemoveConfirm.tm-picker {
  z-index: 1310;
}

/* Лайт «Мои цели»: прогресс только в шапке карточки, не дублируем в теле */
.p8-my-goals-page--lite #p8RivalsProgress {
  display: none !important;
}
.p8-mg-lite-card .p8-mg-lite-card-body {
  overflow: visible;
}

.p8-rivals-inactive-hint {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  line-height: 1.35;
}
.p8-rivals-cat-tag {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef6d6;
  color: #4a6600;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.p8-rivals-setup-done:not([hidden]) {
  animation: p8-rivals-pulse 1.6s ease-in-out infinite;
}
@keyframes p8-rivals-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(183, 224, 0, 0.45); }
  50% { box-shadow: 0 0 0 4px rgba(183, 224, 0, 0.15); }
}

.p8-rivals-picker-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.p8-rivals-select {
  flex: 1 1 160px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}
.p8-rivals-btn {
  border: 1px solid #4A6600;
  background: #F4FBE0;
  color: #3D5500;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.p8-rivals-btn--ghost {
  border-color: var(--border);
  background: #fff;
  color: var(--secondary);
  font-weight: 600;
}
.p8-goal-segment-rail-track--rivals {
  position: relative;
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}

.p8-goal-details {
  margin-top: 10px;
  font-size: 12px;
  color: var(--secondary);
}
.p8-goal-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}
.p8-goal-details-body {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
}

/* ── Ступени рейтинга (баннер «я») ── */
.mbn-steps-wrap {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  max-width: none;
  width: 100%;
  align-self: stretch;
  padding-left: 0;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.mbn-steps {
  display: flex;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
}
.mbn-step {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
}
@media (min-width: 901px) {
  .mbn-steps-wrap {
    margin-top: 6px;
    padding-top: 10px;
  }
  .mbn-step {
    width: 44px;
  }
  .mbn-step-node-wrap {
    height: 28px;
  }
  .mbn-step-node {
    width: 14px;
    height: 14px;
  }
  .mbn-step-node--current {
    width: 28px;
    height: 28px;
  }
  .mbn-step-node-num {
    font-size: 12px;
  }
  .mbn-step-conn {
    min-width: 28px;
    height: 3px;
    margin-top: 13px;
  }
  .mbn-step-label {
    font-size: 10px;
  }
  .mbn-step-delta {
    font-size: 9px;
  }
}
.mbn-step-node-wrap {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mbn-step-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card);
  box-sizing: border-box;
  flex-shrink: 0;
}
.mbn-step-node--current {
  width: 22px;
  height: 22px;
  border: none;
  background: var(--lime);
  display: flex;
  align-items: center;
  justify-content: center;
}
.mbn-step-node-num {
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.mbn-step-node--next {
  border-color: var(--lime-dark);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(184, 233, 46, 0.3);
}
.mbn-step-node--future {
  border-color: #ddd;
  background: var(--bg);
}
.mbn-step-node--podium.mbn-step-node--next {
  border-color: #C8960C;
  box-shadow: 0 0 0 2px rgba(200, 150, 12, 0.22);
}
.mbn-step-node--podium.mbn-step-node--future {
  border-color: #d4b44a;
}
.mbn-step-label--podium { color: #9A7B0A; }
.mbn-step-delta--podium { color: #C8960C; }
.mbn-step-conn {
  flex: 1 1 auto;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  margin-top: 11px;
  min-width: 16px;
  position: relative;
  overflow: hidden;
}
.mbn-step-conn-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--lime);
  border-radius: 1px;
}
.mbn-step-label {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 600;
  color: var(--secondary);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}
.mbn-step-label--current { color: var(--text); }
.mbn-step-delta {
  margin-top: 2px;
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
}
.mbn-step-delta--next { color: var(--lime-dark); font-size: 9px; font-weight: 700; }
.mbn-step-delta--muted { font-weight: 500; font-size: 9px; }

/* ── TABLE — 5 колонок ── */
.rating-table {
  background: var(--card);
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
}
.rating-table #p8RatingRows {
  overflow: visible;
  border-radius: 0 0 var(--radius) var(--radius);
}
.rating-table--cat-place .tgrid {
  grid-template-columns: 72px 1fr 90px 96px 72px;
}
.rating-table--no-tours .tgrid {
  grid-template-columns: 48px 1fr 90px 72px;
}
.rating-table--no-tours.rating-table--cat-place .tgrid {
  grid-template-columns: 72px 1fr 90px 72px;
}
.rating-table--share .table-header { padding-right: 42px; }
.p8-table-share {
  position: absolute;
  top: 7px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--secondary);
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.p8-table-share:hover,
.p8-table-share:focus-visible {
  background: var(--bg);
  color: var(--text);
}
.p8-table-share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.p8-table-share-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.p8-table-share-tip {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  background: var(--text);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
}
.p8-table-share-tip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 8px;
  border: 4px solid transparent;
  border-bottom-color: var(--text);
}
.p8-table-share:hover .p8-table-share-tip,
.p8-table-share:focus-visible .p8-table-share-tip {
  display: block;
}
.tgrid { display: grid; grid-template-columns: 48px 1fr 90px 96px 72px; }

.table-header {
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg); align-items: end;
  position: relative;
  z-index: 3;
  border-radius: var(--radius) var(--radius) 0 0;
}
.th { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.th.right  { text-align: right; }
.th.center { text-align: center; }
.th-sub { font-size: 10px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; display: block; margin-top: 1px; opacity: 0.75; }
.th-help { display: inline-flex; align-items: center; gap: 4px; cursor: help; position: relative; max-width: 100%; }
.th-help-icon {
  width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--muted);
  color: var(--muted); font-size: 8px; font-weight: 700; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.th-tooltip {
  display: none; position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%); background: var(--text); color: #fff;
  font-size: 11px; font-weight: 400; text-transform: none; letter-spacing: 0;
  padding: 6px 10px; border-radius: 6px; white-space: nowrap; z-index: 100;
  pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.th-tooltip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--text);
}
.table-header .th-tooltip {
  bottom: auto;
  top: calc(100% + 8px);
}
.table-header .th-tooltip::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--text);
}
.th-help:hover .th-tooltip { display: block; }

.player-row {
  padding: 11px 16px; align-items: center;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s; cursor: pointer;
}
.player-row:last-child { border-bottom: none; }
.player-row:hover { background: #FAFAFA; }
.player-row.me {
  background: #FAFFF0;
  outline: 2px solid var(--lime); outline-offset: -2px;
  border-bottom: none; position: relative; z-index: 1;
}
.player-row.me:hover { background: #F4FCE3; }

.col-rank { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.rank-num        { display: block; font-size: 17px; }
.rank-num.gold   { color: #C8960C; }
.rank-num.silver { color: #7A7A7A; }
.rank-num.bronze { color: #9A5C2E; }
.rank-change { font-size: 10px; font-weight: 500; display: block; margin-top: 2px; }
.rank-up   { color: var(--up); }
.rank-down { color: var(--down); }
.rank-same { color: var(--muted); }

.col-player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.col-player-body { min-width: 0; flex: 1; }
.player-photo { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
.player-photo img { width: 100%; height: 100%; object-fit: cover; }
.player-ph {
  width: 36px; height: 36px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; color: var(--secondary); flex-shrink: 0;
}
.player-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-name-link { color: inherit; text-decoration: none; }
.player-name-link:hover { text-decoration: underline; }
.player-cat  { font-size: 11px; color: var(--muted); margin-top: 1px; }
.badge-me {
  display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 4px;
  background: var(--lime-dark); color: #fff; font-size: 10px; font-weight: 600; vertical-align: middle;
}

.p8-rating-page .badge-series {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--lime-light);
  color: var(--lime-dark);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

.p8-rating-page .col-rank--cat {
  cursor: help;
}

.col-us { text-align: right; }
.us-val   { font-size: 14px; font-weight: 600; }
.us-delta { font-size: 11px; font-weight: 500; display: block; }

.col-tours { text-align: center; min-width: 0; }
.tours-frac-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  line-height: 1.2;
  white-space: nowrap;
}
.tours-frac {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.tours-frac--full {
  color: var(--secondary);
}
.tours-frac--open {
  font-weight: 700;
  color: var(--text);
}
.tours-frac--empty {
  color: var(--muted);
}
.tours-frac-badge {
  font-size: 10px;
  font-weight: 700;
  color: #4A6600;
  background: rgba(183, 224, 0, 0.28);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.35;
  cursor: help;
  white-space: nowrap;
}
.tours-mobile-open {
  color: var(--lime-dark);
  font-weight: 600;
}
.p8-rating-page .tours-frac-wrap.p8-tip-wrap { cursor: help; }

/* Подсказки при наведении (кружки, дробь, movers) */
.p8-rating-page .p8-tip-wrap {
  position: relative;
  cursor: help;
  outline: none;
}
.p8-rating-page .p8-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.p8-rating-page .p8-tip--wide { white-space: normal; width: 210px; text-align: center; }
.p8-rating-page .p8-tip--tours {
  width: min(260px, 72vw);
  text-align: left;
  left: auto;
  right: 0;
  transform: none;
  z-index: 40;
  line-height: 1.4;
}
.p8-rating-page .p8-tip--tours::after {
  left: auto;
  right: 18px;
  transform: none;
}
.p8-rating-page .col-tours .p8-tip-wrap {
  overflow: visible;
}
.p8-rating-page .p8-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}
.p8-rating-page .p8-tip-wrap:hover .p8-tip,
.p8-rating-page .p8-tip-wrap:focus .p8-tip {
  display: block;
}

.p8-rating-page .mover-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.p8-rating-page .mover-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.p8-rating-page .mover-delta {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.p8-rating-page .side-card-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.p8-rating-page .p8-movers-hint {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--muted);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  flex-shrink: 0;
  line-height: 1;
}

.col-points { text-align: right; }
.pts-val { font-size: 15px; font-weight: 700; }
.pts-val--empty { font-weight: 500; color: var(--muted); }
.pts-sub { font-size: 10px; color: var(--muted); font-weight: 400; display: block; }

/* section-label — тонкий, не рвёт таблицу */
.section-label {
  padding: 5px 16px; background: var(--bg);
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.6px; color: var(--muted);
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
.section-label:first-child { border-top: none; }

.load-more { display: flex; justify-content: center; padding: 14px; border-top: 1px solid var(--border); }
.load-more button {
  background: none; border: 1.5px solid var(--border); border-radius: 8px;
  padding: 7px 20px; font-size: 13px; font-weight: 500; color: var(--secondary);
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.load-more button:hover { border-color: var(--text); color: var(--text); }
.load-more button:disabled { opacity: 0.6; cursor: wait; }

.btn-download:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-download:disabled:hover {
  border-color: var(--border);
  color: var(--secondary);
}

/* ── SIDEBAR ── */
.side-card { background: var(--card); border-radius: var(--radius); padding: 16px; overflow: visible; position: relative; z-index: 1; }
.side-card-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px;
}

/* Достижения + сезон — единый блок */
.achievements-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.ach-card { background: var(--bg); border-radius: 8px; padding: 10px 8px; text-align: center; }
.ach-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 6px; }
.ach-val { font-size: 26px; font-weight: 700; line-height: 1; color: var(--muted); }
.ach-val.nonzero { color: var(--lime-dark); }

.side-divider { height: 1px; background: var(--border); margin: 0 0 14px; }

.season-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; gap: 8px; }
.season-item:last-child { margin-bottom: 0; }
.season-item--best { align-items: flex-start; }
.season-lbl { font-size: 13px; color: var(--secondary); flex-shrink: 0; }
.season-val { font-size: 13px; font-weight: 600; color: var(--text); }
.season-val--link {
  color: var(--lime-dark);
  text-decoration: none;
  border-bottom: 1px dashed rgba(107, 142, 0, 0.45);
  transition: color 0.15s, border-color 0.15s;
}
.season-val--link:hover {
  color: #4A6600;
  border-bottom-color: #4A6600;
}
.season-val--best {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 4px;
  text-align: right;
}
.season-val--place-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.season-val--place-link:hover {
  color: var(--lime-dark);
  border-bottom-color: rgba(107, 142, 0, 0.35);
}
.p8-season-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.p8-season-info-i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  font-style: italic;
  line-height: 12px;
  text-align: center;
  cursor: help;
}
.p8-season-info.p8-tip-wrap .p8-tip {
  bottom: calc(100% + 8px);
  right: 0;
  left: auto;
  transform: none;
  white-space: normal;
  width: 220px;
  text-align: left;
  z-index: 60;
}
.p8-season-info.p8-tip-wrap .p8-tip--period {
  width: 240px;
  line-height: 1.4;
}
.p8-season-info.p8-tip-wrap .p8-tip::after {
  left: auto;
  right: 10px;
  transform: none;
}

.mover-row  { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.mover-row:last-child { margin-bottom: 0; }
.mover-ph {
  width: 26px; height: 26px; border-radius: 50%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 600; color: var(--secondary); flex-shrink: 0;
}
.mover-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mover-name  { font-size: 12px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mover-delta { font-size: 10px; font-weight: 700; flex-shrink: 0; white-space: nowrap; }
.mover-delta.up   { color: var(--up); }
.mover-delta.down { color: var(--down); }

/* ── MODAL (share топ-10) ── */
#shareModal.modal-overlay {
  display: none !important;
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 10100 !important;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
#shareModal.modal-overlay.open {
  display: flex !important;
}
#shareModal,
#shareModal * {
  box-sizing: border-box;
}
#shareModal .p8-share-modal {
  position: relative !important;
  display: block !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  background: #FFFFFF;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  z-index: 1;
}
#shareModal .p8-share-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #E8E8E8;
  background: #FFFFFF;
}
#shareModal .p8-share-modal__heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
#shareModal .p8-share-modal__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: #1F1F1F;
}
#shareModal .p8-share-modal__date {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
  color: #888;
}
#shareModal .p8-share-modal__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #F5F5F5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #888;
  transition: background 0.15s;
  flex-shrink: 0;
}
#shareModal .p8-share-modal__close:hover {
  background: #E8E8E8;
}

/* Карточка топ-10 — типографская, без аватарок */
#shareModal .share-card {
  padding: 16px;
  background: #F5F5F5;
}
#shareModal .share-card-inner {
  background: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #E8E8E8;
}
#shareModal .share-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: #1F1F1F;
}
#shareModal .share-card-logo {
  display: block;
  width: auto;
  height: 22px;
  max-width: 132px;
  flex-shrink: 0;
}
#shareModal .share-card-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#shareModal .share-row {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-bottom: 1px solid #E8E8E8;
  gap: 12px;
}
#shareModal .share-row:last-child {
  border-bottom: none;
}
#shareModal .share-row-rank {
  font-size: 13px;
  font-weight: 700;
  width: 18px;
  flex-shrink: 0;
  color: #AAA;
  text-align: right;
}
#shareModal .share-row-rank.gold   { color: #C8960C; }
#shareModal .share-row-rank.silver { color: #7A7A7A; }
#shareModal .share-row-rank.bronze { color: #9A5C2E; }
#shareModal .share-row-name {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  color: #1F1F1F;
}
#shareModal .share-row-pts {
  font-size: 13px;
  font-weight: 700;
  color: #1F1F1F;
  flex-shrink: 0;
}

#shareModal .p8-share-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid #E8E8E8;
  background: #FFFFFF;
}
#shareModal .p8-share-modal__hint {
  flex: 1 1 100%;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(46, 125, 50, 0.1);
  color: #2E7D32;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
#shareModal .p8-share-modal__hint[hidden] {
  display: none !important;
}
#shareModal .btn-share-native {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  background: #1F1F1F;
  color: #fff;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
#shareModal .btn-share-native:hover {
  opacity: 0.92;
}
#shareModal .btn-share-native.copied {
  background: #2E7D32;
}
#shareModal .btn-copy {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid #E8E8E8;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  color: #888;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}
#shareModal .btn-copy:hover {
  border-color: #1F1F1F;
  color: #1F1F1F;
}
#shareModal .btn-copy.copied {
  border-color: #2E7D32;
  color: #2E7D32;
}
.btn-download {
  flex: 1; padding: 10px; border-radius: 10px; background: var(--text); color: #fff;
  border: none; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: opacity 0.15s;
}
.btn-download:hover { opacity: 0.85; }

.watermark { text-align: right; padding: 12px 24px; font-size: 10px; color: var(--muted); letter-spacing: 1px; max-width: 1200px; margin: 0 auto; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .p8-rating-page.mainV2__page--inner {
    padding-left: 0;
    padding-right: 0;
  }

  .p8-rating-page .page-wrap { padding: 0; max-width: none; }

  .p8-rating-page .p8-rating-page-title,
  .p8-rating-page .p8-rating-filter-form,
  .p8-rating-page .p8-search-banner,
  .p8-rating-page .p8-pagination {
    padding-left: 12px;
    padding-right: 12px;
  }

  .p8-rating-page .p8-my-banner-block {
    width: 100%;
  }

  .p8-rating-page .p8-my-banner-block--has-banner {
    position: relative;
    border-radius: 0;
    margin-bottom: 0;
  }

  .p8-rating-page .p8-my-banner-block:not(.p8-my-banner-block--has-banner) .p8-rating-share-bar {
    padding-left: 12px;
    padding-right: 12px;
    margin-bottom: 8px;
  }

  .p8-rating-page .p8-my-banner-block--has-banner .p8-rating-share-bar {
    position: absolute;
    right: 10px;
    bottom: 8px;
    z-index: 3;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
  }

  .p8-rating-page .p8-rating-share-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .p8-rating-page .p8-rating-share-bar .table-topbar-label {
    display: none;
  }

  .p8-rating-page .p8-my-banner-block--has-banner .p8-rating-share-bar .table-topbar-label {
    display: none;
  }

  .p8-rating-page .p8-rating-share-bar .btn-share {
    width: auto;
    padding: 5px 7px;
    font-size: 0;
    line-height: 0;
    gap: 0;
    border-radius: 8px;
    border-width: 1px;
    background: var(--card);
  }

  .p8-rating-page .p8-rating-share-bar .btn-share .btn-share-text {
    display: none;
  }

  .p8-rating-page .p8-rating-share-bar .btn-share svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .p8-rating-page .p8-my-pin .p8-my-pin-steps {
    padding: 8px 12px 10px;
  }

  .p8-rating-page .section-label--with-share {
    padding: 5px 12px;
  }

  .p8-rating-page .section-label--with-share .btn-share--section {
    padding: 4px 6px;
    font-size: 0;
    line-height: 0;
    gap: 0;
    border-radius: 8px;
    border-width: 1px;
  }

  .p8-rating-page .section-label--with-share .btn-share--section .btn-share-text {
    display: none;
  }

  .p8-rating-page .section-label--with-share .btn-share--section svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }

  .p8-rating-page .page-layout {
    grid-template-columns: 1fr;
    gap: 12px;
    display: flex;
    flex-direction: column;
  }
  .p8-rating-page .main-col { order: 1; width: 100%; max-width: 100%; }

  .p8-rating-page .p8-my-pin,
  .p8-rating-page .rating-table,
  .p8-rating-page .p8-movers-mobile,
  .p8-rating-page .p8-movers-mobile .p8-movers-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 0;
  }

  .p8-rating-page .p8-my-pin {
    border-left-width: 3px;
    border-radius: 0;
    margin-bottom: 0;
  }

  .p8-rating-page .rating-table {
    margin-bottom: 0;
    border-top: 1px solid var(--border);
  }

  .p8-rating-page .p8-movers-mobile {
    display: block;
    margin: 0;
  }

  .p8-rating-page .p8-movers-mobile .p8-movers-card {
    border-top: 1px solid var(--border);
    box-shadow: none;
  }
  .p8-rating-page .side-col {
    order: 2;
    position: static;
    top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    min-width: 0;
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }

  .p8-rating-page .side-col > .side-card,
  .p8-rating-page .side-col > .p8-movers-desktop {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .p8-rating-page .side-col .p8-movers-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .p8-rating-page .p8-movers-desktop {
    display: none;
  }

  body.v2-page .p8-rating-page form.mainV2__filter-form[name="rating_filter"] .p8-rating-filters-row {
    gap: 4px;
    margin-bottom: 6px;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .p8-rating-page .p8-rating-filters-row > .p8-rating-filter-field--sex,
  .p8-rating-page .p8-rating-filters-row > .p8-rating-filter-search,
  .p8-rating-page .p8-rating-filters-row > .mainV2__filter-field {
    flex: 0 0 auto;
  }

  .p8-rating-page .p8-rating-filters-row .p8-rating-filter-field--sex .p8-filter-dd {
    min-width: 64px;
    max-width: 72px;
  }

  .p8-rating-page .p8-rating-filters-row .p8-filter-dd--sort,
  .p8-rating-page .p8-rating-filters-row .p8-rating-filter-field--sort .p8-filter-dd {
    min-width: 56px;
    max-width: 76px;
  }

  body.v2-page .p8-rating-page #rating_filter_sex label {
    padding: 3px 8px !important;
    font-size: 11px !important;
  }

  .p8-rating-page .p8-rating-filters-row .p8-rating-filter-search {
    flex: 0 1 72px;
    min-width: 56px;
    max-width: 72px;
    width: 72px;
  }

  body.v2-page .p8-rating-page form.mainV2__filter-form[name="rating_filter"] .p8-rating-filters-row .p8-rating-filter-search {
    flex: 0 0 72px !important;
    max-width: 72px !important;
    width: 72px !important;
  }

  body.v2-page .p8-rating-page form.mainV2__filter-form[name="rating_filter"] .p8-rating-filters-row .p8-rating-filter-search input.ratingSearch__input {
    width: 100% !important;
    max-width: 72px !important;
    min-width: 0 !important;
    flex: none !important;
    padding: 3px 8px !important;
    font-size: 11px !important;
  }

  .p8-rating-page .p8-filter-dd-btn {
    padding: 4px 7px;
    font-size: 11px;
  }

  .p8-rating-page .p8-rating-filters-row .p8-filter-dd {
    min-width: 76px;
    max-width: 92px;
  }

  .p8-rating-page .p8-rating-filters-row .p8-filter-dd--city {
    min-width: 80px;
    max-width: 88px;
  }

  .frow-main { gap: 5px; flex-wrap: wrap; }
  .filters-header--compact { padding: 6px 10px; }
  .fsearch-top { order: 10; margin-left: 0; width: 100%; }
  .fsearch-top input { width: 100%; }
  .frow2--inline { width: 100%; }
  .frow2 { flex-wrap: wrap; gap: 6px; }

  .mbn-overall {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    margin-top: 4px;
    padding-top: 0;
  }
  .my-banner--has-overall .mbn-overall {
    grid-row: 2;
  }
  .p8-rating-page .mbn-steps-wrap,
  .mbn-steps-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
    min-width: 0;
    max-width: none;
    width: 100%;
    align-self: stretch;
    padding-left: 0;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }
  .my-banner--has-overall .mbn-steps-wrap {
    grid-row: 3;
  }

  .p8-amateur-ladder {
    margin: 12px 0 8px;
    padding: 14px 12px 12px;
    border-radius: 10px;
  }
  .p8-al-top {
    flex-direction: column;
    gap: 8px;
  }
  .p8-al-rank {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-align: left;
  }
  .p8-al-rank-num {
    font-size: 24px;
    display: inline;
  }
  .p8-al-rank-of {
    display: inline;
    font-size: 13px;
  }
  .p8-al-pin-bubble {
    font-size: 9px;
    padding: 2px 6px;
  }
  .p8-al-card {
    flex: 1 1 100%;
  }

  .p8-goals-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .p8-goal-card {
    padding: 14px 12px 12px;
  }
  .p8-goal-head {
    flex-direction: column;
    gap: 8px;
  }
  .p8-goal-rank {
    display: flex;
    align-items: baseline;
    gap: 6px;
    text-align: left;
  }
  .p8-goal-rank-num {
    font-size: 22px;
    display: inline;
  }
  .p8-goal-rank-of {
    display: inline;
    font-size: 12px;
  }
  .p8-goal-mini {
    flex: 1 1 calc(50% - 8px);
  }
  .p8-goal-cards--rank .p8-goal-mini {
    flex: 1 1 calc(33% - 8px);
  }
  .p8-goal-pin-bubble {
    font-size: 9px;
  }

  .mbn-steps { max-width: 100%; }
  .mbn-step { width: 38px; }
  .mbn-step-conn { min-width: 6px; }

  .p8-rating-page .p8-movers-mobile .p8-movers-card {
    padding: 10px 12px;
  }

  .p8-rating-page .player-mobile-meta {
    display: none !important;
  }

  .p8-rating-page .player-cat {
    display: none;
  }

  /* таблица мобайл — как desktop: место | игрок | УС | зачёт | очки */
  .table-header { display: none; }

  .p8-rating-page .tgrid {
    grid-template-columns: 34px minmax(0, 1fr) 40px 58px 50px;
    column-gap: 6px;
    align-items: center;
  }

  .p8-rating-page .rating-table--cat-place .tgrid {
    grid-template-columns: 38px minmax(0, 1fr) 40px 58px 50px;
  }

  .p8-rating-page .rating-table--no-tours .tgrid {
    grid-template-columns: 34px minmax(0, 1fr) 40px 50px;
  }

  .p8-rating-page .rating-table--no-tours.rating-table--cat-place .tgrid {
    grid-template-columns: 38px minmax(0, 1fr) 40px 50px;
  }

  .p8-rating-page .player-row {
    padding: 10px 12px;
    align-items: center;
  }

  .p8-rating-page .col-rank {
    padding-top: 0;
    font-size: 14px;
    line-height: 1.15;
    text-align: center;
  }

  .p8-rating-page .rank-num {
    font-size: 15px;
  }

  .p8-rating-page .rank-change {
    font-size: 9px;
    margin-top: 1px;
  }

  .p8-rating-page .col-player {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: auto;
  }

  .p8-rating-page .col-player-body {
    min-width: 0;
    flex: 1;
  }

  .p8-rating-page .player-photo,
  .p8-rating-page .player-ph {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .p8-rating-page .player-ph {
    font-size: 11px;
  }

  .p8-rating-page .player-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    font-size: 13px;
  }

  .p8-rating-page .badge-series {
    display: none;
  }

  .p8-rating-page .col-us,
  .p8-rating-page .col-tours,
  .p8-rating-page .col-points {
    display: block;
    align-self: center;
    min-width: 0;
  }

  .p8-rating-page .col-us {
    text-align: right;
  }

  .p8-rating-page .us-val {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.15;
  }

  .p8-rating-page .us-delta {
    font-size: 9px;
    line-height: 1.15;
  }

  .p8-rating-page .col-tours {
    text-align: center;
  }

  .p8-rating-page .tours-frac {
    font-size: 11px;
    font-weight: 600;
  }

  .p8-rating-page .tours-frac-badge {
    font-size: 9px;
    padding: 0 3px;
  }

  .p8-rating-page .tours-frac-wrap {
    gap: 2px;
  }

  .p8-rating-page .col-points {
    text-align: right;
  }

  .p8-rating-page .pts-val {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
  }
}

/* ── Цвета: перебиваем mainV2__page * ── */
.p8-rating-page .rank-up,
.p8-rating-page .us-delta.rank-up,
.p8-rating-page .mover-delta.up,
.p8-rating-page .mbn-meta-item .up {
  color: var(--up);
}

.p8-rating-page .rank-down,
.p8-rating-page .us-delta.rank-down,
.p8-rating-page .mover-delta.down,
.p8-rating-page .mbn-meta-item .down {
  color: var(--down);
}

.p8-rating-page .rank-same,
.p8-rating-page .us-delta.rank-same {
  color: var(--muted);
}

.p8-rating-page .rank-num.gold,
.p8-rating-page .share-row-rank.gold {
  color: #C8960C;
}

.p8-rating-page .rank-num.silver,
.p8-rating-page .share-row-rank.silver {
  color: #7A7A7A;
}

.p8-rating-page .rank-num.bronze,
.p8-rating-page .share-row-rank.bronze {
  color: #9A5C2E;
}

.p8-rating-page .ach-val.nonzero {
  color: var(--lime-dark);
}

.p8-rating-page .player-row.me {
  background: #FAFFF0;
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

.p8-rating-page .player-row.me:hover {
  background: #F4FCE3;
}

.p8-rating-page .badge-me {
  background: var(--lime-dark);
  color: #fff;
}

.p8-rating-page .mbn-step-conn-fill {
  background: var(--lime);
}

.p8-rating-page .my-banner--p8 {
  border-left-color: var(--lime);
}

.p8-rating-page .fpill.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

.p8-rating-page .btn-share:hover {
  border-color: var(--lime-dark);
  color: var(--lime-dark);
}

.p8-rating-page .fsearch-top input:focus {
  border-color: var(--lime);
}

/* ── Полировка визуала ── */
.p8-rating-page .side-card {
  box-shadow: 0 1px 3px rgba(31, 31, 31, 0.06);
}

.p8-rating-page .rating-table {
  box-shadow: 0 1px 4px rgba(31, 31, 31, 0.07);
}

.p8-rating-page .section-label {
  background: #EEF0F2;
  color: #888;
}

.p8-rating-page .section-label--top3 {
  background: #FFF8E8;
  color: #B8860B;
}

.p8-rating-page .section-label--with-share {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.p8-rating-page .section-label--with-share .section-label-text {
  flex: 1;
  min-width: 0;
}

.p8-rating-page .section-label--with-share .btn-share--section {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 11px;
  background: var(--card);
}

.p8-rating-page .section-label--top3.section-label--with-share .btn-share--section {
  border-color: rgba(184, 134, 11, 0.35);
  color: #9A7209;
}

.p8-rating-page .section-label--top3.section-label--with-share .btn-share--section:hover {
  border-color: #B8860B;
  color: #B8860B;
}

@media (min-width: 901px) {
  .p8-rating-page .section-label--with-share .btn-share--section {
    padding: 5px 12px;
    font-size: 12px;
  }
}

.p8-rating-page .player-row--top3 {
  background: #FFFCF5;
}

.p8-rating-page .player-row--top3:hover {
  background: #FFF8E8;
}

.p8-rating-page .col-rank--cat .rank-num + .rank-change,
.p8-rating-page .col-rank--cat .rank-change {
  font-weight: 600;
}