/* SGS phone layout (v2). Built by assets/js/sgs-phone.js. Every rule needs html.sgsm2 + a phone width,
   so the desktop never changes and nothing changes if the script does not run (it then removes html.sgsm2).
   Sizes follow the SellerTracker rules: 16 px text in fields (no iPhone zoom), 44 px touch targets, 16 px card corners. */
.sm-hd, .sm-bar, .sm-dim, .sm-sheet, .sm-twrow { display: none; }
@media (max-width: 860px) {
  html.sgsm2 body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); -webkit-text-size-adjust: 100%; }
  html.sm-lock { overflow: hidden; }

  /* old phone strip, desktop side menu and the parts of the top bar the new header replaces */
  html.sgsm2 .ls-side, html.sgsm2 .iv-side, html.sgsm2 .tr-side, html.sgsm2 .ig-side, html.sgsm2 .rp-side, html.sgsm2 .bl-side, html.sgsm2 .og-side,
  html.sgsm2 .iv-top, html.sgsm2 .iv-ttop, html.sgsm2 .topbar, html.sgsm2 .tr-top, html.sgsm2 .pnav, html.sgsm2 .ig-top, html.sgsm2 .rp-top,
  html.sgsm2 .bl-top, html.sgsm2 .bl-ttop, html.sgsm2 .og-ttop, html.sgsm2 .sgs-bar, html.sgsm2 .sgs-user { display: none !important; }
  html.sgsm2 .sm-ib.on { background: rgba(242,183,5,.18); color: #F2B705; }
  html.sgsm2 .ls-top .ls-acct, html.sgsm2 .ls-top .ls-tspill, html.sgsm2 .ls-top .sx-tbs, html.sgsm2 .ls-top .ls-topspacer, html.sgsm2 .ls-top kbd { display: none !important; }
  html.sgsm2 .ls-top { position: static; background: #fff; border-bottom: 1px solid #E3E6E0; box-shadow: none; }
  html.sgsm2 .ls-topin { padding: 8px 12px; min-height: 0; gap: 0; }
  html.sgsm2 .ls-tsearch { flex: 1 1 auto; max-width: none; width: 100%; }
  html.sgsm2 .ls-tsbox { height: 44px; border-radius: 12px; }
  html.sgsm2 .ls-tsbox input { font-size: 16px; }

  /* header */
  html.sgsm2 .sm-hd {
    display: flex; align-items: center; gap: 2px; position: sticky; top: 0; z-index: 800;
    height: 54px; padding: 0 4px 0 14px; padding-top: env(safe-area-inset-top); box-sizing: content-box;
    background: #1E2B25; border-bottom: 3px solid #F2B705; color: #fff;
  }
  html.sgsm2 .sm-lg { flex: 1 1 auto; min-width: 0; color: #fff; text-decoration: none; font: 700 17px/1 var(--sgs-font-body, Inter, system-ui, sans-serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.sgsm2 .sm-lg b { color: #F2B705; font-weight: 800; }
  html.sgsm2 .sm-ib {
    position: relative; flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    color: #fff; background: none; border: 0; border-radius: 12px; padding: 0; margin: 0; min-height: 0; box-shadow: none; cursor: pointer; text-decoration: none;
  }
  html.sgsm2 .sm-ib:active { background: rgba(255,255,255,.12); }
  html.sgsm2 .sm-ib i { font-size: 23px; font-style: normal; line-height: 1; }
  html.sgsm2 .sm-hd em, html.sgsm2 .sm-bar em {
    position: absolute; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; box-sizing: border-box;
    background: #B42318; color: #fff; font: 800 10px/17px var(--sgs-font-body, Inter, system-ui, sans-serif); font-style: normal; text-align: center;
  }
  html.sgsm2 .sm-hd em { top: 4px; right: 3px; border: 1.5px solid #1E2B25; line-height: 14px; }

  /* bottom bar */
  html.sgsm2 .sm-bar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    height: 62px; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box;
    background: #fff; border-top: 1px solid #E3E6E0;
  }
  html.sgsm2 .sm-bar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; color: #5A6B60; text-decoration: none; font: 600 11px/1.1 var(--sgs-font-body, Inter, system-ui, sans-serif); }
  html.sgsm2 .sm-bar a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  html.sgsm2 .sm-ic { position: relative; display: flex; }
  html.sgsm2 .sm-ic i { font-size: 23px; font-style: normal; line-height: 1; }
  html.sgsm2 .sm-bar em { top: -6px; left: 14px; }
  html.sgsm2 .sm-bar a.on { color: #1E2B25; }
  html.sgsm2 .sm-bar a.on .sm-ic i { color: #C98F00; }

  /* three-dots sheet */
  html.sgsm2 .sm-dim { display: block; position: fixed; inset: 0; z-index: 950; background: rgba(15,23,20,.55); }
  html.sgsm2 .sm-dim[hidden], html.sgsm2 .sm-sheet[hidden] { display: none; }
  html.sgsm2 .sm-sheet {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 960; max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: #fff; color: #1F2A24; border-radius: 20px 20px 0 0; padding: 6px 16px calc(16px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 30px rgba(0,0,0,.25); font-family: var(--sgs-font-body, Inter, system-ui, sans-serif);
  }
  html.sgsm2 .sm-grab { width: 40px; height: 4px; border-radius: 2px; background: #D9DDD6; margin: 6px auto 12px; }
  html.sgsm2 .sm-who { padding: 0 2px 10px; border-bottom: 1px solid #EEF0EC; }
  html.sgsm2 .sm-who b { font-size: 17px; font-weight: 700; }
  html.sgsm2 .sm-sec { margin: 16px 2px 6px; font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #7A877F; }
  html.sgsm2 .sm-list a {
    position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 2px;
    color: #1F2A24; text-decoration: none; font-size: 15px; border-bottom: 1px solid #EEF0EC;
  }
  html.sgsm2 .sm-list a i { flex: none; width: 22px; text-align: center; font-size: 20px; font-style: normal; color: #5A6B60; }
  html.sgsm2 .sm-list a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.sgsm2 .sm-list a.on, html.sgsm2 .sm-list a.on i { color: #157F3D; font-weight: 700; }
  html.sgsm2 .sm-list em { position: static; margin-left: auto; line-height: 17px; }
  html.sgsm2 .sm-list a.sm-out, html.sgsm2 .sm-list a.sm-out i { color: #B42318; border-bottom: 0; }
  html.sgsm2 .sm-apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  html.sgsm2 .sm-apps a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 72px; padding: 8px 4px;
    border: 1px solid #E3E6E0; border-radius: 14px; color: #1F2A24; text-decoration: none; font-size: 12px; font-weight: 600; text-align: center;
  }
  html.sgsm2 .sm-apps a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.sgsm2 .sm-apps a svg { width: 22px; height: 22px; color: #1E2B25; }
  html.sgsm2 .sm-apps a.me { border: 1.5px solid #F2B705; background: #FFFBEF; }
}
@media (max-width: 340px) {
  html.sgsm2 .sm-tw { display: none; }
  html.sgsm2 .sm-twrow { display: block; }   /* very small phones: Team Work is in the Account part of the sheet instead */
}

/* cards and folding filters (phones under 721px) */
.sm-fbtn { display: none; }
@media (max-width: 720px) {
  html.sgsm2 .ls-wrap { padding-left: 10px; padding-right: 10px; }
  html.sgsm2 .ls-wrap h1 { font-size: 20px; margin: 4px 0 8px; }
  html.sgsm2 .ls-wrap h1 + p, html.sgsm2 .ls-wrap .ls-intro { display: none; }
  html.sgsm2 .ls-tw { overflow: visible; border: 0; background: none; box-shadow: none; padding: 0; margin: 0; }
  html.sgsm2 table.sm-c, html.sgsm2 table.sm-c tbody, html.sgsm2 table.sm-c thead { display: block; width: 100% !important; min-width: 0 !important; border: 0; background: none; }
  html.sgsm2 table.sm-c colgroup, html.sgsm2 table.sm-c .sm-hr, html.sgsm2 table.sm-c .sm-h { display: none !important; }
  html.sgsm2 table.sm-c tr { display: block; background: #fff; border: 1px solid #E3E6E0; border-radius: 14px; margin: 0 0 8px; height: auto !important; box-shadow: none; }
  html.sgsm2 table.sm-c tr.sm-one { padding: 14px; }
  html.sgsm2 table.sm-c tr.sm-one td { display: block; border: 0; padding: 0; }
  html.sgsm2 table.sm-c td.pc { display: block; padding: 12px !important; border: 0 !important; width: auto !important; text-align: left !important; font-size: 13px; line-height: 1.35; color: #1F2A24; }

  html.sgsm2 .pc-h { display: flex; gap: 10px; align-items: flex-start; }
  html.sgsm2 .pc-img { flex: none; }
  html.sgsm2 .pc-img img, html.sgsm2 .pc-img .ls-thumb { display: block; width: 56px !important; height: 56px !important; position: static !important; transform: none !important; margin: 0 !important; border-radius: 10px; object-fit: cover; }
  html.sgsm2 .pc-i { flex: 1 1 auto; min-width: 0; }
  html.sgsm2 .pc-sku { font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.sgsm2 .pc-sku a, html.sgsm2 .pc-sku b { font-weight: 700; color: #007185; text-decoration: none; }
  html.sgsm2 .pc-sub { margin-top: 2px; font-size: 12px !important; color: #6B776F; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.sgsm2 .pc-sub a { color: #007185; }
  html.sgsm2 .pc-tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; font-size: 12px; }
  html.sgsm2 .pc-nm { margin-top: 4px; font-size: 13px; line-height: 1.35; color: #333E37; max-width: none !important; white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  html.sgsm2 .pc-sc { flex: none; }
  html.sgsm2 .pc-sc a { text-decoration: none; }
  html.sgsm2 .pc-sc .ls-sc { display: flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: 10px; font-size: 16px; font-weight: 800; margin: 0; }

  html.sgsm2 .pc-m { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
  html.sgsm2 .pc-st > * { margin: 0; }
  html.sgsm2 .pc-pr { font-weight: 800; font-size: 15px; display: inline-flex; align-items: baseline; gap: 5px; }
  html.sgsm2 .pc-pr div, html.sgsm2 .pc-pr .mut { display: inline; font-weight: 400; font-size: 12px !important; color: #7A877F; }
  html.sgsm2 .pc-mrp { font-size: 12px; color: #7A877F; }
  html.sgsm2 .pc-rt { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
  html.sgsm2 .pc-rt .ls-pill { font-size: 11px; padding: 1px 7px; }

  html.sgsm2 .pc-t { display: grid; margin-top: 10px; border: 1px solid #EEF0EC; border-radius: 10px; background: #FAFBF9; }
  html.sgsm2 .pc-t > div { padding: 7px 9px; min-width: 0; border-left: 1px solid #EEF0EC; }
  html.sgsm2 .pc-t > div:first-child { border-left: 0; }
  html.sgsm2 .pc-t > div > span { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #7A877F; }
  html.sgsm2 .pc-v { margin-top: 2px; font-size: 13px; line-height: 1.3; overflow: hidden; }
  html.sgsm2 .pc-v b { font-weight: 800; white-space: nowrap; }
  html.sgsm2 .pc-v small { display: block; font-size: 11px; color: #7A877F; }
  html.sgsm2 .pc-v .ls-pill { font-size: 10.5px; padding: 1px 6px; white-space: nowrap; }
  html.sgsm2 .pc-v div, html.sgsm2 .pc-v .mut { font-size: 11px !important; }
  html.sgsm2 .pc-na { color: #A3ADA6; }
  html.sgsm2 .pc-fix { margin-top: 10px; padding: 8px 10px; background: #FFF8E6; border-radius: 10px; font-size: 13px; }
  html.sgsm2 .pc-fix > span { display: block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #8A6400; margin-bottom: 2px; }

  html.sgsm2 .pc-x { display: none; margin-top: 8px; }
  html.sgsm2 tr.pc-open .pc-x { display: block; }
  html.sgsm2 .pc-xr { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 7px 0; border-top: 1px solid #EEF0EC; font-size: 13px; }
  html.sgsm2 .pc-xr > span { flex: none; font-size: 12px; color: #7A877F; }
  html.sgsm2 .pc-xr > div { min-width: 0; text-align: right; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px; }
  html.sgsm2 .pc-xr .ls-cp { display: inline-flex; align-items: center; gap: 4px; margin: 0; }

  html.sgsm2 .pc-a { display: flex; gap: 8px; margin-top: 10px; }
  html.sgsm2 .pc-a > button, html.sgsm2 .pc-a > a {
    flex: 1 1 0; display: inline-flex !important; align-items: center; justify-content: center; gap: 4px; width: auto !important; height: 38px; min-height: 0;
    margin: 0 !important; padding: 0 10px !important; border-radius: 10px; font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  }
  html.sgsm2 .pc-a > .pc-mb { flex: 0 0 auto; background: #fff !important; color: #1F2A24 !important; border: 1px solid #CBD2CB !important; }
  html.sgsm2 .pc-a i { font-size: 16px; font-style: normal; }

  html.sgsm2 .ls-kpis { display: grid !important; grid-auto-flow: column; grid-auto-columns: 112px; grid-template-columns: none !important; overflow-x: auto; gap: 8px; margin: 0 -10px 10px; padding: 0 10px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html.sgsm2 .ls-kpis::-webkit-scrollbar { display: none; }
  html.sgsm2 .ls-kpis > * { min-width: 0; padding: 10px 12px !important; }

  html.sgsm2 .sm-fbtn {
    display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; margin: 0 0 10px; padding: 0 14px;
    background: #fff; color: #1F2A24; border: 1px solid #CBD2CB; border-radius: 12px; font: 600 15px/1 var(--sgs-font-body, Inter, system-ui, sans-serif);
  }
  html.sgsm2 .sm-fbtn i { font-size: 19px; font-style: normal; }
  html.sgsm2 .sm-fbtn i:last-child { margin-left: auto; color: #7A877F; }
  html.sgsm2 form.sm-fold { display: none !important; }
  html.sgsm2 form.sm-fold.sm-fopen { display: flex !important; flex-wrap: wrap; gap: 10px; }
  html.sgsm2 form.sm-fold label { flex: 1 1 calc(50% - 10px); min-width: 0; }
  html.sgsm2 form.sm-fold label:first-child { flex-basis: 100%; }
  html.sgsm2 form.sm-fold select, html.sgsm2 form.sm-fold input[type=search], html.sgsm2 form.sm-fold input[type=text] { width: 100% !important; height: 44px; font-size: 16px; border-radius: 12px; }
  html.sgsm2 form.sm-fold button, html.sgsm2 form.sm-fold .ls-ob { height: 44px; flex: 1 1 40%; border-radius: 12px; font-size: 15px; }
}

/* Team access on phones: the person column stays visible while the app columns scroll sideways inside the table box */
@media (max-width: 720px) {
  html.sgsm2 #rv table.pp-t td:first-child, html.sgsm2 #rv table.pp-t th:first-child {
    position: sticky; left: 0; z-index: 2; background: #fff; width: 150px; min-width: 150px; max-width: 150px; box-shadow: 1px 0 0 #E3E6E0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal;
  }
  html.sgsm2 #rv table.pp-t tr.pp-own td:first-child { background: #FAFAF6; }
  html.sgsm2 #rv table.pp-t tr.pp-me td:first-child { background: #FFFBEA; }
  html.sgsm2 #rv table.pp-t td:first-child b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
  html.sgsm2 #rv table.pp-t td:first-child .small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  html.sgsm2 #rv table.pp-t td:first-child img, html.sgsm2 #rv table.pp-t td:first-child .pv { float: left; margin: 2px 8px 0 0; }
  html.sgsm2 #rv table.pp-t .pp-c { min-width: 104px; }
  html.sgsm2 #rv table.pp-t th { white-space: nowrap; }
  html.sgsm2 #rv .tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* wide tables that cannot become cards scroll inside their own box, never the page */
@media (max-width: 860px) {
  html.sgsm2 table.og-tbl { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html.sgsm2 .og-card { min-width: 0; max-width: 100%; box-sizing: border-box; }
  html.sgsm2 body { overflow-x: clip; }
}

/* Alerts on phones: the number boxes are one row you swipe; the app links line is left out */
@media (max-width: 720px) {
  html.sgsm2 #ib-app .ibrow { display: flex !important; flex-wrap: nowrap; gap: 8px; overflow-x: auto; margin: 0 -12px 10px; padding: 0 12px 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html.sgsm2 #ib-app .ibrow::-webkit-scrollbar { display: none; }
  html.sgsm2 #ib-app .ibks { display: flex !important; flex: none; gap: 8px; border: 0 !important; padding: 0 !important; margin: 0 !important; }
  html.sgsm2 #ib-app .ibk { flex: 0 0 96px; min-width: 96px; }
  html.sgsm2 #ib-app .ibk * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.sgsm2 #ib-app > p.small.muted:first-of-type { display: none; }

  /* Team Work on phones: the count pills and the filters are each one row you swipe, instead of four rows */
  html.sgsm2 #wk-app .kpis, html.sgsm2 #wk-app .wk-ufil {
    display: flex !important; flex-wrap: nowrap !important; gap: 6px; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  html.sgsm2 #wk-app .kpis::-webkit-scrollbar, html.sgsm2 #wk-app .wk-ufil::-webkit-scrollbar { display: none; }
  html.sgsm2 #wk-app .kpis > *, html.sgsm2 #wk-app .wk-ufil > * { flex: none !important; white-space: nowrap; }
  html.sgsm2 #wk-app .wk-ufil select { max-width: 170px; height: 40px; font-size: 14px; }

  /* Chat on phones: the chat fills the screen; the bottom bar steps aside while a conversation is open */
  html.sgsm2 main.wrap:has(> #ch) { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  html.sgsm2 #ch { height: calc(100dvh - 57px - 62px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; min-height: 0 !important; margin: 0 !important; border: 0 !important; border-radius: 0 !important; }
  html.sgsm2 #ch.conv { height: calc(100dvh - 57px - env(safe-area-inset-top)) !important; }
  html.sgsm2 body:has(#ch.conv) .sm-bar { display: none; }
  html.sgsm2 body:has(#ch.conv) { padding-bottom: 0 !important; }
  html.sgsm2 body:has(#ch) .pfoot, html.sgsm2 body:has(#ch) footer { display: none !important; }
}

/* side panels and task panels sit above the phone header and bottom bar, full width */
@media (max-width: 860px) {
  html.sgsm2 #rv .backdrop, html.sgsm2 .mtp-back { z-index: 1000 !important; }
  html.sgsm2 #rv .drawer, html.sgsm2 #rv #wk-drawer.drawer, html.sgsm2 .mtp { z-index: 1010 !important; width: 100vw !important; max-width: 100vw !important; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  html.sgsm2 .mt-modal, html.sgsm2 .wk-modal { z-index: 1020 !important; }
  html.sgsm2 body:has(#rv .drawer.open) .sm-bar, html.sgsm2 body:has(#rv .drawer.open) .sm-hd { visibility: hidden; }
  /* the small footer links are for computers */
  html.sgsm2 .bl-foot, html.sgsm2 .pfoot, html.sgsm2 .iv-foot, html.sgsm2 .og-foot, html.sgsm2 .ls-foot, html.sgsm2 footer.foot { display: none !important; }
}

/* Catalog and Health cards */
@media (max-width: 720px) {
  html.sgsm2 .pc-box { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 46px; height: 42px; border-radius: 10px; text-decoration: none; line-height: 1.1; }
  html.sgsm2 .pc-box b { font-size: 14px; font-weight: 800; }
  html.sgsm2 .pc-box small { font-size: 10px; font-weight: 600; }
  html.sgsm2 .pc-box.ok { background: #E6F4EC; color: #157F3D; } html.sgsm2 .pc-box.warn { background: #FDF1DC; color: #7A4505; }
  html.sgsm2 .pc-box.bad { background: #FDECEA; color: #B42318; } html.sgsm2 .pc-box.na { background: #F1F2EF; color: #6B776F; }
  html.sgsm2 .pc-off { font-size: 12px; font-weight: 700; color: #157F3D; }
  html.sgsm2 .pc-pos { color: #157F3D; } html.sgsm2 .pc-mid { color: #7A4505; } html.sgsm2 .pc-neg { color: #B42318; }
  html.sgsm2 .pc-v b.pc-plain { font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
  html.sgsm2 .pc-note { margin-top: 8px; font-size: 12px; color: #7A877F; }
  html.sgsm2 .pc-a > a.ls-ob.sec { background: #fff !important; color: #1F2A24 !important; border: 1px solid #CBD2CB !important; }
  html.sgsm2 .pc-m .ls-rt { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; }
  html.sgsm2 .pc-m > div, html.sgsm2 .pc-m > span > div { display: inline; }
  html.sgsm2 .pc-p { display: grid; gap: 4px; margin-top: 8px; }
  html.sgsm2 .pc-p > div { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 9px; background: #FAFBF9; border: 1px solid #EEF0EC; min-width: 0; }
  html.sgsm2 .pc-p > div > span { font-size: 10px; font-weight: 700; color: #7A877F; text-transform: uppercase; letter-spacing: .02em; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  html.sgsm2 .pc-p .ls-sc { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 24px; padding: 0 5px; margin: 0; border-radius: 7px; font-size: 13px; font-weight: 800; }
}

/* SKU, Ratings and Health detail pages on phones */
@media (max-width: 720px) {
  html.sgsm2 .pc-t.one .pc-v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
  html.sgsm2 .pc-t.one .pc-v small { display: inline; font-size: 13px; color: #1F2A24; font-weight: 600; }
  html.sgsm2 .pc-t.one .pc-v small::before { content: '· '; color: #7A877F; }

  html.sgsm2 table.sm-mini, html.sgsm2 table.sm-mini tbody { display: block; width: 100% !important; min-width: 0 !important; border: 0; }
  html.sgsm2 table.sm-mini colgroup, html.sgsm2 table.sm-mini .sm-hr { display: none !important; }
  html.sgsm2 table.sm-mini tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid #EEF0EC; }
  html.sgsm2 table.sm-mini tr:last-child { border-bottom: 0; }
  html.sgsm2 table.sm-mini td { display: block; padding: 0 !important; border: 0 !important; text-align: left !important; font-size: 13px; min-width: 0; width: auto !important; overflow-wrap: anywhere; }
  html.sgsm2 table.sm-mini td:first-child { grid-column: 1 / -1; font-size: 14px; }
  html.sgsm2 table.sm-mini td[data-l]::before { content: attr(data-l); display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #7A877F; margin-bottom: 1px; }
  html.sgsm2 table.sm-mini td.sm-e { display: none; }
  html.sgsm2 .ls-tw:has(> table.sm-mini) { overflow: visible; }

  html.sgsm2 .ls-hs-cols, html.sgsm2 .ls-two, html.sgsm2 .ls-stk { display: block !important; grid-template-columns: 1fr !important; }
  html.sgsm2 .ls-hs-cols > *, html.sgsm2 .ls-card { min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; }
  html.sgsm2 .ls-hs-cols > * + * { margin-top: 12px; }
  html.sgsm2 .ls-act-row, html.sgsm2 .ls-btnrow { flex-wrap: wrap !important; min-width: 0; }
  html.sgsm2 .ls-btnrow > * { flex: 1 1 auto; }
  html.sgsm2 .ls-act-row input[type=text], html.sgsm2 .ls-act-row input:not([type]) { flex: 1 1 120px; min-width: 0; font-size: 16px; }
  html.sgsm2 .ls-act-row > button, html.sgsm2 .ls-act-row > form, html.sgsm2 .ls-act-row > a { flex: none; }
  html.sgsm2 table.sm-mini .ls-pill, html.sgsm2 table.sm-mini .ls-chip { white-space: normal; display: inline-block; max-width: 100%; line-height: 1.3; }
  html.sgsm2 .ls-wrap input[type=text], html.sgsm2 .ls-wrap input[type=search], html.sgsm2 .ls-wrap input:not([type]), html.sgsm2 .ls-wrap select, html.sgsm2 .ls-wrap textarea { max-width: 100%; box-sizing: border-box; }
}

/* Ratings page actions: "What was done?" box, Mark done and the red × on one line */
@media (max-width: 720px) {
  html.sgsm2 .ls-act-row .ls-btnrow { display: flex; flex-wrap: nowrap !important; align-items: center; gap: 6px; width: 100%; }
  html.sgsm2 .ls-act-row .ls-btnrow > form { flex: 0 0 auto; margin: 0; }
  html.sgsm2 .ls-act-row .ls-btnrow > form.ls-f { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; align-items: center; }
  html.sgsm2 .ls-act-row .ls-btnrow > form.ls-f input[type=text] { width: auto !important; flex: 1 1 0; min-width: 0; }
  html.sgsm2 .ls-act-row .ls-btnrow > form.ls-f button { flex: none; white-space: nowrap; }
  html.sgsm2 .ls-act-row .ls-btnrow button.danger { width: 44px; height: 44px; min-height: 44px; padding: 0; font-size: 20px; line-height: 1; border-radius: 10px; }
  html.sgsm2 .ls-act-row .ls-btnrow > form.ls-f input[type=text], html.sgsm2 .ls-act-row .ls-btnrow > form.ls-f button { height: 44px; }
}
