/* Phone layout fixes, site wide. Loaded early in <head>, so every rule is scoped with
   "html body" (and !important where an inline page style already uses it). Phones only. */

@media (max-width:760px){
  /* ---------- homepage hero ---------- */
  /* order: headline, subhead, buttons, the phone + work order animation, checks, stamp, logos */
  html body .hero.split .hc-main > .hero-cta{order:4}
  html body .hero.split .hmini{order:5;width:100%;margin:6px 0 0}
  html body .hero.split .hc-main > .tags{order:6}
  html body .hero.split .hc-main > .guar{order:7}
  html body .hx.hmx.mm .phone{left:0;top:46px}
  html body .hx.hmx.mm .wo{left:186px;top:0;width:374px}
  html body .hx.hmx.mm .wo-body{padding-left:130px;padding-right:18px}
  html body .hx.hmx.mm .f{grid-template-columns:76px 1fr}
  html body .hx.hmx.mm .f .sk{left:92px}
  /* 25 years stamp: centred under the checks instead of floating above the headline */
  html body .hero > .hero-copy{order:1}
  html body .hero > .hstamp{order:2;position:relative;right:auto;bottom:auto;align-self:center;margin:26px auto 0}
  html body .hero > .hero-logos{order:3}
}

@media (max-width:760px){
  /* ---------- homepage arm "price": section 2 numbers stack instead of overlapping the text ---------- */
  html body #problem[data-l] .lic-n{grid-template-columns:1fr!important;row-gap:10px}
  html body #problem[data-l] .lic-n b{font-size:clamp(56px,17vw,72px)}

  /* ---------- #how numbered steps: a stable row of five numbers, the open step's title above it ---------- */
  html body #how #fbTabs.nums .fb-tl{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;align-items:stretch}
  html body #how #fbTabs.nums .fb-tab{width:auto!important;height:46px!important;min-height:0!important;flex:none!important;padding:0!important;justify-content:center!important;margin:0!important}
  html body #how #fbTabs.nums .fb-tab.on{background:rgba(242,183,5,.12)!important;border-color:rgba(242,183,5,.6)!important}
  html body #how #fbTabs.nums .fb-tl{position:relative}
  html body #how #fbTabs.nums .fb-tl::before{content:"";grid-column:1/-1;grid-row:1;height:58px}
  html body #how #fbTabs.nums .fb-tab.on{position:static!important;overflow:visible!important}
  html body #how #fbTabs.nums .fb-tab.on span{position:absolute;left:2px;right:2px;top:0;height:50px;display:flex!important;align-items:flex-end}
  html body #how #fbTabs.nums .fb-tab.on strong{font:700 20px/1.15 var(--display)!important;white-space:normal!important;text-wrap:balance}
  html body #how #fbTabs.nums .fb-tab.on .fb-bar{left:0!important;right:0!important;top:56px!important;bottom:auto!important}
  html body #how #fbTabs.nums .fb-stage{grid-column:1/-1;margin:6px 0 0!important}

  /* gap between the steps and the next section's photo */
  html body #how[data-fx]{padding-bottom:72px!important}
  html body #results .res-ph{margin:48px 20px 28px!important;border-radius:16px;overflow:hidden}
  html body #results .res-ph::after{display:none!important}

  /* results numbers: number, line, logo stacked and left aligned, one divider each */
  html body #results .nums3{display:block!important;gap:0!important;padding-top:0!important;margin-top:18px!important}
  html body #results .nums3>div{display:flex!important;flex-direction:column!important;align-items:flex-start!important;text-align:left!important;padding:22px 0!important;border-top:1px solid var(--line)}
  html body #results .nums3>div:first-child{border-top:0!important}
  html body #results .nums3 .big{font-size:52px!important;line-height:1!important}
  html body #results .nums3 p{margin:8px 0 0!important;max-width:22em!important;text-align:left!important}
  html body #results .nums3 .st-logo{margin-top:12px!important;justify-content:flex-start!important}
}

@media (max-width:560px){
  /* ---------- Book a demo / fit quiz: a bottom sheet with the buttons always in reach ---------- */
  html body .sheet{padding:0!important;place-items:end stretch!important;align-items:end!important}
  html body .sheet > .panel{width:100%!important;max-width:none!important;max-height:calc(100dvh - 10px)!important;border-radius:22px 22px 0 0!important;padding:26px 20px 0!important;overscroll-behavior:contain;animation:zxSheetUp .32s cubic-bezier(.2,.8,.2,1)}
  html body .sheet > .panel h3,html body .sheet .qtitle{font-size:26px!important;line-height:1.1!important;margin-bottom:12px!important;padding-right:44px!important}
  html body .sheet > .panel > .x{top:16px!important;right:16px!important}
  html body .sheet .qact{position:sticky;bottom:0;z-index:2;margin:18px -20px 0!important;padding:12px 20px calc(14px + env(safe-area-inset-bottom,0px))!important;background:#fff;box-shadow:0 -14px 18px -14px rgba(12,14,17,.14);flex-direction:row!important;flex-wrap:nowrap!important}
  html body .sheet .qact .btn{height:52px;flex:1 1 auto!important;margin-left:auto}
  html body .sheet .qact .qback{flex:none}
  /* phone number above "Call me instead", not squeezed beside it */
  html body #qBody > div:has(> label > #qPhone){flex-direction:column!important;align-items:stretch!important;gap:12px!important}
  html body #qBody .qdays{gap:6px!important}
  html body #qBody .qtimes button{height:46px}
}
@keyframes zxSheetUp{from{transform:translateY(40px);opacity:.4}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){html body .sheet > .panel{animation:none}}

@media (max-width:560px){
  /* ---------- homepage "Book a live demo" (#plan): steps as rows, industries as a 2 column grid ---------- */
  html body #plan .ld-steps{grid-template-columns:1fr!important;gap:12px!important;margin-top:28px!important}
  html body #plan .ld-steps li{display:grid!important;grid-template-columns:150px minmax(0,1fr);align-items:center;column-gap:18px}
  html body #plan .ld-steps b{font-size:18px!important}
  html body #plan .ld-inds{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}
  html body #plan .ld-inds button{flex-direction:column!important;align-items:flex-start!important;justify-content:flex-start!important;gap:8px!important;min-height:84px!important;height:auto!important;padding:12px!important;text-align:left!important;font-size:14.5px!important;line-height:1.25!important;margin:0!important}
  html body #plan .ld{grid-template-columns:minmax(0,1fr)!important}
  html body #plan .ld-card{padding-left:18px!important;padding-right:18px!important;min-width:0}
  html body #plan .ld-card *{max-width:100%}
}

@media (max-width:760px){
  /* ---------- all pages ---------- */
  /* sections breathe less on a phone: 96px top and bottom left big empty bands */
  html body{--pad:72px}
  /* page sub navigation (Scan or snap, Speak your fix...): fade the right edge so it reads as scrollable */
  html body .subnav .wrap{-webkit-mask-image:linear-gradient(90deg,#000 82%,transparent);mask-image:linear-gradient(90deg,#000 82%,transparent);padding-right:40px}

  /* ---------- product: module rows closer together ---------- */
  html body .mrow{padding-block:40px!important;gap:22px!important}
}

@media (max-width:760px){
  /* ---------- industry pages: benefit list with the tick beside the heading, not on its own line ---------- */
  html body .bgrid{grid-template-columns:1fr!important;gap:22px!important}
  html body .bgrid li{display:grid!important;grid-template-columns:26px minmax(0,1fr);column-gap:14px;align-items:start}
  html body .bgrid li > svg{grid-column:1;grid-row:1 / span 2;margin:2px 0 0!important}
  html body .bgrid li > :not(svg){grid-column:2;margin-top:0!important}
  html body .bgrid li > p{margin-top:6px!important}
}
@media (max-width:760px){
  /* industry pages "Day 1 / Days 2 to 6" timeline: column was sized to its content and ran 7px off screen */
  html body .steps{grid-template-columns:minmax(0,1fr)!important}
}
@media (max-width:760px){html body .steps .mark{white-space:normal!important}}

@media (max-width:560px){
  /* ---------- live demo section, designs 4 to 6: one step per row instead of three squeezed columns ---------- */
  html body #plan .ld-d4{grid-template-columns:minmax(0,1fr)!important;gap:10px!important}
  html body #plan .ld-d4 li{display:grid!important;grid-template-columns:minmax(0,1fr) 148px;grid-template-rows:auto 1fr;grid-template-areas:"h v" "p v";column-gap:14px;align-items:start;align-content:start;padding:16px!important;min-height:0!important;height:auto!important}
  html body #plan .ld-d4 .d4h{grid-area:h}
  html body #plan .ld-d4 .d4h b{font-size:34px!important}
  html body #plan .ld-d4 .d4h span{font-size:18px!important}
  html body #plan .ld-d4 li > p{grid-area:p;margin:8px 0 0!important;font-size:14px!important;align-self:start}
  html body #plan .ld-d4 .dv{grid-area:v;margin:0!important;align-self:center;width:148px!important;min-height:112px}

  html body #plan .ld-d5{grid-template-columns:minmax(0,1fr)!important;gap:18px!important}
  html body #plan .ld-d5 li{display:grid!important;grid-template-columns:76px minmax(0,1fr);grid-template-areas:"n s" "n p";column-gap:16px;align-items:start;text-align:left!important}
  html body #plan .ld-d5 li > b{grid-area:n;font-size:96px!important;line-height:.85!important}
  html body #plan .ld-d5 li > span{grid-area:s}
  html body #plan .ld-d5 li > p{grid-area:p;margin-top:6px!important}

  html body #plan .ld-d6 > svg{display:none!important}
  html body #plan .ld-d6{padding-top:0!important;height:auto!important}
  html body #plan .ld-d6 .d6t{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:20px!important;counter-reset:d6;margin:0!important;position:static!important}
  html body #plan .ld-d6 .d6t li{counter-increment:d6;position:relative;padding-left:64px!important;text-align:left!important;min-height:48px}
  html body #plan .ld-d6 .d6t li::before{content:counter(d6);position:absolute;left:0;top:0;width:46px;height:46px;display:grid;place-items:center;background:#fff;border:2px solid var(--ink,#11161c);border-radius:10px;font:700 20px/1 var(--display);color:var(--ink,#11161c)}
  html body #plan .ld-d6 .d6t li:nth-child(2)::before{border-radius:50%}
}
