/* [MPOL1] Phone polish (body.m3, <=820px): X-style posts + roomier top bar. Not loaded for frozen members. */
@media (max-width: 820px) {
  /* ---------- top bar: everything fits, brand never covered ---------- */
  html body.m3 .topbar.topbar-merged{padding:0 10px!important;gap:6px!important}
  html body.m3 .hamburger{width:36px!important;height:36px!important;border-radius:11px!important}
  html body.m3 .m3-brand{font-size:16.5px!important;gap:6px!important;flex:1 1 auto!important;min-width:0!important;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
  html body.m3 .m3-brand svg{width:20px!important;height:20px!important}
  html body.m3 .topbar-right,html body.m3 .topnav{gap:6px!important;flex:none!important}
  html body.m3 .topnav .nav-ico,html body.m3 .m3-search{width:36px!important;height:36px!important;border-radius:11px!important;font-size:15px!important}
  html body.m3 .m3-search svg{width:17px!important;height:17px!important}
  html body.m3 .topuser,html body.m3 .topuser-av{width:36px!important;height:36px!important}
  html body.m3 .nav-badge{top:-6px!important;right:-6px!important;min-width:17px!important;height:17px!important;font-size:10.5px!important}

  /* ---------- feed: flat list with thin dividers ---------- */
  html body.m3 #feed,html body.m3 #feed-fol,html body.m3 .hv3 #feed,html body.m3 .hv3 #feed-fol{gap:0!important;padding:4px 0 0!important}
  html body.m3 #feed > article.post.card,html body.m3 #feed-fol > article.post.card,html body.m3 article.post.card{
    border:0!important;border-bottom:1px solid #1a1a1c!important;border-radius:0!important;background:#000!important;
    margin:0!important;padding:14px 22px 10px!important;box-shadow:none!important;overflow:visible!important}

  /* header row: avatar | name + time | small admin icons */
  html body.m3 article.post.card > .post-head{display:flex!important;align-items:flex-start!important;gap:12px!important;margin:0!important;padding:0!important}
  html body.m3 article.post.card .post-av{flex:0 0 44px!important;width:44px!important;height:44px!important;margin:0!important}
  html body.m3 article.post.card .post-head > div:not(.post-av){flex:1 1 auto;min-width:0;padding-top:1px}
  html body.m3 article.post.card .post-user{font-size:15.5px!important;font-weight:700!important;color:#f4f4f5!important}
  html body.m3 article.post.card .post-time{font-size:13px!important;color:#7d7d85!important;margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  html body.m3 article.post.card .post-pinbadge{color:var(--gold-2,#e2c784)}
  html body.m3 article.post.card .post-head > button,html body.m3 article.post.card .post-head > a:not(.post-user){
    flex:none!important;width:30px!important;height:30px!important;padding:0!important;margin:0!important;border:0!important;background:none!important;
    font-size:14px!important;line-height:30px!important;text-align:center;opacity:.5;filter:grayscale(1)}
  html body.m3 article.post.card .post-head > button:active,html body.m3 article.post.card .post-head > a:not(.post-user):active{opacity:1}
  html body.m3 article.post.card .post-head > .post-pin.is-pinned{opacity:.9;filter:none}

  /* [MPOL3] text full width again, with even room left and right */
  html body.m3 article.post.card:not(.post-announce) > :not(.post-head):not(.act-del){
    margin-left:0!important;margin-right:0!important;width:auto!important;max-width:100%!important;box-sizing:border-box}
  html body.m3 article.post.card .post-body{font-size:15.5px!important;line-height:1.45!important;color:#e8e8eb!important;margin:10px 0 8px!important;padding:0!important;overflow-wrap:anywhere}
  html body.m3 article.post.card .post-body[style*="background"]{margin-top:2px!important;padding:22px 16px!important;border-radius:16px!important}
  html body.m3 article.post.card > .post-head + :not(.post-body){margin-top:4px!important}

  /* media + link cards: rounded, inside the column */
  html body.m3 article.post.card .post-images,html body.m3 article.post.card .link-card,html body.m3 article.post.card .post-video,html body.m3 article.post.card .act-card{
    margin-top:6px!important;margin-bottom:4px!important;border-radius:16px!important;overflow:hidden;border:1px solid #222!important}
  html body.m3 article.post.card .post-images img,html body.m3 article.post.card .post-images video,html body.m3 article.post.card .post-images .pi{border-radius:0!important}
  html body.m3 article.post.card .link-card .lc-body{padding:10px 12px 12px!important}
  html body.m3 article.post.card .link-card .lc-title{font-size:15.5px!important;line-height:1.3!important}
  html body.m3 article.post.card .link-card .lc-desc{font-size:13.5px!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

  /* action row: quiet icons, evenly spaced */
  html body.m3 article.post.card .post-actions{padding:6px 0 0!important;margin-top:2px!important;gap:20px!important;align-items:center!important}
  html body.m3 article.post.card .post-rx-chip{font-size:12.5px!important;padding:2px 8px!important}
  html body.m3 article.post.card .comments{margin-top:6px!important}
}
/* light theme */
@media (max-width: 820px) {
  html body.m3.mc-light article.post.card{background:#fff!important;border-bottom-color:#ececee!important}
  html body.m3.mc-light article.post.card .post-user{color:#111!important}
  html body.m3.mc-light article.post.card .post-body{color:#1d1d1f!important}
  html body.m3.mc-light article.post.card .post-images,html body.m3.mc-light article.post.card .link-card,html body.m3.mc-light article.post.card .post-video,html body.m3.mc-light article.post.card .act-card{border-color:#e4e4e7!important}
}
/* [MPOL2] long posts: 3 lines then "Show more" right under the text (coloured-background posts keep the old 6 lines) */
@media (max-width: 820px) {
  html body.m3 article.post.card .post-body.clamped:not([style*="background"]):not([data-bg]):not([class*="bg"]){-webkit-line-clamp:3!important;line-clamp:3!important;max-height:calc(1.45em * 3)!important}
  html body.m3 article.post.card .post-body:not([style*="background"]):not([data-bg]):not([class*="bg"]) + .post-showmore{display:block!important;margin:-4px 0 8px 0!important;padding:0!important;border:0!important;background:none!important;font-size:14px!important;font-weight:600!important;line-height:1.3!important;color:var(--gold-2,#e2c784)!important}
}
/* [MPOL4] For You | Following: two halves, plain text, one straight gold line under the active tab */
@media (max-width: 820px) {
  html body.m3 .hv-tabs{display:flex!important;gap:0!important;padding:0!important;margin:4px 0 0!important;border:0!important;border-bottom:1px solid #1a1a1c!important;background:none!important;overflow:visible!important}
  html body.m3 .hv-tabs .hv-tab,html body.m3 .hv-tab{flex:1 1 0!important;position:relative!important;height:46px!important;display:flex!important;align-items:center!important;justify-content:center!important;
    margin:0!important;padding:0!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;
    font-size:15px!important;font-weight:600!important;color:#7d7d85!important}
  html body.m3 .hv-tabs .hv-tab.active,html body.m3 .hv-tab.active{color:#f4f4f5!important;background:none!important;border:0!important;box-shadow:none!important}
  html body.m3 .hv-tabs .hv-tab::after,html body.m3 .hv-tab::after{content:none!important}
  html body.m3 .hv-tabs .hv-tab.active::after,html body.m3 .hv-tab.active::after{content:""!important;display:block!important;position:absolute!important;left:22px!important;right:22px!important;bottom:-1px!important;width:auto!important;height:2px!important;margin:0!important;border-radius:0!important;background:var(--gold,#c9a961)!important}
}
@media (max-width: 820px) {
  html body.m3.mc-light .hv-tabs{border-bottom-color:#ececee!important}
  html body.m3.mc-light .hv-tabs .hv-tab.active,html body.m3.mc-light .hv-tab.active{color:#111!important}
}
/* [MPOL5] phone menu: left slide-out list of link names (like desktop), no tiles/cards */
@media (max-width: 820px) {
  html body.m3 nav.rail{top:0!important;bottom:0!important;left:0!important;right:auto!important;width:min(290px,84vw)!important;height:100vh!important;height:100dvh!important;max-height:none!important;
    transform:translateX(-105%)!important;transition:transform .25s cubic-bezier(.2,.8,.2,1)!important;border:0!important;border-right:1px solid #1a1a1c!important;border-radius:0!important;
    background:#0a0a0a!important;box-shadow:20px 0 60px rgba(0,0,0,.55)!important;padding:10px 0 calc(20px + env(safe-area-inset-bottom))!important;overflow-y:auto!important}
  html body.m3.menu-open nav.rail{transform:none!important}
  html body.m3 nav.rail::before{display:none!important;content:none!important}
  html body.m3 nav.rail .rail-top{padding:8px 20px 14px!important}
  html body.m3 nav.rail .rail-group{display:block!important;padding:2px 10px!important;margin:0!important}
  html body.m3 nav.rail .rail-label{display:block!important;padding:16px 12px 6px!important;font-size:10.5px!important}
  html body.m3 nav.rail a.rail-item,html body.m3 nav.rail button.rail-item,html body.m3 nav.rail a.rail-item[data-label],html body.m3 nav.rail button.rail-item[data-label]{
    display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:14px!important;
    min-height:0!important;height:46px!important;padding:0 12px!important;margin:0!important;width:100%!important;box-sizing:border-box!important;grid-column:auto!important;
    background:none!important;border:0!important;border-radius:10px!important;box-shadow:none!important;
    color:#e4e4e7!important;font-size:15.5px!important;font-weight:500!important;text-align:left!important}
  html body.m3 nav.rail .rail-item .ri-ico,html body.m3 nav.rail .rail-item[data-label] .ri-ico{flex:none!important;width:22px!important;height:22px!important;background:none!important;border-radius:0!important;
    display:flex!important;align-items:center!important;justify-content:center!important;color:#a1a1aa!important}
  html body.m3 nav.rail .rail-item .ri-ico i,html body.m3 nav.rail .rail-item .ri-ico svg{width:20px!important;height:20px!important}
  html body.m3 nav.rail .rail-item .ri-text,html body.m3 nav.rail .rail-item[data-label] .ri-text{font-size:15.5px!important;line-height:1.2!important;text-align:left!important;white-space:nowrap!important;color:inherit}
  html body.m3 nav.rail a.rail-item.active{background:rgba(255,255,255,.06)!important;color:#fff!important}
  html body.m3 nav.rail a.rail-item.active .ri-ico{color:var(--gold-2,#e2c784)!important}
  html body.m3 nav.rail a.rail-item[data-label*="pgrade"] .ri-text,html body.m3 nav.rail a.rail-item[data-label*="pgrade"] .ri-ico{color:var(--gold-2,#e2c784)!important;font-weight:600!important}
  html body.m3 nav.rail .rail-more{margin:2px 0 4px 22px!important;padding-left:8px!important}
  html body.m3 nav.rail .rail-bottom{padding:10px 10px 0!important;margin-top:6px!important;border-top:1px solid #1a1a1c!important}
  html body.m3 nav.rail .rail-bottom a.rail-item,html body.m3 nav.rail .rail-bottom a.rail-item .ri-ico{color:#ff8a8a!important}
}
@media (max-width: 820px) {
  html body.m3.mc-light nav.rail{background:#fff!important;border-right-color:#ececee!important}
  html body.m3.mc-light nav.rail a.rail-item,html body.m3.mc-light nav.rail button.rail-item{color:#1d1d1f!important}
  html body.m3.mc-light nav.rail a.rail-item.active{background:#f2f2f4!important;color:#111!important}
}
