/* Medicann Patients UK — desktop layout repair v5, 2026-10-12.
   IMPORTANT: All styles below are desktop/tablet only. Do not modify mobile.
   Designed to load after desktop-pro.css; no JavaScript or database changes. */
@media (min-width:768px) {
  html body { min-width:0!important; }
  html body > .phone {
    box-sizing:border-box!important;
    display:block; /* Do not replace purposeful dashboard/profile grids. */
    width:calc(100% - 2 * clamp(18px,3vw,48px))!important;
    max-width:1600px!important;
    min-width:0!important;
    margin-inline:auto!important;
    padding:clamp(18px,2.3vw,34px) 0 64px!important;
    background:transparent!important;
  }
  /* Keep the existing grids for dashboard, rewards, profile etc. Their children
     just need the ability to shrink instead of pushing the viewport sideways. */
  html body > .phone > * {min-width:0;max-width:100%;box-sizing:border-box;}
  html body .phone img,html body .phone video,html body .phone svg{max-width:100%;}
  html body .phone input,html body .phone select,html body .phone textarea{max-width:100%;min-width:0;}
  html body .phone .foot {
    box-sizing:border-box!important;width:100%!important;max-width:none!important;
    min-width:0!important;margin-left:0!important;margin-right:0!important;
  }
  /* Restrained safeguards for long tables and user-generated text. */
  html body .phone .card,html body .phone .d-card,
  html body .phone .fx-block,html body .phone .xf-block {min-width:0;}
  html body .phone .table-wrap,html body .phone .scroll-x {max-width:100%;overflow-x:auto;}
  /* Two newest destinations: remove their hard-coded tablet-sized caps. */
  html body[data-page="stock-watchtower"] > .phone .wt-wrap,
  html body[data-page="stock-watchtower"] > .phone .watchtower-page,
  html body[data-page="stock-watchtower"] > .phone main,
  html body[data-page="terpene-lab"] > .phone > .terpene-page-layout,
  html body[data-page="terpene-lab"] > .phone > .terpene-page-layout > .mpuk-terpene-lab {
    box-sizing:border-box!important;width:100%!important;max-width:none!important;min-width:0!important;
  }
  /* Stock: normal document flow. This is one continuous full-width workspace.
     The old desktop-pro.css grid assigned overlapping grid-areas to content. */
  html body[data-page="stock"] > .phone {display:block!important;}
  html body[data-page="stock"] .phone > .xf-page {
    display:block!important;box-sizing:border-box!important;
    width:100%!important;max-width:none!important;min-width:0!important;
    margin:0!important;padding:0!important;
  }
  html body[data-page="stock"] .phone > .xf-page > * {
    box-sizing:border-box!important;max-width:100%!important;min-width:0!important;
    grid-area:auto!important;grid-column:auto!important;grid-row:auto!important;
  }
  html body[data-page="stock"] .phone .xf-page > .xf-toolbar {
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    gap:16px!important;flex-wrap:wrap!important;width:100%!important;margin:0 0 16px!important;
  }
  html body[data-page="stock"] .phone .xf-page .xf-search {
    box-sizing:border-box!important;flex:1 1 320px!important;
    width:min(100%,540px)!important;max-width:580px!important;min-width:min(100%,260px)!important;
    margin:0 0 0 auto!important;
  }
  html body[data-page="stock"] .phone .xf-page .stock-promo-row {
    box-sizing:border-box!important;display:grid!important;
    grid-template-columns:minmax(0,5fr) minmax(0,7fr)!important;
    align-items:stretch!important;justify-content:stretch!important;
    width:100%!important;height:auto!important;min-height:0!important;
    gap:18px!important;margin:0 0 18px!important;
    position:static!important;isolation:auto!important;
  }
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > a.stock-ad,
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > .stock-review-panel {
    box-sizing:border-box!important;display:flex!important;
    flex-direction:row!important;align-items:center!important;
    gap:16px!important;justify-content:flex-start!important;
    grid-area:auto!important;grid-column:auto!important;grid-row:auto!important;
    width:100%!important;max-width:none!important;min-width:0!important;
    height:auto!important;min-height:148px!important;
    margin:0!important;padding:22px!important;
    flex:initial!important;flex-basis:auto!important;
    position:relative!important;inset:auto!important;float:none!important;
    transform:none!important;opacity:1!important;visibility:visible!important;
  }
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > a.stock-ad > span,
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > .stock-review-panel > span:nth-child(2) {
    display:block;flex:1 1 auto!important;min-width:0!important;max-width:100%!important;
    overflow-wrap:anywhere;
  }
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > a.stock-ad > img {
    width:70px!important;height:70px!important;max-width:70px!important;flex:0 0 70px!important;
    object-fit:contain;
  }
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > .stock-review-panel > .review-pro-icon,
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > .stock-review-panel > .review-pro-arrow {
    flex:0 0 auto!important;
  }
  html body[data-page="stock"] .phone .xf-page > .stock-livebar,
  html body[data-page="stock"] .phone .xf-page > .stock-updates,
  html body[data-page="stock"] .phone .xf-page > .stock-jump,
  html body[data-page="stock"] .phone .xf-page > .stock-advice,
  html body[data-page="stock"] .phone .xf-page > .wt-stock-banner,
  html body[data-page="stock"] .phone .xf-page > .stock-sort-tools {
    display:flex;box-sizing:border-box!important;width:100%!important;
    max-width:100%!important;min-width:0!important;
    margin:0 0 18px!important;
  }
  html body[data-page="stock"] .phone .xf-page > .stock-updates {display:block!important;}
  html body[data-page="stock"] .phone .xf-page > .stock-jump {flex-wrap:wrap!important;}
  html body[data-page="stock"] .phone .xf-page > .stock-sort-tools {justify-content:flex-end;}
  html body[data-page="stock"] .phone #stockBoard {
    display:grid!important;box-sizing:border-box!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:18px!important;align-items:stretch!important;
    margin:0!important;padding:0!important;border:0!important;
    background:transparent!important;overflow:visible!important;
  }
  html body[data-page="stock"] .phone #stockBoard > .xf-cat,
  html body[data-page="stock"] .phone #stockBoard > .hint,
  html body[data-page="stock"] .phone #stockBoard > #stockHead {
    grid-column:1/-1!important;
  }
  html body[data-page="stock"] .phone #stockBoard > .stock-node {
    box-sizing:border-box!important;display:grid!important;
    grid-template-columns:88px minmax(0,1fr)!important;
    grid-template-areas:"pic main" "side side"!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    height:auto!important;min-height:240px!important;
    align-items:start!important;align-content:start!important;
    gap:12px 16px!important;
    padding:18px!important;
    overflow:hidden!important;
  }
  html body[data-page="stock"] .phone #stockBoard > .stock-node.is-hide {display:none!important;}
  html body[data-page="stock"] .phone #stockBoard .stock-pic{grid-area:pic!important;width:88px!important;height:88px!important;}
  html body[data-page="stock"] .phone #stockBoard .stock-main{grid-area:main!important;min-width:0!important;overflow-wrap:anywhere;}
  html body[data-page="stock"] .phone #stockBoard .stock-side{
    grid-area:side!important;display:flex!important;align-items:center!important;
    justify-content:flex-start!important;flex-wrap:wrap!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    margin-top:auto!important;padding-top:12px!important;gap:8px 12px!important;
    text-align:left!important;
  }
  html body[data-page="stock"] .phone #stockBoard .stock-side form{margin:0 0 0 auto!important;}
  /* Lab and Galaxy: use actual available space, not 1100/1154px fixed caps. */
  html body[data-page="terpene-lab"] > .phone{display:block!important;}
  html body[data-page="terpene-lab"] > .phone > .terpene-page-layout{
    width:100%!important;max-width:none!important;min-width:0!important;
    margin:0!important;
  }
  html body[data-page="terpene-lab"] .terpene-page-layout > .mpuk-terpene-lab {
    width:100%!important;max-width:none!important;min-width:0!important;
    margin:0!important;
  }
  html body[data-page="terpene-lab"] .mpuk-terpene-lab .tg-universe,
  html body[data-page="terpene-lab"] .mpuk-terpene-lab .tlx-tools,
  html body[data-page="terpene-lab"] .mpuk-terpene-lab .tlx-list {
    max-width:100%!important;min-width:0!important;
  }
}
@media (min-width:768px) and (max-width:1099px) {
  /* Tablet and smaller desktop: one stock card column prevents squeezing. */
  html body[data-page="stock"] .phone #stockBoard{grid-template-columns:minmax(0,1fr)!important;}
  html body[data-page="stock"] .phone .xf-page .stock-promo-row{grid-template-columns:minmax(0,1fr)!important;}
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > a.stock-ad,
  html body[data-page="stock"] .phone .xf-page .stock-promo-row > .stock-review-panel{min-height:118px!important;}
}
@media (min-width:1450px) {
  html body[data-page="stock"] .phone #stockBoard{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
}
