/* Legal Setu: phone layout. Loaded last on every page, so these rules win ties with a page's own styles.
   Desktop is not changed: everything below sits in a width or touch query, except section 1. */

/* 1. No page may ever scroll sideways. Content that is too wide wraps or stacks instead (sections 2 and 8). */
html,body{max-width:100%;overflow-x:clip}
@supports not (overflow-x:clip){html,body{overflow-x:hidden}}
img,video,iframe{max-width:100%}
p,li,td,th,dd,dt,h1,h2,h3,h4,blockquote,figcaption,label{overflow-wrap:break-word}
article a,main a{overflow-wrap:anywhere}

/* the contents list built by ls-mobile.js: phones and small tablets only (the sidebar shows it on desktop) */
.ls-mtoc{display:none}

@media(max-width:900px){
  /* 2. A row of chips or tabs wraps onto the next line; it never scrolls sideways */
  .sit-row,.chips,.hero-chips,.quick-chips,.filter-row,.filters-inner,.cat-row,.tabs,.tab-row,.pill-row{display:flex!important;flex-wrap:wrap!important;overflow-x:visible!important;white-space:normal!important}
  .inline-cta{flex-wrap:wrap}
  .inline-cta a,.inline-cta-text{white-space:normal!important;min-width:0;max-width:100%;flex-shrink:1!important;box-sizing:border-box}
  /* a long set of chips shows two rows; one button opens the rest (ls-mobile.js adds it) */
  .ls-clamp:not(.ls-open){max-height:var(--ls-clamp,100px);overflow:hidden!important}
  .ls-chips-more{display:inline-flex;align-items:center;min-height:44px;margin:2px 0 0;padding:6px 2px;border:0;background:none;color:var(--ls-ind,#2B3FD9);font:700 14px/1.3 'Manrope',system-ui,sans-serif;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
  /* testimonials: two rows that move by themselves (no finger scrolling, so the page never slides sideways) */
  .testi-rows{overflow:hidden!important;margin-top:26px!important}
  .testi-rows>.testi-row:nth-child(n+3){display:none!important}
  .testi-row{width:max-content!important;max-width:none!important;margin:0!important;padding:0 0 6px!important;gap:0!important;overflow:visible!important;scroll-snap-type:none!important;animation:marquee 55s linear infinite;will-change:transform}
  .testi-rows>.testi-row:nth-child(2){animation-direction:reverse;animation-duration:65s}
  .testi-row .tc{display:block!important;flex:0 0 272px!important;width:272px;margin-right:14px;box-sizing:border-box}
  .testi-row .tc[aria-hidden="true"]:not(.ls-dup){display:none!important}
  .testi-rows:active .testi-row{animation-play-state:paused}
  /* table wrappers no longer scroll: the table inside stacks (section 8) */
  .table-scroll,.ls-table-scroll,.ls-tbl,.tool-tblwrap,.tbl{overflow-x:visible!important}
  .sit-row>*,.chips>*,.filter-row>*,.cat-row>*{flex-shrink:1;white-space:normal}

  /* 3. Guides: a contents list to jump with, since the sidebar is hidden at this width */
  .ls-mtoc{display:block;margin:0 0 26px;border:1px solid var(--ls-b,#DCE1F0);border-radius:12px;background:#fff}
  .ls-mtoc>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:10px 16px;font:700 15px/1.4 'Manrope',system-ui,sans-serif;color:var(--ls-t,#0C0E1A);cursor:pointer;list-style:none}
  .ls-mtoc>summary::-webkit-details-marker{display:none}
  .ls-mtoc>summary::after{content:"";width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin:-4px 4px 0 0;flex-shrink:0}
  .ls-mtoc[open]>summary::after{transform:rotate(-135deg);margin-top:4px}
  .ls-mtoc ol{margin:0;padding:0 16px 10px;list-style:none}
  .ls-mtoc li{margin:0;padding:0;font:500 15px/1.45 'Manrope',system-ui,sans-serif;color:var(--ls-t2,#4A5068)}
  .ls-mtoc li a{display:block;padding:9px 0;color:var(--ls-ind,#2B3FD9);text-decoration:none;overflow-wrap:break-word}
}

@media(max-width:768px){
  /* 4. Shorter pages */
  .bl-masonry>.bl-item:nth-child(n+4){display:none}                 /* homepage: three guides, then the link to all of them */
  .card.rv .card-img,.grid>.card .card-img{height:112px}            /* guides index: shorter thumbnails */
  .grid>.card .card-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}

  /* 5. Small labels: nothing under 12px */
  .lsf-h,.callout-title,.related-card-cat,.ftag,.page-badge,.tag,.tool-eyebrow,.res-next-k,.wex-tag,.page-tag,.hiw-rtxt,.hiw-doc-txt,
  .ls-trust,.sb-label,.cat-count,.hero-tag,.sources-title,.cm-label,.form-section-title,.brand-tag,.gate-tag,.ladder-kicker,.eyebrow,.ls-pcard-k,.hiw-mlbl,.s-tag,.card-cat,.bl-badges,.bl-badge,.pr-tag,.hiw-eyebrow{font-size:12px!important}

  /* 6. Cookie notice: one short strip, not a quarter of the screen */
  #ls-cookie-overlay .ls-cb-head{display:none}
  #ls-cookie-overlay .ls-cb-body{padding:10px 14px 0}
  #ls-cookie-overlay .ls-cb-desc{font-size:13px;line-height:1.45;margin:0}
  #ls-cookie-overlay .ls-expand-prefs{min-height:36px;justify-content:flex-start;padding:0;font-size:13px;width:auto}
  #ls-cookie-overlay .ls-cb-btns{padding:6px 14px 12px;gap:8px;border-top:0}
  #ls-cookie-overlay .ls-cb-btns button{min-height:44px;padding:8px 6px;font-size:13.5px;white-space:nowrap}
  /* on the chat pages the message box is at the bottom, so the notice sits under the header instead */
  html.ls-input-bottom #ls-cookie-overlay{top:56px;bottom:auto}
  html.ls-input-bottom #ls-cookie-overlay .ls-cb-card{border-radius:0 0 16px 16px}

  /* 7. Document pages */
  .wrap>*,.fs,.fscroll{min-width:0!important;max-width:100%}
  .tl-item{min-width:0!important;flex:1 1 0}
  .tl-label{overflow-wrap:anywhere}
  nav .n-back{font-size:0;gap:0;padding-left:10px;padding-right:10px;flex-shrink:0}      /* arrow only: room for the step label */
  nav .n-back svg{width:18px;height:18px}
  nav .n-step-label{white-space:nowrap}
  .ffooter{position:fixed;left:0;right:0;bottom:0;z-index:40;margin:0;background:#fff;padding:10px 14px calc(10px + env(safe-area-inset-bottom,0px));border-top:1px solid #E2E6F3;box-shadow:0 -6px 16px rgba(12,14,26,.08);box-sizing:border-box}
  .fscroll{padding-bottom:96px!important}
  #step1-wrap,.step-fade{animation-fill-mode:backwards!important}      /* a kept transform would un-pin the buttons */
  .editor-footer{padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px));gap:8px}
  .editor-footer .btn-back-to-form{font-size:0;gap:0;padding:12px 14px;flex:0 0 auto}
  .editor-footer .btn-back-to-form svg{width:18px;height:18px}
  .editor-footer button{flex:1 1 0;min-width:0;white-space:normal;padding-left:8px;padding-right:8px;font-size:13.5px;line-height:1.25}
  .editor-footer .btn-back-to-form{flex:0 0 48px}

  /* 8. Tables: each row becomes a small card, so nothing needs a sideways swipe */
  table.ls-stack{display:block;width:100%!important;min-width:0!important;overflow:visible;border:0;white-space:normal}
  table.ls-stack thead{display:none}
  table.ls-stack tbody,table.ls-stack tr,table.ls-stack td,table.ls-stack th{display:block;width:auto!important;min-width:0!important;max-width:100%;white-space:normal!important;text-align:left!important}
  table.ls-stack tr{margin:0 0 8px;padding:8px 12px;border:1px solid var(--ls-b,#DCE1F0);border-radius:10px;background:#fff}
  table.ls-stack td,table.ls-stack th{padding:2px 0!important;border:0!important;background:none!important;font-size:14.5px;line-height:1.45}
  table.ls-stack td[data-label]::before{content:attr(data-label) ": ";font-weight:700;font-size:13px;color:var(--ls-t2,#4A5068)}
  /* a long table shows its first rows; one button opens the rest */
  table.ls-fold:not(.ls-open) tbody tr:nth-child(n+6){display:none}
  .ls-more-rows{display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:0 0 20px;padding:8px 16px;border:1.5px solid var(--ls-ind,#2B3FD9);border-radius:10px;background:#fff;color:var(--ls-ind,#2B3FD9);font:700 14.5px/1.3 'Manrope',system-ui,sans-serif;cursor:pointer}
  table.ls-stack td:first-child{font-weight:700}
}

/* 10. Shorter pages on phones: long content folds, nothing is removed from the page */
@media(max-width:768px){
  /* guides: each section opens from its heading (ls-mobile.js marks the parts) */
  .ls-sx-off{display:none!important}
  h2.ls-sech{margin:0!important;padding:0!important;border-top:1px solid var(--ls-b,#DCE1F0)}
  h2.ls-sech>.ls-sect{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;min-height:56px;margin:0;padding:14px 0;border:0;background:none;color:inherit;font:inherit;letter-spacing:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}
  h2.ls-sech>.ls-sect::after{content:"";flex:0 0 auto;width:9px;height:9px;margin:-4px 6px 0 0;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);opacity:.7}
  h2.ls-sech.ls-open>.ls-sect::after{transform:rotate(-135deg);margin-top:5px}
  h2.ls-sech.ls-open{margin-bottom:6px!important}
  h2.ls-sech:not(.ls-open)+h2:not(.ls-sech){margin-top:28px}
  .ls-openall{display:inline-flex;align-items:center;min-height:44px;margin:0 0 8px;padding:6px 0;border:0;background:none;color:var(--ls-ind,#2B3FD9);font:700 14.5px/1.3 'Manrope',system-ui,sans-serif;text-decoration:underline;text-underline-offset:3px;cursor:pointer}

  /* footer: link groups open from their heading */
  .lsf-grid,.footer-grid{display:block!important;margin-bottom:20px!important}
  .lsf-brand,.footer-brand{margin-bottom:18px}
  .ls-facc{border-top:1px solid rgba(255,255,255,.16)}
  .ls-facc>.lsf-h,.ls-facc>.fc-h{display:flex;align-items:center;justify-content:space-between;min-height:48px;margin:0!important;font-size:13px!important;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .ls-facc>.lsf-h::after,.ls-facc>.fc-h::after{content:"";width:8px;height:8px;margin:-4px 6px 0 0;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
  .ls-facc.ls-fopen>.lsf-h::after,.ls-facc.ls-fopen>.fc-h::after{transform:rotate(-135deg);margin-top:4px}
  .ls-facc:not(.ls-fopen)>.lsf-links,.ls-facc:not(.ls-fopen)>.fc-links{display:none!important}
  .ls-facc.ls-fopen>.lsf-links,.ls-facc.ls-fopen>.fc-links{padding-bottom:12px}

  /* documents catalogue: three per group, one button for the rest; two lines of description */
  .card.ls-cx{display:none!important}
  section.cat .card .m-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .ls-cmore{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;margin:0;padding:8px 16px;border:1.5px solid var(--ls-ind,#2B3FD9);border-radius:12px;background:#fff;color:var(--ls-ind,#2B3FD9);font:700 15px/1.3 'Manrope',system-ui,sans-serif;cursor:pointer}

  /* guides index: one compact row per guide */
  a.card.rv .card-img,a.card.rv .card-desc,a.card.rv .card-foot{display:none!important}
  a.card.rv .card-body{padding:14px 16px!important;gap:5px!important}
  .grid:has(>a.card.rv){gap:10px!important}

  /* homepage: the decorative previews step aside; every section, price and link stays */
  .hiw-preview,.about-visual,.pr-ico,.chat-section-inner>.rv.d1{display:none!important}
}

/* 11. Homepage and shared pieces on phones (18 Nov, second round) */
@media(max-width:768px){
  /* the first screen is the hero and nothing else: it ends at the four trust lines */
  section#home.hero{min-height:100vh;min-height:100svh;box-sizing:border-box}
  /* WhatsApp button: smaller, in WhatsApp's own green with its own mark */
  .ls-wa-float{width:44px!important;height:44px!important;right:12px!important;background:#25D366 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z'/%3E%3C/svg%3E") center/24px 24px no-repeat!important;box-shadow:0 4px 12px rgba(12,14,26,.2)!important}
  .ls-wa-float svg{display:none!important}
  /* how it works: the steps follow the button directly */
  .hiw-inner{gap:22px!important}
  .hiw-left{margin-bottom:0!important}
}
@media(max-width:768px) and (prefers-reduced-motion:reduce){
  .testi-row{animation:none!important;width:auto!important;flex-direction:column!important;padding:0 20px!important}
  .testi-row .tc{flex:0 0 auto!important;width:auto;margin:0 0 12px}
  .testi-row .tc.ls-dup,.testi-row .tc[aria-hidden="true"],.testi-row .tc:nth-child(n+3),.testi-rows>.testi-row:nth-child(n+2){display:none!important}
}

@media(min-width:769px){.ls-more-rows,.ls-openall,.ls-cmore{display:none}}
@media(min-width:901px){.ls-chips-more{display:none}}

@media(max-width:600px){
  /* documents catalogue: the first document sooner */
  .hero:has(.hero-hint) .hero-in h1{font-size:34px;line-height:1.08}
  .hero .hero-hint{display:none}
  .hero:has(.hero-hint){padding-top:22px!important;padding-bottom:18px!important}
  .sits{padding-top:18px!important;padding-bottom:6px!important}
}
@media(max-width:768px){
  /* documents catalogue: "what's happening" chips sit inside the page gutter and fold between rows */
  .sit-wrap .sit-row{margin:0!important;padding:3px 0!important;gap:8px!important}
  .sit-wrap .sit-row.ls-clamp:not(.ls-open){padding-bottom:0!important}
  .sit-wrap .sit-row .chip{min-height:40px;padding:0 14px;font-size:13.5px}
  .sit-wrap::before,.sit-wrap::after,.chips-wrap::before,.chips-wrap::after{display:none!important}
  .sit-wrap .ls-chips-more{margin:6px 0 8px;padding:6px 0}
}
@media(max-width:600px){
  /* "what's happening" on a phone: an even two-column grid with no ragged gaps */
  .sit-wrap .sit-row{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-rows:none!important;grid-auto-flow:row!important;grid-auto-rows:auto;justify-content:stretch!important;justify-items:stretch!important;gap:8px!important;max-height:none!important;overflow:visible!important}
  .sit-wrap .sit-row .chip{min-width:0;min-height:48px;padding:7px 13px;border-radius:13px;justify-content:flex-start;text-align:left;line-height:1.25;white-space:normal!important}
  .sit-wrap .sit-row.ls-six:not(.ls-open)>:nth-child(n+7){display:none!important}
  .sit-wrap .sit-row>:last-child:nth-child(odd){grid-column:1/-1}
}
@media(max-width:768px){
  /* the category list: two tidy columns that scroll away with the page instead of sticking under the header */
  .chips-wrap{position:static!important;margin:0!important;padding:16px 0 18px!important;background:none!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important;border-top:1px solid var(--line,#E3E7F0)}
  .chips-wrap .chips{display:grid!important;grid-template-columns:1fr 1fr;gap:8px!important;padding:0!important;max-height:none!important;overflow:visible!important}
  .chips-wrap .chips .chip{min-width:0;min-height:48px;padding:7px 10px 7px 13px;border-radius:13px;justify-content:space-between;gap:8px;font-size:13.5px;line-height:1.25;white-space:normal!important;text-align:left}
  .chips-wrap .chips .chip i{flex-shrink:0;font-size:12.5px;padding:1px 8px}
  .chips-wrap .chips .chip:last-child:nth-child(odd){grid-column:1/-1}
}

/* 9. Touch screens: small controls get a 44px touch area without changing how they look */
@media(pointer:coarse){
  .ibt{position:relative;overflow:visible}
  .ibt::after{content:"";position:absolute;inset:-13px}
  .breadcrumb a,.crumbs a,.ls-wa,.lsf-links a,.lsf-legal a,.ls-about-foot a{display:inline-flex;align-items:center;min-height:44px}
  .lsf-links a{min-height:40px}
  article sup a,.fn-ref,a.fn{display:inline-block;padding:10px 8px;margin:-10px -6px}
  .ls-toplink a,.fguide a{display:inline-block;padding-top:10px;padding-bottom:10px}
  nav .logo,nav .n-logo{display:inline-flex;align-items:center;min-height:44px}
}
