/* ==========================================================================
   duno social shell (27 Nov 2026). Loaded last from header.php, for signed-in members only
   (body has the class "sx"). Markup: header_social.php.

   - one top bar on every screen: logo and search on the left, five big tabs in
     the middle, round buttons (menu, messages, notifications, account) on the right
   - 1280px and wider: shortcuts in a column on the left, the feed in the middle,
     birthdays and contacts on the right
   - 900 to 1279px: feed and right column; the shortcuts move into the account menu
   - phones: top bar + the bottom tabs, cards edge to edge
   - grey page, white cards with a soft shadow and no outline
   - the post box is one line until you click it; stories are tall cards

   To go back: set $socialShell = false in header.php.
   ========================================================================== */

/* ---------- 1. tokens ---------- */
body.sx {
  --bg: #f0f2f5; --card: #ffffff; --elev: #ffffff; --soft: #f0f2f5;
  --ink: #080809; --ink-2: #1c1e21; --muted: #65686c; --faint: #8a8d91;
  --line: #d8dadf; --line-2: #e4e6eb; --hover: #f2f2f2; --press: #e4e6eb; --field: #f0f2f5;
  --brand: #1565e6; --brand-600: #0f52c2; --brand-50: #e7f0fe; --brand-100: #cfe0fd;
  --brand-grad: linear-gradient(#1565e6, #1565e6);
  --radius: 10px; --radius-sm: 8px; --radius-lg: 12px;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .1);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, .2), 0 2px 4px rgba(0, 0, 0, .1);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .2), 0 2px 4px rgba(0, 0, 0, .1);
  --header-h: 56px; --side-w: 0px; --sx-rail: 0px; --gut: 16px;
  padding-left: 0;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.34;
}
[data-theme="dark"] body.sx {
  --bg: #18191a; --card: #242526; --elev: #242526; --soft: #3a3b3c;
  --ink: #e4e6eb; --ink-2: #d0d3d8; --muted: #b0b3b8; --faint: #8a8d91;
  --line: #3e4042; --line-2: #393a3b; --hover: #3a3b3c; --press: #4e4f50; --field: #3a3b3c;
  --brand: #4a9bff; --brand-600: #77b3ff; --brand-50: #263951; --brand-100: #2f4a6e;
  --brand-grad: linear-gradient(#4a9bff, #4a9bff);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .3); --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 28px rgba(0, 0, 0, .5), 0 2px 4px rgba(0, 0, 0, .3);
}
body.sx h1, body.sx h2, body.sx h3 { letter-spacing: 0; font-weight: 700; }
body.sx .card, [data-theme="dark"] body.sx .card { border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); }
body.sx .btn { border-radius: 8px; font-weight: 600; }
body.sx .btn-ghost { background: var(--press); border-color: transparent; color: var(--ink); }
body.sx .btn-ghost:hover { background: color-mix(in srgb, var(--press) 85%, #000); }
body.sx .tab { background: var(--press); color: var(--ink); font-weight: 600; }
body.sx .tab:hover { background: color-mix(in srgb, var(--press) 88%, #000); }
body.sx .tab.active, body.sx .tab.active:hover { background: var(--brand-50); color: var(--brand) !important; font-weight: 600; }
body.sx .chip.on, body.sx .chip.on:hover, body.sx .jb-dd.on > summary, body.sx .ct-tab.on { background: var(--brand-50) !important; border-color: var(--brand-50) !important; color: var(--brand) !important; }
body.sx .nav-badge, body.sx .bb-badge { background: #e41e3f; color: #fff; font-weight: 700; }

/* ---------- 2. top bar ---------- */
body.sx .topbar.sx-top {
  position: sticky; top: 0; left: 0; right: 0; bottom: auto; width: auto; height: var(--header-h); z-index: 60;
  background: var(--card) !important; border: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .12), 0 0 1px rgba(0, 0, 0, .08);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
body.sx .sx-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; height: var(--header-h); padding: 0 16px; gap: 8px; }
body.sx .sx-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.sx .sx-right { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
body.sx .sx-top .logo { height: 40px; padding: 0; margin: 0; flex: none; gap: 8px; }
body.sx .sx-top .logo-mark { width: 40px; height: 40px; border-radius: 50% !important; background: var(--brand); color: #fff; font-size: 1.5rem; font-weight: 800; }
body.sx .sx-top .logo-word { display: none; font-size: 1.5rem; font-weight: 800; letter-spacing: -.03em; color: var(--brand); }

/* search: a grey pill that stays in place; results drop down under it */
body.sx .sx-top .top-search { display: flex; position: relative; flex: 0 1 244px; min-width: 0; margin: 0; }
body.sx .sx-top .top-search .ic { left: 12px; color: var(--muted); }
body.sx .sx-top .top-search input { width: 100%; height: 40px; min-height: 40px; padding: 0 14px 0 38px; border: 0 !important; border-radius: 999px !important; background: var(--field) !important; font-size: .9375rem; color: var(--ink); box-shadow: none; }
body.sx .sx-top .top-search input::placeholder { color: var(--muted); }
body.sx .sx-top .top-search input:focus { background: var(--field) !important; box-shadow: 0 0 0 2px var(--brand-100); outline: 0; }
body.sx.search-open::before { display: none; }
body.sx .sx-top .top-search.expanded { position: relative; top: auto; left: auto; transform: none; width: auto; flex: 0 1 320px; z-index: auto; }
body.sx .sx-top .top-search.expanded input { font-size: .9375rem; padding: 0 14px 0 38px; box-shadow: 0 0 0 2px var(--brand-100); }
body.sx .sx-top .search-pop, body.sx .sx-top .top-search.expanded .search-pop { position: absolute; top: calc(100% + 8px); left: 0; right: auto; width: min(400px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow-y: auto; border: 0; border-radius: 10px; box-shadow: var(--shadow-lg); background: var(--elev); }

/* the five tabs */
body.sx .sx-tabs { display: flex; align-items: stretch; justify-content: center; gap: 8px; height: var(--header-h); }
body.sx .sx-tab { position: relative; display: flex; align-items: center; justify-content: center; width: clamp(60px, 8.6vw, 116px); margin: 4px 0; border-radius: 8px; color: var(--muted); text-decoration: none !important; transition: background .12s; }
body.sx .sx-tab:hover { background: var(--hover); }
body.sx .sx-tab .nav-ic svg { width: 26px; height: 26px; stroke-width: 1.9; }
body.sx .sx-tab.active { color: var(--brand); border-radius: 8px 8px 0 0; }
body.sx .sx-tab.active:hover { background: transparent; }
body.sx .sx-tab.active .nav-ic svg { stroke-width: 2.3; fill: color-mix(in srgb, var(--brand) 16%, transparent); }
body.sx .sx-tab.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; background: var(--brand); border-radius: 3px 3px 0 0; }

/* round buttons on the right */
body.sx .sx-round, body.sx .sx-top .create-toggle {
  position: relative; display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; margin: 0;
  border: 0; border-radius: 50%; background: var(--press); color: var(--ink); cursor: pointer; text-decoration: none !important; transition: background .12s;
}
body.sx .sx-round:hover { background: color-mix(in srgb, var(--press) 86%, #000); transform: none; }
[data-theme="dark"] body.sx .sx-round:hover { background: color-mix(in srgb, var(--press) 86%, #fff); }
body.sx .sx-round.active, body.sx .sx-round[aria-expanded="true"] { background: var(--brand-50); color: var(--brand); }
body.sx .sx-round .nav-ic { display: inline-flex; position: static; }
body.sx .sx-round .nav-ic svg { stroke-width: 2.1; }
body.sx .sx-round .nav-badge { position: absolute; top: -4px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border: 0; font-size: .75rem; line-height: 19px; }
body.sx .sx-search-btn { display: none; }
body.sx .sx-top .me-chip { position: relative; display: block; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
body.sx .sx-top .me-chip:hover { background: none; filter: brightness(.95); }
body.sx .sx-top .me-chip .avatar, body.sx .sx-top .me-chip .av-on { width: 40px !important; height: 40px !important; border-radius: 50%; object-fit: cover; display: block; }
body.sx .sx-top .me-chip .on-dot { display: none; }
body.sx .sx-chev { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: var(--press); color: var(--ink); box-shadow: 0 0 0 2px var(--card); }
body.sx .sx-chev svg { stroke-width: 3; }

/* the two menus that hang off the bar */
body.sx .sx-top .me-menu, body.sx .sx-top .create-menu {
  top: calc(100% + 8px) !important; bottom: auto !important; left: auto !important; right: 0 !important;
  width: min(360px, calc(100vw - 16px)); max-height: calc(100vh - var(--header-h) - 16px); max-height: calc(100dvh - var(--header-h) - 16px); overflow-y: auto; overscroll-behavior: contain;
  padding: 8px; border: 0; border-radius: 10px; background: var(--elev); box-shadow: var(--shadow-lg);
}
body.sx .me-menu a, body.sx .me-menu button { border-radius: 8px; font-weight: 500; font-size: .9375rem; color: var(--ink); padding: 8px; }
body.sx .me-menu > a > .ic, body.sx .me-menu > button > .ic { box-sizing: content-box; padding: 9px; border-radius: 50%; background: var(--press); flex: none; }
body.sx .me-menu .me-card { align-items: center; padding: 10px; margin-bottom: 4px; border-radius: 10px; box-shadow: 0 2px 12px rgba(0, 0, 0, .14); }
body.sx .create-menu .cm-head { text-transform: none; letter-spacing: 0; padding: 6px 8px 8px; font-size: 1.25rem; font-weight: 700; color: var(--ink); }
body.sx .create-menu .cm-sub { display: block; font-size: .8125rem; font-weight: 400; color: var(--muted); }
body.sx .create-menu a > span, body.sx .create-menu button > span { display: flex; flex-direction: column; }
body.sx .me-discover, body.sx .me-discover-sep { display: block; }
body.sx .me-menu .me-stats a { background: var(--field); border-radius: 8px; }
body.sx .me-menu-sep { background: var(--line); }

/* ---------- 3. shortcuts on the left ---------- */
body.sx .sx-rail { display: none; }
body.sx .sx-row {
  position: relative; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px;
  width: auto; min-width: 0; min-height: 52px; height: auto; margin: 0; padding: 0 8px; border: 0 !important; border-radius: 8px;
  color: var(--ink); font-size: .9375rem; font-weight: 500; line-height: 1.25; text-decoration: none !important; cursor: pointer; transition: background .12s;
}
body.sx .sx-row:hover { background: var(--press); color: var(--ink); }
body.sx .sx-row.active { background: var(--press); font-weight: 600; }
body.sx .sx-ic { position: relative; display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c, #1c7ed6) 78%, #fff), var(--c, #1c7ed6)); }
body.sx .sx-ic svg { stroke-width: 2.2; }
body.sx .sx-ic .nav-badge { position: absolute; top: -5px; right: -7px; border: 2px solid var(--bg); }
body.sx .sx-ic-plain { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--press); color: var(--ink); }
body.sx .sx-ic-img, body.sx .sx-av { background: none; }
body.sx .sx-ic-img > *, body.sx .sx-ic-img img { width: 36px !important; height: 36px !important; border-radius: 8px; object-fit: cover; }
body.sx .sx-av .avatar, body.sx .sx-av .av-on { width: 36px !important; height: 36px !important; border-radius: 50%; object-fit: cover; }
body.sx .sx-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sx .sx-me .sx-label { display: flex; flex-direction: column; font-weight: 600; }
body.sx .sx-me small { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 400; color: var(--muted); }
body.sx .sx-me .streak { font-size: .78rem; }
body.sx .sx-more > summary { list-style: none; }
body.sx .sx-more > summary::-webkit-details-marker { display: none; }
body.sx .sx-more-close, body.sx .sx-more[open] .sx-more-open { display: none; }
body.sx .sx-more[open] .sx-more-close { display: inline; }
body.sx .sx-more[open] > summary .sx-ic-plain svg { transform: rotate(180deg); }
body.sx .sx-sep { height: 1px; margin: 8px 8px; background: var(--line); }
body.sx .sx-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 4px; font-size: 1.0625rem; font-weight: 600; color: var(--muted); }
body.sx .sx-head a { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); }
body.sx .sx-head a:hover { background: var(--press); color: var(--ink); }
body.sx .sx-ic-new { border: 1.5px dashed var(--faint); background: transparent; color: var(--muted); }
body.sx .sx-strength { display: flex; flex-direction: column; gap: 6px; margin: 12px 8px 4px; padding: 12px; border-radius: 10px; background: var(--card); box-shadow: var(--shadow-xs); font-size: .84rem; color: var(--muted); text-decoration: none !important; }
body.sx .sx-strength b { color: var(--ink); }
body.sx .sx-strength small { font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sx .sx-foot { padding: 16px 8px 8px; font-size: .8125rem; line-height: 1.5; color: var(--muted); }
body.sx .sx-foot a { color: inherit; }

/* ---------- 4. page frame ---------- */
body.sx .shell { max-width: none; margin: 0 0 0 var(--sx-rail); padding: 16px 16px 80px; }
body.sx .shell:has(.layout.tl) { padding-top: 16px; }
body.sx main.container { max-width: 1120px; margin: 0 auto; }
body.sx .layout { gap: 24px; }
body.sx .layout.tl { grid-template-columns: minmax(0, 680px) minmax(0, 340px); gap: 32px; justify-content: center; }
body.sx .layout.tl > .main-col { border: 0; min-height: 0; }
body.sx .side-col, body.sx .tl > .side-col { top: calc(var(--header-h) + 16px); padding-top: 0; max-height: calc(100vh - var(--header-h) - 32px); }
body.sx.dm-page .shell { margin: 0; padding: 0; }
body.sx.dm-page main.container { max-width: none; }
body.sx.dm-page .sx-rail { display: none; }

@media (min-width: 1280px) {
  body.sx { --sx-rail: 300px; }
  body.sx.dm-page { --sx-rail: 0px; }
  body.sx .sx-rail {
    display: block; position: fixed; top: var(--header-h); left: 0; bottom: 0; width: var(--sx-rail); padding: 16px 8px 24px;
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: transparent transparent;
  }
  body.sx .sx-rail:hover { scrollbar-color: var(--line) transparent; }
  body.sx .me-discover, body.sx .me-discover-sep { display: none; }
  body.sx .shell { padding-left: 32px; padding-right: 32px; }
  body.sx .tl .sx-dup-rail { display: none; }   /* "Your communities" is already on the left */
}
@media (min-width: 1600px) {
  body.sx { --sx-rail: 340px; }
  body.sx .sx-rail { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 1099px) {
  body.sx .sx-top .top-search { display: none; }
  body.sx .sx-search-btn { display: inline-grid; }
}
@media (max-width: 1099px) {
  body.sx .sx-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
}
@media (max-width: 899px) {
  body.sx .layout, body.sx .layout.tl { grid-template-columns: minmax(0, 680px); justify-content: center; }
  body.sx .side-col, body.sx .tl > .side-col { position: static; max-height: none; }
}

/* ---------- 5. the post box ---------- */
body.sx form.composer, body.sx .tl > .main-col > .composer { padding: 12px 16px; margin: 0 0 16px; }
body.sx .composer-row { gap: 8px; align-items: flex-start; }
body.sx .composer-row .avatar, body.sx .composer-row .av-on { width: 40px !important; height: 40px !important; flex: none; }
body.sx .composer-row textarea, body.sx .tl .composer-row textarea {
  background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  padding: 8px 4px; min-height: 84px; font-size: 1.25rem; line-height: 1.3; color: var(--ink);
}
body.sx .composer-row textarea::placeholder { color: var(--muted); opacity: 1; }
body.sx .composer-foot { gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
body.sx .composer-foot .file-label { padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: .9375rem; }
body.sx .composer-foot .file-label:hover { background: var(--hover); }
body.sx .composer-foot .file-label .ic { color: #45bd62; }
body.sx .composer-foot .video-label .ic { color: #f3425f; }
body.sx .composer-foot .poll-toggle .ic { color: #f7b928; }
body.sx .composer-foot select { border-radius: 8px; background-color: var(--press); border-color: transparent; font-weight: 600; }
body.sx .composer-foot .btn-primary { min-height: 36px; padding-left: 28px; padding-right: 28px; }
/* closed: avatar, one grey line, three round coloured buttons */
body.sx form.composer:not(.is-open) { display: flex; align-items: center; gap: 8px; }
body.sx form.composer:not(.is-open) .composer-row { flex: 1 1 auto; min-width: 0; align-items: center; }
body.sx form.composer:not(.is-open) .composer-row textarea {
  height: 40px !important; min-height: 40px; padding: 9px 16px; border-radius: 20px !important; background: var(--field) !important;
  font-size: 1.0625rem; line-height: 22px; overflow: hidden; white-space: nowrap; resize: none; cursor: pointer;
}
body.sx form.composer:not(.is-open) .composer-row textarea:hover { background: var(--press) !important; }
body.sx form.composer:not(.is-open) .composer-foot { flex: none; flex-wrap: nowrap; margin: 0; padding: 0; border: 0; gap: 0; }
body.sx form.composer:not(.is-open) .composer-foot > :not(.file-label) { display: none; }
body.sx form.composer:not(.is-open) .composer-foot .file-label { width: 40px; height: 40px; padding: 0; justify-content: center; gap: 0; font-size: 0; border-radius: 50%; }
body.sx form.composer:not(.is-open) .composer-foot .file-label .ic { width: 24px; height: 24px; }
body.sx form.composer:not(.is-open) .poll-builder { display: none; }

/* ---------- 6. stories: a row of tall cards ---------- */
body.sx .sx-stories, body.sx .tl > .main-col > .sx-stories { position: relative; display: block; overflow: visible; margin: 0 0 16px; padding: 0; background: none; border: 0; box-shadow: none; }
body.sx .sx-st-track { display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scrollbar-width: none; padding: 1px 1px 3px; border-radius: 12px; }
body.sx .sx-st-track::-webkit-scrollbar { display: none; }
body.sx .sx-st {
  position: relative; flex: 0 0 calc((100% - 32px) / 5); min-width: 104px; max-width: 141px; aspect-ratio: 112 / 200; width: auto; padding: 0; margin: 0;
  border: 0; border-radius: 12px; overflow: hidden; cursor: pointer; font: inherit; color: #fff; text-align: left; box-shadow: var(--shadow-xs); display: block;
}
body.sx .sx-st-bg { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .25s ease; }
body.sx .sx-st:hover .sx-st-bg, body.sx .sx-st-add:hover .sx-st-photo img { transform: scale(1.04); }
body.sx .sx-st.story-bubble::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0) 32%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .58)); pointer-events: none; transition: background .15s; }
body.sx .sx-st.story-bubble:hover::after { background: linear-gradient(180deg, rgba(0, 0, 0, .36), rgba(0, 0, 0, .1) 32%, rgba(0, 0, 0, .1) 58%, rgba(0, 0, 0, .64)); }
body.sx .sx-st .story-ring { position: absolute; z-index: 1; top: 10px; left: 10px; display: block; width: 40px; height: 40px; padding: 0; border: 4px solid rgba(255, 255, 255, .85); border-radius: 50%; background: var(--card); transform: none !important; overflow: hidden; }
body.sx .sx-st .story-ring.unseen { border-color: var(--brand); background: var(--card); }
body.sx .sx-st .story-ring .avatar { width: 100% !important; height: 100% !important; border: 0; border-radius: 50%; object-fit: cover; display: block; }
body.sx .sx-st .story-name { position: absolute; z-index: 1; left: 10px; right: 10px; bottom: 10px; max-width: none; color: #fff; font-size: .8125rem; font-weight: 600; line-height: 1.2; text-align: left; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }
body.sx .sx-st-text { position: absolute; inset: 58px 10px 44px; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; font-size: .875rem; font-weight: 700; line-height: 1.25; overflow: hidden; }
body.sx .sx-st-add { background: var(--card); color: var(--ink); }
body.sx .sx-st-photo { position: absolute; inset: 0 0 24% 0; overflow: hidden; background: var(--press); }
body.sx .sx-st-photo img { width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; transition: transform .25s ease; }
body.sx .sx-st-plus { position: absolute; left: 50%; bottom: 24%; transform: translate(-50%, 50%); z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; border: 4px solid var(--card); box-sizing: border-box; }
body.sx .sx-st-plus svg { stroke-width: 2.6; }
body.sx .sx-st-addlabel { position: absolute; left: 4px; right: 4px; bottom: 9px; text-align: center; font-size: .8125rem; font-weight: 600; color: var(--ink); }
body.sx .sx-st-hint { align-self: center; margin: 0 0 0 8px; max-width: 320px; }
body.sx .sx-st-nav { position: absolute; z-index: 2; top: 50%; right: 12px; transform: translateY(-50%); display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--card); color: var(--muted); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); cursor: pointer; }
body.sx .sx-st-nav[hidden] { display: none; }
body.sx .sx-st-nav:hover { background: var(--hover); color: var(--ink); }
body.sx .sx-st-next svg { transform: rotate(-90deg); }
body.sx .sx-st-prev { right: auto; left: 12px; }
body.sx .sx-st-prev svg { transform: rotate(90deg); }

/* ---------- 7. feed ---------- */
body.sx .tl > .main-col > .card, [data-theme="dark"] body.sx .tl > .main-col > .card { background: var(--card); border: 0; border-radius: var(--radius-lg); margin: 0 0 16px; box-shadow: var(--shadow-xs); }
body.sx .tl > .main-col > .qotd { padding: 14px 16px; border-left: 0; }
body.sx .tl > .main-col > .tabs { position: static; margin: 0 0 12px; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.sx .post, [data-theme="dark"] body.sx .post { background: var(--card); border: 0; border-radius: var(--radius-lg); margin: 0 0 16px; box-shadow: var(--shadow-xs); }
body.sx .post-top { padding: 12px 8px 0 16px; }
body.sx .post-head { gap: 8px; }
body.sx .post-av .avatar, body.sx .post-av .av-on { width: 40px !important; height: 40px !important; }
body.sx .post-author { font-size: .9375rem; font-weight: 600; color: var(--ink); }
body.sx .post-sub { font-size: .8125rem; color: var(--muted); }
body.sx .post-menu > summary { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
body.sx .post-menu > summary:hover { background: var(--hover); }
body.sx .post-body { padding: 6px 16px 8px; font-size: .9375rem; line-height: 1.34; color: var(--ink); }
body.sx .read-more { padding: 0 16px 8px; font-weight: 600; }
body.sx .post-flag, body.sx .founder-flag { padding: 12px 16px 0; }
body.sx .post-image, body.sx .post-gallery, body.sx .post-video { margin: 4px 0 0; border: 0; border-radius: 0; }
body.sx .post-image img { width: 100%; max-height: 700px; object-fit: cover; background: var(--soft); display: block; }
body.sx .link-card, body.sx .repost-embed, body.sx .poll { margin: 8px 16px 4px; border-radius: 10px; }
body.sx .repost-embed .post-image, body.sx .repost-embed .post-gallery { margin: 8px 0 0; }
body.sx .post-actions { margin: 8px 16px 0; padding: 4px 0; gap: 4px; border-top: 1px solid var(--line); justify-content: space-between; }
body.sx .post-actions .btn-react, body.sx .post-actions .btn-comment, body.sx .post-actions .btn-repost, body.sx .post-actions .btn-share, body.sx .post-actions .btn-save {
  height: 36px; border-radius: 6px !important; color: var(--muted); font-size: .9375rem; font-weight: 600; justify-content: center;
}
body.sx .post-actions .btn-comment:hover, body.sx .post-actions .btn-repost:hover, body.sx .post-actions .btn-share:hover, body.sx .post-actions .btn-save:hover { background: var(--hover); }
body.sx .post-actions .btn-save.active { color: var(--brand); }
body.sx .post-actions + .post-stats, body.sx .post-stats { padding: 2px 16px 10px; }
body.sx .post-comments-preview { margin: 0 16px; padding: 8px 0 10px; border-top: 1px solid var(--line); }
body.sx .founder-feature { margin: 0 0 16px; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); background: var(--card); }
body.sx .founder-feature .post { margin: 0; box-shadow: none !important; }
body.sx .tl .empty { border: 0 !important; }
body.sx .my-nets { padding: 14px 16px; }

/* ---------- 8. right column of the feed: flat sections on the grey page ---------- */
body.sx .tl > .side-col { gap: 0; scrollbar-width: none; }
body.sx .tl > .side-col::-webkit-scrollbar { display: none; }
body.sx .tl > .side-col .card, [data-theme="dark"] body.sx .tl > .side-col .card { background: transparent; border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 12px 8px 14px; border-bottom: 1px solid var(--line); }
body.sx .tl > .side-col .card:first-child { padding-top: 0; }
body.sx .tl > .side-col .card:last-child { border-bottom: 0; }
body.sx .tl > .side-col .side-card h3 { font-size: 1.0625rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
body.sx .tl > .side-col .gs-card { order: -4; }
body.sx .tl > .side-col .bday-side { order: -3; }
body.sx .tl > .side-col .sx-contacts { order: -2; }
body.sx .bday-side h3 .ic { color: #e41e3f; }
body.sx .sx-side-head { display: flex; align-items: center; justify-content: space-between; }
body.sx .sx-side-head a { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -6px 0 2px; border-radius: 50%; color: var(--muted); }
body.sx .sx-side-head a:hover { background: var(--press); color: var(--ink); }
body.sx .sx-contact { display: flex; align-items: center; gap: 12px; min-height: 52px; margin: 0 -8px; padding: 0 8px; border-radius: 8px; color: var(--ink); font-size: .9375rem; font-weight: 500; text-decoration: none !important; }
body.sx .sx-contact:hover { background: var(--press); }
body.sx .sx-contact .avatar, body.sx .sx-contact .av-on { width: 36px !important; height: 36px !important; border-radius: 50%; object-fit: cover; flex: none; }
body.sx .sx-contact > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sx .sx-contact-all { color: var(--muted); }
body.sx .tl > .side-col .person-row, body.sx .tl > .side-col .side-group { border-radius: 8px; }
body.sx .on-dot { background: #31a24c; }

/* ---------- 9. phones ---------- */
@media (max-width: 760px) {
  body.sx { --header-h: 52px; }
  body.sx .topbar.sx-top { position: fixed; top: 0; left: 0; right: 0; height: auto; padding-top: env(safe-area-inset-top, 0px); background: var(--card) !important; }   /* phones: pinned, as before (duno.css pads the page for it) */
  body.sx .sx-bar { grid-template-columns: minmax(0, 1fr) auto; padding: 0 12px; }
  body.sx .sx-tabs { display: none; }
  body.sx .sx-top .logo-word { display: inline; }
  body.sx .sx-top .logo-mark { display: none; }
  body.sx .sx-dm, body.sx .sx-bell { display: none; }   /* both are in the bottom tabs */
  body.sx .sx-round, body.sx .sx-top .me-chip, body.sx .sx-top .me-chip .avatar, body.sx .sx-top .me-chip .av-on { width: 36px !important; height: 36px !important; }
  body.sx .sx-top .me-menu, body.sx .sx-top .create-menu {
    position: fixed; top: calc(var(--header-h) + 6px) !important; right: 8px !important;
    max-height: calc(100vh - var(--header-h) - var(--bb-total, 56px) - 16px); max-height: calc(100dvh - var(--header-h) - var(--bb-total, 56px) - 16px);
  }
  body.sx .shell { margin: 0; padding: 8px 0 calc(var(--bb-total, 56px) + 24px); }
  body.sx .layout, body.sx .layout.tl { grid-template-columns: minmax(0, 1fr); }
  body.sx .card, [data-theme="dark"] body.sx .card, body.sx .post, [data-theme="dark"] body.sx .post,
  body.sx .tl > .main-col > .card, [data-theme="dark"] body.sx .tl > .main-col > .card, body.sx .founder-feature { border-radius: 0; margin-bottom: 8px; box-shadow: none; }
  body.sx form.composer, body.sx .tl > .main-col > .composer { margin-bottom: 8px; padding: 10px 12px; }
  body.sx .sx-stories { margin: 0 0 8px; padding: 8px 0; background: var(--card); }
  body.sx .sx-st-track { padding: 0 12px; border-radius: 0; }
  body.sx .sx-st { flex-basis: 104px; }
  body.sx .sx-st-nav { display: none; }
  body.sx .tl > .main-col > .tabs { margin: 0 0 8px; padding: 4px 12px; }
  body.sx .tl > .side-col { padding: 0 12px; }
  body.sx .tl > .side-col .card, [data-theme="dark"] body.sx .tl > .side-col .card { padding-left: 0; padding-right: 0; }
  body.sx .sx-contact { margin: 0; }
  body.sx .post-actions .btn-comment span, body.sx .post-actions .btn-repost span, body.sx .post-actions .btn-share span, body.sx .post-actions .btn-save span { display: none; }
  body.sx .bottombar { background: var(--card); border-top: 1px solid var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; }
  body.sx .bottombar a { color: var(--muted); }
  body.sx .bottombar a.active { color: var(--brand); }
}
body.sx .profile-cover { max-height: none; }
