/* Friends, DMs, notification bell, evening history */

/* same frame as every other page: the gutter used to collapse to the bare padding here */
.soc-page { max-width: var(--wide); width: 100%; }
.soc-chip-num {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--grad-cran);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}

.soc-search { margin-bottom: 22px; }
.soc-search-fields {
  display: flex;
  align-items: end;
  gap: 10px;
}
.soc-search-fields label { flex: 1; min-width: 0; }
.soc-search-fields .label { margin-bottom: 6px; }
.soc-search-fields input,
.soc-search-fields .btn {
  min-height: 48px;
  height: 48px;
}
.soc-search-fields .btn {
  flex: none;
  align-self: end;
  padding: 0 20px;
}
.soc-search-fields .btn:hover,
.soc-search-fields .btn:active { transform: none; }
.soc-search-out { margin: -8px 0 22px; }

.soc-tabs { margin: 8px 0 18px; }
.soc-panel[hidden] { display: none !important; }

.soc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.soc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 14px;
}
.soc-who {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
}
.soc-who b { display: block; font-size: 16px; line-height: 1.2; }
.soc-who small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.soc-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.soc-face {
  position: relative;
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  overflow: visible;
  background: var(--field);
}
.soc-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  box-shadow: 0 0 0 1px var(--line-2) inset;
}
.soc-face.is-on::after {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 2;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 2px var(--surface-solid), 0 0 10px rgba(95, 207, 152, 0.7);
}

.soc-hit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  margin-bottom: 8px;
}

/* Bell */
.soc-bell { position: relative; }
.soc-bell-btn, .nav-mail { position: relative; }
.soc-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--grad-cran);
  color: #fff;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 10px rgba(229, 72, 107, 0.55);
}
.soc-bell-badge.is-empty { display: none; }
.menu-pop.soc-bell-pop {
  display: block;
  width: min(400px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
  z-index: 80;
}
.menu-pop.soc-bell-pop a,
.menu-pop.soc-bell-pop button {
  display: block !important;
  width: auto;
  height: auto;
  min-height: 0;
  padding: 0;
  flex: none;
  align-items: stretch;
  gap: 0;
  white-space: normal;
}
.menu-pop.soc-bell-pop .soc-notice {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--line-soft) inset;
}
.soc-notice-tag {
  display: block;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}
.soc-notice-title,
.soc-notice-body,
.soc-notice b,
.soc-notice small {
  display: block !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: none;
  font-family: var(--sans);
  font-style: normal;
  letter-spacing: 0.01em;
  word-spacing: 0.22em;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: pre-wrap;
}
.soc-notice-title,
.soc-notice b { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.soc-notice-body,
.soc-notice small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.soc-bell-head, .soc-bell-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}
.soc-bell-head { border-bottom: 1px solid var(--line-soft); }
.soc-bell-head b { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: 0; }
.soc-bell-head .text-btn { flex: none; white-space: nowrap; }
.soc-bell-foot { border-top: 1px solid var(--line-soft); flex-wrap: nowrap; }
.notice-sum { margin: 0 0 14px; }
.notice-empty { margin: 0; padding: 22px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--muted); }
.notice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.notice-row span { display: grid; gap: 4px; min-width: 0; }
.notice-row .soc-notice-tag { margin-bottom: 2px; }
.notice-row .soc-notice-title { font-size: 16px; overflow-wrap: break-word; }
.notice-row .soc-notice-body { color: var(--ink-2); font-size: 14px; -webkit-line-clamp: unset; display: block; overflow: visible; }
.notice-row time { flex: none; color: var(--muted); font-size: 13px; }
.notice-row.is-unread { border-color: rgba(217, 183, 122, 0.4); background: rgba(217, 183, 122, 0.08); }
.notice-page .spk-pager { margin-top: 16px; }
@media (max-width: 720px) {
  .menu-pop.soc-bell-pop {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 64px);
    left: 12px;
    right: 12px;
    width: auto;
    max-height: min(70vh, 520px);
  }
  .soc-bell-list { max-height: none; overflow: hidden; }
  .soc-bell-foot { flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .notice-row { align-items: flex-start; flex-direction: column; gap: 6px; }
}
.soc-bell-foot a {
  display: inline !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.soc-bell-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(52vh, 460px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 10px;
}
.soc-bell-empty { margin: 0; padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.soc-notice { color: inherit; text-decoration: none; }
.soc-notice:hover { background: var(--surface-hi); }
.soc-notice.is-unread { background: rgba(217, 183, 122, 0.1); box-shadow: 0 0 0 1px rgba(217, 183, 122, 0.28) inset; }
/* support answers: a gold edge and the gold tag, in the bell and on /notices */
.soc-notice.is-support,
.notice-row.is-support { box-shadow: inset 3px 0 0 #d9b77a, 0 0 0 1px rgba(217, 183, 122, 0.3) inset; }
.soc-notice.is-support .soc-notice-tag,
.notice-row.is-support .soc-notice-tag {
  display: inline-block;
  width: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6e2b3 0%, #d9b77a 48%, #9a7437 100%);
  color: #1b1206;
}

/* DMs */
.page-messages { max-width: none; width: 100%; }
.page-messages.page { padding-bottom: 28px; }
.soc-dm-head .lede { max-width: 46ch; }
.soc-dm-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  min-height: calc(100dvh - var(--nav-h) - 220px);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--surface-solid);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2);
}
.soc-inbox, .soc-thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.soc-inbox { border-right: 1px solid var(--line-soft); background: color-mix(in srgb, var(--surface-2) 55%, transparent); min-width: 0; overflow: hidden; }
.soc-aside-title {
  margin: 0;
  padding: 18px 18px 12px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
}
.soc-inbox-empty, .soc-thread-empty { margin: auto; padding: 28px 22px; text-align: center; }
.soc-convo-list { list-style: none; margin: 0; padding: 0 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; overflow-x: hidden; overflow-y: auto; }
.soc-convo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 10px 12px 10px 10px;
  border-radius: 18px;
  color: inherit;
  background: color-mix(in srgb, var(--surface-hi) 55%, transparent);
  border: 1px solid transparent;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent);
}
.soc-convo:hover {
  background: var(--surface-hi);
  border-color: color-mix(in srgb, var(--gold) 28%, transparent);
}
.soc-convo.is-on {
  background: linear-gradient(135deg, rgba(217, 183, 122, 0.16), var(--surface-hi) 62%);
  border-color: color-mix(in srgb, var(--gold) 42%, transparent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.16);
}
.soc-convo.is-unread .soc-convo-name { color: var(--gold-2); }
.soc-convo.is-salon {
  background:
    radial-gradient(90% 140% at 0% 0%, rgba(217, 183, 122, 0.2), transparent 58%),
    color-mix(in srgb, var(--surface-hi) 70%, transparent);
}
.soc-convo.is-salon.is-on { box-shadow: inset 3px 0 0 var(--gold), 0 8px 22px rgba(0, 0, 0, 0.16); }
.soc-convo-text { min-width: 0; flex: 1; overflow: hidden; }
.soc-convo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.soc-convo-text b {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 15px;
  line-height: 1.2;
}
.soc-convo-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.soc-convo-time {
  flex: none;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.soc-convo-text small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.soc-convo.is-unread small { color: var(--ink-2); }
.soc-convo .soc-face {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}
.soc-convo .soc-face img { box-shadow: 0 0 0 1px var(--line-2) inset; }
.soc-convo.is-salon .soc-face img {
  box-shadow: 0 0 0 2px rgba(217, 183, 122, 0.72), 0 0 16px rgba(217, 183, 122, 0.22);
}
.soc-convo .soc-face.is-on::after,
.soc-thread-head .soc-face.is-on::after {
  right: -3px;
  bottom: -3px;
}
.soc-convo.is-salon .soc-face.is-on::after,
.soc-thread-head .soc-who.is-salon .soc-face.is-on::after {
  background: var(--gold);
  box-shadow: 0 0 0 2px var(--surface-solid), 0 0 10px rgba(217, 183, 122, 0.55);
}
.soc-convo-pip {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(217, 183, 122, 0.7);
}
.soc-salon-tag {
  flex: none;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1b1206;
  background: var(--grad-gold);
  border-radius: 999px;
  padding: 2px 7px;
}

.soc-thread-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.soc-thread-head .soc-face {
  width: 46px;
  height: 46px;
  border-radius: 14px;
}
.soc-thread-head .soc-who.is-salon .soc-face img {
  box-shadow: 0 0 0 2px rgba(217, 183, 122, 0.72), 0 0 14px rgba(217, 183, 122, 0.2);
}
.soc-back { display: none; }
.soc-msgs {
  flex: 1;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  background:
    radial-gradient(80% 50% at 100% 0%, rgba(217, 183, 122, 0.08), transparent 55%),
    transparent;
}
.soc-msg-empty { margin: auto; color: var(--muted); text-align: center; max-width: 32ch; }
.soc-msg {
  max-width: min(78%, 540px);
  padding: 11px 15px;
  border-radius: 16px 16px 16px 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  align-self: flex-start;
}
.soc-msg p { margin: 0; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.soc-msg a { color: var(--gold-2); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.soc-msg.is-mine {
  align-self: flex-end;
  background: linear-gradient(160deg, rgba(217, 183, 122, 0.22), rgba(217, 183, 122, 0.08));
  border-color: var(--line-2);
  border-radius: 16px 16px 6px 16px;
}
.soc-msg.is-salon {
  max-width: min(94%, 580px);
  padding: 20px 22px 16px;
  background: linear-gradient(180deg, rgba(217, 183, 122, 0.14), var(--surface-2));
  border-color: var(--line-2);
  box-shadow: inset 3px 0 0 var(--gold);
}
.soc-day {
  align-self: center;
  margin: 8px 0 2px;
  padding: 4px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 88%, transparent);
  border: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.soc-msg time {
  display: block;
  margin-top: 6px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: left;
}
.soc-msg.is-mine time { text-align: right; }
.soc-composer {
  display: flex;
  gap: 10px;
  align-items: stretch;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line-soft);
}
.soc-composer textarea {
  flex: 1;
  min-height: 48px;
  height: 48px;
  max-height: 160px;
  margin: 0;
  padding: 13px 18px;
  border-radius: var(--r-pill);
  line-height: 1.35;
  resize: none;
}
.soc-composer .btn {
  flex: none;
  align-self: stretch;
  min-height: 48px;
  height: auto;
  padding: 0 22px;
  border-radius: var(--r-pill);
}
.soc-composer .btn:hover,
.soc-composer .btn:active { transform: none; }
.soc-composer-locked {
  margin: 0;
  padding: 16px 18px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  text-align: center;
}

/* Длинная переписка листается внутри окна, а не растягивает страницу. */
.soc-dm-shell { min-height: 0; height: max(480px, calc(100dvh - var(--nav-h) - 300px)); }
.soc-thread { overflow: hidden; }

/* Письма: поиск по списку, меню «⋯», баннер блокировки, удаление, «показать раньше» */
.soc-inbox-top { display: grid; gap: 10px; padding: 0 0 12px; }
.soc-inbox-top .soc-aside-title { padding-bottom: 0; }
.soc-filter { display: block; padding: 0 12px; }
.soc-filter[hidden] { display: none; }
.soc-filter input { width: 100%; height: 40px; margin: 0; padding: 0 14px; border-radius: var(--r-pill); font-size: 14px; }
.soc-filter-none { margin: 4px 18px 16px; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.soc-convo-me { color: var(--faint); }
.soc-blocked-tag {
  flex: none;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  padding: 1px 6px;
}
.soc-convo.is-blocked .soc-face img { filter: grayscale(0.7); opacity: 0.75; }
.soc-convo-pip.has-num {
  width: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #1b1206;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.soc-thread-head .soc-who { flex: 1; min-width: 0; }
.soc-thread-head .soc-who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-thread-menu { flex: none; margin-left: auto; }
.soc-more { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: 0.04em; }
.soc-thread-menu .menu-pop { width: 230px; }
.soc-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--danger, #e06b6b) 9%, transparent);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.4;
}
.soc-banner[hidden] { display: none; }
.soc-banner .ico { width: 18px; height: 18px; flex: none; color: var(--danger, #e06b6b); }
.soc-banner span { flex: 1 1 200px; min-width: 0; }
.soc-banner .btn { flex: none; }
.soc-older { align-self: center; flex: none; }
.soc-older[hidden] { display: none; }
.soc-msg-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.soc-msg.is-mine .soc-msg-foot { justify-content: flex-end; }
.soc-msg .soc-msg-foot time { margin-top: 0; }
.soc-msg-del {
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--dur-1, 120ms) var(--ease, ease);
}
.soc-msg:hover .soc-msg-del, .soc-msg-del:focus-visible { opacity: 1; }
.soc-msg-del:hover { color: var(--danger, #e06b6b); }
@media (hover: none) { .soc-msg-del { opacity: 1; } }
.soc-msg p.is-deleted { color: var(--faint); font-style: italic; }
.soc-msg p .chat-item { vertical-align: middle; }
.soc-composer[hidden], .soc-composer-locked[hidden] { display: none; }
.soc-composer .btn.is-cooling { color: transparent; }
.soc-thread > .chat-tray { padding: 8px 18px 0; border-top: 1px solid var(--line-soft); }
.soc-thread > .chat-tray + .soc-composer { border-top: 0; }

.soc-ach-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.soc-ach-card { padding: 18px 18px 16px; display: grid; gap: 8px; opacity: 0.55; }
.soc-ach-card.is-on { opacity: 1; border-color: var(--line-2); box-shadow: var(--glow-gold); }
.soc-ach-card b { font-family: var(--display); font-size: 24px; font-weight: 600; }
.soc-ach-card p { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }
.soc-ach-card small { color: var(--muted); }

@media (max-width: 820px) {
  .soc-dm-shell { grid-template-columns: 1fr; min-height: 62vh; height: auto; }
  .soc-inbox { border-right: 0; }
  .soc-dm.is-thread .soc-inbox { display: none; }
  .soc-dm:not(.is-thread) .soc-thread { display: none; }
  .soc-back { display: inline-flex; }
  .soc-thread { min-height: 62vh; }
  /* Телефон: переписка во всю высоту экрана, поле ввода внизу, шапка страницы не съедает место. */
  .soc-dm.is-thread .soc-dm-head { display: none; }
  .soc-dm.is-thread .soc-dm-shell { min-height: 0; height: calc(100dvh - var(--nav-h) - var(--tabbar-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 40px); }
  .soc-dm.is-thread .soc-thread { min-height: 0; height: 100%; }
  .soc-thread-head { padding: 10px 12px; gap: 8px; }
  .soc-thread-head .soc-face { width: 40px; height: 40px; }
  .soc-back { padding: 0 10px; }
  .soc-msgs { padding: 16px 12px; }
  .soc-msg { max-width: 88%; }
  .soc-composer { padding: 10px 12px 12px; gap: 8px; }
  .soc-composer .btn { padding: 0 16px; }
}
@media (max-width: 420px) {
  .soc-back { font-size: 0; gap: 0; width: 40px; justify-content: center; }
  .soc-back .ico { width: 20px; height: 20px; }
  .soc-composer .btn { padding: 0 14px; font-size: 14px; }
}

@media (max-width: 560px) {
  .soc-row { padding: 12px; }
  .soc-actions { width: 100%; }
  .soc-actions .btn { flex: 1; }
  .soc-search-fields { flex-wrap: wrap; }
  .soc-search-fields .btn { width: 100%; }
}

/* Achievement grid on history */
.page-history .ach-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 22px;
}
.page-history .ach-hero-tile {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 20px 22px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.page-history .ach-hero-tile.is-signs {
  background: linear-gradient(160deg, rgba(217, 183, 122, 0.16), transparent 70%), var(--surface);
  border-color: rgba(217, 183, 122, 0.3);
}
.page-history .ach-hero-tile > span:first-child {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.page-history .ach-hero-tile b {
  font-family: var(--display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  line-height: 1;
}
.page-history .ach-hero-tile b i { font-style: normal; font-size: 0.48em; color: var(--muted); }
.page-history .ach-hero-tile.is-points b { color: var(--gold); }
.page-history .ach-hero-tile .meter { margin-top: 8px; }
.page-history .ach-hero-tile small { font-size: 12.5px; color: var(--muted); }
.page-history .ach-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 20px;
}
.page-history .ach-empty { margin: 0 0 12px; }
.page-history .ach-group { margin: 0 0 28px; }
.page-history .ach-group[hidden] { display: none !important; }
.page-history .ach-group-head {
  display: grid;
  grid-template-columns: 1fr minmax(80px, 160px);
  align-items: end;
  gap: 12px 20px;
  margin-bottom: 12px;
}
.page-history .ach-group-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
}
.page-history .ach-group-head p { margin: 4px 0 0; }
.page-history .ach-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 10px;
}
.page-history .ach-card {
  position: relative;
  padding: 16px 14px 14px 18px;
  display: grid;
  gap: 5px;
  opacity: 0.4;
  min-height: 0;
  overflow: hidden;
}
.page-history .ach-card.is-on {
  opacity: 1;
  border-color: var(--line-2);
  box-shadow: var(--glow-gold);
}
.page-history .ach-card.is-rare.is-on { border-color: rgba(178, 107, 255, 0.4); }
.page-history .ach-card.is-legend.is-on {
  border-color: rgba(243, 184, 87, 0.55);
  background: linear-gradient(160deg, rgba(217, 183, 122, 0.14), transparent 65%), var(--surface);
}
.page-history .ach-card[hidden] { display: none !important; }
.page-history .ach-seal {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-2);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
}
.page-history .ach-card.is-on .ach-seal {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 183, 122, 0.18), 0 0 12px rgba(243, 184, 87, 0.45);
}
.page-history .ach-card b {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  padding-right: 16px;
}
.page-history .ach-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.page-history .ach-pts {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: var(--line-soft);
  color: var(--muted);
}
.page-history .ach-card.is-on .ach-pts { background: rgba(217, 183, 122, 0.16); color: var(--gold); }
@media (max-width: 720px) {
  .page-history .ach-hero { grid-template-columns: 1fr; }
  .page-history .ach-group-head { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .page-history .ach-grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); }
}

/* Presence: «в сети» dot + last-seen text (profile, rating; friends/messages use .soc-face.is-on) */
.presence { display: inline-flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 13px; line-height: 1.3; }
.presence-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.presence.is-on { color: var(--ok); }
.presence.is-on .presence-dot { background: var(--ok); box-shadow: 0 0 8px rgba(95, 207, 152, 0.7); }
.presence-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-presence { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: -4px 0 12px; }
.pf-presence .presence { font-size: 14px; }
.pf-ghost { padding: 2px 9px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--muted); font-size: 12px; text-decoration: none; }
.pf-ghost:hover { color: var(--ink); }
.podium-seen { display: flex; justify-content: center; min-height: 18px; margin-top: 4px; max-width: 100%; }
.podium-seen .presence { font-size: 12px; max-width: 100%; }
.podium-seen .presence-text { white-space: normal; text-align: center; }
.podium-seat:has(.podium-seen) { min-width: 0; }
.rank-seen { flex-basis: 100%; min-width: 0; }
.rank-seen .presence { font-size: 12px; max-width: 100%; }
@media (max-width: 760px) {
  .pf-presence { justify-content: center; }
}
