/* Mobile and layout repairs, 2026-11-17.
   Loaded after site-v2.css. Does not delete or replace existing files. */

/* Sticky header must not cover in-page targets or the hero. */
.sp-site-header{position:sticky;top:0;z-index:200}
#main-content,#apps,#tools,#omnia,#learn,.sp-hero-home,.sp-page-hero,.sp-home-section{
  scroll-margin-top:96px;
}
.sp-hero-home{
  overflow:visible!important;
  padding-top:calc(28px + env(safe-area-inset-top,0px))!important;
}
@media (max-width:950px){
  .sp-hero-home{padding-top:24px!important}
}

/* Hero app tiles: no vertical shift that clips logos under overflow. */
.sp-vis-card{transform:none!important;min-height:0;overflow:visible}
.sp-vis-card img{
  width:58px!important;height:58px!important;
  object-fit:contain!important;
  object-position:center!important;
  background:transparent;
  flex:none;
  border-radius:13px;
}
.sp-hero-visual{overflow:visible;align-items:stretch}
.sp-hero-panel{overflow:visible}

/* App icons must show the full launcher artwork. */
.sp-app-icon{
  object-fit:contain!important;
  background:#fff;
  border-radius:14px;
  flex:none;
}

/* Hamburger: 44px tap target, icon bars, not a tiny "Menu" label. */
.sp-menu-toggle{
  width:44px!important;
  height:44px!important;
  min-width:44px!important;
  min-height:44px!important;
  padding:0!important;
  max-width:none!important;
  font-size:0!important;
  position:relative;
  border-radius:12px;
  border:1px solid var(--sp-line);
  background:var(--sp-panel);
  color:var(--sp-text);
}
.sp-menu-toggle > span{
  position:absolute;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
}
.sp-menu-toggle::before{
  content:"";
  display:block;
  width:18px;height:2px;
  margin:0 auto;
  background:currentColor;
  border-radius:1px;
  box-shadow:0 -6px 0 currentColor,0 6px 0 currentColor;
}
.sp-menu-toggle[aria-expanded="true"]::before{
  box-shadow:none;
  transform:rotate(45deg);
  height:2px;
  background:currentColor;
}
.sp-menu-toggle[aria-expanded="true"]::after{
  content:"";
  position:absolute;
  left:50%;top:50%;
  width:18px;height:2px;
  margin:-1px 0 0 -9px;
  background:currentColor;
  border-radius:1px;
  transform:rotate(-45deg);
}
@media (min-width:951px){
  .sp-menu-toggle{display:none!important}
}
@media (max-width:950px){
  .sp-menu-toggle{display:inline-flex!important;align-items:center;justify-content:center}
  .sp-site-nav{
    display:none;
    order:3;
    flex:1 0 100%;
    width:100%;
    flex-direction:column;
    align-items:stretch;
    gap:4px;
    padding:8px 0 16px;
  }
  .sp-site-nav[data-open="true"]{display:flex}
  .sp-site-nav a{
    font-size:1rem!important;
    min-height:44px;
    display:flex;
    align-items:center;
    padding:10px 14px!important;
    border-radius:10px;
  }
  .sp-header-inner{flex-wrap:wrap}
  .sp-header-actions button,
  .sp-header-actions select{
    min-height:44px;
    min-width:44px;
    font-size:.9rem!important;
    max-width:none;
  }
  .sp-header-actions select{max-width:11.5rem}
}
@media (max-width:440px){
  .sp-site-header .sp-brand span{display:inline!important;font-size:.9rem}
}

/* Catalogue: search sits with the filters, not isolated on a huge empty row. */
.sp-catalog-controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px 12px;
  align-items:center;
}
.sp-filters{display:flex;flex-wrap:wrap;gap:8px;flex:1 1 auto}
.sp-filter{min-height:44px!important;padding:10px 14px}
.sp-search{
  flex:1 1 220px!important;
  margin-inline-start:0!important;
  min-height:44px;
  min-width:0!important;
  width:auto;
  max-width:100%;
}

/* Footer links readable on phones. */
.sp-site-footer a,
.sp-footer-links a{
  font-size:1rem!important;
  min-height:44px;
  display:inline-flex;
  align-items:center;
  padding:6px 4px;
}
.sp-footer-links{gap:8px 16px}

/* Prevent horizontal overflow site-wide. */
html,body{max-width:100%;overflow-x:clip}
img,svg,video,canvas{max-width:100%;height:auto}
body.sp-v2:not(.sp-home)>main{
  width:min(100%,calc(100% - 28px))!important;
  max-width:100%;
  box-sizing:border-box;
}

/* Buttons and inputs meet 44px tap targets on small screens. */
@media (max-width:950px){
  body.sp-v2 a.sp-button,
  body.sp-v2 .sp-button,
  body.sp-v2 a.btn,
  body.sp-v2 .btn,
  body.sp-v2 button:not(.sp-tab):not(.omnia-tab){
    min-height:44px;
  }
  body.sp-v2 input,
  body.sp-v2 select,
  body.sp-v2 textarea{
    min-height:44px;
    max-width:100%;
    box-sizing:border-box;
  }
}

/* ---- Blog pages: CSS-only hamburger (no inline JS) ---- */
.sp-blog-nav-toggle{position:absolute;opacity:0;pointer-events:none}
.sp-blog-nav-button{
  display:none;
  width:44px;height:44px;
  border:1px solid #334155;
  border-radius:10px;
  background:transparent;
  cursor:pointer;
  align-items:center;justify-content:center;
  margin-left:auto;
}
.sp-blog-nav-button span{
  display:block;width:18px;height:2px;background:currentColor;position:relative;
}
.sp-blog-nav-button span::before,
.sp-blog-nav-button span::after{
  content:"";position:absolute;left:0;width:18px;height:2px;background:currentColor;
}
.sp-blog-nav-button span::before{top:-6px}
.sp-blog-nav-button span::after{top:6px}
@media (max-width:800px){
  header nav{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
  }
  .sp-blog-nav-button{display:inline-flex}
  header nav > div{
    display:none;
    flex:1 0 100%;
    flex-direction:column;
    align-items:stretch;
    gap:4px;
    padding:8px 0 12px;
  }
  header nav > div a{
    display:flex;
    align-items:center;
    min-height:44px;
    font-size:1rem;
    padding:8px 10px;
  }
  #sp-blog-nav-toggle:checked ~ div,
  #sp-blog-nav-toggle:focus-visible ~ div{display:flex}
  /* label is sibling before the links div */
  header nav:has(#sp-blog-nav-toggle:checked) > div{display:flex}
}
/* Blog tables shouldn't blow the page width. */
.blog-table{max-width:100%;overflow-x:auto}
.blog-table table{min-width:0;max-width:100%}
header .hero h1{overflow-wrap:anywhere}
footer{font-size:1rem}
footer a{font-size:1rem;min-height:44px;display:inline-flex;align-items:center}

/* ---- Round 2 of mobilefix: header overflow, 44px chrome, blog menu ---- */
.sp-skip{min-height:44px;display:inline-flex;align-items:center}
.sp-brand{min-height:44px}
.sp-header-inner{max-width:100%;min-width:0;box-sizing:border-box}
.sp-site-nav{min-width:0}
.sp-header-actions{flex:0 1 auto;min-width:0;max-width:100%}
@media (min-width:951px){
  .sp-header-inner{flex-wrap:nowrap}
  .sp-site-nav{flex:1 1 auto;flex-wrap:wrap}
  .sp-header-actions{margin-inline-start:auto}
}

/* Blog hamburger must beat body.sp-content / body.sp-detail nav rules. */
@media (max-width:800px){
  header nav{
    display:flex!important;
    flex-wrap:wrap!important;
    align-items:center!important;
    gap:8px!important;
  }
  .sp-blog-nav-button{display:inline-flex!important}
  header nav > div,
  body.sp-content nav > div,
  body.sp-detail nav > div,
  body.sp-content header nav > div{
    display:none!important;
  }
  #sp-blog-nav-toggle:checked ~ div,
  header nav:has(#sp-blog-nav-toggle:checked) > div,
  body.sp-content nav:has(#sp-blog-nav-toggle:checked) > div,
  body.sp-detail nav:has(#sp-blog-nav-toggle:checked) > div{
    display:flex!important;
    flex:1 0 100%!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:4px!important;
    padding:8px 0 12px!important;
  }
  header nav > div a,
  body.sp-content nav > div a,
  body.sp-detail nav > div a{
    display:flex!important;
    align-items:center!important;
    min-height:44px!important;
    font-size:1rem!important;
    padding:8px 10px!important;
    margin-left:0!important;
  }
}

/* Hero note and RTL punctuation stay on one line. */
.sp-hero-note{overflow-wrap:normal;word-break:normal;max-width:36rem}
[dir=rtl] .sp-hero-note{text-align:start}

/* App landing heroes: official icon sizing. */
.sp-page-hero .sp-app-hero-icon{
  width:96px;height:96px;
  object-fit:contain;
  border-radius:20px;
  background:#fff;
  display:block;
  margin-bottom:16px;
}

.sp-header-actions button,.sp-header-actions select{min-width:44px;min-height:44px}


/* Hard override: hide the site nav unless the hamburger is open.
   Beats .sp-site-nav{display:flex} in site-v2.css. */
@media (max-width:950px){
  #sp-site-nav.sp-site-nav,
  .sp-site-nav{
    display:none!important;
  }
  #sp-site-nav.sp-site-nav[data-open="true"],
  .sp-site-nav[data-open="true"]{
    display:flex!important;
  }
}

.sp-brand{min-height:44px!important;display:inline-flex!important;align-items:center}
header .hero a,
.sp-content .crumbs a,
.sp-crumbs a,
nav.crumbs a,
.breadcrumbs a{
  min-height:44px;
  display:inline-flex;
  align-items:center;
  padding-block:10px;
}

input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]):not(.sp-blog-nav-toggle),
select, textarea{
  min-height:44px;
  box-sizing:border-box;
}

/* Articles index: keep wide cards/tables inside the viewport. */
.sp-article-list, .sp-card-grid, .grid, .sp-content-wrap, .sp-content main{
  max-width:100%;
  min-width:0;
}
.sp-article-list a, .grid .card{max-width:100%}

/* Blog brand and desktop blog nav: 44px targets */
header nav a.brand,
a.brand{
  min-height:44px!important;
  display:inline-flex!important;
  align-items:center;
}
@media (min-width:801px){
  header nav > div a{
    min-height:44px;
    display:inline-flex;
    align-items:center;
    padding:10px 8px;
  }
}

/* Catalogue small buttons were 42px */
body.sp-v2 .sp-button-sm,
.sp-button-sm{min-height:44px!important}

/* Digit pads on lottery workspaces */
.ws-digits button{
  min-width:44px!important;
  min-height:44px!important;
}

/* Articles index: flex rows with 1200px thumbs were expanding body.scrollWidth. */
.sp-content-wrap a[style*="display:flex"],
body.sp-content a[style*="display:flex"]{
  max-width:100%;
  min-width:0;
}
.sp-content-wrap a[style*="display:flex"] img,
body.sp-content a[style*="display:flex"] img{
  width:120px!important;
  max-width:40%!important;
  height:auto!important;
  flex:0 0 120px!important;
}
.sp-content-wrap ul,
.sp-content-wrap li,
.sp-content-wrap a,
body.sp-content .sp-content-wrap{
  max-width:100%;
  min-width:0;
  overflow-wrap:anywhere;
}
