/* iOS feel for Dakkei on phones (Lite chat, Pro app, Settings). Active only with html.ios,
   which assets/ios.js sets on touch devices with a narrow screen. */
html.ios{-webkit-text-size-adjust:100%;text-size-adjust:100%;--ios-ease:cubic-bezier(.32,.72,0,1);--kb:0px}
html.ios body{overscroll-behavior-y:none;-webkit-tap-highlight-color:transparent}
html.ios *{-webkit-tap-highlight-color:transparent}
/* no zoom when a field is tapped: Safari zooms in on text under 16px */
html.ios :is(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){font-size:16px!important}
/* buttons press like iOS controls, and don't select or pop a callout on long-press */
html.ios :is(button,.btn,a.btn,.cbtn,.chip,[role=button],.tplbtn,.nav-item,summary){-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:manipulation;transition:transform .18s var(--ios-ease),opacity .18s var(--ios-ease),background-color .2s}
html.ios :is(button,.btn,a.btn,.cbtn,.chip,[role=button],.tplbtn,.nav-item):active:not(:disabled){transform:scale(.96);opacity:.82}
/* scroll areas: momentum, contained, no visible bars */
html.ios :is(#thread,.thread,.mlist,.side,.sidebar,.tabview,#tabview,.view,#view,.modal,.overlay,.dk-ov){-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
html.ios ::-webkit-scrollbar{width:0;height:0}

/* translucent top bars under the status bar / Dynamic Island */
html.ios :is(.topbar,.top,header.top,.mtop){padding-top:max(.6rem,env(safe-area-inset-top))!important;background:color-mix(in srgb,var(--bg,#fafaf9) 72%,transparent)!important;-webkit-backdrop-filter:saturate(180%) blur(20px)!important;backdrop-filter:saturate(180%) blur(20px)!important;border-bottom:.5px solid color-mix(in srgb,var(--ink,#000) 14%,transparent)!important}
html.ios body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}

/* sidebar slides over like an iOS drawer, following your finger */
html.ios :is(.sidebar,.side){transition:transform .5s var(--ios-ease),box-shadow .5s var(--ios-ease)!important;border-radius:0 22px 22px 0;padding-top:max(1rem,env(safe-area-inset-top))!important;padding-bottom:max(1rem,env(safe-area-inset-bottom))!important;will-change:transform}
html.ios.dragging :is(.sidebar,.side){transition:none!important}
html.ios :is(.scrim,body.side-open::after){-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}

/* composer sits above the home indicator, and above the keyboard when it opens */
html.ios :is(.composer-wrap){padding-bottom:calc(.6rem + max(env(safe-area-inset-bottom),0px))!important;transform:translateY(calc(var(--kb) * -1));transition:transform .25s var(--ios-ease)}
html.ios .composer{border-radius:22px!important}
html.ios .send,html.ios #send{border-radius:50%!important;min-width:36px;min-height:36px}

/* popups become bottom sheets with a grabber */
html.ios :is(.modal,.overlay,.dk-ov){align-items:flex-end!important;padding:0!important}
html.ios :is(.modal .box,.overlay .popup,.dk-ov .dk-box){max-width:none!important;width:100%!important;margin:0!important;border-radius:22px 22px 0 0!important;padding-top:1.9rem!important;padding-bottom:calc(1.3rem + env(safe-area-inset-bottom))!important;max-height:92svh;overflow-y:auto;animation:ios-sheet .5s var(--ios-ease) both!important;position:relative;border-bottom:none!important}
html.ios :is(.modal .box,.overlay .popup,.dk-ov .dk-box)::before{content:"";position:absolute;top:8px;left:50%;width:38px;height:5px;margin-left:-19px;border-radius:3px;background:color-mix(in srgb,currentColor 25%,transparent)}
@keyframes ios-sheet{from{transform:translateY(100%)}to{transform:none}}

/* bigger touch targets */
html.ios :is(.cbtn,.btn.sm,button.sm,.chip){min-height:36px}
html.ios .tabs{scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
html.ios .tabs>*{scroll-snap-align:start}

@media (prefers-reduced-motion:reduce){html.ios *{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* Lite chat: one compact navigation bar instead of a stacked card */
html.ios .topbar{flex-wrap:nowrap!important;gap:.4rem!important;margin:0!important;border-radius:0!important;box-shadow:none!important;padding-left:.6rem!important;padding-right:.6rem!important;padding-bottom:.45rem!important;align-items:center!important;position:sticky;top:0;z-index:30}
html.ios .topbar .modes{display:none!important}
html.ios .topbar .top-right{display:flex!important;flex:1;min-width:0;gap:.35rem!important;flex-wrap:nowrap!important;margin:0!important;width:auto!important}
html.ios .topbar #jurisdiction{flex:1 1 auto;min-width:0;width:auto!important;height:36px!important;border-radius:10px!important;padding:0 .6rem!important}
html.ios .topbar .theme-tg{flex:none;height:36px}
html.ios .topbar .theme-tg button{font-size:0!important;width:34px;padding:0!important;justify-content:center}
html.ios .topbar .theme-tg button svg{width:16px!important;height:16px!important}
html.ios .topbar #brief-btn{flex:none;height:36px!important;padding:0 .6rem!important;font-size:.82rem!important;white-space:nowrap}
html.ios .topbar #brief-btn svg,html.ios .topbar #aff-btn svg{display:none}
html.ios .topbar #aff-btn{flex:none;height:36px!important;padding:0 .6rem!important;font-size:.82rem!important;white-space:nowrap}
html.ios .topbar .burger{flex:none;width:36px;height:36px;justify-content:center}
html.ios .topbar .burger{min-width:36px!important;margin:0!important;padding:0!important;display:inline-flex!important;align-items:center}
html.ios #input{min-height:50px}
html.ios .topbar>.burger{position:static!important}
html.ios .topbar{flex-direction:row!important}
html.ios .composer .modes{flex-wrap:nowrap!important;overflow-x:auto!important;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent)}html.ios .composer .modes button{flex:none;white-space:nowrap;scroll-snap-align:start}
html.ios .topbar #brief-btn{font-size:0!important;gap:0!important}html.ios .topbar #brief-btn::after{content:"Brief";font-size:.82rem}
