/* =====================================================================
   AB Digital — phone layer. Loads last on every page.
   Each rule fixes one thing that makes a website feel like a website
   on a phone. Hover styles are gated to mouse devices in the other
   stylesheets (tools/gate_hover.py), so taps never leave them stuck.
   ===================================================================== */

/* no grey tap flash, no font inflation in landscape */
html{-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* taps fire at once (no double-tap-zoom wait); control labels don't get selected on long-press */
a,button,[role="button"],label,summary,input[type="range"],.chip-q,.index-list li[data-ad]{touch-action:manipulation}
button,[role="button"],.btn3,.btn,.tkt-btn,.chip-q,.nav-toggle,.radio-pill,.usmap-presets button,.adview-nav button,.index-list li[data-ad]{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

/* press feedback lands on touch-down, like a native control */
.btn3,.btn,.tkt-btn,.pc-send,.f3-submit,.nav-cta,.nav-toggle,.chip-q,.usmap-presets button,.adview-nav button,.adview-book,.btn-ticket,.radio-pill,.lost-links a,.cr-btn,#build-chips button,.chips button{transition-property:transform,background-color,color,border-color,box-shadow;transition-duration:.14s;transition-timing-function:cubic-bezier(.2,.8,.2,1)}
.btn3:active,.btn:active,.tkt-btn:active,.pc-send:active,.f3-submit:active,.nav-cta:active,.nav-toggle:active,.chip-q:active,.usmap-presets button:active,.adview-nav button:active,.adview-book:active,.btn-ticket:active,.radio-pill:active,.cr-btn:active,#build-chips button:active,.chips button:active{transform:scale(.97)}
.index-list li[data-ad]:active{background:rgba(24,120,248,.08)}
.nextpage:active .nextpage-arrow{transform:translateX(.15em)}

/* inner scrollers keep their own bounce and don't drag the page */
.chat-log,.chat-chips,.adview,.feed-track,.anyind-strip,.nav-links{overscroll-behavior:contain}

/* iPhone notch / home bar: content stays clear of them (needs viewport-fit=cover) */
.v3 .bar{padding-top:calc(14px + env(safe-area-inset-top,0px));padding-left:calc(clamp(14px,2.4vw,32px) + env(safe-area-inset-left,0px));padding-right:calc(clamp(14px,2.4vw,32px) + env(safe-area-inset-right,0px))}
.foot{padding-bottom:calc(28px + env(safe-area-inset-bottom,0px))}
.adview-wrap{margin-bottom:calc(24px + env(safe-area-inset-bottom,0px))}

/* full-screen pieces: never taller than what's actually visible */
.lost{min-height:100svh}
.intro,.veil{height:100dvh}

/* ---------------- touch devices ---------------- */
@media (pointer:coarse){
  /* iOS zooms into any input under 16px and never zooms back out */
  input:not([type="range"]):not([type="radio"]):not([type="checkbox"]),textarea,select{font-size:16px!important}

  /* every tap target at least 44px */
  .foot a{display:inline-flex;align-items:center;min-height:44px}
  .nav-logo{min-height:44px;display:inline-flex;align-items:center}
  .chip-q,.usmap-presets button,#build-chips button,.chips button,#city-chips button,.adview-nav button{min-height:44px}
  .star,.pc-stars .star{min-width:44px;min-height:44px}
  .web-preview-controls button{min-height:44px;padding-left:16px!important;padding-right:16px!important}
  .book-info-toggle{min-height:48px}
  .cr-btn{min-height:40px;display:inline-flex;align-items:center}
  .nextpage-or a,.chat-contact a,.pq-more a,.checks-review a,.wd-partner a{display:inline-block;padding:10px 0}
  .theme-toggle{min-width:44px;min-height:44px}

  /* sliders: 44px to grab, track still drawn thin */
  input[type="range"].usmap-range,.receipt #ad-budget-range,#area-range{height:44px;padding:18px 0;background-clip:content-box;box-sizing:border-box}
  input[type="range"].usmap-range::-webkit-slider-thumb,.receipt #ad-budget-range::-webkit-slider-thumb{width:32px;height:32px}
}

/* ---------------- small screens ---------------- */
@media (max-width:640px){
  /* small print stays readable */
  .rep-kpis dt,.rep-chart figcaption,.rep-table th,.rep-days,.receipt .spend-range-labels,.rl-small,.receipt-foot,.pc-field label,.pc-field .form-label,.stub-k,.checks-when,.vow-tag,.nextpage-kicker,.kicker{font-size:12px!important}
  .rl strong .cur,.tkt-price .cur{font-size:11px}

  /* headline sizes tuned for 360–430px screens */
  main[class^="p-"] h1{font-size:clamp(2.5rem,1.4rem + 6.4vw,3.4rem)}
  main[class^="p-"] .big{font-size:clamp(2rem,1.3rem + 4vw,2.6rem)}
  main[class^="p-"] > section:first-child{padding-top:110px}
  main[class^="p-"]{--sec:72px}
  .nextpage-name{font-size:clamp(2.8rem,1rem + 10vw,4rem)}
  .nextpage{padding-top:64px;padding-bottom:56px}

  /* report reads as a phone-width sheet */
  .rep-paper{padding:18px;font-size:13px}
  .rep-stamp{top:74px;right:12px;font-size:16px}
  .rep-table td:nth-child(3){font-size:12px}

  /* receipt fills the width */
  .receipt{width:100%;padding:24px 18px 30px}
  .till-machine::before{width:100%}

  /* tickets: tighter */
  .tkt-top{padding:26px 22px 20px}
  .tkt-bot{padding:18px 22px 24px}

  /* FAQ chat: taller log, thumb-reach chips */
  .chat-win{min-height:0;border-radius:20px}
  .chat-log{max-height:62vh;max-height:62svh}
  .chat-chips{max-height:200px}
  .chip-q{font-size:15px}
  .bub{max-width:88%}

  /* compare: handle easy to find */
  .cmp-handle span{width:48px;height:48px}
  .new-copy{width:72%}
  .old-body p{max-width:100%}

  /* postcard */
  .pc-field{max-width:calc(100% - 80px)}
  .postcard-stamp{width:58px;height:70px;right:16px;top:16px}

  /* services anatomy */
  .anat-ad{max-width:300px;margin:0 auto 0 0}
  .anat-form{width:150px;right:-4px;bottom:-170px;padding:12px}
  .anat-note{margin-top:180px;text-align:left}
  .anat-list li{grid-template-columns:36px 1fr;gap:14px}
  .pin,.pin-n{width:32px;height:32px;font-size:14px}

  /* book a call */
  .board-photos{height:180px}
  .p-book .book-wrap{padding-left:12px;padding-right:12px}
  .p-book .book-form-panel{padding:22px 18px!important}
  .p-book .radio-group{display:grid;grid-template-columns:1fr;gap:8px}
  .p-book .radio-pill{min-height:48px}

  /* 404 */
  .lost{padding-top:110px}
  .lost-ad{max-width:300px}

  /* ad popup: room for the close button and a thumb */
  .adview-x{top:10px;right:10px}
  .adview-nav button{width:52px;height:52px}
}

/* very small phones (iPhone SE, older Android) */
@media (max-width:380px){
  main[class^="p-"] h1{font-size:2.35rem}
  .usmap-big,.area3-km{font-size:2.6rem}
  .board-steps strong{font-size:15px}
  .anat-form{display:none}
  .anat-note{margin-top:30px}
  .tkt-price{font-size:2.3rem}
}
@media (pointer:coarse){.foot a{padding:0 6px;margin:0 -6px}.legal-toc a,.toc a{min-height:44px;display:flex;align-items:center}}@media (max-width:640px){.lost-ad{max-width:340px}}

/* ---------------- homepage on phones ---------------- */
@media (max-width:640px){
  /* industry list: one compact row per industry, whole row is the button */
  .index-list li[data-ad]{display:grid!important;grid-template-columns:64px minmax(0,1fr) 40px;grid-template-areas:"img name go" "img jobs go";column-gap:14px;row-gap:2px;align-items:center;padding:12px 0!important}
  .index-list li[data-ad] img{grid-area:img;width:64px!important;height:64px!important;border-radius:12px!important;order:0!important}
  .index-list li[data-ad] .index-name{grid-area:name;font-size:clamp(1.35rem,1rem + 2.6vw,1.75rem)!important;line-height:1;transform:none!important;align-self:end}
  .index-list li[data-ad] .index-jobs{grid-area:jobs;font-size:14px!important;opacity:1!important;align-self:start;color:rgba(5,7,13,.6)}
  .index-list li[data-ad] .index-view{grid-area:go;font-size:0!important;width:40px;height:40px;border-radius:50%;background:var(--night)!important;display:grid!important;place-items:center;margin:0!important;position:static!important;transform:none!important;opacity:1!important}
  .index-list li[data-ad] .index-view::after{content:"";width:9px;height:9px;border-top:2.5px solid #fff;border-right:2.5px solid #fff;transform:translateX(-2px) rotate(45deg)}
  .index-list li[data-ad].demo .index-view{background:var(--volt)!important}
  .index-list li[data-ad].demo{background:transparent!important}
  .index-head{margin-bottom:28px!important}

  /* hand-off and numbers: less dead air */
  .handoff{padding:72px 18px!important;gap:28px!important}
  .zig-handoff{max-width:220px;margin:0 auto;transform:none!important}
  .nums{padding:72px 18px!important;gap:0!important}
  .num{padding:26px 0}
  .num-big{font-size:clamp(3.4rem,2rem + 8vw,5rem)!important;margin-bottom:10px!important}
  .usmap,.build,.say,.index,.feed-head{padding-top:72px;padding-bottom:72px}

  /* map: let it use the full width */
  .usmap-stage{margin:0 -10px 24px;padding:8px;border-radius:18px}
}

/* map on touch screens: tap moves the circle, a sideways drag resizes it, vertical swipes still scroll the page */
.usmap-hint .hint-touch{display:none}
@media (pointer:coarse){
  .us-svg{touch-action:pan-y}
  .usmap-hint .hint-mouse{display:none}
  .usmap-hint .hint-touch{display:inline}
}
@media (max-width:640px){
  .index-list li[data-ad] .index-name{font-stretch:100%!important;letter-spacing:-0.02em!important;font-size:clamp(1.25rem,.9rem + 2.4vw,1.6rem)!important;overflow-wrap:anywhere}
  .index-list li[data-ad] .index-view{position:relative!important;color:transparent!important;overflow:hidden}
  .index-list li[data-ad] .index-view::after{position:absolute;left:50%;top:50%;transform:translate(-70%,-50%) rotate(45deg)}
}
@media (max-width:640px){.index-list li[data-ad] .index-view{align-self:center!important;justify-self:end}}
@media (max-width:640px){
  /* long industry names wrap between words, never mid-word */
  .index-list li[data-ad] .index-name{overflow-wrap:normal!important;hyphens:none;font-size:clamp(1.15rem,.8rem + 2.4vw,1.55rem)!important}
  /* owner's number stays on one line */
  .talk-num{white-space:nowrap;font-size:clamp(2.1rem,.4rem + 8.6vw,3.4rem)}
  /* any-industry photos: a swipeable row */
  .anyind-strip{overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;mask-image:none;margin:0 calc(-1 * var(--pad));padding:0 var(--pad) 34px;scrollbar-width:none}
  .anyind-strip::-webkit-scrollbar{display:none}
  .anyind-strip img{scroll-snap-align:start;width:58vw}
  /* services anatomy pins sit off the headline */
  .anat-cr .pin[data-pin="1"]{left:4%!important;top:52%!important}
}
.v3 .letter-stars{color:#E8A317}
@media (max-width:640px){.talk{padding-left:12px;padding-right:12px}.talk-num{font-size:clamp(1.9rem,.2rem + 8.2vw,3.2rem);letter-spacing:-0.03em}}
@media (max-width:640px){.nextpage-name{font-size:clamp(2.4rem,.6rem + 9vw,4rem)}}
@media (max-width:360px){
  .mega{font-size:clamp(2.6rem,13.5vw,3.4rem)!important}
  .index-list li[data-ad] .index-name{font-size:1.08rem!important}
  .index-list li[data-ad]{grid-template-columns:56px minmax(0,1fr) 40px}
  .index-list li[data-ad] img{width:56px!important;height:56px!important}
}
@media (max-width:820px){.adview-x{width:44px!important;height:44px!important}}
