/* ── The social page: /explore/, /feed/, /p/<id>/, /u/<name>/ ──────────────
   Layout only — the feed's own pieces are css/social.css. A top bar, the task
   pane down the left (Places · You · Details, the way Explorer grouped them),
   the content, and a status bar along the bottom. On a phone: the top bar,
   section tabs under it, the content, and one floating button to the editor. */

html.lr-social, html.lr-social body {
  height: auto; min-height: 100%; overflow: visible; overflow-x: clip;
  overscroll-behavior: auto; background: var(--so-ground); color: var(--so-text);
}
html.lr-social.fd-lock, html.lr-social.fd-lock body { overflow: hidden; }
html.lr-social body.sx-body { margin: 0; font: 400 14px/1.5 var(--so-font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.sx-body *, .sx-body *::before, .sx-body *::after { box-sizing: border-box; }
.sx-body a { color: inherit; }
.sx-skip { position: absolute; left: -9999px; top: 8px; z-index: 999; padding: 8px 14px; border-radius: 999px; background: var(--so-text); color: var(--so-ground); }
.sx-skip:focus { left: 12px; }

/* ── Top bar ── */
.sx-top {
  position: sticky; top: 0; z-index: 50;
  height: calc(var(--sx-top-h) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 20px 0;
  display: flex; align-items: center; gap: 16px;
  background: var(--so-glass); -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border-bottom: 1px solid var(--so-line);
}
.sx-brand { display: inline-flex; align-items: center; gap: 10px; flex: none; color: var(--so-text); text-decoration: none; }
.sx-brand svg { width: 28px; height: 28px; }
.sx-brand b { font: 800 16px/1 var(--so-font); letter-spacing: -0.01em; }
.sx-brand i { font: 500 13px/1 var(--so-font); font-style: normal; color: var(--so-muted); padding-left: 10px; border-left: 1px solid var(--so-line-2); }
.sx-search-slot { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.sx-search-slot .fd-search { margin: 0; flex: 1 1 auto; max-width: 520px; height: 40px; }
.sx-actions { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.sx-acct {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--so-line-2); background: transparent; color: var(--so-text); cursor: pointer;
  font: 650 13px/1 var(--so-font);
}
.sx-acct:hover { background: var(--so-chip); }
.sx-acct.logged-in { padding: 0 12px 0 3px; }
.sx-acct .acct-trigger-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--so-chip-2); border: 1px solid var(--so-line-2); flex: none; }
.sx-acct .acct-trigger-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-acct .acct-trigger-ini { font: 700 13px/1 var(--so-font); }
.sx-acct svg { flex: none; }
.sx-acct .sx-av { width: 32px; height: 32px; border-radius: 50%; background: var(--so-chip-2) center / cover no-repeat; border: 1px solid var(--so-line-2); display: grid; place-items: center; font: 700 13px/1 var(--so-font); }
.sx-cta {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px 0 14px; border-radius: 999px;
  background: var(--so-cta); color: #fff; text-decoration: none; border: 0; cursor: pointer;
  font: 700 13.5px/1 var(--so-font);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 8px 22px var(--so-cta-glow);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.sx-cta svg { width: 18px; height: 18px; }
.sx-cta:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 10px 26px rgba(190, 20, 60, 0.5); }
.sx-cta:active { transform: scale(0.97); }

/* ── The frame: task pane + content ── */
.sx-wrap { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 36px; max-width: 1480px; margin: 0 auto; padding: 24px 24px 72px; }
.sx-pane { position: sticky; top: calc(var(--sx-top-h) + 24px); align-self: start; display: flex; flex-direction: column; gap: 14px; }
.sx-group { border: 1px solid var(--so-line); border-radius: 18px; background: var(--so-surface); overflow: hidden; }
/* The group header bar — Explorer's task pane, without the blue. */
.sx-group-h {
  display: flex; align-items: center; justify-content: space-between; margin: 0;
  padding: 11px 14px 10px; border-bottom: 1px solid var(--so-line);
  background: linear-gradient(180deg, var(--so-raise), var(--so-surface));
  font: 800 10.5px/1 var(--so-font); letter-spacing: 0.14em; text-transform: uppercase; color: var(--so-muted);
}
.sx-group-h::after {
  content: ''; width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 1px solid var(--so-line-2);
  background: var(--so-raise) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 9.5l3-3 3 3' fill='none' stroke='%238a96bf' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.sx-nav { display: flex; flex-direction: column; padding: 6px; gap: 2px; }
.sx-nav a, .sx-nav button {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border-radius: 12px;
  border: 0; background: none; cursor: pointer; text-align: left; text-decoration: none;
  color: var(--so-text); font: 600 14px/1.1 var(--so-font);
}
.sx-nav a:hover, .sx-nav button:hover { background: var(--so-chip); }
.sx-nav svg { width: 19px; height: 19px; flex: none; color: var(--so-muted); }
.sx-nav a.on { background: var(--so-chip-2); font-weight: 750; }
.sx-nav a.on svg { color: var(--so-sel); }
.sx-nav small { margin-left: auto; font: 600 11px/1 var(--so-font); color: var(--so-muted); }
.sx-details { margin: 0; padding: 10px 14px 12px; display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font: 400 12px/1.3 var(--so-xp); color: var(--so-muted); }
.sx-details dt { margin: 0; }
.sx-details dd { margin: 0; color: var(--so-text); font-variant-numeric: tabular-nums; text-align: right; }
.sx-about { padding: 12px 14px 14px; margin: 0; font: 500 12.5px/1.5 var(--so-font); color: var(--so-muted); }
.sx-about b { color: var(--so-text); }

.sx-main { position: relative; min-width: 0; }
.sx-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.sx-intro-t { min-width: 0; }
.sx-intro h1 { margin: 0; font: 800 30px/1.1 var(--so-font); letter-spacing: -0.02em; color: var(--so-text); text-wrap: balance; }
.sx-intro p { margin: 6px 0 0; max-width: 62ch; font: 500 14px/1.5 var(--so-font); color: var(--so-muted); }
/* The feed's toolbar sits on the intro's row: only the sort is left in it here. */
/* The feed's root steps out of the way so its toolbar can sit on the title's row. */
.sx-main .fd-page:not(.fd-immersive) { position: static; }
.sx-main .fd-page:not(.fd-immersive) > .fd-modal > .fd-head { position: absolute; top: 4px; right: 0; padding: 0; border: 0; background: none; gap: 8px; }
.sx-intro { padding-right: 150px; }
.sx-main .fd-page .fd-pitch { display: none; }      /* the intro already says it */
.sx-main .fd-page.fd-immersive > .fd-modal > .fd-head { position: absolute; left: 0; padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 30px; background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0)); }
.sx-main .fd-page .fd-title { display: none; }
.sx-ssr .fd-grid { margin-top: 0; }

/* ── Status bar — panes of small Tahoma, like the bottom of every window ── */
.sx-status {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  height: 28px; display: flex; align-items: stretch;
  background: var(--so-glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-top: 1px solid var(--so-line);
  font: 400 11.5px/1 var(--so-xp); color: var(--so-muted);
}
.sx-status > span { display: flex; align-items: center; padding: 0 14px; border-right: 1px solid var(--so-line); white-space: nowrap; }
.sx-status > span:last-child { margin-left: auto; border-right: 0; border-left: 1px solid var(--so-line); }
.sx-status b { font-weight: 700; color: var(--so-text); margin-right: 4px; }
.sx-status .sx-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ccf7a; margin-right: 7px; box-shadow: 0 0 0 2px rgba(60, 207, 122, 0.2); }

/* ── The balloon tip — XP's notification balloon, once, for the Feed ── */
.sx-balloon {
  position: absolute; z-index: 60; max-width: 260px; padding: 12px 34px 12px 14px;
  border-radius: 12px; border: 1px solid rgba(0, 0, 0, 0.55);
  background: #ffffe1; color: #000; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  font: 400 12px/1.4 var(--so-xp);
}
.sx-balloon b { display: block; margin-bottom: 3px; font: 700 12px/1.3 var(--so-xp); }
.sx-balloon::before { content: ''; position: absolute; left: 22px; top: -9px; width: 14px; height: 14px; background: #ffffe1; border-left: 1px solid rgba(0, 0, 0, 0.55); border-top: 1px solid rgba(0, 0, 0, 0.55); transform: rotate(45deg); }
.sx-balloon button { position: absolute; right: 8px; top: 8px; width: 18px; height: 18px; padding: 0; border: 1px solid rgba(0, 0, 0, 0.35); border-radius: 4px; background: #fff; color: #000; font: 700 10px/1 var(--so-xp); cursor: pointer; }

/* ── Section tabs (phones) ── */
.sx-tabs { display: none; }

/* ── Phones and narrow windows ── */
@media (max-width: 960px) {
  .sx-wrap { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 14px 120px; }
  .sx-pane { display: none; }
  .sx-status { display: none; }
  .sx-tabs {
    position: sticky; top: calc(var(--sx-top-h) + env(safe-area-inset-top, 0px)); z-index: 45;
    display: flex; gap: 6px; padding: 10px 14px; margin: 0 -14px 14px; overflow-x: auto; scrollbar-width: none;
    background: var(--so-glass); -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
    border-bottom: 1px solid var(--so-line);
  }
  .sx-tabs::-webkit-scrollbar { display: none; }
  .sx-tabs a { flex: none; padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--so-muted); font: 650 13px/1 var(--so-font); background: var(--so-chip); }
  .sx-tabs a.on { background: var(--so-text); color: var(--so-ground); }
  .fd-page .fd-feed-aside { top: calc(var(--sx-top-h) + 70px); }
  .fd-page .fd-notif { top: calc(var(--sx-top-h) + 8px + env(safe-area-inset-top, 0px)); right: 10px; }
}
@media (max-width: 760px) {
  :root { --sx-top-h: 54px; }
  .sx-top { padding-left: 14px; padding-right: 10px; gap: 8px; }
  .sx-brand i { display: none; }
  .sx-search-slot { display: none; }
  .sx-brand b { font-size: 15px; }
  .sx-intro { margin: 4px 0 12px; padding-right: 0; }
  .sx-intro h1 { font-size: 24px; }
  .sx-intro p { font-size: 13px; }
  /* The editor button floats at the bottom: the one hero on a phone. */
  .sx-top .sx-cta { display: none; }
  .sx-body .sx-fab { display: inline-flex; }
  html.fd-lock .sx-fab { display: none; }
  .sx-acct:not(.logged-in) { height: 34px; padding: 0 12px; font-size: 12.5px; }
  .sx-acct.logged-in b { display: none; }
  .sx-acct.logged-in { padding: 0 2px; border-color: transparent; }
  /* The sort and search share the row under the title. */
  .sx-main .fd-page:not(.fd-immersive) > .fd-modal > .fd-head { position: static; margin: 0 0 12px; padding: 0; }
  .sx-main .fd-page:not(.fd-immersive) .fd-head .fd-search { display: inline-flex; flex: 1 1 auto; min-width: 0; max-width: none; height: 36px; }
}
@media (min-width: 761px) {
  /* On a wide page the search lives in the top bar (js/social.js moves it). */
  .sx-main .fd-page:not(.fd-immersive) .fd-head .fd-search { display: none; }
}

/* The account panel (css/browser.css) sits over the page like it does over the editor. */
html.lr-social .acct-overlay { z-index: 400; }

/* ── The floating editor button (phones) ── */
.sx-fab {
  display: none; position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 70;
  align-items: center; gap: 8px; height: 48px; padding: 0 22px 0 18px; border-radius: 999px;
  transform: translateX(-50%); background: var(--so-cta); color: #fff; text-decoration: none;
  font: 700 14.5px/1 var(--so-font);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 12px 30px rgba(190, 20, 60, 0.5);
}
.sx-fab svg { width: 18px; height: 18px; }
.sx-fab:active { transform: translateX(-50%) scale(0.97); }

/* ── Toasts: bottom centre, glass, a spring in ── */
.sx-toast {
  position: fixed; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom, 0px)); z-index: 500;
  max-width: min(440px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 16px;
  background: rgba(16, 21, 33, 0.9); color: #fff; font: 600 13px/1.4 var(--so-font); text-align: center;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.55, 1), opacity 0.2s ease;
}
.sx-toast.on { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 760px) { .sx-toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }
@media (prefers-reduced-motion: reduce) { .sx-toast { transition: opacity 0.2s ease; } }
