/* Phase 166xt refined drawer + desktop avatar/dark-mode polish */
@media (max-width: 980px){
  #sv-drawer.sv-drawer{
    width:min(68vw, 256px)!important;
    left:0!important; right:auto!important;
    border-radius:0!important;
    padding:6px 6px calc(14px + env(safe-area-inset-bottom))!important;
    max-height:100dvh!important; height:100dvh!important;
    background:linear-gradient(180deg,var(--sv-bg),var(--sv-bg2))!important;
    box-shadow:0 26px 70px rgba(2,6,23,.34)!important;
    border-right:1px solid rgba(148,163,184,.16)!important;
  }
  #sv-drawer .sv-drawerTop{padding:2px 2px 10px!important;border-bottom:0!important;align-items:flex-start!important;gap:10px!important}
  #sv-drawer .sv-x{width:42px!important;height:42px!important;border-radius:999px!important;background:var(--sv-chip)!important;box-shadow:0 6px 18px rgba(15,23,42,.08)!important}
  #sv-drawer .sv-drawerBody.sv165-drawerBody{padding:0 2px 8px!important;gap:10px!important}

  .sv165-drawerHeader{display:flex;align-items:center;gap:10px;min-width:0;flex:1 1 auto;padding:8px 8px;border:1px solid var(--sv-border);border-radius:14px;background:linear-gradient(180deg,var(--sv-card),color-mix(in srgb, var(--sv-card) 74%, transparent));box-shadow:0 10px 28px rgba(15,23,42,.06)}
  .sv165-drawerMe{position:relative;width:54px;height:54px;border-radius:999px!important;overflow:visible!important;display:grid;place-items:center;background:transparent!important;box-shadow:none!important;flex:0 0 auto}
  .sv165-drawerMe img,.sv165-topProfileAv img{width:100%;height:100%;object-fit:cover;object-position:center;display:block;border-radius:999px;background:var(--sv-chip)}
  .sv165-drawerMe::before,.sv165-topProfileAv.has-story::before,.sv165-drawerMe.has-story::before,.sv165-miniAvatar.has-story::before{content:"";position:absolute;inset:-3px;border-radius:999px;background:linear-gradient(135deg,#1877f2,#8b5cf6,#f43f5e,#f59e0b);z-index:0}
  .sv165-drawerMe img,.sv165-drawerMe > span,.sv165-topProfileAv img,.sv165-topProfileAv > span,.sv165-miniAvatar img{position:relative;z-index:1;border:2px solid var(--sv-card)}
  .sv165-drawerIdentity{min-width:0;display:flex;flex-direction:column;gap:3px}
  .sv165-drawerNameRow{display:flex;align-items:center;gap:6px;min-width:0}
  .sv165-drawerName{font-size:17px;font-weight:950;color:var(--sv-fg);text-decoration:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.05}
  .sv165-drawerHandle{font-size:12px;color:var(--sv-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .sv165-nameBadge{width:18px;height:18px;border-radius:999px;background:#1877f2;color:#fff;border:2px solid var(--sv-card);display:inline-grid;place-items:center;font-size:10px;font-weight:900;box-shadow:0 4px 10px rgba(24,119,242,.22);flex:0 0 auto}

  .sv165-createWrap{display:block}.sv165-createCard{display:flex;align-items:center;gap:10px;padding:10px;border-radius:14px;background:linear-gradient(180deg,var(--sv-card),var(--sv-bg2));border:1px solid var(--sv-border);text-decoration:none;color:var(--sv-fg);box-shadow:0 10px 24px rgba(15,23,42,.06)}
  .sv165-createIco,.sv165-gridIco{width:34px;height:34px;border-radius:10px;display:grid;place-items:center;flex:0 0 auto}
  .sv165-createIco .sv-ico,.sv165-gridIco .sv-ico{width:16px;height:16px}
  .sv165-createTxt{display:flex;flex-direction:column;line-height:1.12}.sv165-createTxt strong{font-size:14px;font-weight:900;color:var(--sv-fg)}.sv165-createTxt small{font-size:11px;color:var(--sv-muted)}
  .sv165-ico--groups{background:rgba(24,119,242,.12);color:#1877f2}.sv165-ico--profile{background:rgba(14,165,233,.12);color:#0284c7}.sv165-ico--dash{background:rgba(139,92,246,.12);color:#7c3aed}.sv165-ico--saved{background:rgba(236,72,153,.12);color:#db2777}.sv165-ico--reels{background:rgba(249,115,22,.12);color:#ea580c}.sv165-ico--feed{background:rgba(16,185,129,.12);color:#059669}

  .sv165-section{display:grid;gap:8px}.sv165-sectionTitle{font-size:12px;font-weight:900;color:var(--sv-muted);padding:0 4px}.sv165-sectionHead{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px}.sv165-sectionHead a{font-size:12px;font-weight:800;color:var(--sv-muted);text-decoration:none}
  .sv165-gridLinks{display:grid;grid-template-columns:1fr 1fr;gap:6px}
  .sv165-gridLink{display:flex;align-items:center;gap:8px;padding:9px 8px;border:1px solid var(--sv-border);background:var(--sv-card);border-radius:14px;text-decoration:none;color:var(--sv-fg)!important;font-weight:850;min-height:58px;box-shadow:0 8px 18px rgba(15,23,42,.045)}
  .sv165-gridLink span:last-child{font-size:13px;line-height:1.08;color:var(--sv-fg)!important}

  .sv165-miniList,.sv165-cardRail{display:flex!important;flex-wrap:nowrap!important;gap:10px;overflow-x:auto;overflow-y:hidden;padding:2px 2px 8px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none;align-items:stretch}
  .sv165-miniList::-webkit-scrollbar,.sv165-cardRail::-webkit-scrollbar{display:none}
  .sv165-miniList .sv-note,.sv165-cardRail .sv-note{min-width:170px}
  .sv165-railCard,.sv165-miniItem{scroll-snap-align:start;flex:0 0 132px!important;min-width:132px!important;max-width:132px!important;display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:10px;border:1px solid var(--sv-border);background:linear-gradient(180deg,var(--sv-card),color-mix(in srgb, var(--sv-card) 88%, var(--sv-bg2)));border-radius:16px;text-decoration:none;color:var(--sv-fg)!important;box-shadow:0 8px 18px rgba(15,23,42,.05)}
  .sv165-miniAvatar{position:relative;width:52px;height:52px;border-radius:999px;overflow:hidden;flex:0 0 auto;background:var(--sv-chip);display:grid;place-items:center}
  .sv165-miniAvatar--group{border-radius:16px;width:54px;height:54px;background:linear-gradient(135deg,rgba(24,119,242,.12),rgba(16,185,129,.12))}
  .sv165-miniAvatar img{width:100%;height:100%;object-fit:cover;object-position:center;display:block;background:var(--sv-chip)}
  .sv165-miniText{display:flex;flex-direction:column;gap:3px;min-width:0;width:100%}
  .sv165-miniText strong,.sv165-miniText .sv165-miniName{font-size:13px;font-weight:900;line-height:1.22;color:var(--sv-fg)!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
  .sv165-miniText small,.sv165-miniText .sv165-miniSub{font-size:11px;color:var(--sv-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  .sv165-plainLinks{display:grid;gap:8px}.sv165-plainLinks .sv-drawerLink{background:var(--sv-card)!important;border:1px solid var(--sv-border)!important;border-radius:14px!important;padding:11px 13px!important;box-shadow:none!important}
  .sv165-accordionList{display:grid;gap:8px}.sv165-accordionList details{border:1px solid var(--sv-border);background:var(--sv-card);border-radius:16px;padding:0 12px}.sv165-accordionList summary{list-style:none;display:flex;align-items:center;gap:10px;padding:13px 0;font-weight:900;cursor:pointer}.sv165-accordionList summary::-webkit-details-marker{display:none}.sv165-accordionBody{display:grid;gap:8px;padding:0 0 12px}.sv165-accordionBody a{text-decoration:none;color:var(--sv-fg);font-size:14px}
  .sv165-logoutBtn{display:flex;align-items:center;justify-content:center;min-height:46px;border-radius:16px;background:var(--sv-chip);text-decoration:none;color:var(--sv-fg);font-weight:900;margin-top:4px}
}
@media (min-width: 981px){
  .sv165-topProfileAv{position:relative;overflow:visible!important}.sv165-topProfileAv img{border-radius:999px}.sv165-topProfileAv.has-story::before{content:"";position:absolute;inset:-3px;border-radius:999px;background:linear-gradient(135deg,#1877f2,#8b5cf6,#f43f5e,#f59e0b)}.sv165-topProfileAv.has-story img{position:relative;border:2px solid var(--sv-card)}
  .sv-dTopProfile{display:inline-flex!important}
  body.sv-dark .sv-dTop, html[data-theme="dark"] .sv-dTop, html.sv-pre-dark .sv-dTop{background:rgba(11,15,20,.96)!important;border-color:rgba(255,255,255,.08)!important;box-shadow:0 18px 40px rgba(0,0,0,.32)!important}
  body.sv-dark .sv-dTopProfile, html[data-theme="dark"] .sv-dTopProfile{background:rgba(255,255,255,.03)!important;border-color:rgba(255,255,255,.08)!important}
  body.sv-dark .sv-side, body.sv-dark .sv-sideRight, body.sv-dark .sv-main .sv-card, body.sv-dark .sv-main .sv-profileCardV2, html[data-theme="dark"] .sv-side, html[data-theme="dark"] .sv-sideRight, html[data-theme="dark"] .sv-main .sv-card, html[data-theme="dark"] .sv-main .sv-profileCardV2{background:var(--sv-card)!important;color:var(--sv-fg)!important;border-color:var(--sv-border)!important}
}
html.sv165-lock-scroll,body.sv165-lock-scroll{overflow:hidden!important;overscroll-behavior:none!important}
#sv-ov, .sv-modal, .sv-msgOverlay, .svConnOverlay, .sv-descOverlay{padding-bottom:max(14px, env(safe-area-inset-bottom))!important}
#sv-ov .sv-ovPanel, .sv-modalCard, .sv-modalBox, .sv-msgPanel, .svConnSheet, .sv-descCard{max-height:calc(100dvh - 18px - env(safe-area-inset-bottom))!important;overscroll-behavior:contain!important}
#sv-ov .sv-ovPanel, .sv-modalCard, .sv-modalBox, .sv-msgPanel{margin-bottom:max(8px, env(safe-area-inset-bottom))!important}
@media (max-width: 980px){#sv-ov .sv-ovPanel, .sv-modalCard, .sv-modalBox, .sv-msgPanel, .svConnSheet, .sv-descCard{width:min(100vw - 12px, 700px)!important;border-radius:22px!important}.sv-msgPanel{height:min(calc(100dvh - 16px - env(safe-area-inset-bottom)), 860px)!important}}
.sv-msgPanel .sv-msgThread, .sv-msgPanel .sv-msgList, .sv-msgPanel .sv-msgMain, .sv-msgPanel .sv-msgConv, .sv-msgPanel .sv-msgBody, .sv-msgPanel [data-sv-thread], .sv-msgPanel [data-sv-messages]{overscroll-behavior:contain!important}
.sv160-campaignMeta, .sv162-stat, .sv162-readSub{display:none!important}
.sv165-planAvatar{width:38px;height:38px;border-radius:999px;overflow:hidden;flex:0 0 auto;margin-right:10px;background:var(--sv-chip)}.sv165-planAvatar img{width:100%;height:100%;object-fit:cover;display:block}

@media (max-width: 980px){
  #sv-drawer .sv165-drawerBody a,
  #sv-drawer .sv165-drawerBody button,
  #sv-drawer .sv165-drawerName,
  #sv-drawer .sv165-createCard,
  #sv-drawer .sv165-gridLink,
  #sv-drawer .sv165-gridLink span,
  #sv-drawer .sv165-miniText strong,
  #sv-drawer .sv165-miniText .sv165-miniName{color:var(--sv-fg)!important;text-decoration:none!important}
  #sv-drawer .sv165-createTxt small,
  #sv-drawer .sv165-miniText small,
  #sv-drawer .sv165-miniText .sv165-miniSub,
  #sv-drawer .sv165-sectionHead a,
  #sv-drawer .sv165-drawerHandle{color:var(--sv-muted)!important}
  #sv-drawer .sv165-miniList, #sv-drawer .sv165-cardRail{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important}
  #sv-drawer [data-sv165-joined-groups] .sv165-railCard,
  #sv-drawer [data-sv165-suggested-users] .sv165-userCard{flex:0 0 132px!important;min-width:132px!important;max-width:132px!important}
  #sv-drawer .sv165-userCard{scroll-snap-align:start;display:flex;flex-direction:column;gap:10px;padding:10px;border:1px solid var(--sv-border);background:linear-gradient(180deg,var(--sv-card),color-mix(in srgb, var(--sv-card) 88%, var(--sv-bg2)));border-radius:16px;box-shadow:0 8px 18px rgba(15,23,42,.05)}
  #sv-drawer .sv165-userLink{display:flex;flex-direction:column;gap:10px;text-decoration:none!important;color:var(--sv-fg)!important}
  #sv-drawer .sv165-followBtnMini{width:100%;min-height:34px;border-radius:999px;border:1px solid var(--sv-border);background:var(--sv-fg);color:var(--sv-bg);font-size:12px;font-weight:900;cursor:pointer;transition:.18s ease}
  #sv-drawer .sv165-followBtnMini:hover,#sv-drawer .sv165-followBtnMini:active{transform:translateY(-1px)}
  #sv-drawer .sv165-followBtnMini.is-busy{opacity:.72;pointer-events:none}
  #sv-drawer .sv165-badgeDot{position:absolute;right:-1px;bottom:-1px;width:18px;height:18px;border-radius:999px;background:#1877f2;color:#fff;border:2px solid var(--sv-card);display:grid;place-items:center;font-size:10px;font-weight:900;box-shadow:0 4px 10px rgba(24,119,242,.22);z-index:2}
}
@media (min-width:981px){
  body.sv-dark, html[data-theme="dark"] body{background:linear-gradient(180deg,#081019,#0b1118)!important;color:var(--sv-fg)!important}
  body.sv-dark .sv-layout, body.sv-dark .sv-main, body.sv-dark .sv-shell, body.sv-dark .sv-mid, body.sv-dark .sv-page, body.sv-dark .sv-pageWrap, body.sv-dark .site, body.sv-dark #page, body.sv-dark #primary, body.sv-dark #content, html[data-theme="dark"] .sv-layout, html[data-theme="dark"] .sv-main, html[data-theme="dark"] .sv-shell, html[data-theme="dark"] .sv-mid, html[data-theme="dark"] .sv-page, html[data-theme="dark"] .sv-pageWrap, html[data-theme="dark"] .site, html[data-theme="dark"] #page, html[data-theme="dark"] #primary, html[data-theme="dark"] #content{background:transparent!important}
  body.sv-dark .sv-layout::before, body.sv-dark .sv-layout::after, body.sv-dark .sv-main::before, body.sv-dark .sv-main::after, body.sv-dark .sv-shell::before, body.sv-dark .sv-shell::after, html[data-theme="dark"] .sv-layout::before, html[data-theme="dark"] .sv-layout::after, html[data-theme="dark"] .sv-main::before, html[data-theme="dark"] .sv-main::after, html[data-theme="dark"] .sv-shell::before, html[data-theme="dark"] .sv-shell::after{background:transparent!important}
  body.sv-dark .sv-side, body.sv-dark .sv-sideRight, body.sv-dark .sv-card, body.sv-dark .sv-profileCardV2, body.sv-dark .sv-searchPanel, body.sv-dark .sv-gFbLeft, body.sv-dark .sv-gFbTop, html[data-theme="dark"] .sv-side, html[data-theme="dark"] .sv-sideRight, html[data-theme="dark"] .sv-card, html[data-theme="dark"] .sv-profileCardV2, html[data-theme="dark"] .sv-searchPanel, html[data-theme="dark"] .sv-gFbLeft, html[data-theme="dark"] .sv-gFbTop{background:var(--sv-card)!important}
}

/* Phase 168xt: compact modern sidebar redesign */
@media (max-width:980px){
  #sv-drawer.sv-drawer{
    width:clamp(280px,58vw,318px)!important;
    max-width:calc(100vw - 44px)!important;
    left:0!important;right:auto!important;
    border-radius:0!important;
    padding:0 0 calc(12px + env(safe-area-inset-bottom))!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--sv-card) 98%, transparent),color-mix(in srgb,var(--sv-card) 95%, var(--sv-bg2)))!important;
    box-shadow:20px 0 50px rgba(2,6,23,.32)!important;
    border-right:1px solid rgba(148,163,184,.14)!important;
    overflow:hidden!important;
  }
  #sv-drawer .sv-drawerTop{
    position:sticky!important;top:0!important;z-index:5!important;
    padding:14px 14px 12px!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--sv-card) 97%, transparent),color-mix(in srgb,var(--sv-card) 90%, transparent))!important;
    backdrop-filter:blur(12px)!important;
    border-bottom:1px solid rgba(148,163,184,.10)!important;
    align-items:flex-start!important;gap:12px!important;
  }
  #sv-drawer .sv-x{
    width:40px!important;height:40px!important;flex:0 0 auto!important;
    border-radius:999px!important;border:1px solid var(--sv-border)!important;
    background:color-mix(in srgb,var(--sv-card) 70%, var(--sv-chip))!important;
    box-shadow:none!important;
  }
  #sv-drawer .sv-drawerBody.sv165-drawerBody{
    padding:12px 12px 14px!important;
    gap:14px!important;
  }

  #sv-drawer .sv165-drawerHeader{
    display:flex!important;align-items:center!important;gap:12px!important;
    padding:0!important;border:0!important;border-radius:0!important;
    background:transparent!important;box-shadow:none!important;min-width:0!important;
  }
  #sv-drawer .sv165-drawerMe{width:60px!important;height:60px!important}
  #sv-drawer .sv165-drawerMe img,
  #sv-drawer .sv165-drawerMe > span{border-width:2px!important}
  #sv-drawer .sv165-drawerIdentity{gap:2px!important}
  #sv-drawer .sv165-drawerNameRow{gap:6px!important;flex-wrap:wrap!important}
  #sv-drawer .sv165-drawerName{font-size:16px!important;font-weight:950!important;line-height:1.05!important;max-width:100%!important}
  #sv-drawer .sv165-drawerHandle{font-size:12px!important;line-height:1.2!important}
  #sv-drawer .sv165-nameBadge{width:16px!important;height:16px!important;font-size:9px!important;box-shadow:none!important}

  #sv-drawer .sv165-createWrap{display:block!important}
  #sv-drawer .sv165-createCard{
    display:flex!important;align-items:center!important;gap:10px!important;
    padding:12px 12px!important;
    border-radius:18px!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--sv-card) 96%, transparent),color-mix(in srgb,var(--sv-card) 90%, var(--sv-bg2)))!important;
    border:1px solid rgba(148,163,184,.14)!important;
    box-shadow:0 8px 22px rgba(15,23,42,.05)!important;
  }
  #sv-drawer .sv165-createIco,
  #sv-drawer .sv165-gridIco{width:38px!important;height:38px!important;border-radius:14px!important}
  #sv-drawer .sv165-createIco .sv-ico,
  #sv-drawer .sv165-gridIco .sv-ico{width:17px!important;height:17px!important}
  #sv-drawer .sv165-createTxt strong{font-size:15px!important;line-height:1.05!important}
  #sv-drawer .sv165-createTxt small{font-size:11px!important;line-height:1.2!important}

  #sv-drawer .sv165-section{display:grid!important;gap:10px!important}
  #sv-drawer .sv165-sectionTitle{
    padding:0 2px!important;
    font-size:11px!important;
    font-weight:950!important;
    text-transform:uppercase!important;
    letter-spacing:.08em!important;
    color:var(--sv-muted)!important;
  }
  #sv-drawer .sv165-sectionHead{padding:0 2px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8px!important}
  #sv-drawer .sv165-sectionHead a{font-size:11px!important;font-weight:900!important;letter-spacing:.04em!important;color:var(--sv-muted)!important;text-decoration:none!important}

  #sv-drawer .sv165-gridLinks{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #sv-drawer .sv165-gridLink{
    display:flex!important;align-items:center!important;gap:10px!important;
    min-height:58px!important;padding:10px 12px!important;
    border-radius:18px!important;
    border:1px solid rgba(148,163,184,.14)!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--sv-card) 96%, transparent),color-mix(in srgb,var(--sv-card) 92%, var(--sv-bg2)))!important;
    box-shadow:0 8px 20px rgba(15,23,42,.045)!important;
  }
  #sv-drawer .sv165-gridLink span:last-child{
    color:var(--sv-fg)!important;
    font-size:14px!important;
    font-weight:900!important;
    line-height:1.08!important;
  }

  #sv-drawer .sv165-miniList,
  #sv-drawer .sv165-cardRail{
    display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;
    gap:12px!important;padding:2px 2px 4px!important;align-items:stretch!important;
    scroll-snap-type:x proximity!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:none!important;
  }
  #sv-drawer .sv165-miniList::-webkit-scrollbar,
  #sv-drawer .sv165-cardRail::-webkit-scrollbar{display:none!important}
  #sv-drawer [data-sv165-joined-groups] .sv165-railCard,
  #sv-drawer [data-sv165-suggested-users] .sv165-userCard{
    flex:0 0 124px!important;min-width:124px!important;max-width:124px!important;width:124px!important;
  }
  #sv-drawer .sv165-railCard,
  #sv-drawer .sv165-miniItem,
  #sv-drawer .sv165-userCard{
    scroll-snap-align:start!important;
    display:flex!important;flex-direction:column!important;align-items:flex-start!important;
    gap:10px!important;min-height:140px!important;padding:10px!important;
    border-radius:18px!important;
    border:1px solid rgba(148,163,184,.14)!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--sv-card) 97%, transparent),color-mix(in srgb,var(--sv-card) 91%, var(--sv-bg2)))!important;
    box-shadow:0 8px 20px rgba(15,23,42,.045)!important;
    text-decoration:none!important;color:var(--sv-fg)!important;
  }
  #sv-drawer .sv165-miniAvatar{width:48px!important;height:48px!important;border-radius:999px!important}
  #sv-drawer .sv165-miniAvatar--group{width:48px!important;height:48px!important;border-radius:14px!important;background:color-mix(in srgb,var(--sv-chip) 72%, transparent)!important}
  #sv-drawer .sv165-miniAvatar img{width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important}
  #sv-drawer .sv165-miniText{display:flex!important;flex-direction:column!important;gap:4px!important;min-width:0!important;width:100%!important}
  #sv-drawer .sv165-miniText strong,
  #sv-drawer .sv165-miniText .sv165-miniName{font-size:13px!important;font-weight:900!important;line-height:1.15!important;color:var(--sv-fg)!important}
  #sv-drawer .sv165-miniText small,
  #sv-drawer .sv165-miniText .sv165-miniSub{font-size:10px!important;line-height:1.2!important;color:var(--sv-muted)!important}
  #sv-drawer .sv165-userLink{display:flex!important;flex-direction:column!important;gap:10px!important;min-width:0!important;width:100%!important;text-decoration:none!important;color:var(--sv-fg)!important}
  #sv-drawer .sv165-followBtnMini{
    width:100%!important;min-height:32px!important;margin-top:auto!important;
    border-radius:999px!important;border:1px solid rgba(148,163,184,.14)!important;
    background:var(--sv-fg)!important;color:var(--sv-bg)!important;
    font-size:12px!important;font-weight:900!important;box-shadow:none!important;
  }
  #sv-drawer .sv165-followBtnMini.is-busy{opacity:.72!important;pointer-events:none!important}
  #sv-drawer .sv165-badgeDot{width:16px!important;height:16px!important;font-size:9px!important;box-shadow:none!important}
  #sv-drawer .sv-note{
    min-width:124px!important;padding:12px!important;border-radius:16px!important;
    border:1px solid rgba(148,163,184,.14)!important;background:var(--sv-card)!important;color:var(--sv-muted)!important
  }

  #sv-drawer .sv165-pageGrid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  #sv-drawer .sv165-pageGrid .sv-drawerLink{
    display:flex!important;align-items:center!important;gap:10px!important;
    min-height:48px!important;padding:0 12px!important;
    border-radius:16px!important;border:1px solid rgba(148,163,184,.14)!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--sv-card) 96%, transparent),color-mix(in srgb,var(--sv-card) 92%, var(--sv-bg2)))!important;
    box-shadow:none!important;
  }
  #sv-drawer .sv165-pageGrid .sv-drawerLink span:last-child{font-size:14px!important;font-weight:850!important;color:var(--sv-fg)!important}

  #sv-drawer .sv165-accordionList{display:grid!important;gap:8px!important}
  #sv-drawer .sv165-accordionList details{
    border-radius:18px!important;padding:0 12px!important;
    border:1px solid rgba(148,163,184,.14)!important;
    background:linear-gradient(180deg,color-mix(in srgb,var(--sv-card) 97%, transparent),color-mix(in srgb,var(--sv-card) 93%, var(--sv-bg2)))!important;
  }
  #sv-drawer .sv165-accordionList summary{
    position:relative;list-style:none!important;
    display:flex!important;align-items:center!important;gap:10px!important;
    padding:14px 18px 14px 0!important;
    font-size:14px!important;font-weight:900!important;color:var(--sv-fg)!important;
  }
  #sv-drawer .sv165-accordionList summary::-webkit-details-marker{display:none!important}
  #sv-drawer .sv165-accordionList summary::after{
    content:'›';position:absolute;right:2px;top:50%;transform:translateY(-50%) rotate(90deg);
    font-size:20px;line-height:1;color:var(--sv-muted);transition:transform .18s ease;
  }
  #sv-drawer .sv165-accordionList details[open] summary::after{transform:translateY(-50%) rotate(-90deg)}
  #sv-drawer .sv165-accordionBody{display:grid!important;gap:8px!important;padding:0 0 12px!important}
  #sv-drawer .sv165-accordionBody a{font-size:13px!important;line-height:1.2!important;color:var(--sv-muted)!important;text-decoration:none!important}

  #sv-drawer .sv165-logoutBtn{
    min-height:44px!important;border-radius:18px!important;margin-top:2px!important;
    background:color-mix(in srgb,var(--sv-chip) 82%, transparent)!important;color:var(--sv-fg)!important;
    border:1px solid rgba(148,163,184,.14)!important;box-shadow:none!important;
  }

  #sv-drawer .sv165-drawerBody a,
  #sv-drawer .sv165-drawerBody button,
  #sv-drawer .sv165-drawerName,
  #sv-drawer .sv165-createCard,
  #sv-drawer .sv165-gridLink,
  #sv-drawer .sv165-gridLink span,
  #sv-drawer .sv165-miniText strong,
  #sv-drawer .sv165-miniText .sv165-miniName,
  #sv-drawer .sv165-pageGrid .sv-drawerLink{color:var(--sv-fg)!important;text-decoration:none!important}
  #sv-drawer .sv165-createTxt small,
  #sv-drawer .sv165-miniText small,
  #sv-drawer .sv165-miniText .sv165-miniSub,
  #sv-drawer .sv165-sectionHead a,
  #sv-drawer .sv165-drawerHandle,
  #sv-drawer .sv165-accordionBody a{color:var(--sv-muted)!important}
}

@media (min-width:981px){
  html[data-theme="dark"],
  html[data-theme="dark"] body,
  body.sv-dark,
  body.sv-dark #page,
  body.sv-dark .site,
  body.sv-dark .site-content,
  body.sv-dark .content-area,
  body.sv-dark .sv-shell,
  body.sv-dark .sv-layout,
  body.sv-dark .sv-main,
  html[data-theme="dark"] #page,
  html[data-theme="dark"] .site,
  html[data-theme="dark"] .site-content,
  html[data-theme="dark"] .content-area,
  html[data-theme="dark"] .sv-shell,
  html[data-theme="dark"] .sv-layout,
  html[data-theme="dark"] .sv-main{background:#0b1118!important;color:var(--sv-fg)!important}
  body.sv-dark .sv-main > *,
  body.sv-dark .sv-page > *,
  html[data-theme="dark"] .sv-main > *,
  html[data-theme="dark"] .sv-page > *{background:transparent!important}
}


/* Phase 170xt: force compact mobile/PWA drawer and real horizontal rails */
@media (max-width:980px){
  html body #sv-drawer.sv-drawer,
  body #sv-drawer.sv-drawer{
    width:min(74vw,292px)!important;
    max-width:292px!important;
    left:0!important;
    right:auto!important;
    border-radius:0!important;
    padding:0 10px calc(12px + env(safe-area-inset-bottom))!important;
    background:var(--sv-bg)!important;
    box-shadow:0 22px 56px rgba(0,0,0,.28)!important;
    border-right:1px solid rgba(148,163,184,.14)!important;
  }
  html body #sv-drawer .sv-drawerTop,
  body #sv-drawer .sv-drawerTop{
    position:sticky!important;top:0!important;z-index:5!important;
    padding:12px 0 10px!important;
    align-items:flex-start!important;gap:10px!important;
    background:var(--sv-bg)!important;
    border-bottom:1px solid rgba(148,163,184,.10)!important;
  }
  html body #sv-drawer .sv-drawerTitle.sv165-drawerHeader,
  body #sv-drawer .sv-drawerTitle.sv165-drawerHeader{
    padding:0!important;gap:10px!important;border:0!important;border-radius:0!important;
    background:transparent!important;box-shadow:none!important;min-width:0!important;
  }
  html body #sv-drawer .sv165-drawerMe,
  body #sv-drawer .sv165-drawerMe{width:52px!important;height:52px!important;flex:0 0 52px!important}
  html body #sv-drawer .sv165-drawerIdentity,
  body #sv-drawer .sv165-drawerIdentity{gap:2px!important;min-width:0!important}
  html body #sv-drawer .sv165-drawerName,
  body #sv-drawer .sv165-drawerName{font-size:15px!important;line-height:1.05!important}
  html body #sv-drawer .sv165-drawerHandle,
  body #sv-drawer .sv165-drawerHandle{font-size:11px!important;line-height:1.2!important}
  html body #sv-drawer .sv165-nameBadge,
  body #sv-drawer .sv165-nameBadge{width:16px!important;height:16px!important;font-size:9px!important}
  html body #sv-drawer .sv-x,
  body #sv-drawer .sv-x{width:40px!important;height:40px!important;margin-left:auto!important;flex:0 0 40px!important}

  html body #sv-drawer .sv-drawerBody.sv165-drawerBody,
  body #sv-drawer .sv-drawerBody.sv165-drawerBody{padding:10px 0 6px!important;gap:12px!important}
  html body #sv-drawer .sv165-createCard,
  body #sv-drawer .sv165-createCard{padding:10px 12px!important;border-radius:16px!important;gap:10px!important}
  html body #sv-drawer .sv165-createIco,
  html body #sv-drawer .sv165-gridIco,
  body #sv-drawer .sv165-createIco,
  body #sv-drawer .sv165-gridIco{width:32px!important;height:32px!important;border-radius:10px!important}
  html body #sv-drawer .sv165-createTxt strong,
  body #sv-drawer .sv165-createTxt strong{font-size:14px!important}
  html body #sv-drawer .sv165-createTxt small,
  body #sv-drawer .sv165-createTxt small{font-size:11px!important}

  html body #sv-drawer .sv165-section,
  body #sv-drawer .sv165-section{display:grid!important;gap:8px!important;margin:0!important}
  html body #sv-drawer .sv165-sectionTitle,
  body #sv-drawer .sv165-sectionTitle{padding:0!important;font-size:11px!important;letter-spacing:.04em!important;text-transform:uppercase!important}
  html body #sv-drawer .sv165-sectionHead,
  body #sv-drawer .sv165-sectionHead{padding:0!important;gap:8px!important}
  html body #sv-drawer .sv165-sectionHead a,
  body #sv-drawer .sv165-sectionHead a{font-size:11px!important;font-weight:800!important}

  html body #sv-drawer .sv165-gridLinks,
  body #sv-drawer .sv165-gridLinks{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  html body #sv-drawer .sv165-gridLink,
  body #sv-drawer .sv165-gridLink{min-height:52px!important;padding:10px!important;gap:8px!important;border-radius:16px!important;box-shadow:none!important}
  html body #sv-drawer .sv165-gridLink span:last-child,
  body #sv-drawer .sv165-gridLink span:last-child{font-size:13px!important;line-height:1.08!important}

  html body #sv-drawer [data-sv165-joined-groups] .sv165-miniList,
  html body #sv-drawer [data-sv165-suggested-users] .sv165-miniList,
  html body #sv-drawer [data-sv165-joined-groups] .sv165-cardRail,
  html body #sv-drawer [data-sv165-suggested-users] .sv165-cardRail,
  body #sv-drawer [data-sv165-joined-groups] .sv165-miniList,
  body #sv-drawer [data-sv165-suggested-users] .sv165-miniList,
  body #sv-drawer [data-sv165-joined-groups] .sv165-cardRail,
  body #sv-drawer [data-sv165-suggested-users] .sv165-cardRail{
    display:flex!important;flex-wrap:nowrap!important;overflow-x:auto!important;overflow-y:hidden!important;align-items:stretch!important;
    gap:10px!important;padding:2px 0 8px!important;scroll-snap-type:x proximity!important;-webkit-overflow-scrolling:touch!important;scrollbar-width:none!important;
  }
  html body #sv-drawer [data-sv165-joined-groups] .sv165-miniList > *,
  html body #sv-drawer [data-sv165-suggested-users] .sv165-miniList > *,
  body #sv-drawer [data-sv165-joined-groups] .sv165-miniList > *,
  body #sv-drawer [data-sv165-suggested-users] .sv165-miniList > *{
    flex:0 0 116px!important;min-width:116px!important;max-width:116px!important;width:116px!important;
  }
  html body #sv-drawer [data-sv165-joined-groups] .sv165-miniItem,
  html body #sv-drawer [data-sv165-joined-groups] .sv165-railCard,
  html body #sv-drawer [data-sv165-suggested-users] .sv165-userCard,
  body #sv-drawer [data-sv165-joined-groups] .sv165-miniItem,
  body #sv-drawer [data-sv165-joined-groups] .sv165-railCard,
  body #sv-drawer [data-sv165-suggested-users] .sv165-userCard{
    display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;
    min-height:132px!important;padding:10px!important;gap:9px!important;border-radius:16px!important;box-shadow:none!important;
  }
  html body #sv-drawer .sv165-miniAvatar,
  body #sv-drawer .sv165-miniAvatar{width:44px!important;height:44px!important}
  html body #sv-drawer .sv165-miniAvatar--group,
  body #sv-drawer .sv165-miniAvatar--group{width:44px!important;height:44px!important;border-radius:12px!important}
  html body #sv-drawer .sv165-miniText,
  body #sv-drawer .sv165-miniText{gap:3px!important}
  html body #sv-drawer .sv165-miniText strong,
  html body #sv-drawer .sv165-miniText .sv165-miniName,
  body #sv-drawer .sv165-miniText strong,
  body #sv-drawer .sv165-miniText .sv165-miniName{font-size:12px!important;line-height:1.15!important;display:-webkit-box!important;-webkit-line-clamp:2!important;-webkit-box-orient:vertical!important;overflow:hidden!important}
  html body #sv-drawer .sv165-miniText small,
  html body #sv-drawer .sv165-miniText .sv165-miniSub,
  body #sv-drawer .sv165-miniText small,
  body #sv-drawer .sv165-miniText .sv165-miniSub{font-size:10px!important}
  html body #sv-drawer .sv165-followBtnMini,
  body #sv-drawer .sv165-followBtnMini{min-height:30px!important;padding:0 10px!important;font-size:12px!important;margin-top:auto!important}

  html body #sv-drawer .sv165-pageGrid,
  body #sv-drawer .sv165-pageGrid{grid-template-columns:1fr!important;gap:8px!important}
  html body #sv-drawer .sv165-pageGrid .sv-drawerLink,
  body #sv-drawer .sv165-pageGrid .sv-drawerLink{min-height:46px!important;border-radius:14px!important;padding:0 12px!important}
  html body #sv-drawer .sv165-accordionList,
  body #sv-drawer .sv165-accordionList{gap:8px!important}
  html body #sv-drawer .sv165-accordionList details,
  body #sv-drawer .sv165-accordionList details{border-radius:14px!important;padding:0 12px!important;box-shadow:none!important}
  html body #sv-drawer .sv165-accordionList summary,
  body #sv-drawer .sv165-accordionList summary{padding:12px 16px 12px 0!important;font-size:14px!important}
  html body #sv-drawer .sv165-accordionBody,
  body #sv-drawer .sv165-accordionBody{padding:0 0 10px!important;gap:8px!important}
  html body #sv-drawer .sv165-accordionBody a,
  body #sv-drawer .sv165-accordionBody a{font-size:13px!important}
  html body #sv-drawer .sv165-logoutBtn,
  body #sv-drawer .sv165-logoutBtn{min-height:42px!important;border-radius:14px!important;margin-top:0!important}

  html body #sv-drawer .sv165-drawerBody a,
  html body #sv-drawer .sv165-drawerBody button,
  html body #sv-drawer .sv165-drawerName,
  html body #sv-drawer .sv165-gridLink span:last-child,
  html body #sv-drawer .sv165-miniText strong,
  html body #sv-drawer .sv165-miniText .sv165-miniName,
  html body #sv-drawer .sv165-pageGrid .sv-drawerLink span:last-child,
  html body #sv-drawer .sv165-accordionList summary,
  html body #sv-drawer .sv165-logoutBtn,
  body #sv-drawer .sv165-drawerBody a,
  body #sv-drawer .sv165-drawerBody button,
  body #sv-drawer .sv165-drawerName,
  body #sv-drawer .sv165-gridLink span:last-child,
  body #sv-drawer .sv165-miniText strong,
  body #sv-drawer .sv165-miniText .sv165-miniName,
  body #sv-drawer .sv165-pageGrid .sv-drawerLink span:last-child,
  body #sv-drawer .sv165-accordionList summary,
  body #sv-drawer .sv165-logoutBtn{color:var(--sv-fg)!important}

  html body #sv-drawer .sv165-sectionTitle,
  html body #sv-drawer .sv165-drawerHandle,
  html body #sv-drawer .sv165-createTxt small,
  html body #sv-drawer .sv165-sectionHead a,
  html body #sv-drawer .sv165-miniText small,
  html body #sv-drawer .sv165-miniText .sv165-miniSub,
  html body #sv-drawer .sv165-accordionBody a,
  body #sv-drawer .sv165-sectionTitle,
  body #sv-drawer .sv165-drawerHandle,
  body #sv-drawer .sv165-createTxt small,
  body #sv-drawer .sv165-sectionHead a,
  body #sv-drawer .sv165-miniText small,
  body #sv-drawer .sv165-miniText .sv165-miniSub,
  body #sv-drawer .sv165-accordionBody a{color:var(--sv-muted)!important}
}

/* Phase 170xt: stronger desktop dark-mode wrapper cleanup */
body.sv-dark .sv-layout,
body.sv-dark .sv-main,
body.sv-dark .sv-shell,
body.sv-dark .sv-mid,
body.sv-dark .sv-page,
body.sv-dark .sv-pageWrap,
body.sv-dark .site,
body.sv-dark #page,
body.sv-dark #primary,
body.sv-dark #content,
html[data-theme="dark"] .sv-layout,
html[data-theme="dark"] .sv-main,
html[data-theme="dark"] .sv-shell,
html[data-theme="dark"] .sv-mid,
html[data-theme="dark"] .sv-page,
html[data-theme="dark"] .sv-pageWrap,
html[data-theme="dark"] .site,
html[data-theme="dark"] #page,
html[data-theme="dark"] #primary,
html[data-theme="dark"] #content{background:var(--sv-bg)!important}
body:not(.sv-dark) .sv-layout,
body:not(.sv-dark) .sv-main,
body:not(.sv-dark) .sv-shell,
body:not(.sv-dark) .sv-mid,
body:not(.sv-dark) .sv-page,
body:not(.sv-dark) .sv-pageWrap,
body:not(.sv-dark) .site,
body:not(.sv-dark) #page,
body:not(.sv-dark) #primary,
body:not(.sv-dark) #content,
html[data-theme="light"] .sv-layout,
html[data-theme="light"] .sv-main,
html[data-theme="light"] .sv-shell,
html[data-theme="light"] .sv-mid,
html[data-theme="light"] .sv-page,
html[data-theme="light"] .sv-pageWrap,
html[data-theme="light"] .site,
html[data-theme="light"] #page,
html[data-theme="light"] #primary,
html[data-theme="light"] #content{background:var(--sv-bg)!important}

/* Phase 1xa: keep drawer follow buttons readable on mobile in both themes without changing the rest of the drawer */
@media (max-width:980px){
  #sv-drawer .sv165-followBtnMini{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    letter-spacing:.01em!important;
    text-align:center!important;
    text-shadow:none!important;
  }
  body:not(.sv-dark) #sv-drawer .sv165-followBtnMini,
  html:not([data-theme="dark"]) body #sv-drawer .sv165-followBtnMini{
    background:#111827!important;
    color:#ffffff!important;
    border-color:#111827!important;
  }
  body.sv-dark #sv-drawer .sv165-followBtnMini,
  html[data-theme="dark"] #sv-drawer .sv165-followBtnMini{
    background:#f8fafc!important;
    color:#0f172a!important;
    border-color:#f8fafc!important;
  }
}


/* Phase 2xa: visible mobile drawer quick settings + strict sidebar follow-button theme colors */
@media (max-width:980px){
  #sv-drawer .sv165-gridLinks--quick{grid-template-columns:1fr 1fr!important}
  #sv-drawer .sv165-gridLink--quick,
  #sv-drawer .sv165-themeBtn{
    min-height:58px!important;
    width:100%!important;
    border:1px solid var(--sv-border)!important;
    background:var(--sv-card)!important;
    border-radius:14px!important;
    text-decoration:none!important;
    color:var(--sv-fg)!important;
    box-shadow:0 8px 18px rgba(15,23,42,.045)!important;
  }
  #sv-drawer .sv165-themeBtn{display:flex!important;align-items:center!important;gap:8px!important;padding:9px 8px!important;font-weight:850!important;text-align:left!important}
  #sv-drawer .sv165-gridLink--quick span:last-child,
  #sv-drawer .sv165-themeBtn span:last-child{font-size:13px!important;line-height:1.08!important;color:var(--sv-fg)!important}
  .sv165-ico--ads{background:rgba(244,63,94,.12);color:#e11d48}
  .sv165-ico--theme{background:rgba(99,102,241,.12);color:#4f46e5}
  body:not(.sv-dark) #sv-drawer .sv165-followBtnMini,
  html:not([data-theme="dark"]) body #sv-drawer .sv165-followBtnMini{
    background:#111827!important;
    color:#ffffff!important;
    border-color:#111827!important;
  }
  body.sv-dark #sv-drawer .sv165-followBtnMini,
  html[data-theme="dark"] #sv-drawer .sv165-followBtnMini{
    background:#f8fafc!important;
    color:#000000!important;
    border-color:#f8fafc!important;
  }
}
