/* UI/UX audit 2026-10-15 (docs/audit/FULL-AUDIT-2026-10-15-uiux.md): cross-cutting layout and theme fixes that span several
   modules. Module-specific fixes live in the module itself. Loaded after the other stylesheets; module <style> tags are added
   later at runtime, so rules here use #appview / !important where they must win. Item numbers refer to the audit. */

/* #20 sidebar search results are their own view: the open chat's avatar, tabs, header actions, pinned bars and composer
   are hidden while #msgs shows the results (title "Search: ..." and the result count stay) */
#main:has(#msgs>.cf-sr) :is(#hav,#htabs,#head .hr,#comp,#annbar,.pinbar,#pinbar,.gr-bar,.ext-bar){display:none!important}
#main:has(#msgs>.cf-sr) #head{min-height:56px}

/* #43 keyboard focus: rings only for keyboard users (a clicked bell no longer keeps a blue box on every later screen) */
:focus:not(:focus-visible){outline:none}
button:focus:not(:focus-visible),.ibtn:focus:not(:focus-visible){box-shadow:none}

/* #17 toasts sit above the in-call toolbar */
html.call-on body #ts-toasts{bottom:116px}

/* #30 in-call toolbar: flat line icons only. The 3D thumbs-up and the orange italic "OK" / "+1" quick buttons are gone; the
   flat smile button opens the reaction picker (Lark: one Reactions button) */
.cbl>button[data-do=react][data-arg=up],.cbl>button[data-do=react][data-arg=ok],.cbl>button[data-do=react][data-arg=plus]{display:none!important}

/* #62 call screen: no stray rail-collapse chevron above the meeting title */
html.call-on body #rmode,html.call-on body #rm-menu{display:none!important}




@media(max-width:800px){
  /* #13 the shell never scrolls sideways; popovers are clamped inside the viewport */
  #app,#main,#head{max-width:100vw;overflow-x:clip}
  #head .hm{min-width:0;flex:1 1 auto}
  .lp-menu{max-width:calc(100vw - 16px)}
  /* #36 phone chat header: Call and "..." only (Translate is in "...", layout is in Settings, search lives in the chat list) */
  #head .hr #lpbtn,#head .hr [title="Search messages"],#head .hr [title*="ranslat" i]{display:none!important}
}

/* #11 phone: two-column app layouts stack to one column; the secondary nav becomes a scrolling strip at the top */
@media(max-width:600px){
  #appview .at,#appview .dr,#appview .tk,#appview .ml{flex-direction:column!important}
  #appview .at-side,#appview .dr-side,#appview .tk-side,#appview .ml-side{width:auto!important;max-width:none!important;flex:none!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center;gap:4px!important;overflow-x:auto!important;overflow-y:hidden!important;border-right:0!important;border-bottom:1px solid var(--line);padding:6px 10px!important;scrollbar-width:none;max-height:none}
  #appview .at-side>*,#appview .dr-side>*,#appview .tk-side>*,#appview .ml-side>*{flex:none!important;width:auto!important;margin:0!important;white-space:nowrap}
  #appview .at-side .at-nav span{display:inline!important}
  #appview .at-side h2,#appview .at-side .grp,#appview .dr-side .dr-q,#appview .dr-side .dr-ws,#appview .dr-side>div:not([class]),#appview .tk-side .tk-eyebrow,#appview .ml-side .ml-eyebrow,#appview .ml-side .ml-addr,#appview .ml-side .mx-tools,#appview .ml-side .ml-help{display:none!important}
  #appview .ml-view:has(>.ml-empty:only-child){display:none!important}
  #appview .at-main,#appview .dr-main,#appview .tk-main,#appview .ml-list,#appview .ml-view{width:100%!important;min-width:0!important;flex:1 1 auto!important;max-width:100%!important}
  #appview .at-body{padding:12px!important}
  #appview .at-grid{grid-template-columns:minmax(0,1fr)!important}
  #appview .at-grid>*{min-width:0}
  #appview .at-top{padding:10px 12px!important}
  /* Drive table: name + actions only */
  #appview .dr-r,#appview .dr-h{grid-template-columns:26px minmax(0,1fr) auto!important}
  #appview .dr-r>:nth-child(3),#appview .dr-r>:nth-child(4),#appview .dr-r>:nth-child(5),#appview .dr-h>:nth-child(3),#appview .dr-h>:nth-child(4),#appview .dr-h>:nth-child(5){display:none!important}
  #appview .dr-r .dr-cb{opacity:1}
  #appview .dr-prev.on{position:fixed;inset:auto 0 0 0;max-height:60dvh;z-index:60;box-shadow:0 -10px 40px rgba(0,0,0,.25)}
  /* Mail: list and toolbar wrap inside the screen */
  #appview .ml-bar,#appview .ml-search,#appview .ml-tools{flex-wrap:wrap;min-width:0}
  #appview .ml-search input{min-width:0}
  /* Tasks */
  #appview .tk-bar,#appview .tk-filters{flex-wrap:wrap;min-width:0}
  #appview .tk-strip{flex-wrap:nowrap!important;overflow-x:auto;min-width:0;scrollbar-width:none}#appview .tk-strip>*{flex:none}
  /* app heads: action buttons wrap below the title */
  #appview .ap-head .ap-actions{display:flex;flex-wrap:wrap;gap:6px}
}

/* #34 dark mode: floating cards and popovers follow the theme */
@media(prefers-color-scheme:dark){
  .ts-card,.nf-pop,#nf-pop,.ig-card{background:var(--paper)}
  .ProseMirror mark{color:#16172E}
}

/* #26 row "..." menu (TS.rowMenu in ux-audit.js) */
.ux-rm{width:28px;height:28px;border:0;border-radius:7px;background:transparent;color:var(--muted);display:inline-grid;place-items:center;cursor:pointer;flex:none;padding:0}
.ux-rm:hover,.ux-rm.on{background:var(--wash);color:var(--ink)}
.ux-rmenu{position:fixed;z-index:9500;min-width:170px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 34px rgba(20,30,70,.2);padding:4px}
.ux-rmenu button{display:block;width:100%;text-align:left;border:0;background:transparent;color:inherit;font:400 13.5px var(--f-b);padding:8px 12px;border-radius:7px;cursor:pointer}
.ux-rmenu button:hover,.ux-rmenu button:focus-visible{background:var(--wash);outline:none}.ux-rmenu button.danger{color:var(--red-ink,#B3322D)}

/* #29 workspace tiles carry two-letter initials */
#rail .wst{font-size:12.5px!important;letter-spacing:-.01em}

/* #31 in-call More menu: capped height, scrolls, grouped headings */
#moremenu.ux-callmore{max-height:calc(100dvh - 150px);overflow-y:auto;overscroll-behavior:contain}
#moremenu .ux-grp{padding:8px 12px 2px;font:600 11px var(--f-b);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
#moremenu .ux-grp:first-child{padding-top:4px}

/* #35 chat filters: one compact horizontally scrolling row (the filter button opens the full Lark-style filter sidebar) */
#cf-rail{flex-wrap:nowrap!important;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-webkit-mask-image:linear-gradient(90deg,#000 88%,transparent);mask-image:linear-gradient(90deg,#000 88%,transparent)}
#cf-rail::-webkit-scrollbar{display:none}
#cf-rail>*{flex:none}

/* #45 sign-in / create account: one card size for both tabs, so switching does not move or resize the card */
#login .lc,#login .su-card{width:min(420px,100%)!important;min-height:430px;box-sizing:border-box}
/* #46 phone sign-in: 40 px hit areas */
@media(max-width:800px){#login .ltabs button{min-height:40px}#login #eye{min-height:40px;min-width:48px}#login a[href*="forgot" i],#login .lfp,#login #lfp{display:inline-flex;align-items:center;min-height:40px}}

/* #56 docs editor toolbar: icon buttons; on phone one scrolling row instead of running off-screen */
.dx-tool .dx-ib{display:inline-grid;place-items:center;padding:5px 7px}
@media(max-width:600px){.dx-tool{flex-wrap:nowrap!important;overflow-x:auto;scrollbar-width:none;padding:6px 10px!important}.dx-tool>*{flex:none}}

/* #57 docs list: a flat doc-type icon in the row tile */
.dx-row .ic.dx-dic{display:grid;place-items:center;color:var(--blue);background:var(--blue-wash);border-color:transparent}
.dx-row .ic.dx-dic.wk{color:var(--green-ink,#07694E);background:rgba(14,158,118,.12)}
.dx-row .ic.dx-dic::before,.dx-row .ic.dx-dic::after{display:none}

/* #59 disabled primary buttons read as disabled (Email Compose without a mailbox, Rooms Book without rooms) */
.btn.pri:disabled,.btn.pri[disabled]{opacity:.45;cursor:not-allowed;filter:saturate(.6)}
#appview .ml-search input:disabled{opacity:.55;cursor:not-allowed}

/* #28 Admin opens as a full-width console (Lark Admin): the Dock rail is hidden while it is open; "‹ Dock" goes back */
@media(min-width:801px){body.appmode:has(#appview .adx) #rail{display:none!important}}
.adx-back{display:inline-flex;align-items:center;gap:2px;border:0;background:transparent;color:var(--ink-soft);font:500 13.5px var(--f-b);padding:6px 10px 6px 4px;border-radius:8px;cursor:pointer;margin-right:6px;flex:none}
.adx-back:hover{background:var(--wash);color:var(--ink)}.adx-back .adx-i{width:18px;height:18px}
@media(max-width:800px){.adx-back{display:none}}
