/* ==========================================================================
   SOCIAL — stats, the message board, how the weekly lists are made, and
   sending songs to each other.

   Every colour here is the profile's own: --accent / --accent-rgb for the
   highlights, and the theme's surfaces, borders and text levels (base.css)
   for the rest, so the tab sits right on every background, Daylight too.
   ========================================================================== */

#view-social,
.soc-sheet {
    --soc-card: var(--surface-1);
    --soc-card-strong: var(--surface-2);
    --soc-line: var(--border);
    --soc-dim: var(--fg-2);
    --soc-tint: rgba(var(--accent-rgb), 0.12);
    --soc-ring: rgba(var(--accent-rgb), 0.45);
}
#view-social { padding-bottom: 24px; }

/* ---------- Header ---------- */
.soc-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 16px;
}
.soc-hero h1 { margin: 0 0 4px; font-size: 1.9rem; }
.soc-sub { margin: 0; color: var(--soc-dim); font-size: 0.9rem; line-height: 1.35; max-width: 34ch; }
/* ---------- Tabs: a pill that slides under the label ---------- */
.soc-tabs {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 4px;
    margin-bottom: 18px;
    background: var(--soc-card);
    border: 1px solid var(--soc-line);
    border-radius: 16px;
}
.soc-tab-pill {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc((100% - 8px) / 3);
    border-radius: 12px;
    background: var(--accent);
    box-shadow: 0 6px 16px -6px rgba(var(--accent-rgb), 0.8);
    transition: transform 0.28s cubic-bezier(0.3, 0.8, 0.3, 1);
    transform: translateX(calc(var(--soc-tab, 0) * 100%));
}
.soc-tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    padding: 0 4px;
    height: 42px;
    border: none;
    background: transparent;
    color: var(--soc-dim);
    font-weight: 700;
    font-size: 0.82rem;
    border-radius: 12px;
    cursor: pointer;
    transition: color 0.2s;
}
.soc-tab.active { color: var(--on-accent); }
.soc-badge {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--fg);
    color: var(--fg-inverse);
    font-size: 0.7rem;
    line-height: 18px;
    text-align: center;
}
.soc-tab.active .soc-badge { background: var(--on-accent); color: var(--accent); }

.soc-panel { animation: soc-rise 0.32s ease both; }
@keyframes soc-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* The dot on the Social tab in the nav bar. */
.nav-link[data-view="social"] { position: relative; }
.nav-dot {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(var(--accent-rgb), 0.9);
    animation: soc-pulse 2s ease-in-out infinite;
}
@media (min-width: 769px) {
    .nav-dot { top: 6px; left: auto; right: 8px; }
}
@keyframes soc-pulse { 50% { transform: scale(1.25); } }

/* ---------- Shared bits ---------- */
.soc-card {
    background: var(--soc-card);
    border: 1px solid var(--soc-line);
    border-radius: 18px;
    padding: 16px;
    margin-bottom: 14px;
}
.soc-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.soc-card-head h2, .soc-h {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.soc-card-head h2 .icon, .soc-h .icon { color: var(--accent); }
.soc-small-btn {
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--soc-ring);
    border-radius: 16px;
    background: var(--soc-tint);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.soc-small-btn:hover { background: rgba(var(--accent-rgb), 0.2); }
.soc-note { color: var(--soc-dim); font-size: 0.82rem; line-height: 1.4; margin: 10px 0 0; }
.soc-empty {
    text-align: center;
    color: var(--soc-dim);
    padding: 28px 16px;
    font-size: 0.92rem;
    line-height: 1.5;
}
.soc-empty .icon { width: 36px; height: 36px; color: var(--accent); opacity: 0.8; display: block; margin: 0 auto 8px; }
.soc-error { text-align: center; color: var(--soc-dim); padding: 36px 16px; }
.soc-loading { text-align: center; color: var(--soc-dim); padding: 40px 0; }

.soc-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 800;
    position: relative;
}
.soc-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
/* Online: a green dot in the corner, ringed in the page colour so it reads on any face. */
.soc-avatar.online::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: max(9px, 26%);
    height: max(9px, 26%);
    border-radius: 50%;
    background: #34d27b;
    box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(52, 210, 123, 0.7);
}
.soc-chip.online { color: var(--like); }
.soc-chip.online::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d27b; box-shadow: 0 0 6px #34d27b; }
.soc-status { font-size: 0.78rem; color: var(--soc-dim); font-weight: 600; }
.soc-status.on { color: #7ff0ae; }
.soc-avatar.big { width: 64px; height: 64px; font-size: 1.6rem; }
.soc-avatar.small { width: 26px; height: 26px; font-size: 0.75rem; }
.soc-avatar.globe { background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #8b5cf6)); }
.soc-avatar.globe .icon { width: 55%; height: 55%; }

/* Cover art, or a tile with a note on it when there isn't any. */
.soc-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--r-sm);
    flex-shrink: 0;
    object-fit: cover;
    background: var(--soc-card-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    overflow: hidden;
}
.soc-cover.ghost {
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent-rgb), 0.08));
}
.soc-cover.ghost .icon { width: 55%; height: 55%; }

.soc-icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--soc-dim);
    cursor: pointer;
    display: grid;
    place-items: center;
}
.soc-icon-btn:hover { background: var(--soc-card-strong); color: var(--fg); }
.soc-icon-btn.play { background: var(--accent); color: var(--on-accent); }
.soc-icon-btn.play:hover { background: var(--accent-hover); color: var(--on-accent); }
.soc-icon-btn .icon { width: 20px; height: 20px; }

/* ---------- Who: a row of faces ---------- */
.soc-people {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 10px;
    margin: 0 -2px 4px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.soc-people::-webkit-scrollbar { display: none; }
.soc-people-wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 4px; }
.soc-person {
    flex: 0 0 auto;
    width: 68px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--soc-dim);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    scroll-snap-align: start;
    padding: 0;
}
.soc-person .soc-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.2rem;
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px transparent;
    transition: box-shadow 0.2s, transform 0.2s;
}
.soc-person span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-person.active { color: var(--fg); }
.soc-person.active .soc-avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); transform: scale(1.05); }
.soc-person:active .soc-avatar { transform: scale(0.94); }

/* Small segmented control (periods, mine / the house). */
.soc-seg {
    display: inline-flex;
    padding: 3px;
    background: var(--soc-card);
    border: 1px solid var(--soc-line);
    border-radius: 12px;
    gap: 2px;
}
.soc-seg button {
    height: 30px;
    padding: 0 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: var(--soc-dim);
    font-weight: 700;
    font-size: 0.8rem;
    cursor: pointer;
    white-space: nowrap;
}
.soc-seg button.active { background: var(--accent); color: var(--on-accent); }
.soc-seg-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- Stats: the hero card ---------- */
.soc-profile-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 22px;
    border: 1px solid var(--soc-ring);
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(var(--accent-rgb), 0.38), transparent 60%),
        linear-gradient(160deg, rgba(var(--accent-rgb), 0.14), rgba(var(--tint-rgb), 0.02));
}
.soc-profile-card::after {
    content: "";
    position: absolute;
    right: -30px;
    top: -30px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 18px solid rgba(var(--accent-rgb), 0.1);
}
.soc-profile-main { min-width: 0; position: relative; z-index: 1; }
.soc-profile-name { font-size: 1.15rem; font-weight: 800; margin: 0 0 2px; }
.soc-profile-title { color: var(--soc-dim); font-size: 0.85rem; margin: 0 0 8px; }
.soc-bignum {
    font-size: 2.3rem;
    font-weight: 900;
    letter-spacing: -1px;
    line-height: 1;
    background: linear-gradient(90deg, var(--fg), var(--accent-hover));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.soc-bignum small { font-size: 0.85rem; font-weight: 700; letter-spacing: 0; -webkit-text-fill-color: var(--soc-dim); margin-left: 6px; }
.soc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.soc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 26px;
    padding: 0 10px;
    border-radius: 13px;
    background: rgba(var(--tint-rgb), 0.06);
    border: 1px solid var(--soc-line);
    font-size: 0.76rem;
    font-weight: 700;
}
.soc-chip .icon { width: 14px; height: 14px; color: var(--accent); }

.soc-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 560px) { .soc-tiles { grid-template-columns: repeat(4, 1fr); } }
.soc-tile {
    background: var(--soc-card);
    border: 1px solid var(--soc-line);
    border-radius: 16px;
    padding: 12px 14px;
}
.soc-tile-num { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px; }
.soc-tile-label { color: var(--soc-dim); font-size: 0.76rem; font-weight: 600; margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.soc-tile-label .icon { width: 13px; height: 13px; color: var(--accent); }

/* ---------- Top songs ---------- */
.soc-rank-list { list-style: none; margin: 0; padding: 0; }
.soc-rank {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 4px;
    border-radius: 12px;
    cursor: pointer;
}
.soc-rank:hover { background: var(--soc-card); }
.soc-rank-n {
    width: 22px;
    text-align: center;
    font-weight: 900;
    font-size: 0.95rem;
    color: var(--soc-dim);
    flex-shrink: 0;
}
.soc-rank:nth-child(-n+3) .soc-rank-n { color: var(--accent); font-size: 1.1rem; }
.soc-rank-body { flex: 1; min-width: 0; }
.soc-rank-title { font-weight: 700; font-size: 0.93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-rank-artist { color: var(--soc-dim); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-bar { height: 4px; border-radius: 2px; background: rgba(var(--tint-rgb), 0.07); margin-top: 6px; overflow: hidden; }
.soc-bar > i {
    display: block;
    height: 100%;
    width: calc(var(--w, 0) * 1%);
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.6), var(--accent));
    transform-origin: left;
    animation: soc-grow 0.7s cubic-bezier(0.3, 0.8, 0.3, 1) both;
}
@keyframes soc-grow { from { transform: scaleX(0); } }
.soc-rank-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; font-size: 0.78rem; font-weight: 700; }
.soc-stat { display: inline-flex; align-items: center; gap: 4px; color: var(--fg); }
.soc-stat .icon { width: 13px; height: 13px; color: var(--accent); }
.soc-stat.dim { color: var(--soc-dim); }
.soc-stat.liked .icon { color: #ff5c8a; }

/* ---------- Charts ---------- */
.soc-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 130px; }
.soc-week-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.soc-week-bar {
    width: 100%;
    max-width: 34px;
    min-height: 4px;
    height: calc(var(--h, 0) * 1%);
    border-radius: 8px 8px 4px 4px;
    background: linear-gradient(180deg, var(--accent), rgba(var(--accent-rgb), 0.35));
    transform-origin: bottom;
    animation: soc-rise-bar 0.8s cubic-bezier(0.3, 0.8, 0.3, 1) both;
}
.soc-week-col.zero .soc-week-bar { background: rgba(var(--tint-rgb), 0.08); }
.soc-week-col.today .soc-week-bar { box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.7); }
@keyframes soc-rise-bar { from { transform: scaleY(0); } }
.soc-week-n { font-size: 0.72rem; font-weight: 800; color: var(--fg); height: 14px; }
.soc-week-col.zero .soc-week-n { color: transparent; }
.soc-week-d { font-size: 0.72rem; color: var(--soc-dim); font-weight: 700; }
.soc-week-col.today .soc-week-d { color: var(--accent); }

.soc-hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; align-items: end; height: 64px; }
.soc-hours i {
    display: block;
    height: calc(var(--h, 0) * 1%);
    min-height: 3px;
    border-radius: 3px;
    background: rgba(var(--accent-rgb), 0.35);
    transform-origin: bottom;
    animation: soc-rise-bar 0.8s ease both;
}
.soc-hours i.peak { background: var(--accent); box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.7); }
.soc-hours-axis { display: flex; justify-content: space-between; color: var(--soc-dim); font-size: 0.68rem; margin-top: 6px; font-weight: 600; }

.soc-meters { display: grid; gap: 12px; }
.soc-meter-top { display: flex; justify-content: space-between; font-size: 0.82rem; font-weight: 700; margin-bottom: 5px; }
.soc-meter-top span:last-child { color: var(--soc-dim); }
.soc-meter { height: 8px; border-radius: 4px; background: rgba(var(--tint-rgb), 0.07); overflow: hidden; }
.soc-meter > i {
    display: block;
    height: 100%;
    width: calc(var(--w, 0) * 1%);
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.5), var(--accent));
    animation: soc-grow 0.8s cubic-bezier(0.3, 0.8, 0.3, 1) both;
}

.soc-two { display: grid; gap: 14px; }
@media (min-width: 760px) { .soc-two { grid-template-columns: 1fr 1fr; align-items: start; } .soc-two .soc-card { margin-bottom: 0; } }
.soc-two { margin-bottom: 14px; }

.soc-leader { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-radius: 12px; cursor: pointer; background: none; border: none; width: 100%; color: inherit; text-align: left; font: inherit; }
.soc-leader:hover { background: var(--soc-card); }
.soc-leader-name { flex: 1; font-weight: 700; font-size: 0.93rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-medal { width: 22px; text-align: center; font-weight: 900; color: var(--soc-dim); }
.soc-leader:nth-child(1) .soc-medal { color: #ffd54a; }
.soc-leader:nth-child(2) .soc-medal { color: #cfd8dc; }
.soc-leader:nth-child(3) .soc-medal { color: #d8935c; }

/* ---------- Board ---------- */
.soc-mail {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid var(--soc-line);
    background: var(--soc-card);
}
.soc-mail.has-new {
    border-color: var(--soc-ring);
    background:
        radial-gradient(110% 150% at 100% 0%, rgba(var(--accent-rgb), 0.3), transparent 60%),
        linear-gradient(160deg, rgba(var(--accent-rgb), 0.12), rgba(var(--tint-rgb), 0.02));
}
.soc-mail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.soc-mail-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--on-accent);
    flex-shrink: 0;
}
.soc-mail.has-new .soc-mail-icon { animation: soc-wiggle 2.4s ease-in-out infinite; }
@keyframes soc-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-9deg); } 92% { transform: rotate(9deg); } }
.soc-mail-title { font-weight: 800; font-size: 1rem; }
.soc-mail-sub { color: var(--soc-dim); font-size: 0.82rem; }
.soc-mail-items { margin-top: 10px; }
.soc-mail-item { display: flex; align-items: center; gap: 11px; padding: 7px 0; }
.soc-mail-item .soc-rank-body { cursor: pointer; }
.soc-new-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    vertical-align: 1px;
}
.soc-mail-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.soc-compose {
    background: var(--soc-card);
    border: 1px solid var(--soc-line);
    border-radius: var(--r-lg);
    padding: 12px;
    margin-bottom: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.soc-compose:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18); }
.soc-compose textarea {
    display: block;
    width: 100%;
    min-height: 54px;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    padding: 4px;
}
.soc-compose textarea::placeholder { color: var(--fg-3); }
.soc-compose-bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.soc-compose-bar .grow { flex: 1; }
.soc-count { font-size: 0.74rem; color: var(--soc-dim); font-weight: 700; }
.soc-count.near { color: #ffb74d; }
.soc-post-btn {
    height: 38px;
    padding: 0 18px;
    border: none;
    border-radius: 19px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.soc-post-btn:disabled { opacity: 0.35; cursor: default; }
.soc-attach {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px;
    border-radius: var(--r-md);
    background: var(--soc-tint);
    border: 1px solid var(--soc-ring);
}
.soc-attach .soc-cover { width: 40px; height: 40px; }
.soc-attach-for { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--soc-dim); font-weight: 600; }
.soc-attach-for select {
    flex: 1;
    min-width: 0;
    height: 36px;
    border-radius: var(--r-sm);
    border: 1px solid var(--soc-line);
    background: var(--surface-1);
    color: var(--fg);
    padding: 0 8px;
    font-size: 16px;
}

.soc-posts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.soc-post {
    display: flex;
    gap: 11px;
    padding: 12px;
    border-radius: 18px;
    background: var(--soc-card);
    border: 1px solid var(--soc-line);
    animation: soc-rise 0.35s ease both;
}
.soc-post.mine { background: var(--soc-tint); border-color: rgba(var(--accent-rgb), 0.28); }
.soc-post.for-me { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -12px rgba(var(--accent-rgb), 0.8); }
.soc-post-main { flex: 1; min-width: 0; }
.soc-post-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.soc-post-author { font-weight: 800; font-size: 0.92rem; }
.soc-post-time { color: var(--soc-dim); font-size: 0.74rem; }
.soc-post-for {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: var(--r-sm);
    background: rgba(var(--accent-rgb), 0.18);
    color: var(--accent-hover);
    font-size: 0.72rem;
    font-weight: 800;
}
.soc-post-for .icon { width: 11px; height: 11px; }
.soc-post-body { margin: 4px 0 0; line-height: 1.42; font-size: 0.95rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.soc-post-song {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 9px;
    padding: 8px;
    border-radius: var(--r-md);
    background: rgba(var(--tint-rgb), 0.06);
    border: 1px solid var(--soc-line);
}
.soc-post-song .soc-cover { width: 44px; height: 44px; }
.soc-post-del { align-self: flex-start; width: 32px; height: 32px; }
.soc-keeps { text-align: center; color: var(--soc-dim); font-size: 0.78rem; margin: 14px 0 0; }

/* ---------- Weekly: how a list is made ---------- */
.soc-flow { position: relative; margin: 4px 0 0; padding: 0; list-style: none; }
.soc-step { position: relative; display: flex; gap: 14px; padding-bottom: 20px; }
.soc-step:last-child { padding-bottom: 0; }
.soc-step::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 34px;
    bottom: 2px;
    width: 2px;
    background: linear-gradient(var(--accent), rgba(var(--accent-rgb), 0.1));
    opacity: 0.55;
}
.soc-step:last-child::before { display: none; }
.soc-step-n {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 900;
    font-size: 0.9rem;
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}
.soc-step-body { flex: 1; min-width: 0; }
.soc-step-title { font-weight: 800; font-size: 0.97rem; margin: 5px 0 2px; }
.soc-step-text { color: var(--soc-dim); font-size: 0.84rem; line-height: 1.45; margin: 0; }
.soc-step-text b { color: var(--fg); }
.soc-seeds { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.soc-seed { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border-radius: 12px; background: rgba(var(--tint-rgb), 0.05); cursor: pointer; }
.soc-seed:hover { background: rgba(var(--tint-rgb), 0.1); }
.soc-seed .soc-cover { width: 38px; height: 38px; border-radius: 8px; }
.soc-seed-n { font-weight: 900; font-size: 0.8rem; color: var(--accent); width: 18px; text-align: center; flex-shrink: 0; }
.soc-seed-times {
    flex-shrink: 0;
    font-size: 0.74rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--r-sm);
    background: rgba(var(--accent-rgb), 0.16);
    color: var(--accent-hover);
}
.soc-out-covers { display: flex; margin-top: 12px; }
.soc-out-covers .soc-cover { width: 46px; height: 46px; margin-right: -12px; box-shadow: 0 0 0 3px var(--bg); }
.soc-contrib { display: flex; align-items: center; margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.soc-stack { display: flex; }
.soc-stack .soc-avatar { width: 30px; height: 30px; font-size: 0.8rem; margin-right: -8px; box-shadow: 0 0 0 2px var(--bg); }
.soc-contrib-text { color: var(--soc-dim); font-size: 0.82rem; font-weight: 600; }
.soc-countdown {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 5px 11px;
    border-radius: var(--r-md);
    background: var(--soc-tint);
    border: 1px solid var(--soc-ring);
    color: var(--accent-hover);
    font-size: 0.78rem;
    font-weight: 800;
}
.soc-countdown .icon { width: 14px; height: 14px; }
.soc-banner {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: var(--soc-tint);
    border: 1px solid var(--soc-ring);
    font-size: 0.85rem;
    line-height: 1.4;
}
.soc-banner .icon { flex-shrink: 0; color: var(--accent); width: 20px; height: 20px; margin-top: 1px; }
.soc-unheard { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; box-shadow: 0 0 6px rgba(var(--accent-rgb), 0.9); }
.soc-more { margin-top: 12px; }
.soc-more summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.84rem;
    list-style: none;
}
.soc-more summary::-webkit-details-marker { display: none; }
.soc-more[open] summary { margin-bottom: 8px; }

/* ---------- Sheets: send a song, a song arrives ---------- */
.soc-sheet { max-height: 88vh; }
.soc-label { margin: 16px 0 6px; color: var(--soc-dim); font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.soc-pick {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    margin-bottom: 4px;
    border-radius: 16px;
    background: var(--soc-tint);
    border: 1px solid var(--soc-ring);
}
.soc-pick:empty { display: none; }
.soc-pick .soc-rank-body { flex: 1; }
.soc-results { list-style: none; margin: 8px 0 0; padding: 0; max-height: 34vh; overflow-y: auto; }
.soc-result { display: flex; align-items: center; gap: 11px; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.soc-result:hover { background: rgba(var(--tint-rgb), 0.07); }
.soc-result .soc-cover { width: 40px; height: 40px; }
.soc-results .soc-empty { padding: 14px; }
.soc-note-input {
    display: block;
    width: 100%;
    height: 46px;
    margin-top: 10px;
    padding: 0 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);
    background: var(--surface-1);
    color: var(--fg);
    font: inherit;
    font-size: 16px;
}
.soc-note-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2); }
.soc-msg { min-height: 1.2em; margin: 8px 2px; font-size: 0.85rem; color: var(--soc-dim); text-align: center; }
.soc-msg.bad { color: #ff8a80; }
.soc-msg.good { color: var(--accent-hover); }
.soc-primary, .soc-secondary {
    width: 100%;
    min-height: 48px;
    margin-bottom: 8px;
    border-radius: var(--r-md);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}
.soc-primary { border: none; background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 20px -10px rgba(var(--accent-rgb), 0.9); }
.soc-secondary { border: 1px solid var(--soc-ring); background: var(--soc-tint); color: var(--accent-hover); }
.soc-primary:disabled, .soc-secondary:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.soc-sheet .menu-btn.close-btn { justify-content: center; }

.soc-gift { text-align: center; }
.soc-gift-cover { width: 150px; height: 150px; border-radius: 18px; margin: 4px auto 14px; box-shadow: 0 18px 40px -14px rgba(var(--accent-rgb), 0.8); }
.soc-gift-cover.soc-cover.ghost .icon { width: 50%; height: 50%; }
.soc-gift h4 { margin: 0 0 4px; font-size: 1.15rem; }
.soc-gift p { margin: 0 0 6px; color: var(--soc-dim); }
.soc-gift .soc-gift-from { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--fg); font-weight: 700; font-size: 0.9rem; }
.soc-gift .soc-primary, .soc-gift .soc-secondary { text-align: center; }

@media (prefers-reduced-motion: reduce) {
    .soc-panel, .soc-post, .soc-bar > i, .soc-week-bar, .soc-hours i, .soc-meter > i { animation: none; }
    .nav-dot, .soc-mail.has-new .soc-mail-icon { animation: none; }
    .soc-tab-pill { transition: none; }
}

/* ---------- Chats ---------- */
.soc-convo {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 8px;
    border: none;
    border-radius: var(--r-md);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.soc-convo:hover { background: var(--soc-card); }
.soc-convo .soc-avatar { width: 46px; height: 46px; }
.soc-convo-body { flex: 1; min-width: 0; }
.soc-convo-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.soc-convo-name { font-weight: 800; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-convo-time { color: var(--soc-dim); font-size: 0.72rem; flex-shrink: 0; }
.soc-convo-last { color: var(--soc-dim); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soc-convo.unread .soc-convo-last { color: var(--fg); font-weight: 700; }
.soc-unread {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.75rem;
    font-weight: 900;
    line-height: 22px;
    text-align: center;
    flex-shrink: 0;
}

.soc-thread-head {
    position: sticky;
    top: var(--top-inset);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px 10px;
    margin-bottom: 6px;
    background: var(--bg);
    border-bottom: 1px solid var(--soc-line);
}
.soc-thread-head .soc-avatar { width: 40px; height: 40px; }
.soc-thread-who { flex: 1; min-width: 0; }
.soc-thread-name { font-weight: 800; font-size: 1rem; }
.soc-thread { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 14px; min-height: 40vh; }
.soc-day { align-self: center; margin: 10px 0 4px; color: var(--soc-dim); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.soc-bubble-row { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; animation: soc-rise 0.25s ease both; }
.soc-bubble-row.mine { align-self: flex-end; align-items: flex-end; }
.soc-bubble {
    padding: 9px 13px;
    border-radius: 18px 18px 18px 6px;
    background: var(--soc-card-strong);
    border: 1px solid var(--soc-line);
    line-height: 1.38;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}
.soc-bubble-text { white-space: pre-wrap; }
.soc-bubble .soc-icon-btn { min-width: 40px; }
.soc-bubble-row.mine .soc-bubble {
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 78%, #000));
    border-color: transparent;
    color: var(--on-accent);
}
/* A song in a chat is a fixed-size card that never outgrows the window: the
   title truncates instead of stretching the bubble. */
.soc-bubble.has-song { width: min(270px, 100%); max-width: 100%; padding: 8px; }
.soc-bubble .soc-post-song { margin-top: 0; min-width: 0; width: 100%; color: var(--fg); padding: 6px; }
.soc-bubble .soc-post-song .soc-rank-body { min-width: 0; overflow: hidden; }
.soc-bubble .soc-post-song .soc-cover { width: 44px; height: 44px; }
.soc-bubble.has-song .soc-bubble-text { padding: 8px 6px 2px; }
.soc-bubble .soc-post-song + .soc-bubble-text, .soc-bubble-text + .soc-post-song { margin-top: 8px; }
.soc-bubble-meta { color: var(--soc-dim); font-size: 0.68rem; margin: 2px 6px 0; display: flex; gap: 8px; align-items: center; }
.soc-bubble-del { border: none; background: none; color: #ff8a80; font-size: 0.7rem; font-weight: 800; cursor: pointer; padding: 0; display: none; }
.soc-bubble-row.show-del .soc-bubble-del { display: inline; }

.soc-composer {
    position: sticky;
    bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--jelly-bar-h) + 8px);
    z-index: 6;
    padding: 10px;
    border-radius: 22px;
    background: var(--sheet);
    border: 1px solid var(--soc-line);
    box-shadow: 0 -10px 24px -12px rgba(0, 0, 0, 0.7);
}
body.has-player .soc-composer { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + var(--jelly-bar-h) + 96px); }
.soc-composer:focus-within { border-color: var(--accent); }
.soc-composer-row { display: flex; align-items: flex-end; gap: 6px; }
.soc-composer textarea {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    resize: none;
    border: none;
    outline: none;
    background: transparent;
    color: var(--fg);
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    padding: 9px 6px;
}
.soc-composer textarea::placeholder { color: var(--fg-3); }
.soc-composer .soc-icon-btn.play:disabled { opacity: 0.35; cursor: default; }
.soc-composer .soc-attach { margin: 0 0 8px; }
.soc-chat-note { text-align: center; color: var(--soc-dim); font-size: 0.78rem; margin: 6px 0 0; }

/* ==========================================================================
   Right now, above the tabs: live jellies, invites, people and what they are
   playing, shared playlists (js/socialLive.js), and the person sheet.
   ========================================================================== */
/* ==========================================================================
   SOCIAL — the Potipeople tab and the person sheet (js/social.js)
   ========================================================================== */

.social-section {
    max-width: 760px;
    margin-bottom: 26px;
}
.social-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 1.15rem;
    font-weight: 800;
}

/* A red dot that breathes, like an "on air" light. */
.live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
    animation: livePulse 1.6s ease-out infinite;
}
@keyframes livePulse {
    to { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); }
}

/* ---------- Live jellies ---------- */
.social-jelly-list {
    display: grid;
    gap: 8px;
}
.social-jelly {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px 12px 14px;
    border-radius: var(--r-lg);
    background:
        linear-gradient(120deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.05) 70%),
        var(--surface-1);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
}
.social-jelly.is-mine {
    background: var(--surface-1);
    border-color: var(--border);
}
.social-jelly-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.82rem;
    color: var(--fg-3);
}
.social-jelly-text strong {
    font-size: 0.98rem;
    color: var(--fg);
}
.social-join {
    padding: 9px 20px;
    font-size: 0.88rem;
}

/* ---------- Invites ---------- */
.social-invite-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.social-invite {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    padding: 12px 14px;
    border-radius: var(--r-lg);
    background: var(--surface-1);
    border: 1px solid var(--border);
}
.social-invite-text {
    flex: 1 1 220px;
    font-size: 0.9rem;
    color: var(--fg-2);
}
.social-invite-text strong { color: var(--fg); }
.social-invite-actions {
    display: flex;
    gap: 8px;
}
.social-invite-actions button {
    padding: 8px 16px;
    font-size: 0.85rem;
}
.social-invite-actions .social-decline {
    background: var(--surface-3);
    color: var(--fg);
}

/* ---------- People ---------- */
.social-people {
    list-style: none;
    margin: 0;
    padding: 0;
}
.social-person {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 8px;
    background: transparent;
    color: var(--fg);
    border-radius: var(--r-md);
    text-align: left;
    font-weight: 500;
}
.social-person:hover { background: var(--hover); }
.social-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.social-avatar {
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
}
/* Around now: a green dot on the avatar. */
.social-avatar-wrap.is-online::after,
.person-avatar.is-online::after {
    content: "";
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--like);
    box-shadow: 0 0 0 3px var(--bg);
}
/* Listening now: the avatar gets a ring in the accent colour. */
.social-person.is-listening .social-avatar {
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}
.social-person-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.social-person-name {
    font-size: 1rem;
    font-weight: 700;
}
.social-person-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--fg-3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.social-person.is-listening .social-person-status {
    color: var(--accent);
    font-weight: 600;
}
.social-person-cover {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
/* Three little bars bouncing next to "Listening to …". */
.eq-mini {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 11px;
    flex-shrink: 0;
}
.eq-mini i {
    width: 3px;
    height: 100%;
    border-radius: 1px;
    background: currentColor;
    animation: eqMini 0.9s ease-in-out infinite alternate;
}
.eq-mini i:nth-child(2) { animation-delay: -0.3s; }
.eq-mini i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eqMini {
    from { transform: scaleY(0.3); }
    to { transform: scaleY(1); }
}
.eq-mini i { transform-origin: bottom; }
.skel-round { border-radius: 50%; width: 52px; height: 52px; }
.social-empty,
.social-footnote {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--fg-3);
}
.social-footnote { max-width: 760px; }

/* ---------- One person ---------- */
.person-content { text-align: center; }
.person-hero { margin-bottom: 16px; }
.person-avatar {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 4px auto 12px;
    font-size: 2.4rem;
    overflow: visible;
}
.person-avatar img { border-radius: 50%; }
.modal-content #person-name {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
}
.person-status {
    margin: 0;
    font-size: 13px;
    color: var(--fg-3);
}
.person-now {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-bottom: 16px;
    padding: 8px 16px 8px 8px;
    background: var(--surface-2);
    color: var(--fg);
    border-radius: var(--r-md);
    text-align: left;
    font-weight: 600;
}
.person-now:hover { background: var(--surface-3); }
.person-now img {
    width: 48px;
    height: 48px;
    border-radius: 9px;
    object-fit: cover;
}
.person-now-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.person-now-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
}
.person-now-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.person-now > .icon { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
    .live-dot, .eq-mini i { animation: none; }
}

/* On this tab the invites are listed right here, so the pop-up banner that
   announces them elsewhere would only be saying it twice. */
body:has(#view-social.active) .collab-invite {
    display: none;
}
