/* Friends, DMs, notification bell, evening history */

.soc-page { max-width: none; 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 {
  width: min(360px, calc(100vw - 24px));
  padding: 0;
  overflow: hidden;
}
.soc-bell-head, .soc-bell-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  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; }
.soc-bell-foot { border-top: 1px solid var(--line-soft); }
.soc-bell-foot a { color: var(--gold); font-weight: 700; font-size: 13px; width: auto; height: auto; padding: 0; }
.soc-bell-list { max-height: min(420px, 60vh); overflow: auto; padding: 6px; }
.soc-bell-empty { margin: 0; padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13.5px; }
.soc-notice {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: inherit;
  text-decoration: none;
}
.soc-notice:hover { background: var(--line-soft); }
.soc-notice.is-unread { background: rgba(217, 183, 122, 0.08); }
.soc-notice b { font-size: 14px; }
.soc-notice small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }

/* 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; 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-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; }
  .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; }
}

@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)); }
}
