/* mobile fixes shared by every page: nav, footer, shared components. Loaded after site.css. */
@media (max-width:760px){
  /* The chat on a phone (27 Nov 2026). In the page the card is the invitation: Lem's header, the greeting, the
     starter chips and the composer, a normal page element that never resizes itself. A tap on the box or a chip
     turns it into a full-screen sheet (class "sheet", the same nodes) sized by --ld-sheet-h / --ld-sheet-top,
     which demo.js writes from the visual viewport only on a change of 24px or more. */
  .lemdemo .stage{perspective:none}
  .lemdemo .win{transform:none!important}
  .lemdemo .win-in{display:flex;flex-direction:column}
  .lemdemo .bar{display:none}
  .lemdemo .d-grid{display:flex;flex-direction:column;flex:1;min-height:0}
  .lemdemo .d-chat{flex:1;min-height:0}
  .lemdemo .d-brief{display:none}
  /* Lem's header, like a contact at the top of a text chat: avatar centred over the name, Close left, Start again right */
  .lemdemo .d-head{position:relative;flex-direction:column;justify-content:center;gap:1px;padding:5px 56px 4px;min-height:52px;background:#fff;flex:none}
  .lemdemo .d-head .sp{display:none}
  .lemdemo .d-av{width:30px;height:30px}.lemdemo .d-av img{width:19px;height:19px}
  .lemdemo .d-head>div{text-align:center;display:flex;align-items:baseline;gap:6px}
  .lemdemo .d-head b{font-size:14.5px}
  .lemdemo .d-head small{display:inline;font-size:11.5px}
  .lemdemo .d-head [data-reset],.lemdemo .d-close{position:absolute;top:50%;translate:0 -50%;width:44px;height:44px;min-height:0;padding:0;border-radius:50%;font-size:0;display:grid;place-items:center;background:#fff;border:0;color:var(--ink2)}
  .lemdemo .d-head [data-reset]{right:6px}
  .lemdemo .d-head [data-reset]::before{content:"\21BB";font-size:20px;line-height:1}
  .lemdemo .d-close{left:6px}
  .lemdemo .d-close svg{width:24px;height:24px}
  .lemdemo:not(.sheet) .d-close{display:none}
  /* the brief card: the line is always there ("Your brief 2 of 5" and the thin meter, which fills as Lem writes);
     a tap drops the five rows OVER the list, never pushing it, and a tap anywhere else or typing closes it */
  .lemdemo .d-bw{display:block;position:relative;flex:none;z-index:6}
  .lemdemo .d-bl{display:flex;flex-direction:column;justify-content:center;gap:4px;height:34px;padding:0 12px;border:0;border-top:1.5px solid var(--line);border-bottom:1.5px solid var(--line);background:var(--y);font:800 12px var(--body);color:var(--dark);text-align:left;flex:none;width:100%;transition:background .3s}
  .lemdemo .d-bl.flash{background:#ffe88a}
  .lemdemo .d-bl-t{display:flex;align-items:center;gap:5px;line-height:1}
  .lemdemo .d-bl-n{font-weight:700;color:var(--ink2)}
  .lemdemo .d-bw.done .d-bl-n{color:var(--dark)}
  .lemdemo .d-bl-c{width:14px;height:14px;margin-left:auto;color:var(--ink2);transition:transform .2s}
  .lemdemo .d-bl[aria-expanded="true"] .d-bl-c{transform:rotate(180deg)}
  .lemdemo .d-bl .meter{height:4px;border:0;border-radius:2px;background:rgba(26,26,46,.18)}
  .lemdemo .d-bl .meter i{background:var(--dark)}
  .lemdemo .d-bp{display:block;position:absolute;top:100%;left:0;right:0;background:#fff;border-bottom:2px solid var(--dark);box-shadow:0 14px 28px rgba(26,26,46,.2);opacity:0;visibility:hidden;translate:0 -8px;transition:opacity .18s ease,translate .18s ease,visibility 0s .18s}
  .lemdemo .d-bp.open{opacity:1;visibility:visible;translate:0 0;transition:opacity .18s ease,translate .18s ease,visibility 0s}
  .lemdemo .d-bp .fl{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:10px 12px 8px}
  .lemdemo .d-bp .f{padding:5px 9px}.lemdemo .d-bp .f span{font-size:13.5px;min-height:0}.lemdemo .d-bp .f:last-child{grid-column:1/-1}
  .lemdemo .d-bp .bn{display:block;margin:0;padding:0 12px 10px;font-size:12px;color:var(--mute)}
  /* Turnstile lives under the brief line on phones: no room at all until Cloudflare needs a tap (demo.js sets .ts-live
     from the widget's before-interactive callback), then it pushes the list, never the composer */
  .lemdemo .d-chat>.ts-holder{display:block;flex:none;height:0;overflow:hidden}
  .lemdemo .d-chat>.ts-holder:empty{display:none}
  .lemdemo [data-ts="phone"].ts-live{height:auto;overflow:visible;padding:8px 12px 0}
  /* the list: the only scroller, a plain column with the newest message right above the composer */
  .lemdemo .d-body,.lemdemo[data-size="tall"] .d-body{flex:1;height:300px;min-height:0;padding:12px 10px}
  .lemdemo .m p{font-size:15px;padding:9px 12px}
  .lemdemo .m.lem,.lemdemo .ld-typing{padding-left:34px;max-width:90%}
  .lemdemo .who{width:26px;height:26px}.lemdemo .who img{width:16px;height:16px}
  .lemdemo .d-in{padding:8px 10px 10px;gap:8px;flex:none}
  .lemdemo .starthint{font-size:12px}
  .lemdemo .d-chips{margin:0 -10px;padding:2px 10px 4px;scroll-padding-left:10px}
  .lemdemo .chip{min-height:44px}
  .lemdemo .m.fin{padding:14px;box-shadow:4px 4px 0 var(--dark)}
  .lemdemo .fin-h b{font-size:18px}
  .lemdemo .fin-l div{grid-template-columns:76px minmax(0,1fr);font-size:14px}
  .lemdemo .m.fin .btn{justify-self:stretch}
  /* 16px stops iOS zooming on focus; the box grows by whole lines to about five */
  .lemdemo .d-row textarea,.lemdemo .d-mirror{font-size:16px;line-height:1.3;padding:11px 14px;min-height:44px;border-radius:22px}
  .lemdemo .d-row textarea{max-height:7.5em}
  .lemdemo .d-row .btn{width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;display:grid;place-items:center;flex:none;box-shadow:none}
  .lemdemo .d-row .btn .d-send-t{display:none}
  .lemdemo .d-row .btn .d-send-i{display:block}
  .lemdemo .m.mk-msg .mk{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px 12px}
  .lemdemo .mk-t{min-width:0;align-content:start}
  .lemdemo .mk-t span{white-space:normal;overflow-wrap:break-word;display:block;font-size:11.5px;line-height:1.3}
  .lemdemo .mk-h,.lemdemo .mk-ex{grid-column:1/-1;font-size:10px}
  .lemdemo .mk-t b{font-size:20px}
  /* the sheet: it rises from the box as it opens (translate, kept apart from the tilt's transform) */
  .lemdemo.sheet .win{position:fixed;left:0;right:0;top:var(--ld-sheet-top,0px);height:var(--ld-sheet-h,100dvh);z-index:70;border:0;border-radius:0;box-shadow:none;background:#fff;animation:ld-rise .34s cubic-bezier(.2,.8,.2,1) both}
  @keyframes ld-rise{from{opacity:0;translate:0 40px}to{opacity:1;translate:0 0}}
  .lemdemo.sheet .win-in{height:100%;border-radius:0}
  .lemdemo.sheet .sticker{display:none}
  .lemdemo.sheet .d-head{padding-top:calc(5px + env(safe-area-inset-top,0px))}
  .lemdemo.sheet .d-body{height:auto}
  .lemdemo.sheet .d-in{padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))}
  /* inside a frame, or with no visual viewport to measure: the full viewport and a composer that sticks */
  .lemdemo.sheet-fb .win{height:100dvh}
  .lemdemo.sheet-fb .d-chat{overflow-y:auto}
  .lemdemo.sheet-fb .d-body{flex:none;min-height:60%}
  .lemdemo.sheet-fb .d-in{position:sticky;bottom:0;background:#fff}
  /* the section holding the open sheet sits above every other section (each is isolation:isolate) and the sticky nav (z-index 50) */
  .ld-host{position:relative;z-index:80}
  html.ld-lock,body.ld-lock{overflow:hidden;overscroll-behavior:none}
  html.ld-lock .ck{display:none}
}
@media (max-width:480px){
  /* the "Your turn" sticker sat on the window's header and covered "Start again" */
  .lemdemo .sticker{display:none}
}

/* Shared fixes flagged by the page reviews */
@media (max-width:480px){
  .app .ab-n{display:none}
}
@media (max-width:760px){
  /* Lem's cost bar clipped four- and five-figure totals at 88px */
  .cmp-r.lm .cmp-b{min-width:max-content}
}

@media (max-width:480px){
  /* the nav on narrow phones: the logo gives way first, so the burger keeps its gutter and its shadow never meets the edge */
  .nav-in{gap:10px}
  .nav-in .nav-logo{flex:0 1 auto;min-width:0}
  .nav-in .logo{max-width:min(100%,34vw);height:auto}
  .nav-in .burger{margin-right:3px}
}
@media (max-width:400px){
  .nav-in .nav-cta{display:none}
}
